From 89dd87d5a150edccb542085b51c3b5bfdf6592f7 Mon Sep 17 00:00:00 2001 From: DmitryTsymbal Date: Fri, 7 Jun 2019 18:04:29 +0300 Subject: [PATCH 001/595] Convert NewCustomerPasswordComplexityTest --- .../StorefrontFillRegistryFormActionGroup.xml | 31 +++++++++++++++++ .../StorefrontSeeHeaderLinksActionGroup.xml | 19 +++++++++++ .../Mftf/Section/StorefrontHeaderSection.xml | 16 +++++++++ .../NewCustomerPasswordComplexityTest.xml | 33 +++++++++++++++++++ 4 files changed, 99 insertions(+) create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontFillRegistryFormActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/Section/StorefrontHeaderSection.xml create mode 100644 app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontFillRegistryFormActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontFillRegistryFormActionGroup.xml new file mode 100644 index 0000000000000..0a1440937a554 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontFillRegistryFormActionGroup.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml new file mode 100644 index 0000000000000..b70560ad2cd86 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + diff --git a/app/code/Magento/Cms/Test/Mftf/Section/StorefrontHeaderSection.xml b/app/code/Magento/Cms/Test/Mftf/Section/StorefrontHeaderSection.xml new file mode 100644 index 0000000000000..fefde1e6035f3 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/Section/StorefrontHeaderSection.xml @@ -0,0 +1,16 @@ + + + + +
+ + +
+
diff --git a/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml b/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml new file mode 100644 index 0000000000000..a414878997021 --- /dev/null +++ b/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml @@ -0,0 +1,33 @@ + + + + + + + + + + <description value="Show notifies to the customer if password length or complexity is not match to requirements"/> + <group value="security"/> + <group value="mtf_migrated"/> + </annotations> + + <!-- TEST BODY --> + <!-- Go to storefront home page --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/> + <!-- Click the Registration Link --> + <actionGroup ref="StorefrontSeeHeaderLinksActionGroup" stepKey="ClickTheLink"> + <argument name="LinkName" value="Create an Account" /> + </actionGroup> + <!-- Fill Registry Form with Incorrect Password (Two variations) --> + <actionGroup ref="StorefrontFillRegistryFormActionGroup" stepKey="FillRegistryForm"/> + <!--Test Body END--> + + </test> +</tests> From 100a81eb41648eabb41c2d77059368750916758e Mon Sep 17 00:00:00 2001 From: DmitryTsymbal <d.tsymbal@atwix.com> Date: Fri, 7 Jun 2019 18:32:45 +0300 Subject: [PATCH 002/595] Refactoring --- .../Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml b/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml index a414878997021..29135332d6125 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml @@ -23,7 +23,7 @@ <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/> <!-- Click the Registration Link --> <actionGroup ref="StorefrontSeeHeaderLinksActionGroup" stepKey="ClickTheLink"> - <argument name="LinkName" value="Create an Account" /> + <argument name="LinkName" value="Create an Account" /> </actionGroup> <!-- Fill Registry Form with Incorrect Password (Two variations) --> <actionGroup ref="StorefrontFillRegistryFormActionGroup" stepKey="FillRegistryForm"/> From d32285cb23f2047777176bc7b2a6b4ab1685df3d Mon Sep 17 00:00:00 2001 From: mmularski <mmularczyk9@gmail.com> Date: Fri, 5 Jul 2019 13:40:43 +0200 Subject: [PATCH 003/595] Issue-709. Convert CreateAdminUserEntityTest to MFTF --- .../AdminCreateUserActionGroup.xml | 26 +++++++++++- .../Magento/User/Test/Mftf/Data/UserData.xml | 32 ++++++++++++++ .../Mftf/Section/AdminNewUserFormSection.xml | 1 + .../Test/AdminCreateActiveUserEntityTest.xml | 42 +++++++++++++++++++ .../AdminCreateInactiveUserEntityTest.xml | 41 ++++++++++++++++++ 5 files changed, 140 insertions(+), 2 deletions(-) create mode 100644 app/code/Magento/User/Test/Mftf/Test/AdminCreateActiveUserEntityTest.xml create mode 100644 app/code/Magento/User/Test/Mftf/Test/AdminCreateInactiveUserEntityTest.xml diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml index d550d855fcdd0..bcc7ec78e87a5 100644 --- a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml @@ -36,7 +36,6 @@ <!--Create new user with role--> <actionGroup name="AdminCreateUserWithRoleActionGroup"> <arguments> - <argument name="role"/> <argument name="user" defaultValue="newAdmin"/> </arguments> <amOnPage url="{{AdminNewUserPage.url}}" stepKey="navigateToNewUser"/> @@ -50,9 +49,32 @@ <fillField selector="{{AdminCreateUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword" /> <scrollToTopOfPage stepKey="scrollToTopOfPage" /> <click stepKey="clickUserRole" selector="{{AdminCreateUserSection.userRoleTab}}"/> - <click stepKey="chooseRole" selector="{{AdminStoreSection.createdRoleInUserPage(role.name)}}"/> + <checkOption selector="{{AdminNewUserFormSection.roleRadiobutton(user.role)}}" stepKey="assignRole"/> <click selector="{{AdminCreateUserSection.saveButton}}" stepKey="clickSaveUser" /> <waitForPageLoad stepKey="waitForSaveTheUser" /> <see userInput="You saved the user." stepKey="seeSuccessMessage" /> </actionGroup> + + <!--Create new user with role and active/inactive setting--> + <actionGroup name="AdminCreateUserWithRoleAndIsActiveActionGroup"> + <arguments> + <argument name="user" defaultValue="newAdmin"/> + </arguments> + <amOnPage url="{{AdminNewUserPage.url}}" stepKey="navigateToNewUser"/> + <waitForPageLoad stepKey="waitForUsersPage" /> + <fillField selector="{{AdminNewUserFormSection.username}}" userInput="{{user.username}}" stepKey="enterUserName" /> + <fillField selector="{{AdminNewUserFormSection.firstname}}" userInput="{{user.firstName}}" stepKey="enterFirstName" /> + <fillField selector="{{AdminNewUserFormSection.lastname}}" userInput="{{user.lastName}}" stepKey="enterLastName" /> + <fillField selector="{{AdminNewUserFormSection.email}}" userInput="{{user.username}}@magento.com" stepKey="enterEmail" /> + <fillField selector="{{AdminNewUserFormSection.password}}" userInput="{{user.password}}" stepKey="enterPassword" /> + <fillField selector="{{AdminNewUserFormSection.passwordConfirmation}}" userInput="{{user.password}}" stepKey="confirmPassword" /> + <checkOption selector="{{AdminNewUserFormSection.userIsActive(user.is_active)}}" stepKey="checkIsActive" /> + <fillField selector="{{AdminNewUserFormSection.currentPassword}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword" /> + <scrollToTopOfPage stepKey="scrollToTopOfPage" /> + <click stepKey="clickUserRole" selector="{{AdminNewUserFormSection.userRoleTab}}"/> + <checkOption selector="{{AdminNewUserFormSection.roleRadiobutton(user.role)}}" stepKey="assignRole"/> + <click selector="{{AdminNewUserFormSection.save}}" stepKey="clickSaveUser" /> + <waitForPageLoad stepKey="waitForSaveTheUser" /> + <see userInput="You saved the user." stepKey="seeSuccessMessage" /> + </actionGroup> </actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/Data/UserData.xml b/app/code/Magento/User/Test/Mftf/Data/UserData.xml index e665736ae28f1..636dd877bb639 100644 --- a/app/code/Magento/User/Test/Mftf/Data/UserData.xml +++ b/app/code/Magento/User/Test/Mftf/Data/UserData.xml @@ -74,4 +74,36 @@ <item>1</item> </array> </entity> + <entity name="activeAdmin" type="user"> + <data key="username" unique="suffix">AdminUser</data> + <data key="firstname" unique="suffix">FirstName</data> + <data key="lastname" unique="suffix">LastName</data> + <data key="email" unique="prefix">admin@example.com</data> + <data key="password">123123q</data> + <data key="password_confirmation">123123q</data> + <data key="interface_local">en_US</data> + <data key="interface_local_label">English (United States)</data> + <data key="is_active">1</data> + <data key="current_password">{{_ENV.MAGENTO_ADMIN_PASSWORD}}</data> + <data key="role">Administrators</data> + <array key="roles"> + <item>1</item> + </array> + </entity> + <entity name="inactiveAdmin" type="user"> + <data key="username" unique="suffix">AdminUser</data> + <data key="firstname" unique="suffix">FirstName</data> + <data key="lastname" unique="suffix">LastName</data> + <data key="email" unique="prefix">admin@example.com</data> + <data key="password">123123q</data> + <data key="password_confirmation">123123q</data> + <data key="interface_local">en_US</data> + <data key="interface_local_label">English (United States)</data> + <data key="is_active">0</data> + <data key="current_password">{{_ENV.MAGENTO_ADMIN_PASSWORD}}</data> + <data key="role">Administrators</data> + <array key="roles"> + <item>1</item> + </array> + </entity> </entities> diff --git a/app/code/Magento/User/Test/Mftf/Section/AdminNewUserFormSection.xml b/app/code/Magento/User/Test/Mftf/Section/AdminNewUserFormSection.xml index 9b030b216ce2c..79195067315db 100644 --- a/app/code/Magento/User/Test/Mftf/Section/AdminNewUserFormSection.xml +++ b/app/code/Magento/User/Test/Mftf/Section/AdminNewUserFormSection.xml @@ -19,6 +19,7 @@ <element name="password" type="input" selector="#page_tabs_main_section_content input[name='password']"/> <element name="passwordConfirmation" type="input" selector="#page_tabs_main_section_content input[name='password_confirmation']"/> <element name="interfaceLocale" type="select" selector="#page_tabs_main_section_content select[name='interface_locale']"/> + <element name="userIsActive" type="select" selector="#page_tabs_main_section_content select[id='user_is_active'] > option[value='{{var}}']" parameterized="true"/> <element name="currentPassword" type="input" selector="#page_tabs_main_section_content input[name='current_password']"/> <element name="userRoleTab" type="button" selector="#page_tabs_roles_section"/> diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminCreateActiveUserEntityTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminCreateActiveUserEntityTest.xml new file mode 100644 index 0000000000000..1cc2294a3d33e --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/Test/AdminCreateActiveUserEntityTest.xml @@ -0,0 +1,42 @@ +<?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="AdminCreateActiveUserEntityTest"> + <annotations> + <features value="User"/> + <stories value="Create Admin User"/> + <title value="Admin user should be able to create active admin user"/> + <description value="Admin user should be able to create active admin user"/> + <testCaseId value=""/> + <severity value="CRITICAL"/> + <group value="user"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + </before> + + <actionGroup ref="AdminCreateUserWithRoleAndIsActiveActionGroup" stepKey="createAdminUser"> + <argument name="user" value="activeAdmin"/> + </actionGroup> + <actionGroup ref="logout" stepKey="logoutMasterAdmin"/> + <amOnPage url="{{AdminLoginPage.url}}" stepKey="navigateToAdmin"/> + <fillField selector="{{AdminLoginFormSection.username}}" userInput="{{activeAdmin.username}}" stepKey="fillUsername"/> + <fillField selector="{{AdminLoginFormSection.password}}" userInput="{{activeAdmin.password}}" stepKey="fillPassword"/> + <click selector="{{AdminLoginFormSection.signIn}}" stepKey="clickLogin"/> + <closeAdminNotification stepKey="closeAdminNotification"/> + <amOnPage url="{{AdminUsersPage.url}}" stepKey="navigateToAdminUsersGrid"/> + <fillField selector="{{AdminUserGridSection.usernameFilterTextField}}" userInput="{{activeAdmin.username}}" stepKey="fillUsernameSearch"/> + <click selector="{{AdminUserGridSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad time="10" stepKey="wait1"/> + <see selector="{{AdminUserGridSection.usernameInFirstRow}}" userInput="{{activeAdmin.username}}" stepKey="seeFoundUsername"/> + <actionGroup ref="logout" stepKey="logoutCreatedUser"/> + </test> +</tests> diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminCreateInactiveUserEntityTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminCreateInactiveUserEntityTest.xml new file mode 100644 index 0000000000000..0768f3c6e240e --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/Test/AdminCreateInactiveUserEntityTest.xml @@ -0,0 +1,41 @@ +<?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="AdminCreateInactiveUserEntityTest"> + <annotations> + <features value="User"/> + <stories value="Create Admin User"/> + <title value="Admin user should be able to create inactive admin user"/> + <description value="Admin user should be able to create inactive admin user"/> + <testCaseId value=""/> + <severity value="CRITICAL"/> + <group value="user"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + </before> + + <actionGroup ref="AdminCreateUserWithRoleAndIsActiveActionGroup" stepKey="createAdminUser"> + <argument name="user" value="inactiveAdmin"/> + </actionGroup> + <amOnPage url="{{AdminUsersPage.url}}" stepKey="navigateToAdminUsersGrid"/> + <fillField selector="{{AdminUserGridSection.usernameFilterTextField}}" userInput="{{inactiveAdmin.username}}" stepKey="fillUsernameSearch"/> + <click selector="{{AdminUserGridSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad time="10" stepKey="wait1"/> + <see selector="{{AdminUserGridSection.usernameInFirstRow}}" userInput="{{inactiveAdmin.username}}" stepKey="seeFoundUsername"/> + <actionGroup ref="logout" stepKey="logoutMasterAdmin"/> + <amOnPage url="{{AdminLoginPage.url}}" stepKey="navigateToAdmin"/> + <fillField selector="{{AdminLoginFormSection.username}}" userInput="{{inactiveAdmin.username}}" stepKey="fillUsername"/> + <fillField selector="{{AdminLoginFormSection.password}}" userInput="{{inactiveAdmin.password}}" stepKey="fillPassword"/> + <click selector="{{AdminLoginFormSection.signIn}}" stepKey="clickLogin"/> + <actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="seeUserErrorMessage" /> + </test> +</tests> From 7c9b5f7fe45ba39d64f782b609efc370ea2684e3 Mon Sep 17 00:00:00 2001 From: DmitryTsymbal <d.tsymbal@atwix.com> Date: Tue, 30 Jul 2019 12:43:39 +0300 Subject: [PATCH 004/595] refactoring --- .../StorefrontClickHeaderLinkActionGroup.xml | 17 ++++++++++ .../StorefrontFillRegistryFormActionGroup.xml | 31 ------------------- .../StorefrontSeeHeaderLinksActionGroup.xml | 3 -- ...teAccountPasswordComplexityActionGroup.xml | 17 ++++++++++ .../Customer/Test/Mftf/Data/CustomerData.xml | 20 ++++++++++++ .../StorefrontCustomerCreateFormSection.xml | 1 + .../NewCustomerPasswordComplexityTest.xml | 24 +++++++++++--- .../NewCustomerPasswordComplexityTest.xml | 2 ++ 8 files changed, 77 insertions(+), 38 deletions(-) create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml delete mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontFillRegistryFormActionGroup.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.xml diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml new file mode 100644 index 0000000000000..46c06e909b4d9 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.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="StorefrontClickHeaderLinkActionGroup"> + <arguments> + <argument name="LinkName" type="string" defaultValue="Create an Account"/> + </arguments> + <click stepKey="ClickTheLink" selector="{{StorefrontHeaderSection.HeaderLinkByText(LinkName)}}"/> + <waitForPageLoad stepKey="Wait"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontFillRegistryFormActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontFillRegistryFormActionGroup.xml deleted file mode 100644 index 0a1440937a554..0000000000000 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontFillRegistryFormActionGroup.xml +++ /dev/null @@ -1,31 +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="StorefrontFillRegistryFormActionGroup"> - - <!--Fill Registry Form with password length is below 8 characters --> - <fillField stepKey="fillFirstName1stVariation" userInput="John" selector="{{StorefrontCustomerCreateFormSection.firstnameField}}"/> - <fillField stepKey="fillLastName1stVariation" userInput="Doe" selector="{{StorefrontCustomerCreateFormSection.lastnameField}}"/> - <fillField stepKey="fillEmail1stVariation" userInput="johndoe@domain.com" selector="{{StorefrontCustomerCreateFormSection.emailField}}"/> - <fillField stepKey="fillPassword1stVariation" userInput="123123" selector="{{StorefrontCustomerCreateFormSection.passwordField}}"/> - <fillField stepKey="fillConfirmPassword1stVariation" userInput="123123" selector="{{StorefrontCustomerCreateFormSection.confirmPasswordField}}"/> - <click stepKey="clickCreateAccountButton1stVariation" selector="{{StorefrontCustomerCreateFormSection.createAccountButton}}"/> - <see userInput="Minimum length of this field must be equal or greater than 8 symbols. Leading and trailing spaces will be ignored." stepKey="seeTheErrorMessageIsDisplayed1"/> - - <!--Fill Registry Form with not secure enough password --> - <fillField stepKey="fillFirstName2ndVariation" userInput="John" selector="{{StorefrontCustomerCreateFormSection.firstnameField}}"/> - <fillField stepKey="fillLastName2ndVariation" userInput="Doe" selector="{{StorefrontCustomerCreateFormSection.lastnameField}}"/> - <fillField stepKey="fillEmail2ndVariation" userInput="johndoe@domain.com" selector="{{StorefrontCustomerCreateFormSection.emailField}}"/> - <fillField stepKey="fillPassword2ndVariation" userInput="123123qa" selector="{{StorefrontCustomerCreateFormSection.passwordField}}"/> - <fillField stepKey="fillConfirmPassword2ndVariation" userInput="123123qa" selector="{{StorefrontCustomerCreateFormSection.confirmPasswordField}}"/> - <click stepKey="clickCreateAccountButton" selector="{{StorefrontCustomerCreateFormSection.createAccountButton}}"/> - <see userInput="Minimum of different classes of characters in password is 3. Classes of characters: Lower Case, Upper Case, Digits, Special Characters." stepKey="seeTheErrorMessageIsDisplayed2"/> - - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml index b70560ad2cd86..3155cca583d59 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml @@ -11,9 +11,6 @@ <arguments> <argument name="LinkName" type="string" defaultValue="Create an Account"/> </arguments> - <see stepKey="SeeElement" selector="{{StorefrontHeaderSection.headerlinks}}" userInput="{{LinkName}}"/> - <click stepKey="ClickLink" selector="{{StorefrontHeaderSection.HeaderLinkByText(LinkName)}}"/> - <waitForPageLoad stepKey="Wait"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.xml new file mode 100644 index 0000000000000..9d7dbc604f59d --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.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="AssertMessageCustomerCreateAccountPasswordComplexityActionGroup"> + <arguments> + <argument name="message" type="string"/> + </arguments> + <see userInput="{{message}}" selector="{{StorefrontCustomerCreateFormSection.PasswordErrorMessages}}" stepKey="verifyMessage" /> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml b/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml index 5904067aea639..77bf6277d9c21 100644 --- a/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml +++ b/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml @@ -271,4 +271,24 @@ <requiredEntity type="address">US_Address_TX</requiredEntity> <requiredEntity type="address">US_Address_NY_Not_Default_Address</requiredEntity> </entity> + <entity name="Simple_Customer_With_Password_Length_Is_Below_Eight_Characters" type="customer"> + <data key="group_id">1</data> + <data key="email" unique="prefix">John.Doe@example.com</data> + <data key="firstname">John</data> + <data key="lastname">Doe</data> + <data key="fullname">John Doe</data> + <data key="password">123123</data> + <data key="store_id">0</data> + <data key="website_id">0</data> + </entity> + <entity name="Simple_Customer_With_Not_Secure_Password" type="customer"> + <data key="group_id">1</data> + <data key="email" unique="prefix">John.Doe@example.com</data> + <data key="firstname">John</data> + <data key="lastname">Doe</data> + <data key="fullname">John Doe</data> + <data key="password">123123qa</data> + <data key="store_id">0</data> + <data key="website_id">0</data> + </entity> </entities> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml index 8881a2a012ce8..5a731b2c3f0ed 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml @@ -17,6 +17,7 @@ <element name="passwordField" type="input" selector="#password"/> <element name="confirmPasswordField" type="input" selector="#password-confirmation"/> <element name="createAccountButton" type="button" selector="button.action.submit.primary" timeout="30"/> + <element name="PasswordErrorMessages" type="text" selector="#password-error"/> </section> <section name="StoreFrontCustomerAdvancedAttributesSection"> <element name="textFieldAttribute" type="input" selector="//input[@id='{{var}}']" parameterized="true" /> diff --git a/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml b/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml index 29135332d6125..ccd97f83cd0a6 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml @@ -21,12 +21,28 @@ <!-- TEST BODY --> <!-- Go to storefront home page --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/> + <!-- See the Registration Link --> + <actionGroup ref="StorefrontSeeHeaderLinksActionGroup" stepKey="SeeTheLink"/> <!-- Click the Registration Link --> - <actionGroup ref="StorefrontSeeHeaderLinksActionGroup" stepKey="ClickTheLink"> - <argument name="LinkName" value="Create an Account" /> + <actionGroup ref="StorefrontClickHeaderLinkActionGroup" stepKey="ClickTheLink"> + <argument name="LinkName" value="Create an Account"/> + </actionGroup> + <!-- Fill Registration Form with Password length is bellow 8 Characters --> + <actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="FillRegistrationFormPasswordLengthBellowEightCharacters"> + <argument name="customer" value="Simple_Customer_With_Password_Length_Is_Below_Eight_Characters"/> + </actionGroup> + <!-- See the Error --> + <actionGroup ref="AssertMessageCustomerCreateAccountPasswordComplexityActionGroup" stepKey="SeeTheErrorPasswordLength"> + <argument name="message" value="Minimum length of this field must be equal or greater than 8 symbols. Leading and trailing spaces will be ignored."/> + </actionGroup> + <!-- Fill Registration Form with not secure enough password --> + <actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="FillRegistrationFormPasswordNotSecure"> + <argument name="customer" value="Simple_Customer_With_Not_Secure_Password"/> + </actionGroup> + <!-- See the Error --> + <actionGroup ref="AssertMessageCustomerCreateAccountPasswordComplexityActionGroup" stepKey="SeeTheErrorPasswordSecure"> + <argument name="message" value="Minimum of different classes of characters in password is 3. Classes of characters: Lower Case, Upper Case, Digits, Special Characters."/> </actionGroup> - <!-- Fill Registry Form with Incorrect Password (Two variations) --> - <actionGroup ref="StorefrontFillRegistryFormActionGroup" stepKey="FillRegistryForm"/> <!--Test Body END--> </test> diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.xml b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.xml index a169a3f175cc6..7b6f3e981714c 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.xml @@ -16,6 +16,7 @@ <data name="customer/data/password" xsi:type="string">123123</data> <data name="customer/data/password_confirmation" xsi:type="string">123123</data> <constraint name="Magento\Security\Test\Constraint\AssertPasswordLengthErrorMessage" /> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> </variation> <variation name="PasswordComplexityTest" summary="Customer password is not secure enough"> <data name="tag" xsi:type="string">severity:S1</data> @@ -26,6 +27,7 @@ <data name="customer/data/password" xsi:type="string">123123qa</data> <data name="customer/data/password_confirmation" xsi:type="string">123123qa</data> <constraint name="Magento\Security\Test\Constraint\AssertPasswordIsNotSecureEnoughMessage" /> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> </variation> </testCase> </config> From 20567da3428c0ee720c3c5804d6d36d0b6ead089 Mon Sep 17 00:00:00 2001 From: Mila Lesechko <l.lesechko@gmail.com> Date: Tue, 27 Aug 2019 21:43:54 -0500 Subject: [PATCH 005/595] Convert MoveProductFromShoppingCartToWishlistTest to MFTF --- .../Section/CheckoutCartProductSection.xml | 1 + ...orefrontCustomerWishlistProductSection.xml | 3 + ...eProductFromShoppingCartToWishlistTest.xml | 164 ++++++++++++++++++ ...eProductFromShoppingCartToWishlistTest.xml | 110 ++++++++++++ ...eProductFromShoppingCartToWishlistTest.xml | 101 +++++++++++ ...lProductFromShoppingCartToWishlistTest.xml | 71 ++++++++ ...eProductFromShoppingCartToWishlistTest.xml | 5 +- 7 files changed, 454 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml create mode 100644 app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml create mode 100644 app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml create mode 100644 app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartProductSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartProductSection.xml index 3ab3fa5857b78..f028fae1f1f21 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartProductSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartProductSection.xml @@ -32,6 +32,7 @@ selector="//table[@id='shopping-cart-table']//tbody//tr[contains(@class,'item-actions')]//a[contains(@class,'action-delete')]"/> <element name="removeProductByName" type="text" selector="//*[contains(text(), '{{productName}}')]/ancestor::tbody//a[@class='action action-delete']" parameterized="true" timeout="30"/> <element name="productName" type="text" selector="//tbody[@class='cart item']//strong[@class='product-item-name']"/> + <element name="moveToWishlistByProductName" type="button" selector="//a[contains(text(), '{{productName}}')]/ancestor::tbody/tr//a[contains(@class, 'towishlist')]" parameterized="true"/> <element name="nthItemOption" type="block" selector=".item:nth-of-type({{numElement}}) .item-options" parameterized="true"/> <element name="nthEditButton" type="block" selector=".item:nth-of-type({{numElement}}) .action-edit" parameterized="true"/> <element name="nthBundleOptionName" type="text" selector=".product-item-details .item-options:nth-of-type({{numOption}}) dt" parameterized="true"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Section/StorefrontCustomerWishlistProductSection.xml b/app/code/Magento/Wishlist/Test/Mftf/Section/StorefrontCustomerWishlistProductSection.xml index 0b6c2f1191c40..dba0acfc29e8e 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Section/StorefrontCustomerWishlistProductSection.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Section/StorefrontCustomerWishlistProductSection.xml @@ -24,5 +24,8 @@ <element name="productSuccessShareMessage" type="text" selector="div.message-success"/> <element name="pager" type="block" selector=".toolbar .pager"/> <element name="wishlistEmpty" type="block" selector=".form-wishlist-items .message.info.empty"/> + <element name="productSeeDetailsByName" type="block" selector="//a[contains(text(), '{{productName}}')]/ancestor::div/div[contains(@class, 'product-item-tooltip')]" parameterized="true"/> + <element name="productSeeDetailsLabelByName" type="block" selector="//a[contains(text(), '{{productName}}')]/ancestor::div/div[contains(@class, 'product-item-tooltip')]//dt[@class='label']" parameterized="true"/> + <element name="productSeeDetailsValueByName" type="block" selector="//a[contains(text(), '{{productName}}')]/ancestor::div/div[contains(@class, 'product-item-tooltip')]//dd[@class='values']" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml new file mode 100644 index 0000000000000..317f937def3f1 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml @@ -0,0 +1,164 @@ +<?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="StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest"> + <annotations> + <stories value="Wishlist"/> + <title value="Move Configurable Product from Shopping Cart to Wishlist"/> + <description value="Move Configurable Product from Shopping Cart to Wishlist"/> + <severity value="CRITICAL"/> + <testCaseId value="MAGETWO-29545"/> + <group value="wishlist"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <!-- Create Data --> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <!-- Create an attribute with three options to be used in the first child product --> + <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> + <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + <createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + <createData entity="productAttributeOption3" stepKey="createConfigProductAttributeOption3"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + + <!-- Add the attribute just created to default attribute set --> + <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + + <!-- Get the first option of the attribute created --> + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </getData> + + <!-- Get the second option of the attribute created --> + <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </getData> + + <!-- Get the third option of the attribute created --> + <getData entity="ProductAttributeOptionGetter" index="3" stepKey="getConfigAttributeOption3"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </getData> + + <!-- Create Configurable product --> + <createData entity="BaseConfigurableProduct" stepKey="createConfigProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <!-- Create a simple product and give it the attribute with the first option --> + <createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption1"/> + <field key="price">10.00</field> + </createData> + + <!--Create a simple product and give it the attribute with the second option --> + <createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption2"/> + <field key="price">20.00</field> + </createData> + + <!--Create a simple product and give it the attribute with the Third option --> + <createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct3"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption3"/> + <field key="price">30.00</field> + </createData> + + <!-- Create the configurable product --> + <createData entity="ConfigurableProductThreeOptions" stepKey="createConfigProductOption"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption1"/> + <requiredEntity createDataKey="getConfigAttributeOption2"/> + <requiredEntity createDataKey="getConfigAttributeOption3"/> + </createData> + + <!-- Add the first simple product to the configurable product --> + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigChildProduct1"/> + </createData> + + <!-- Add the second simple product to the configurable product --> + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigChildProduct2"/> + </createData> + + <!-- Add the third simple product to the configurable product --> + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild3"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigChildProduct3"/> + </createData> + </before> + <after> + <!-- Delete data --> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteSimpleProduct1"/> + <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteSimpleProduct2"/> + <deleteData createDataKey="createConfigChildProduct3" stepKey="deleteSimpleProduct3"/> + <deleteData createDataKey="createConfigProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteProductAttribute"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!-- 1. Login as a customer --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + + <!-- Open Product page --> + <actionGroup ref="OpenProductFromCategoryPageActionGroup" stepKey="openProductFromCategory"> + <argument name="category" value="$$createCategory$$"/> + <argument name="product" value="$$createConfigProduct$$"/> + </actionGroup> + <selectOption selector="{{StorefrontProductInfoMainSection.productOptionSelect($$createConfigProductAttribute.default_value$$)}}" userInput="$$getConfigAttributeOption2.label$$" stepKey="selectOption1"/> + <scrollTo selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" y="-200" stepKey="scroll"/> + + <!-- Add product to the cart and Assert add product to cart success message--> + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartVirtualProductFromStorefrontProductPage"> + <argument name="productName" value="$$createConfigProduct.name$$"/> + </actionGroup> + + <!-- Select Mini Cart and select 'View And Edit Cart' --> + <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + + <!-- Assert move product to wishlist success message --> + <click selector="{{CheckoutCartProductSection.moveToWishlistByProductName($$createConfigProduct.name$$)}}" stepKey="moveToWishlist"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <see userInput="$$createConfigProduct.name$$ has been moved to your wish list." selector="{{CheckoutCartMessageSection.successMessage}}" stepKey="assertMoveProductToWishlistSuccessMessage"/> + + <!-- Assert product is present in wishlist --> + <amOnPage url="{{StorefrontCustomerWishlistPage.url}}" stepKey="goToWishlistPage"/> + <waitForPageLoad stepKey="waitForWishlistPage"/> + <waitForElement selector="{{StorefrontCustomerWishlistProductSection.ProductTitleByName($$createConfigProduct.name$$)}}" time="30" stepKey="assertWishlistProductName"/> + <see userInput="$20.00" selector="{{StorefrontCustomerWishlistProductSection.ProductPriceByName($$createConfigProduct.name$$)}}" stepKey="AssertWishlistProductPrice"/> + + <!-- Assert product details in Wishlist --> + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName($$createConfigProduct.name$$)}}" stepKey="wishlistMoveMouseOverProduct"/> + <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductAddToCartByName($$createConfigProduct.name$$)}}" stepKey="AssertWishlistAddToCart"/> + <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductImageByName($$createConfigProduct.name$$)}}" stepKey="AssertWishlistProductImage"/> + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsByName($$createConfigProduct.name$$)}}" stepKey="seeDetailsMoveMouseOverProduct"/> + <see userInput="$$createConfigProductAttribute.default_value$$" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsLabelByName($$createConfigProduct.name$$)}}" stepKey="seeAttribute"/> + <see userInput="$$getConfigAttributeOption2.label$$" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsValueByName($$createConfigProduct.name$$)}}" stepKey="seeOption"/> + + <actionGroup ref="AssertShoppingCartIsEmptyActionGroup" stepKey="assertCartIsEmpty"/> + </test> +</tests> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml new file mode 100644 index 0000000000000..dcd69a61e596f --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml @@ -0,0 +1,110 @@ +<?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="StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest"> + <annotations> + <stories value="Wishlist"/> + <title value="Move Dynamic Bundle Product from Shopping Cart to Wishlist"/> + <description value="Move Dynamic Bundle Product from Shopping Cart to Wishlist"/> + <severity value="CRITICAL"/> + <testCaseId value="MAGETWO-29545"/> + <group value="wishlist"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <!-- Create Data --> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="SimpleProduct2" stepKey="simpleProduct1"> + <field key="price">100.00</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct2"> + <field key="price">20.00</field> + </createData> + <!--Create Bundle product--> + <createData entity="ApiBundleProductPriceViewRange" stepKey="createBundleProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="DropDownBundleOption" stepKey="createBundleOption1_1"> + <requiredEntity createDataKey="createBundleProduct"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_1"/> + <requiredEntity createDataKey="simpleProduct1"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct2"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_1"/> + <requiredEntity createDataKey="simpleProduct2"/> + </createData> + <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="goToProductPageViaID" stepKey="goToProduct"> + <argument name="productId" value="$$createBundleProduct.id$$"/> + </actionGroup> + <scrollTo selector="{{AdminProductFormBundleSection.contentDropDown}}" stepKey="scrollToBundleSection"/> + <selectOption userInput="Separately" selector="{{AdminProductFormBundleSection.shipmentType}}" stepKey="selectSeparately"/> + <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <magentoCLI stepKey="reindex" command="indexer:reindex"/> + <magentoCLI stepKey="flushCache" command="cache:flush"/> + </before> + <after> + <!-- Delete data --> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/> + <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> + <deleteData createDataKey="simpleProduct2" stepKey="deleteProduct2"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!-- 1. Login as a customer --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + + <!-- Open Product page --> + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductFromCategory"> + <argument name="productUrlKey" value="$$createBundleProduct.custom_attributes[url_key]$$"/> + </actionGroup> + <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickCustomizeButton"/> + <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts($$createBundleOption1_1.title$$)}}" userInput="$$simpleProduct1.sku$$ +$100.00" stepKey="selectOption0Product0"/> + <fillField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity($$createBundleOption1_1.title$$)}}" userInput="1" stepKey="fillQuantity00"/> + + <!-- Add product to the cart and Assert add product to cart success message--> + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartVirtualProductFromStorefrontProductPage"> + <argument name="productName" value="$$createBundleProduct.name$$"/> + </actionGroup> + + <!-- Select Mini Cart and select 'View And Edit Cart' --> + <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + + <!-- Assert move product to wishlist success message --> + <click selector="{{CheckoutCartProductSection.moveToWishlistByProductName($$createBundleProduct.name$$)}}" stepKey="moveToWishlist"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <see userInput="$$createBundleProduct.name$$ has been moved to your wish list." selector="{{CheckoutCartMessageSection.successMessage}}" stepKey="assertMoveProductToWishlistSuccessMessage"/> + + <!-- Assert product is present in wishlist --> + <amOnPage url="{{StorefrontCustomerWishlistPage.url}}" stepKey="goToWishlistPage"/> + <waitForPageLoad stepKey="waitForWishlistPage"/> + <waitForElement selector="{{StorefrontCustomerWishlistProductSection.ProductTitleByName($$createBundleProduct.name$$)}}" time="30" stepKey="assertWishlistProductName"/> + <see userInput="$100.00" selector="{{StorefrontCustomerWishlistProductSection.ProductPriceByName($$createBundleProduct.name$$)}}" stepKey="AssertWishlistProductPrice"/> + + <!-- Assert product details in Wishlist --> + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName($$createBundleProduct.name$$)}}" stepKey="wishlistMoveMouseOverProduct"/> + <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductAddToCartByName($$createBundleProduct.name$$)}}" stepKey="AssertWishlistAddToCart"/> + <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductImageByName($$createBundleProduct.name$$)}}" stepKey="AssertWishlistProductImage"/> + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsByName($$createBundleProduct.name$$)}}" stepKey="seeDetailsMoveMouseOverProduct"/> + <see userInput="$$createBundleOption1_1.title$$" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsLabelByName($$createBundleProduct.name$$)}}" stepKey="seeBundleOption"/> + <see userInput="$$simpleProduct1.sku$$ $100.00" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsValueByName($$createBundleProduct.name$$)}}" stepKey="seeProduct"/> + + <actionGroup ref="AssertShoppingCartIsEmptyActionGroup" stepKey="assertCartIsEmpty"/> + </test> +</tests> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml new file mode 100644 index 0000000000000..4d99b05e9aa6a --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml @@ -0,0 +1,101 @@ +<?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="StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest"> + <annotations> + <stories value="Wishlist"/> + <title value="Move Fixed Bundle Product from Shopping Cart to Wishlist"/> + <description value="Move Fixed Bundle Product from Shopping Cart to Wishlist"/> + <severity value="CRITICAL"/> + <testCaseId value="MAGETWO-29545"/> + <group value="wishlist"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <!-- Create Data --> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> + <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> + <!-- Create bundle product --> + <createData entity="ApiFixedBundleProduct" stepKey="createBundleProduct"/> + <createData entity="DropDownBundleOption" stepKey="createBundleOption1_1"> + <requiredEntity createDataKey="createBundleProduct"/> + </createData> + <createData entity="ApiBundleLink" stepKey="createBundleLink"> + <field key="price_type">0</field> + <field key="price">100</field> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_1"/> + <requiredEntity createDataKey="simpleProduct1"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct2"> + <field key="price_type">0</field> + <field key="price">100</field> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_1"/> + <requiredEntity createDataKey="simpleProduct2"/> + </createData> + <magentoCLI stepKey="reindex" command="indexer:reindex"/> + <magentoCLI stepKey="flushCache" command="cache:flush"/> + </before> + <after> + <!-- Delete data --> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/> + <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> + <deleteData createDataKey="simpleProduct2" stepKey="deleteProduct2"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!-- 1. Login as a customer --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + + <!-- Open Product page --> + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductFromCategory"> + <argument name="productUrlKey" value="$$createBundleProduct.custom_attributes[url_key]$$"/> + </actionGroup> + <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickCustomizeButton"/> + <selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts($$createBundleOption1_1.title$$)}}" userInput="$$simpleProduct1.sku$$ +$100.00" stepKey="selectOption0Product0"/> + <fillField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity($$createBundleOption1_1.title$$)}}" userInput="1" stepKey="fillQuantity00"/> + + <!-- Add product to the cart and Assert add product to cart success message--> + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartVirtualProductFromStorefrontProductPage"> + <argument name="productName" value="$$createBundleProduct.name$$"/> + </actionGroup> + + <!-- Select Mini Cart and select 'View And Edit Cart' --> + <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + + <!-- Assert move product to wishlist success message --> + <click selector="{{CheckoutCartProductSection.moveToWishlistByProductName($$createBundleProduct.name$$)}}" stepKey="moveToWishlist"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <see userInput="$$createBundleProduct.name$$ has been moved to your wish list." selector="{{CheckoutCartMessageSection.successMessage}}" stepKey="assertMoveProductToWishlistSuccessMessage"/> + + <!-- Assert product is present in wishlist --> + <amOnPage url="{{StorefrontCustomerWishlistPage.url}}" stepKey="goToWishlistPage"/> + <waitForPageLoad stepKey="waitForWishlistPage"/> + <waitForElement selector="{{StorefrontCustomerWishlistProductSection.ProductTitleByName($$createBundleProduct.name$$)}}" time="30" stepKey="assertWishlistProductName"/> + <see userInput="$101.23" selector="{{StorefrontCustomerWishlistProductSection.ProductPriceByName($$createBundleProduct.name$$)}}" stepKey="AssertWishlistProductPrice"/> + + <!-- Assert product details in Wishlist --> + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName($$createBundleProduct.name$$)}}" stepKey="wishlistMoveMouseOverProduct"/> + <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductAddToCartByName($$createBundleProduct.name$$)}}" stepKey="AssertWishlistAddToCart"/> + <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductImageByName($$createBundleProduct.name$$)}}" stepKey="AssertWishlistProductImage"/> + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsByName($$createBundleProduct.name$$)}}" stepKey="seeDetailsMoveMouseOverProduct"/> + <see userInput="$$createBundleOption1_1.title$$" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsLabelByName($$createBundleProduct.name$$)}}" stepKey="seeBundleOption"/> + <see userInput="$$simpleProduct1.sku$$ $100.00" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsValueByName($$createBundleProduct.name$$)}}" stepKey="seeProduct"/> + + <actionGroup ref="AssertShoppingCartIsEmptyActionGroup" stepKey="assertCartIsEmpty"/> + </test> +</tests> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml new file mode 100644 index 0000000000000..baaae80f7d081 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml @@ -0,0 +1,71 @@ +<?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="StorefrontMoveVirtualProductFromShoppingCartToWishlistTest"> + <annotations> + <stories value="Wishlist"/> + <title value="Move Virtual Product from Shopping Cart to Wishlist"/> + <description value="Move Virtual Product from Shopping Cart to Wishlist"/> + <severity value="CRITICAL"/> + <testCaseId value="MAGETWO-29545"/> + <group value="wishlist"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <!-- Create Data --> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="defaultVirtualProduct" stepKey="createProduct"> + <field key="price">40</field> + <requiredEntity createDataKey="createCategory"/> + </createData> + </before> + <after> + <!-- Delete data --> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!-- 1. Login as a customer --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + + <!-- Open Virtual Product page --> + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="OpenStoreFrontProductPage"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + + <!-- Add Virtual product to the cart and Assert add product to cart success message--> + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartVirtualProductFromStorefrontProductPage"> + <argument name="productName" value="$$createProduct.name$$"/> + </actionGroup> + + <!-- Select Mini Cart and select 'View And Edit Cart' --> + <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + + <!-- Assert move product to wishlist success message --> + <click selector="{{CheckoutCartProductSection.moveToWishlistByProductName($$createProduct.name$$)}}" stepKey="moveToWishlist"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <see userInput="$$createProduct.name$$ has been moved to your wish list." selector="{{CheckoutCartMessageSection.successMessage}}" stepKey="assertMoveProductToWishlistSuccessMessage"/> + + <!-- Assert product is present in wishlist --> + <amOnPage url="{{StorefrontCustomerWishlistPage.url}}" stepKey="goToWishlistPage"/> + <waitForPageLoad stepKey="waitForWishlistPage"/> + + <actionGroup ref="StorefrontCustomerCheckProductInWishlist" stepKey="assertProductIsPresentInWishlist"> + <argument name="productVar" value="$$createProduct$$"/> + </actionGroup> + + <!-- Assert cart is empty --> + <actionGroup ref="AssertShoppingCartIsEmptyActionGroup" stepKey="assertCartIsEmpty"/> + </test> +</tests> diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml index 95e6a854ed266..aa3b646161a17 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml @@ -15,6 +15,7 @@ <constraint name="Magento\Checkout\Test\Constraint\AssertCartIsEmpty" /> </variation> <variation name="MoveProductFromShoppingCartToWishlistTestVariation2"> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <data name="product/0" xsi:type="string">catalogProductVirtual::default</data> <constraint name="Magento\Wishlist\Test\Constraint\AssertMoveProductToWishlistSuccessMessage" /> <constraint name="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> @@ -29,7 +30,7 @@ <constraint name="Magento\Wishlist\Test\Constraint\AssertProductDetailsInWishlist" /> </variation> <variation name="MoveProductFromShoppingCartToWishlistTestVariation4"> - <data name="tag" xsi:type="string">test_type:extended_acceptance_test</data> + <data name="tag" xsi:type="string">test_type:extended_acceptance_test, mftf_migrated:yes</data> <data name="product/0" xsi:type="string">configurableProduct::default</data> <constraint name="Magento\Wishlist\Test\Constraint\AssertMoveProductToWishlistSuccessMessage" /> <constraint name="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> @@ -37,6 +38,7 @@ <constraint name="Magento\Wishlist\Test\Constraint\AssertProductDetailsInWishlist" /> </variation> <variation name="MoveProductFromShoppingCartToWishlistTestVariation5"> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <data name="product/0" xsi:type="string">bundleProduct::bundle_dynamic_product</data> <constraint name="Magento\Wishlist\Test\Constraint\AssertMoveProductToWishlistSuccessMessage" /> <constraint name="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> @@ -44,6 +46,7 @@ <constraint name="Magento\Wishlist\Test\Constraint\AssertProductDetailsInWishlist" /> </variation> <variation name="MoveProductFromShoppingCartToWishlistTestVariation6"> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <data name="product/0" xsi:type="string">bundleProduct::bundle_fixed_product</data> <constraint name="Magento\Wishlist\Test\Constraint\AssertMoveProductToWishlistSuccessMessage" /> <constraint name="Magento\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> From ff7c3c9b8d9b1732cd5b69142a856ad27c0b839e Mon Sep 17 00:00:00 2001 From: Kate Kyzyma <kate@atwix.com> Date: Wed, 28 Aug 2019 13:27:16 +0300 Subject: [PATCH 006/595] Convert DeleteCategoryUrlRewriteEntityTest to MFTF --- ...dminDeleteCategoryUrlRewriteEntityTest.xml | 75 +++++++++++++++++++ .../DeleteCategoryUrlRewriteEntityTest.xml | 2 + 2 files changed, 77 insertions(+) create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteEntityTest.xml diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteEntityTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteEntityTest.xml new file mode 100644 index 0000000000000..d0e976a1f9e3d --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteEntityTest.xml @@ -0,0 +1,75 @@ +<?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="AdminDeleteCategoryUrlRewriteEntityTest"> + <annotations> + <stories value="Delete category URL rewrite"/> + <title value="Delete category URL rewrite"/> + <description value="Login as admin and delete category Url Rewrite"/> + <group value="urlRewrite"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <createData entity="_defaultCategory" stepKey="category"/> + </before> + <after> + <deleteData createDataKey="category" stepKey="deleteCategory"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!--Create the Category Url Rewrite--> + <actionGroup ref="AdminAddUrlRewrite" stepKey="addUrlRewrite"> + <argument name="category" value="$$category.name$$"/> + <argument name="customUrlRewriteValue" value="For Category'"/> + <argument name="storeValue" value="Default Store View"/> + <argument name="requestPath" value="-"/> + <argument name="redirectTypeValue" value="No"/> + <argument name="description" value="End To End Test"/> + </actionGroup> + + <!--Delete the Category Url Rewrite--> + <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <argument name="requestPath" value="-"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> + <argument name="message" value="You deleted the URL rewrite."/> + </actionGroup> + + <!--Verify AssertPageByUrlRewriteIsNotFound--> + <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="checkUrlOnFrontend"> + <argument name="requestPath" value="-"/> + </actionGroup> + + <!--Create the Category Url Rewrite--> + <actionGroup ref="AdminAddUrlRewrite" stepKey="addUrlRewriteSecondTime"> + <argument name="category" value="$$category.name$$"/> + <argument name="customUrlRewriteValue" value="For Category'"/> + <argument name="storeValue" value="Default Store View"/> + <argument name="requestPath" value="newrequestpath.html"/> + <argument name="redirectTypeValue" value="No"/> + <argument name="description" value="End To End Test"/> + </actionGroup> + + <!--Delete the Category Url Rewrite--> + <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewriteSecondTime"> + <argument name="requestPath" value="newrequestpath.html"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessageSecondTime"> + <argument name="message" value="You deleted the URL rewrite."/> + </actionGroup> + + <!--Verify AssertPageByUrlRewriteIsNotFound--> + <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="checkUrlOnFrontendSecondTime"> + <argument name="requestPath" value="newrequestpath.html"/> + </actionGroup> + + </test> +</tests> diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/DeleteCategoryUrlRewriteEntityTest.xml b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/DeleteCategoryUrlRewriteEntityTest.xml index 56440e8a8492b..42f71b8d01f76 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/DeleteCategoryUrlRewriteEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/DeleteCategoryUrlRewriteEntityTest.xml @@ -8,6 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\UrlRewrite\Test\TestCase\DeleteCategoryUrlRewriteEntityTest" summary="Delete Category URL Rewrites" ticketId="MAGETWO-25086"> <variation name="DeleteCategoryUrlRewriteEntityTestVariation1"> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <data name="urlRewrite/data/target_path/entity" xsi:type="string">catalog/category/view/id/%category::default%</data> <data name="urlRewrite/data/redirect_type" xsi:type="string">No</data> <data name="urlRewrite/data/request_path" xsi:type="string">-</data> @@ -15,6 +16,7 @@ <constraint name="Magento\UrlRewrite\Test\Constraint\AssertPageByUrlRewriteIsNotFound" /> </variation> <variation name="DeleteCategoryUrlRewriteEntityTestVariation2"> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <data name="urlRewrite/data/target_path/entity" xsi:type="string">catalog/category/view/id/%category::default%</data> <data name="urlRewrite/data/redirect_type" xsi:type="string">No</data> <data name="urlRewrite/data/request_path" xsi:type="string">example%isolation%.html</data> From f208cf5d0db47c13a70fe4e3cf7e3dd3763c6424 Mon Sep 17 00:00:00 2001 From: Kate Kyzyma <kate@atwix.com> Date: Wed, 28 Aug 2019 16:32:48 +0300 Subject: [PATCH 007/595] Working on the test --- ...dminAddUrlRewriteForCmsPageActionGroup.xml | 40 ++++++++ .../Section/AdminUrlRewriteEditSection.xml | 1 + ...AdminDeleteCmsPageUrlRewriteEntityTest.xml | 99 +++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteForCmsPageActionGroup.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteEntityTest.xml diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteForCmsPageActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteForCmsPageActionGroup.xml new file mode 100644 index 0000000000000..f46bd7f5e0386 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteForCmsPageActionGroup.xml @@ -0,0 +1,40 @@ +<?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="AdminAddUrlRewriteForCmsPageActionGroup"> + <annotations> + <description>Goes to the Admin Add URL Rewrite edit page. Fills in the provided URL details. Clicks on Save. Validates that the Success Message is present.</description> + </annotations> + <arguments> + <argument name="cmsPageUrlKey" type="string"/> + <argument name="customUrlRewriteValue" type="string"/> + <argument name="storeValue" type="string"/> + <argument name="requestPath" type="string"/> + <argument name="redirectTypeValue" type="string"/> + <argument name="description" type="string"/> + </arguments> + + <amOnPage url="{{AdminUrlRewriteEditPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> + <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewrite}}" stepKey="clickOnCustomUrlRewrite"/> + <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewriteValue('customUrlRewriteValue')}}" stepKey="selectForCsmPage"/> + <waitForPageLoad stepKey="waitForCategoryEditSectionToLoad"/> + <click selector="{{AdminUrlRewriteEditSection.cmsPage('cmsPageUrlKey')}}" stepKey="selectCmsPage"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> + <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> + <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> + <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue('redirectTypeValue')}}" stepKey="clickOnRedirectTypeValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> + <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> + <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteEditSection.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteEditSection.xml index 52939607f5377..5a55562e99334 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteEditSection.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteEditSection.xml @@ -19,6 +19,7 @@ <element name="redirectTypeValue" type="select" selector="//select[@id='redirect_type']//option[contains(., '{{Var}}')]" parameterized="true"/> <element name="description" type="input" selector="#description"/> <element name="categoryInTree" type="text" selector="//li[contains(@class,'active-category jstree-open')]/a[contains(., '{{categoryName}}')]" parameterized="true"/> + <element name="cmsPage" selector="//td[contains(text(), '{{cmsPageUrlKey}}')]" type="button" parameterized="true"/> <element name="saveButton" type="button" selector="#save" timeout="30"/> <element name="deleteButton" type="button" selector="#delete" timeout="30"/> <element name="okButton" type="button" selector="//button[@class='action-primary action-accept']" timeout="30"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteEntityTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteEntityTest.xml new file mode 100644 index 0000000000000..705786afa83bb --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteEntityTest.xml @@ -0,0 +1,99 @@ +<?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="AdminDeleteCmsPageUrlRewriteEntityTest"> + <annotations> + <stories value="Delete CMS Page URL rewrite"/> + <title value="Delete CMS Page URL rewrite"/> + <description value="Log in to admin and delete CMS Page URL rewrite"/> + <group value="cMSContent"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <createData entity="simpleCmsPage" stepKey="createCMSPage"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + </before> + <after> + <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!-- Create URL Rewrite for CMS Page with No redirects --> + <actionGroup ref="AdminAddUrlRewriteForCmsPageActionGroup" stepKey="addUrlRewrite"> + <argument name="cmsPageUrlKey" value="$$createCMSPage.identifier$$"/> + <argument name="customUrlRewriteValue" value="For CMS page'"/> + <argument name="storeValue" value="Default Store View"/> + <argument name="requestPath" value="newrequestpath"/> + <argument name="redirectTypeValue" value="No"/> + <argument name="description" value="cms_default_no_redirect"/> + </actionGroup> + + <!-- Create URL Rewrite for CMS Page with temporary redirect --> + <actionGroup ref="AdminAddUrlRewriteForCmsPageActionGroup" stepKey="addUrlRewriteTemporary"> + <argument name="cmsPageUrlKey" value="$$createCMSPage.identifier$$"/> + <argument name="customUrlRewriteValue" value="For CMS page'"/> + <argument name="storeValue" value="Default Store View"/> + <argument name="requestPath" value="temporaryrequestpath.html"/> + <argument name="redirectTypeValue" value="Temporary (302)"/> + <argument name="description" value="cms_default_temporary_redirect"/> + </actionGroup> + + <!-- Create URL Rewrite for CMS Page with permanent redirect --> + <actionGroup ref="AdminAddUrlRewriteForCmsPageActionGroup" stepKey="addUrlRewritePermanent"> + <argument name="cmsPageUrlKey" value="$$createCMSPage.identifier$$"/> + <argument name="customUrlRewriteValue" value="For CMS page'"/> + <argument name="storeValue" value="Default Store View"/> + <argument name="requestPath" value="permanentrequestpath.html"/> + <argument name="redirectTypeValue" value="Permanent (301)"/> + <argument name="description" value="cms_default_permanent_redirect"/> + </actionGroup> + + <!--Delete the URL Rewrite for CMS Page with No redirects--> + <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <argument name="requestPath" value="newrequestpath"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> + <argument name="message" value="You deleted the URL rewrite."/> + </actionGroup> + <!--Search and verify AssertUrlRewriteNotInGrid--> + <actionGroup ref="AdminSearchDeletedUrlRewrite" stepKey="searchDeletedUrlRewriteInGrid"> + <argument name="requestPath" value="newrequestpath"/> + </actionGroup> + <!--Verify AssertPageByUrlRewriteIsNotFound--> + <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFound"> + <argument name="requestPath" value="newrequestpath"/> + </actionGroup> + + <!--Delete the URL Rewrite for CMS Page with with temporary redirect--> + <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteTemporaryUrlRewrite"> + <argument name="requestPath" value="temporaryrequestpath.html"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessageSecondTime"> + <argument name="message" value="You deleted the URL rewrite."/> + </actionGroup> + <!--Verify AssertPageByUrlRewriteIsNotFound--> + <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFoundSecondTime"> + <argument name="requestPath" value="temporaryrequestpath.html"/> + </actionGroup> + + <!--Delete the URL Rewrite for CMS Page with permanent redirect--> + <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deletePermanentUrlRewrite"> + <argument name="requestPath" value="permanentrequestpath.html"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessageThirdTime"> + <argument name="message" value="You deleted the URL rewrite."/> + </actionGroup> + <!--Verify AssertPageByUrlRewriteIsNotFound--> + <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFoundThirdTime"> + <argument name="requestPath" value="permanentrequestpath.html"/> + </actionGroup> + + </test> +</tests> From 4674e41ea82a9e51bfb8b56c76a3533446d1c310 Mon Sep 17 00:00:00 2001 From: Kate Kyzyma <kate@atwix.com> Date: Wed, 28 Aug 2019 21:12:41 +0300 Subject: [PATCH 008/595] Convert DeleteCmsPageUrlRewriteEntityTest to MFTF --- .../Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.xml index 8262d88bdff1a..ea9d49d662bdd 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.xml @@ -8,20 +8,20 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Cms\Test\TestCase\DeleteCmsPageUrlRewriteEntityTest" summary="Delete Cms Page URL Rewrites" ticketId="MAGETWO-25915"> <variation name="DeleteCmsPageUrlRewriteEntityTestVariation1"> - <data name="tag" xsi:type="string">severity:S2</data> + <data name="tag" xsi:type="string">severity:S2,mftf_migrated:yes</data> <data name="urlRewrite/dataset" xsi:type="string">cms_default_no_redirect</data> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteDeletedMessage" /> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteNotInGrid" /> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertPageByUrlRewriteIsNotFound" /> </variation> <variation name="DeleteCmsPageUrlRewriteEntityTestVariation2"> - <data name="tag" xsi:type="string">severity:S2</data> + <data name="tag" xsi:type="string">severity:S2,mftf_migrated:yes</data> <data name="urlRewrite/dataset" xsi:type="string">cms_default_permanent_redirect</data> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteDeletedMessage" /> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertPageByUrlRewriteIsNotFound" /> </variation> <variation name="DeleteCmsPageUrlRewriteEntityTestVariation3"> - <data name="tag" xsi:type="string">severity:S2</data> + <data name="tag" xsi:type="string">severity:S2,mftf_migrated:yes</data> <data name="urlRewrite/dataset" xsi:type="string">cms_default_temporary_redirect</data> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertUrlRewriteDeletedMessage" /> <constraint name="Magento\UrlRewrite\Test\Constraint\AssertPageByUrlRewriteIsNotFound" /> From 666a333d19152b86069f2a0e667fc61631141f3d Mon Sep 17 00:00:00 2001 From: Ravi Chandra <ravi.chandra@krishtechnolabs.com> Date: Thu, 29 Aug 2019 17:44:27 +0530 Subject: [PATCH 009/595] Correct spelling --- .../Magento/Sales/Model/ResourceModel/Status/Collection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Model/ResourceModel/Status/Collection.php b/app/code/Magento/Sales/Model/ResourceModel/Status/Collection.php index 23d835db603df..393494858a3bb 100644 --- a/app/code/Magento/Sales/Model/ResourceModel/Status/Collection.php +++ b/app/code/Magento/Sales/Model/ResourceModel/Status/Collection.php @@ -1,6 +1,6 @@ <?php /** - * Oder statuses grid collection + * order status grid collection * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. From d244787c0484df8cf285978b4c2ced9d7c86622a Mon Sep 17 00:00:00 2001 From: Ravi Chandra <ravi.chandra@krishtechnolabs.com> Date: Thu, 29 Aug 2019 17:46:44 +0530 Subject: [PATCH 010/595] update Correct spelling --- .../Magento/Sales/Model/ResourceModel/Status/Collection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Model/ResourceModel/Status/Collection.php b/app/code/Magento/Sales/Model/ResourceModel/Status/Collection.php index 393494858a3bb..f429a62fc3f03 100644 --- a/app/code/Magento/Sales/Model/ResourceModel/Status/Collection.php +++ b/app/code/Magento/Sales/Model/ResourceModel/Status/Collection.php @@ -1,6 +1,6 @@ <?php /** - * order status grid collection + * Order status grid collection * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. From 459c596a74c209b001b1afcfcde8717f46132fec Mon Sep 17 00:00:00 2001 From: Tan Sezer <t.sezer@youwe.nl> Date: Thu, 29 Aug 2019 16:46:38 +0200 Subject: [PATCH 011/595] add eav_attribute_option join for ordering by sort_order column for attributes --- .../Model/Entity/Attribute/Source/Table.php | 8 +++++- .../ResourceModel/Entity/Attribute/Option.php | 27 +++++++++++++++++++ .../Entity/Attribute/Source/TableTest.php | 3 +++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php b/app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php index f9aa1a9ed3ba1..908f29069c429 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php @@ -213,7 +213,13 @@ public function addValueSortToCollection($collection, $dir = \Magento\Framework\ $valueExpr ); - $collection->getSelect()->order("{$attribute->getAttributeCode()} {$dir}"); + $this->_attrOptionFactory->create()->addOptionToCollection( + $collection, + $attribute, + $valueExpr + ); + + $collection->getSelect()->order("{$attribute->getAttributeCode()}_order {$dir}"); return $this; } diff --git a/app/code/Magento/Eav/Model/ResourceModel/Entity/Attribute/Option.php b/app/code/Magento/Eav/Model/ResourceModel/Entity/Attribute/Option.php index 79c277dcb6a82..6dc51247fb3f3 100644 --- a/app/code/Magento/Eav/Model/ResourceModel/Entity/Attribute/Option.php +++ b/app/code/Magento/Eav/Model/ResourceModel/Entity/Attribute/Option.php @@ -61,6 +61,33 @@ public function addOptionValueToCollection($collection, $attribute, $valueExpr) return $this; } + /** + * Add Join with option for collection select + * + * @param \Magento\Eav\Model\Entity\Collection\AbstractCollection $collection + * @param \Magento\Eav\Model\Entity\Attribute $attribute + * @param \Zend_Db_Expr $valueExpr + * @return $this + */ + public function addOptionToCollection($collection, $attribute, $valueExpr) + { + $connection = $this->getConnection(); + $attributeCode = $attribute->getAttributeCode(); + $optionTable1 = $attributeCode . '_option_t1'; + $tableJoinCond1 = "{$optionTable1}.option_id={$valueExpr}"; + $valueExpr = $connection->getIfNullSql( + "{$optionTable1}.sort_order" + ); + + $collection->getSelect()->joinLeft( + [$optionTable1 => $this->getTable('eav_attribute_option')], + $tableJoinCond1, + ["{$attributeCode}_order" => $valueExpr] + ); + + return $this; + } + /** * Retrieve Select for update Flat data * diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php index b68446d22f910..49e7be7ecf594 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php @@ -314,6 +314,9 @@ public function testAddValueSortToCollection() $attrOption->expects($this->once())->method('addOptionValueToCollection') ->with($collection, $this->abstractAttributeMock, $expr) ->willReturnSelf(); + $attrOption->expects($this->once())->method('addOptionToCollection') + ->with($collection, $this->abstractAttributeMock, $expr) + ->willReturnSelf(); $select->expects($this->once())->method('order')->with("{$attributeCode} {$dir}"); $this->assertEquals($this->model, $this->model->addValueSortToCollection($collection, $dir)); From a047aca104cb76d743bb318887f6ff7530175d5d Mon Sep 17 00:00:00 2001 From: Tan Sezer <t.sezer@youwe.nl> Date: Thu, 29 Aug 2019 17:02:43 +0200 Subject: [PATCH 012/595] add a line --- app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php b/app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php index 908f29069c429..ef7b4a69808bc 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php @@ -211,9 +211,7 @@ public function addValueSortToCollection($collection, $dir = \Magento\Framework\ $collection, $attribute, $valueExpr - ); - - $this->_attrOptionFactory->create()->addOptionToCollection( + )->addOptionToCollection( $collection, $attribute, $valueExpr From 952d12e423f2a02c0ead3a7fd8cd7588a15d0760 Mon Sep 17 00:00:00 2001 From: Tan Sezer <t.sezer@youwe.nl> Date: Fri, 30 Aug 2019 11:24:37 +0200 Subject: [PATCH 013/595] fix unit test for ordering of attribute --- .../Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php index 49e7be7ecf594..2997874f6ea34 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php @@ -317,7 +317,7 @@ public function testAddValueSortToCollection() $attrOption->expects($this->once())->method('addOptionToCollection') ->with($collection, $this->abstractAttributeMock, $expr) ->willReturnSelf(); - $select->expects($this->once())->method('order')->with("{$attributeCode} {$dir}"); + $select->expects($this->once())->method('order')->with("{$attributeCode}_order {$dir}"); $this->assertEquals($this->model, $this->model->addValueSortToCollection($collection, $dir)); } From 4d0d2743cf87d2b2f69ebb3a00613a443dbb575b Mon Sep 17 00:00:00 2001 From: DmitryTsymbal <d.tsymbal@atwix.com> Date: Fri, 6 Sep 2019 15:09:35 +0300 Subject: [PATCH 014/595] DeleteEIntegrationEntity --- .../AdminCreatesNewIntegrationActionGroup.xml | 22 +++++++ ...dminDeleteIntegrationEntityActionGroup.xml | 17 ++++++ ...gateToCreateIntegrationPageActionGroup.xml | 18 ++++++ ...dminSearchIntegrationInGridActionGroup.xml | 23 ++++++++ ...sageCreateIntegrationEntityActionGroup.xml | 19 ++++++ ...letedIntegrationIsNotInGridActionGroup.xml | 17 ++++++ .../Mftf/Section/AdminIntegrationsSection.xml | 26 ++++++++ .../Test/AdminDeleteIntegrationEntityTest.xml | 59 +++++++++++++++++++ .../TestCase/DeleteIntegrationEntityTest.xml | 1 + 9 files changed, 202 insertions(+) create mode 100644 app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminCreatesNewIntegrationActionGroup.xml create mode 100644 app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminDeleteIntegrationEntityActionGroup.xml create mode 100644 app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminNavigateToCreateIntegrationPageActionGroup.xml create mode 100644 app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminSearchIntegrationInGridActionGroup.xml create mode 100644 app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertAdminMessageCreateIntegrationEntityActionGroup.xml create mode 100644 app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertDeletedIntegrationIsNotInGridActionGroup.xml create mode 100644 app/code/Magento/Integration/Test/Mftf/Section/AdminIntegrationsSection.xml create mode 100644 app/code/Magento/Integration/Test/Mftf/Test/AdminDeleteIntegrationEntityTest.xml diff --git a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminCreatesNewIntegrationActionGroup.xml b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminCreatesNewIntegrationActionGroup.xml new file mode 100644 index 0000000000000..899ca8b7d7f4e --- /dev/null +++ b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminCreatesNewIntegrationActionGroup.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"> + + <!--Fill Required Fields --> + <actionGroup name="AdminCreatesNewIntegrationActionGroup"> + <arguments> + <argument name="name" type="string"/> + </arguments> + <fillField stepKey="fillNameField" selector="{{AddNewIntegrationSection.name}}" userInput="{{name}}"/> + <fillField stepKey="fillAdminPasswordField" selector="{{AddNewIntegrationSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> + <!--Click the "Save" Button --> + <click stepKey="clickSaveButton" selector="{{AddNewIntegrationSection.saveButton}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminDeleteIntegrationEntityActionGroup.xml b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminDeleteIntegrationEntityActionGroup.xml new file mode 100644 index 0000000000000..87bcff8145184 --- /dev/null +++ b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminDeleteIntegrationEntityActionGroup.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="AdminDeleteIntegrationEntityActionGroup"> + <click stepKey="clickRemoveButon" selector="{{IntegrationsGridSection.remove}}"/> + <waitForElementVisible selector="{{IntegrationsGridSection.submitButton}}" stepKey="waitForConfirmButtonVisible"/> + <click stepKey="clickSubmitButton" selector="{{IntegrationsGridSection.submitButton}}"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminNavigateToCreateIntegrationPageActionGroup.xml b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminNavigateToCreateIntegrationPageActionGroup.xml new file mode 100644 index 0000000000000..f31102419b665 --- /dev/null +++ b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminNavigateToCreateIntegrationPageActionGroup.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"> + + <!--Click the "Add New Integration" Button --> + + <actionGroup name="AdminNavigateToCreateIntegrationPageActionGroup"> + <click stepKey="clickAddNewIntegrationButton" selector="{{IntegrationsGridSection.add}}"/> + <waitForPageLoad stepKey="waitForNewNIntegrationPageLoaded"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminSearchIntegrationInGridActionGroup.xml b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminSearchIntegrationInGridActionGroup.xml new file mode 100644 index 0000000000000..6e0b7dc3eb9d5 --- /dev/null +++ b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminSearchIntegrationInGridActionGroup.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="AdminSearchIntegrationInGridActionGroup"> + <arguments> + <argument name="name" type="string"/> + </arguments> + <!--Reset Search Filters --> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <!--Fill Integration Name Field --> + <fillField selector="{{IntegrationsGridSection.name}}" userInput="{{name}}" stepKey="filterByName"/> + <!--Click "Search" Button --> + <click selector="{{IntegrationsGridSection.search}}" stepKey="doFilter"/> + <waitForPageLoad stepKey="waitForSitemapPageLoadedAfterFiltering"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertAdminMessageCreateIntegrationEntityActionGroup.xml b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertAdminMessageCreateIntegrationEntityActionGroup.xml new file mode 100644 index 0000000000000..e928149c7f08f --- /dev/null +++ b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertAdminMessageCreateIntegrationEntityActionGroup.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="AssertAdminMessageCreateIntegrationEntityActionGroup"> + <arguments> + <argument name="message" type="string" defaultValue="The integration '{{name}}' has been saved."/> + <argument name="messageType" type="string" defaultValue="success"/> + </arguments> + <waitForElementVisible selector="{{IntegrationsGridSection.messageByType(messageType)}}" stepKey="waitForMessage"/> + <see userInput="{{message}}" selector="{{IntegrationsGridSection.messageByType(messageType)}}" stepKey="verifyMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertDeletedIntegrationIsNotInGridActionGroup.xml b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertDeletedIntegrationIsNotInGridActionGroup.xml new file mode 100644 index 0000000000000..895f147fa8834 --- /dev/null +++ b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertDeletedIntegrationIsNotInGridActionGroup.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="AssertDeletedIntegrationIsNotInGridActionGroup"> + <arguments> + <argument name="name" type="string"/> + </arguments> + <dontSee userInput="{{name}}" selector="{{IntegrationsGridSection.rowByIndex('1')}}" stepKey="donSeeIntegration"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Integration/Test/Mftf/Section/AdminIntegrationsSection.xml b/app/code/Magento/Integration/Test/Mftf/Section/AdminIntegrationsSection.xml new file mode 100644 index 0000000000000..4e43cd3babdf6 --- /dev/null +++ b/app/code/Magento/Integration/Test/Mftf/Section/AdminIntegrationsSection.xml @@ -0,0 +1,26 @@ +<?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="IntegrationsGridSection"> + <element name="add" type="button" selector=".add"/> + <element name="messageByType" type="block" selector="#messages .message-{{messageType}}" parameterized="true"/> + <element name="name" type="input" selector="#integrationGrid_filter_name"/> + <element name="search" type="input" selector=".admin__filter-actions button[title=Search]"/> + <element name="remove" type="button" selector=".delete"/> + <element name="submitButton" type="button" selector=".action-primary.action-accept" timeout="30"/> + <element name="rowByIndex" type="text" selector="tr[data-role='row']:nth-of-type({{var1}})" parameterized="true" timeout="30"/> + </section> + + <section name="AddNewIntegrationSection"> + <element name="name" type="input" selector="#integration_properties_name"/> + <element name="password" type="input" selector="#integration_properties_current_password"/> + <element name="saveButton" type="button" selector="#save-split-button-button"/> + </section> +</sections> diff --git a/app/code/Magento/Integration/Test/Mftf/Test/AdminDeleteIntegrationEntityTest.xml b/app/code/Magento/Integration/Test/Mftf/Test/AdminDeleteIntegrationEntityTest.xml new file mode 100644 index 0000000000000..00dc9b320d7ad --- /dev/null +++ b/app/code/Magento/Integration/Test/Mftf/Test/AdminDeleteIntegrationEntityTest.xml @@ -0,0 +1,59 @@ +<?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="AdminDeleteIntegrationEntityTest"> + <annotations> + <features value="Integration"/> + <stories value="System Integration"/> + <title value="Admin system integration"/> + <description value="Admin Deletes Created Integration"/> + <group value="integration"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <!-- Login As Admin --> + <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <!-- Navigate To Integrations Page --> + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToIntegrationsPage"> + <argument name="menuUiId" value="{{AdminMenuSystem.dataUiId}}"/> + <argument name="submenuUiId" value="{{AdminMenuSystemExtensionsIntegrations.dataUiId}}"/> + </actionGroup> + <!-- Click the "Add New Integration" button --> + <actionGroup ref="AdminNavigateToCreateIntegrationPageActionGroup" stepKey="clickAddNewIntegrationButton"/> + <!-- Create New Integration --> + <actionGroup ref="AdminCreatesNewIntegrationActionGroup" stepKey="createIntegration"> + <argument name="name" value="Integration1"/> + </actionGroup> + </before> + <after> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!-- TEST BODY --> + <!-- Find Created Integration In Grid --> + <actionGroup ref="AdminSearchIntegrationInGridActionGroup" stepKey="findCreatedIntegration"> + <argument name="name" value="Integration1"/> + </actionGroup> + <!-- Delete Created Integration Entity --> + <actionGroup ref="AdminDeleteIntegrationEntityActionGroup" stepKey="deleteIntegration"/> + <!-- Assert Success Message --> + <actionGroup ref="AssertAdminMessageCreateIntegrationEntityActionGroup" stepKey="seeSuccessMessage"> + <argument name="message" value="The integration 'Integration1' has been deleted."/> + <argument value="success" name="messageType"/> + </actionGroup> + <!-- Assert Deleted Integration Is Not In Grid --> + <actionGroup ref="AdminSearchIntegrationInGridActionGroup" stepKey="findDeletedIntegration"> + <argument name="name" value="Integration1"/> + </actionGroup> + <actionGroup ref="AssertDeletedIntegrationIsNotInGridActionGroup" stepKey="dontSeeIntegration"> + <argument name="name" value="Integration1"/> + </actionGroup> + </test> +</tests> diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/DeleteIntegrationEntityTest.xml b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/DeleteIntegrationEntityTest.xml index 607c0abf4302e..a43b88469faae 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/DeleteIntegrationEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/DeleteIntegrationEntityTest.xml @@ -11,6 +11,7 @@ <data name="integration/dataset" xsi:type="string">default</data> <constraint name="Magento\Integration\Test\Constraint\AssertIntegrationSuccessDeleteMessage" /> <constraint name="Magento\Integration\Test\Constraint\AssertIntegrationNotInGrid" /> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> </variation> </testCase> </config> From 5f33b53d11a44c9b0af75c0932958e235b08ccb3 Mon Sep 17 00:00:00 2001 From: Kate Kyzyma <kate@atwix.com> Date: Wed, 18 Sep 2019 16:37:07 +0300 Subject: [PATCH 015/595] Working on the test --- .../AdminUpdateCmsPageRewriteEntityTest.xml | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityTest.xml diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityTest.xml new file mode 100644 index 0000000000000..07ec8e0fd71a2 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityTest.xml @@ -0,0 +1,92 @@ +<?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="AdminUpdateCmsPageRewriteEntityTest"> + <annotations> + <stories value="Update CMS Page URL Redirect"/> + <title value="Update CMS Page URL Redirect"/> + <description value="Login as Admin and tried to update the create URL Rewrite for CMS page"/> + <group value="cMSContent"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <createData entity="simpleCmsPage" stepKey="createCMSPage"/> + <actionGroup ref="LoginAsAdmin" stepKey="login"/> + </before> + <after> + <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!--Create Custom Store View--> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"/> + + <!-- Open CMS Edit Page, Get the CMS ID and Modify Store View Option to All Store Views --> + <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage"> + <argument name="CMSPage" value="$$createCMSPage$$"/> + </actionGroup> + <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> + <actionGroup ref="AddStoreViewToCmsPage" stepKey="updateStoreViewForCmsPage"> + <argument name="CMSPage" value="$$createCMSPage$$"/> + <argument name="storeViewName" value="All Store Views"/> + </actionGroup> + + <!--Create CMS Page URL Redirect--> + <actionGroup ref="AdminAddCustomUrlRewrite" stepKey="addCustomUrlRewrite"> + <argument name="customUrlRewriteValue" value="Custom"/> + <argument name="storeValue" value="Default Store View"/> + <argument name="requestPath" value="created-new-cms-page"/> + <argument name="redirectTypeValue" value="Permanent (301)"/> + <argument name="targetPath" value="cms/page/view/page_id/{$cmsId}"/> + <argument name="description" value="Created New CMS Page"/> + </actionGroup> + + <!--Search created CMS page url rewrite in grid--> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="searchUrlRewrite"> + <argument name="requestPath" value="created-new-cms-page"/> + </actionGroup> + + <!-- Update URL Rewrite for CMS Page First Attempt --> + <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateUrlRewriteFirstAttempt"> + <argument name="storeValue" value="{{customStore.name}}"/> + <argument name="requestPath" value="newrequestpath"/> + <argument name="redirectTypeValue" value="No"/> + <argument name="description" value="test_description_custom_store"/> + </actionGroup> + + <!-- Assert Url Rewrite Save Message --> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> + <argument name="message" value="The URL Rewrite has been saved."/> + </actionGroup> + + <!--<amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnStorefrontPage"/>--> + <!--<waitForPageLoad stepKey="waitForStorefrontPageLoad"/>--> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomepage"/> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="storefrontSwitchStoreView"> + <argument name="storeView" value="customStore"/> + </actionGroup> + + <!-- Assert Url Rewrite Cms Page Redirect --> + <actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFront"> + <argument name="page" value="newrequestpath"/> + </actionGroup> + <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage"> + <argument name="cmsTitle" value="$$createCMSPage.title$$"/> + <argument name="cmsContent" value="$$createCMSPage.content$$"/> + <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> + </actionGroup> + + <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <argument name="requestPath" value="newrequestpath"/> + </actionGroup> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteCustomStoreView"/> + + </test> +</tests> From 1334d8ad1a7e3bb07468880f7fb4a40dc3087eb7 Mon Sep 17 00:00:00 2001 From: Kate Kyzyma <kate@atwix.com> Date: Wed, 18 Sep 2019 16:51:58 +0300 Subject: [PATCH 016/595] Update the test --- .../AdminUpdateCmsPageRewriteEntityTest.xml | 33 +++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityTest.xml index 07ec8e0fd71a2..40a38dc689241 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityTest.xml @@ -66,8 +66,6 @@ <argument name="message" value="The URL Rewrite has been saved."/> </actionGroup> - <!--<amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnStorefrontPage"/>--> - <!--<waitForPageLoad stepKey="waitForStorefrontPageLoad"/>--> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomepage"/> <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="storefrontSwitchStoreView"> <argument name="storeView" value="customStore"/> @@ -83,9 +81,38 @@ <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> </actionGroup> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <!--Search created CMS page url rewrite in grid--> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="searchUrlRewriteSecondAttempt"> <argument name="requestPath" value="newrequestpath"/> </actionGroup> + <!-- Update URL Rewrite for CMS Page Second Attempt --> + <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateUrlRewriteSecondAttempt"> + <argument name="storeValue" value="Default Store View"/> + <argument name="requestPath" value="temporaryrequestpath.html"/> + <argument name="redirectTypeValue" value="Temporary (302)"/> + <argument name="description" value="test description_302"/> + </actionGroup> + <!-- Assert Url Rewrite Save Message --> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessageSecondAttempt"> + <argument name="message" value="The URL Rewrite has been saved."/> + </actionGroup> + + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomepageSecondAttempt"/> + <actionGroup ref="StorefrontSwitchDefaultStoreViewActionGroup" stepKey="switchToDefualtStoreView"/> + + <!-- Assert Url Rewrite Cms Page Redirect --> + <actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFrontSecondAttempt"> + <argument name="page" value="temporaryrequestpath.html"/> + </actionGroup> + <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPageSecondAttempt"> + <argument name="cmsTitle" value="$$createCMSPage.title$$"/> + <argument name="cmsContent" value="$$createCMSPage.content$$"/> + <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> + </actionGroup> + + <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <argument name="requestPath" value="temporaryrequestpath.html"/> + </actionGroup> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteCustomStoreView"/> </test> From f92ba2213fefcb3e75299894cd49d75a4efe32aa Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Wed, 18 Sep 2019 13:25:01 -0500 Subject: [PATCH 017/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- .../Model/Indexer/ProductPriceIndexFilter.php | 83 +++++++++---------- 1 file changed, 37 insertions(+), 46 deletions(-) diff --git a/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php b/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php index f9a49d4f8d121..170710ce09698 100644 --- a/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php +++ b/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php @@ -9,11 +9,11 @@ use Magento\CatalogInventory\Api\StockConfigurationInterface; use Magento\CatalogInventory\Model\ResourceModel\Stock\Item; +use Magento\CatalogInventory\Model\Stock; use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\PriceModifierInterface; use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\IndexTableStructure; use Magento\Framework\App\ResourceConnection; use Magento\Framework\App\ObjectManager; -use Magento\Framework\DB\Query\Generator; /** * Class for filter product price index. @@ -40,38 +40,22 @@ class ProductPriceIndexFilter implements PriceModifierInterface */ private $connectionName; - /** - * @var Generator - */ - private $batchQueryGenerator; - - /** - * @var int - */ - private $batchSize; - /** * @param StockConfigurationInterface $stockConfiguration * @param Item $stockItem * @param ResourceConnection $resourceConnection * @param string $connectionName - * @param Generator $batchQueryGenerator - * @param int $batchSize */ public function __construct( StockConfigurationInterface $stockConfiguration, Item $stockItem, ResourceConnection $resourceConnection = null, - $connectionName = 'indexer', - Generator $batchQueryGenerator = null, - $batchSize = 100 + $connectionName = 'indexer' ) { $this->stockConfiguration = $stockConfiguration; $this->stockItem = $stockItem; $this->resourceConnection = $resourceConnection ?: ObjectManager::getInstance()->get(ResourceConnection::class); $this->connectionName = $connectionName; - $this->batchQueryGenerator = $batchQueryGenerator ?: ObjectManager::getInstance()->get(Generator::class); - $this->batchSize = $batchSize; } /** @@ -80,9 +64,7 @@ public function __construct( * @param IndexTableStructure $priceTable * @param array $entityIds * @return void - * * @throws \Magento\Framework\Exception\LocalizedException - * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function modifyPrice(IndexTableStructure $priceTable, array $entityIds = []) : void { @@ -91,38 +73,47 @@ public function modifyPrice(IndexTableStructure $priceTable, array $entityIds = } $connection = $this->resourceConnection->getConnection($this->connectionName); - $select = $connection->select(); - - $select->from( - ['stock_item' => $this->stockItem->getMainTable()], - ['stock_item.product_id', 'MAX(stock_item.is_in_stock) as max_is_in_stock'] - ); + $stockSelect = $connection->select(); if ($this->stockConfiguration->getManageStock()) { - $select->where('stock_item.use_config_manage_stock = 1 OR stock_item.manage_stock = 1'); + $stockStatus = $connection->getCheckSql( + 'use_config_manage_stock = 0 AND manage_stock = 0', + Stock::STOCK_IN_STOCK, + 'is_in_stock' + ); } else { - $select->where('stock_item.use_config_manage_stock = 0 AND stock_item.manage_stock = 1'); + $stockStatus = $connection->getCheckSql( + 'use_config_manage_stock = 0 AND manage_stock = 1', + 'is_in_stock', + Stock::STOCK_IN_STOCK + ); } + $stockStatus = new \Zend_Db_Expr('MAX(' . $stockStatus . ')'); + $stockSelect->from( + $this->stockItem->getMainTable(), + [ + 'product_id' => 'product_id', + 'stock_status' => $stockStatus, + ] + ); + if (!empty($entityIds)) { + $stockSelect->where('product_id IN (?)', $entityIds); + } + $stockSelect->group('product_id'); - $select->group('stock_item.product_id'); - $select->having('max_is_in_stock = 0'); - - $batchSelectIterator = $this->batchQueryGenerator->generate( - 'product_id', - $select, - $this->batchSize, - \Magento\Framework\DB\Query\BatchIteratorInterface::UNIQUE_FIELD_ITERATOR + $select = $connection->select(); + $select->from( + ['price_index' => $priceTable->getTableName()], + [] ); + $select->joinInner( + ['stock_item' => $stockSelect], + 'stock_item.product_id = price_index.' . $priceTable->getEntityField(), + [] + ); + $select->where('stock_item.stock_status = ?', Stock::STOCK_OUT_OF_STOCK); - foreach ($batchSelectIterator as $select) { - $productIds = null; - foreach ($connection->query($select)->fetchAll() as $row) { - $productIds[] = $row['product_id']; - } - if ($productIds !== null) { - $where = [$priceTable->getEntityField() .' IN (?)' => $productIds]; - $connection->delete($priceTable->getTableName(), $where); - } - } + $query = $select->deleteFromSelect('price_index'); + $connection->query($query); } } From c60896cabe8bb7610401cf05ae5504345c2a076d Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Wed, 18 Sep 2019 17:01:36 -0500 Subject: [PATCH 018/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- app/code/Magento/CatalogRule/etc/indexer.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/CatalogRule/etc/indexer.xml b/app/code/Magento/CatalogRule/etc/indexer.xml index e648ea567631c..340918ed63531 100644 --- a/app/code/Magento/CatalogRule/etc/indexer.xml +++ b/app/code/Magento/CatalogRule/etc/indexer.xml @@ -17,6 +17,7 @@ <indexer id="catalog_product_price"> <dependencies> <indexer id="catalogrule_rule" /> + <indexer id="catalogrule_product" /> </dependencies> </indexer> </config> From f556ab303836db16edc2c45ab1aa22ea32f5c736 Mon Sep 17 00:00:00 2001 From: Kate Kyzyma <kate@atwix.com> Date: Thu, 19 Sep 2019 09:07:10 +0300 Subject: [PATCH 019/595] Convert UpdateCmsPageRewriteEntityTest to MFTF --- .../AdminUpdateCmsPageRewriteEntityTest.xml | 46 +++++++++++++++---- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityTest.xml index 40a38dc689241..f772c62489a98 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityTest.xml @@ -11,7 +11,7 @@ <annotations> <stories value="Update CMS Page URL Redirect"/> <title value="Update CMS Page URL Redirect"/> - <description value="Login as Admin and tried to update the create URL Rewrite for CMS page"/> + <description value="Login as Admin and tried to update the created URL Rewrite for CMS page"/> <group value="cMSContent"/> <group value="mtf_migrated"/> </annotations> @@ -66,12 +66,11 @@ <argument name="message" value="The URL Rewrite has been saved."/> </actionGroup> + <!-- Assert Url Rewrite Cms Page Redirect --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomepage"/> - <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="storefrontSwitchStoreView"> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="storefrontSwitchToCustomStoreView"> <argument name="storeView" value="customStore"/> </actionGroup> - - <!-- Assert Url Rewrite Cms Page Redirect --> <actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFront"> <argument name="page" value="newrequestpath"/> </actionGroup> @@ -81,10 +80,11 @@ <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> </actionGroup> - <!--Search created CMS page url rewrite in grid--> + <!--Search created CMS page url rewrite in grid second attempt--> <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="searchUrlRewriteSecondAttempt"> <argument name="requestPath" value="newrequestpath"/> </actionGroup> + <!-- Update URL Rewrite for CMS Page Second Attempt --> <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateUrlRewriteSecondAttempt"> <argument name="storeValue" value="Default Store View"/> @@ -92,15 +92,15 @@ <argument name="redirectTypeValue" value="Temporary (302)"/> <argument name="description" value="test description_302"/> </actionGroup> + <!-- Assert Url Rewrite Save Message --> <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessageSecondAttempt"> <argument name="message" value="The URL Rewrite has been saved."/> </actionGroup> - <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomepageSecondAttempt"/> - <actionGroup ref="StorefrontSwitchDefaultStoreViewActionGroup" stepKey="switchToDefualtStoreView"/> - <!-- Assert Url Rewrite Cms Page Redirect --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomepageSecondAttempt"/> + <actionGroup ref="StorefrontSwitchDefaultStoreViewActionGroup" stepKey="switchToDefaultStoreView"/> <actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFrontSecondAttempt"> <argument name="page" value="temporaryrequestpath.html"/> </actionGroup> @@ -110,9 +110,37 @@ <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> </actionGroup> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <!--Search created CMS page url rewrite in grid third attempt--> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="searchUrlRewriteThirdAttempt"> <argument name="requestPath" value="temporaryrequestpath.html"/> </actionGroup> + + <!-- Update URL Rewrite for CMS Page Third Attempt --> + <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateUrlRewriteThirdAttempt"> + <argument name="storeValue" value="Default Store View"/> + <argument name="requestPath" value="permanentrequestpath.htm"/> + <argument name="redirectTypeValue" value="Permanent (301)"/> + <argument name="description" value="test_description_301"/> + </actionGroup> + + <!-- Assert Url Rewrite Save Message --> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessageThirdAttempt"> + <argument name="message" value="The URL Rewrite has been saved."/> + </actionGroup> + + <!-- Assert Url Rewrite Cms Page Redirect --> + <actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFrontThirdAttempt"> + <argument name="page" value="permanentrequestpath.htm"/> + </actionGroup> + <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPageThirdAttempt"> + <argument name="cmsTitle" value="$$createCMSPage.title$$"/> + <argument name="cmsContent" value="$$createCMSPage.content$$"/> + <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> + </actionGroup> + + <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <argument name="requestPath" value="permanentrequestpath.htm"/> + </actionGroup> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteCustomStoreView"/> </test> From fb9709dfd3dbe98663282f375e6593f179dc7bcd Mon Sep 17 00:00:00 2001 From: Kate Kyzyma <kate@atwix.com> Date: Thu, 19 Sep 2019 09:10:37 +0300 Subject: [PATCH 020/595] Update UpdateCmsPageRewriteEntityTest.xml file --- .../Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.xml index 6ff68599beeb3..1125ce8d916c1 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Cms\Test\TestCase\UpdateCmsPageRewriteEntityTest" summary="Update Cms Page URL Rewrites " ticketId="MAGETWO-26173"> <variation name="UpdateCmsPageRewriteEntityTestVariation1"> - <data name="tag" xsi:type="string">severity:S2</data> + <data name="tag" xsi:type="string">severity:S2,mftf_migrated:yes</data> <data name="cmsPageRewrite/dataset" xsi:type="string">cms_default_no_redirect</data> <data name="urlRewrite/data/store_id" xsi:type="string">Main Website/Main Website Store/%default%</data> <data name="urlRewrite/data/request_path" xsi:type="string">request_path%isolation%</data> @@ -18,7 +18,7 @@ <constraint name="Magento\Cms\Test\Constraint\AssertUrlRewriteCmsPageRedirect" /> </variation> <variation name="UpdateCmsPageRewriteEntityTestVariation2"> - <data name="tag" xsi:type="string">severity:S2</data> + <data name="tag" xsi:type="string">severity:S2,mftf_migrated:yes</data> <data name="cmsPageRewrite/dataset" xsi:type="string">cms_default_temporary_redirect</data> <data name="urlRewrite/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> <data name="urlRewrite/data/request_path" xsi:type="string">request_path%isolation%.html</data> @@ -28,7 +28,7 @@ <constraint name="Magento\Cms\Test\Constraint\AssertUrlRewriteCmsPageRedirect" /> </variation> <variation name="UpdateCmsPageRewriteEntityTestVariation3"> - <data name="tag" xsi:type="string">severity:S2</data> + <data name="tag" xsi:type="string">severity:S2,mftf_migrated:yes</data> <data name="cmsPageRewrite/dataset" xsi:type="string">cms_default_permanent_redirect</data> <data name="urlRewrite/data/store_id" xsi:type="string">Main Website/Main Website Store/Default Store View</data> <data name="urlRewrite/data/request_path" xsi:type="string">request_path%isolation%.htm</data> From 50e60e18484088c05aab85944e8fa80655c3d953 Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Fri, 20 Sep 2019 11:11:01 -0500 Subject: [PATCH 021/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- .../Model/Indexer/IndexBuilder.php | 67 +++++++++---------- .../Model/Indexer/ReindexRuleProductPrice.php | 7 +- .../Indexer/RuleProductsSelectBuilder.php | 13 ++-- 3 files changed, 39 insertions(+), 48 deletions(-) diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index e12eabba76401..10abf356fbef2 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -275,11 +275,21 @@ protected function doReindexByIds($ids) { $this->cleanProductIndex($ids); - $products = $this->productLoader->getProducts($ids); - $activeRules = $this->getActiveRules(); - foreach ($products as $product) { - $this->applyRules($activeRules, $product); + /** @var Rule[] $activeRules */ + $activeRules = $this->getActiveRules()->getItems(); + foreach ($activeRules as $rule) { + $rule->setProductsFilter($ids); + $productIds = $rule->getMatchingProductIds(); + foreach ($productIds as $productId) { + $this->assignProductToRule($rule, $productId); + } + } + + $this->cleanProductPriceIndex($ids); + foreach ($ids as $productId) { + $this->reindexRuleProductPrice->execute($this->batchCount, $productId); } + $this->reindexRuleGroupWebsite->execute(); } @@ -320,7 +330,7 @@ protected function doReindexFull() [ $this->getTable('catalogrule_product'), $this->getTable('catalogrule_product_price'), - $this->getTable('catalogrule_group_website') + $this->getTable('catalogrule_group_website'), ] ); } @@ -365,27 +375,25 @@ protected function cleanByIds($productIds) * Assign product to rule * * @param Rule $rule - * @param Product $product + * @param int $productId * @return void */ - private function assignProductToRule(Rule $rule, Product $product): void + private function assignProductToRule(Rule $rule, int $productId): void { - if (!$rule->validate($product)) { - return; - } - $ruleId = (int) $rule->getId(); - $productEntityId = (int) $product->getId(); $ruleProductTable = $this->getTable('catalogrule_product'); $this->connection->delete( $ruleProductTable, [ 'rule_id = ?' => $ruleId, - 'product_id = ?' => $productEntityId, + 'product_id = ?' => $productId, ] ); - $websiteIds = array_intersect($product->getWebsiteIds(), $rule->getWebsiteIds()); + $websiteIds = $rule->getWebsiteIds(); + if (!is_array($websiteIds)) { + $websiteIds = explode(',', $websiteIds); + } $customerGroupIds = $rule->getCustomerGroupIds(); $fromTime = strtotime($rule->getFromDate()); $toTime = strtotime($rule->getToDate()); @@ -404,7 +412,7 @@ private function assignProductToRule(Rule $rule, Product $product): void 'to_time' => $toTime, 'website_id' => $websiteId, 'customer_group_id' => $customerGroupId, - 'product_id' => $productEntityId, + 'product_id' => $productId, 'action_operator' => $actionOperator, 'action_amount' => $actionAmount, 'action_stop' => $actionStop, @@ -422,6 +430,8 @@ private function assignProductToRule(Rule $rule, Product $product): void } } + + /** * Apply rule * @@ -433,30 +443,15 @@ private function assignProductToRule(Rule $rule, Product $product): void */ protected function applyRule(Rule $rule, $product) { - $this->assignProductToRule($rule, $product); - $this->reindexRuleProductPrice->execute($this->batchCount, $product); + if ($rule->validate($product)) { + $this->assignProductToRule($rule, $product->getId()); + } + $this->reindexRuleProductPrice->execute($this->batchCount, $product->getId()); $this->reindexRuleGroupWebsite->execute(); return $this; } - /** - * Apply rules - * - * @param RuleCollection $ruleCollection - * @param Product $product - * @return void - */ - private function applyRules(RuleCollection $ruleCollection, Product $product): void - { - foreach ($ruleCollection as $rule) { - $this->assignProductToRule($rule, $product); - } - - $this->cleanProductPriceIndex([$product->getId()]); - $this->reindexRuleProductPrice->execute($this->batchCount, $product); - } - /** * Retrieve table name * @@ -507,7 +502,7 @@ protected function updateRuleProductData(Rule $rule) */ protected function applyAllRules(Product $product = null) { - $this->reindexRuleProductPrice->execute($this->batchCount, $product); + $this->reindexRuleProductPrice->execute($this->batchCount, $product->getId()); $this->reindexRuleGroupWebsite->execute(); return $this; } @@ -562,7 +557,7 @@ protected function calcRuleProductPrice($ruleData, $productData = null) */ protected function getRuleProductsStmt($websiteId, Product $product = null) { - return $this->ruleProductsSelectBuilder->build($websiteId, $product); + return $this->ruleProductsSelectBuilder->build((int) $websiteId, (int) $product->getId()); } /** diff --git a/app/code/Magento/CatalogRule/Model/Indexer/ReindexRuleProductPrice.php b/app/code/Magento/CatalogRule/Model/Indexer/ReindexRuleProductPrice.php index 11ba87730bec1..51869f1accbb3 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/ReindexRuleProductPrice.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/ReindexRuleProductPrice.php @@ -6,7 +6,6 @@ namespace Magento\CatalogRule\Model\Indexer; -use Magento\Catalog\Model\Product; use Magento\Framework\Stdlib\DateTime\TimezoneInterface; use Magento\Store\Model\StoreManagerInterface; @@ -65,19 +64,19 @@ public function __construct( * Reindex product prices. * * @param int $batchCount - * @param Product|null $product + * @param int|null $productId * @param bool $useAdditionalTable * @return bool * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ - public function execute($batchCount, Product $product = null, $useAdditionalTable = false) + public function execute(int $batchCount, ?int $productId = null, bool $useAdditionalTable = false) { /** * Update products rules prices per each website separately * because for each website date in website's timezone should be used */ foreach ($this->storeManager->getWebsites() as $website) { - $productsStmt = $this->ruleProductsSelectBuilder->build($website->getId(), $product, $useAdditionalTable); + $productsStmt = $this->ruleProductsSelectBuilder->build($website->getId(), $productId, $useAdditionalTable); $dayPrices = []; $stopFlags = []; $prevKey = null; diff --git a/app/code/Magento/CatalogRule/Model/Indexer/RuleProductsSelectBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/RuleProductsSelectBuilder.php index 6989a33535ad8..31fe9112ed279 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/RuleProductsSelectBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/RuleProductsSelectBuilder.php @@ -74,15 +74,12 @@ public function __construct( * Build select for indexer according passed parameters. * * @param int $websiteId - * @param \Magento\Catalog\Model\Product|null $product + * @param int|null $productId * @param bool $useAdditionalTable * @return \Zend_Db_Statement_Interface */ - public function build( - $websiteId, - \Magento\Catalog\Model\Product $product = null, - $useAdditionalTable = false - ) { + public function build(int $websiteId, ?int $productId = null, bool $useAdditionalTable = false) + { $connection = $this->resource->getConnection(); $indexTable = $this->resource->getTableName('catalogrule_product'); if ($useAdditionalTable) { @@ -107,8 +104,8 @@ public function build( ['rp.website_id', 'rp.customer_group_id', 'rp.product_id', 'rp.sort_order', 'rp.rule_id'] ); - if ($product && $product->getEntityId()) { - $select->where('rp.product_id=?', $product->getEntityId()); + if ($productId) { + $select->where('rp.product_id=?', $productId); } /** From 13cea66ec53f20188d5dd06fe915920b8bb7803f Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Fri, 20 Sep 2019 13:16:51 -0500 Subject: [PATCH 022/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- .../Model/Indexer/ProductPriceIndexFilter.php | 42 +-- .../Model/Indexer/IndexBuilder.php | 17 +- .../Indexer/RuleProductsSelectBuilder.php | 8 +- .../Unit/Model/Indexer/IndexBuilderTest.php | 289 ------------------ .../Indexer/ReindexRuleProductPriceTest.php | 6 +- .../Indexer/RuleProductsSelectBuilderTest.php | 200 ------------ 6 files changed, 31 insertions(+), 531 deletions(-) delete mode 100644 app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/IndexBuilderTest.php delete mode 100644 app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/RuleProductsSelectBuilderTest.php diff --git a/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php b/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php index 170710ce09698..32fb85f270b9c 100644 --- a/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php +++ b/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php @@ -73,8 +73,17 @@ public function modifyPrice(IndexTableStructure $priceTable, array $entityIds = } $connection = $this->resourceConnection->getConnection($this->connectionName); - $stockSelect = $connection->select(); + $stockSelect->from( + $this->stockItem->getMainTable(), + [ + 'product_id', + ] + ); + if (!empty($entityIds)) { + $stockSelect->where('product_id IN (?)', $entityIds); + } + $stockSelect->group('product_id'); if ($this->stockConfiguration->getManageStock()) { $stockStatus = $connection->getCheckSql( 'use_config_manage_stock = 0 AND manage_stock = 0', @@ -89,31 +98,12 @@ public function modifyPrice(IndexTableStructure $priceTable, array $entityIds = ); } $stockStatus = new \Zend_Db_Expr('MAX(' . $stockStatus . ')'); - $stockSelect->from( - $this->stockItem->getMainTable(), - [ - 'product_id' => 'product_id', - 'stock_status' => $stockStatus, - ] - ); - if (!empty($entityIds)) { - $stockSelect->where('product_id IN (?)', $entityIds); - } - $stockSelect->group('product_id'); + $stockSelect->having($stockStatus . ' = ' . Stock::STOCK_OUT_OF_STOCK); + $productIds = $connection->fetchCol($stockSelect); - $select = $connection->select(); - $select->from( - ['price_index' => $priceTable->getTableName()], - [] - ); - $select->joinInner( - ['stock_item' => $stockSelect], - 'stock_item.product_id = price_index.' . $priceTable->getEntityField(), - [] - ); - $select->where('stock_item.stock_status = ?', Stock::STOCK_OUT_OF_STOCK); - - $query = $select->deleteFromSelect('price_index'); - $connection->query($query); + if (!empty($productIds)) { + $where = [$priceTable->getEntityField() .' IN (?)' => $productIds]; + $connection->delete($priceTable->getTableName(), $where); + } } } diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index 10abf356fbef2..6391171be0a35 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -280,8 +280,9 @@ protected function doReindexByIds($ids) foreach ($activeRules as $rule) { $rule->setProductsFilter($ids); $productIds = $rule->getMatchingProductIds(); - foreach ($productIds as $productId) { - $this->assignProductToRule($rule, $productId); + foreach ($productIds as $productId => $result) { + $websiteIds = array_keys(array_filter($result)); + $this->assignProductToRule($rule, $productId, $websiteIds); } } @@ -376,9 +377,10 @@ protected function cleanByIds($productIds) * * @param Rule $rule * @param int $productId + * @param array $websiteIds * @return void */ - private function assignProductToRule(Rule $rule, int $productId): void + private function assignProductToRule(Rule $rule, int $productId, array $websiteIds): void { $ruleId = (int) $rule->getId(); $ruleProductTable = $this->getTable('catalogrule_product'); @@ -390,10 +392,6 @@ private function assignProductToRule(Rule $rule, int $productId): void ] ); - $websiteIds = $rule->getWebsiteIds(); - if (!is_array($websiteIds)) { - $websiteIds = explode(',', $websiteIds); - } $customerGroupIds = $rule->getCustomerGroupIds(); $fromTime = strtotime($rule->getFromDate()); $toTime = strtotime($rule->getToDate()); @@ -430,8 +428,6 @@ private function assignProductToRule(Rule $rule, int $productId): void } } - - /** * Apply rule * @@ -444,7 +440,8 @@ private function assignProductToRule(Rule $rule, int $productId): void protected function applyRule(Rule $rule, $product) { if ($rule->validate($product)) { - $this->assignProductToRule($rule, $product->getId()); + $websiteIds = array_intersect($product->getWebsiteIds(), $rule->getWebsiteIds()); + $this->assignProductToRule($rule, $product->getId(), $websiteIds); } $this->reindexRuleProductPrice->execute($this->batchCount, $product->getId()); $this->reindexRuleGroupWebsite->execute(); diff --git a/app/code/Magento/CatalogRule/Model/Indexer/RuleProductsSelectBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/RuleProductsSelectBuilder.php index 31fe9112ed279..e15bf6b3b1faa 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/RuleProductsSelectBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/RuleProductsSelectBuilder.php @@ -156,9 +156,11 @@ public function build(int $websiteId, ?int $productId = null, bool $useAdditiona sprintf($joinCondition, $tableAlias, $storeId), [] ); - $select->columns([ - 'default_price' => $connection->getIfNullSql($tableAlias . '.value', 'pp_default.value'), - ]); + $select->columns( + [ + 'default_price' => $connection->getIfNullSql($tableAlias . '.value', 'pp_default.value'), + ] + ); return $connection->query($select); } diff --git a/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/IndexBuilderTest.php b/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/IndexBuilderTest.php deleted file mode 100644 index 78668366bccdc..0000000000000 --- a/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/IndexBuilderTest.php +++ /dev/null @@ -1,289 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\CatalogRule\Test\Unit\Model\Indexer; - -use Magento\CatalogRule\Model\Indexer\IndexBuilder\ProductLoader; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; - -/** - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - * @SuppressWarnings(PHPMD.TooManyFields) - */ -class IndexBuilderTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var \Magento\CatalogRule\Model\Indexer\IndexBuilder - */ - protected $indexBuilder; - - /** - * @var \Magento\Framework\App\ResourceConnection|\PHPUnit_Framework_MockObject_MockObject - */ - protected $resource; - - /** - * @var \Magento\Store\Model\StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $storeManager; - - /** - * @var \Magento\CatalogRule\Model\ResourceModel\Rule\CollectionFactory|\PHPUnit_Framework_MockObject_MockObject - */ - protected $ruleCollectionFactory; - - /** - * @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $logger; - - /** - * @var \Magento\Framework\Pricing\PriceCurrencyInterface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $priceCurrency; - - /** - * @var \Magento\Eav\Model\Config|\PHPUnit_Framework_MockObject_MockObject - */ - protected $eavConfig; - - /** - * @var \Magento\Framework\Stdlib\DateTime|\PHPUnit_Framework_MockObject_MockObject - */ - protected $dateFormat; - - /** - * @var \Magento\Framework\Stdlib\DateTime\DateTime|\PHPUnit_Framework_MockObject_MockObject - */ - protected $dateTime; - - /** - * @var \Magento\Catalog\Model\ProductFactory|\PHPUnit_Framework_MockObject_MockObject - */ - protected $productFactory; - - /** - * @var \Magento\Framework\DB\Adapter\AdapterInterface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $connection; - - /** - * @var \Magento\Framework\EntityManager\MetadataPool|\PHPUnit_Framework_MockObject_MockObject - */ - protected $metadataPool; - - /** - * @var \Magento\Framework\DB\Select|\PHPUnit_Framework_MockObject_MockObject - */ - protected $select; - - /** - * @var \Zend_Db_Statement_Interface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $db; - - /** - * @var \Magento\Store\Model\Website|\PHPUnit_Framework_MockObject_MockObject - */ - protected $website; - - /** - * @var \Magento\Rule\Model\Condition\Combine|\PHPUnit_Framework_MockObject_MockObject - */ - protected $combine; - - /** - * @var \Magento\CatalogRule\Model\Rule|\PHPUnit_Framework_MockObject_MockObject - */ - protected $rules; - - /** - * @var \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject - */ - protected $product; - - /** - * @var \Magento\Eav\Model\Entity\Attribute\AbstractAttribute|\PHPUnit_Framework_MockObject_MockObject - */ - protected $attribute; - - /** - * @var \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend|\PHPUnit_Framework_MockObject_MockObject - */ - protected $backend; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - private $reindexRuleProductPrice; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - private $reindexRuleGroupWebsite; - - /** - * @var ProductLoader|\PHPUnit_Framework_MockObject_MockObject - */ - private $productLoader; - - /** - * Set up test - * - * @return void - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - protected function setUp() - { - $this->resource = $this->createPartialMock( - \Magento\Framework\App\ResourceConnection::class, - ['getConnection', 'getTableName'] - ); - $this->ruleCollectionFactory = $this->createPartialMock( - \Magento\CatalogRule\Model\ResourceModel\Rule\CollectionFactory::class, - ['create'] - ); - $this->backend = $this->createMock(\Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend::class); - $this->select = $this->createMock(\Magento\Framework\DB\Select::class); - $this->metadataPool = $this->createMock(\Magento\Framework\EntityManager\MetadataPool::class); - $metadata = $this->createMock(\Magento\Framework\EntityManager\EntityMetadata::class); - $this->metadataPool->expects($this->any())->method('getMetadata')->willReturn($metadata); - $this->connection = $this->createMock(\Magento\Framework\DB\Adapter\AdapterInterface::class); - $this->db = $this->createMock(\Zend_Db_Statement_Interface::class); - $this->website = $this->createMock(\Magento\Store\Model\Website::class); - $this->storeManager = $this->createMock(\Magento\Store\Model\StoreManagerInterface::class); - $this->combine = $this->createMock(\Magento\Rule\Model\Condition\Combine::class); - $this->rules = $this->createMock(\Magento\CatalogRule\Model\Rule::class); - $this->logger = $this->createMock(\Psr\Log\LoggerInterface::class); - $this->attribute = $this->createMock(\Magento\Eav\Model\Entity\Attribute\AbstractAttribute::class); - $this->priceCurrency = $this->createMock(\Magento\Framework\Pricing\PriceCurrencyInterface::class); - $this->dateFormat = $this->createMock(\Magento\Framework\Stdlib\DateTime::class); - $this->dateTime = $this->createMock(\Magento\Framework\Stdlib\DateTime\DateTime::class); - $this->eavConfig = $this->createPartialMock(\Magento\Eav\Model\Config::class, ['getAttribute']); - $this->product = $this->createMock(\Magento\Catalog\Model\Product::class); - $this->productFactory = $this->createPartialMock(\Magento\Catalog\Model\ProductFactory::class, ['create']); - $this->connection->expects($this->any())->method('select')->will($this->returnValue($this->select)); - $this->connection->expects($this->any())->method('query')->will($this->returnValue($this->db)); - $this->select->expects($this->any())->method('distinct')->will($this->returnSelf()); - $this->select->expects($this->any())->method('where')->will($this->returnSelf()); - $this->select->expects($this->any())->method('from')->will($this->returnSelf()); - $this->select->expects($this->any())->method('order')->will($this->returnSelf()); - $this->resource->expects($this->any())->method('getConnection')->will($this->returnValue($this->connection)); - $this->resource->expects($this->any())->method('getTableName')->will($this->returnArgument(0)); - $this->storeManager->expects($this->any())->method('getWebsites')->will($this->returnValue([$this->website])); - $this->storeManager->expects($this->any())->method('getWebsite')->will($this->returnValue($this->website)); - $this->rules->expects($this->any())->method('getId')->will($this->returnValue(1)); - $this->rules->expects($this->any())->method('getWebsiteIds')->will($this->returnValue([1])); - $this->rules->expects($this->any())->method('getCustomerGroupIds')->will($this->returnValue([1])); - - $ruleCollection = $this->createMock(\Magento\CatalogRule\Model\ResourceModel\Rule\Collection::class); - $this->ruleCollectionFactory->expects($this->once()) - ->method('create') - ->willReturn($ruleCollection); - $ruleCollection->expects($this->once()) - ->method('addFieldToFilter') - ->willReturnSelf(); - $ruleIterator = new \ArrayIterator([$this->rules]); - $ruleCollection->method('getIterator') - ->willReturn($ruleIterator); - - $this->product->expects($this->any())->method('load')->will($this->returnSelf()); - $this->product->expects($this->any())->method('getId')->will($this->returnValue(1)); - $this->product->expects($this->any())->method('getWebsiteIds')->will($this->returnValue([1])); - - $this->rules->expects($this->any())->method('validate')->with($this->product)->willReturn(true); - $this->attribute->expects($this->any())->method('getBackend')->will($this->returnValue($this->backend)); - $this->productFactory->expects($this->any())->method('create')->will($this->returnValue($this->product)); - $this->productLoader = $this->getMockBuilder(ProductLoader::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->indexBuilder = (new ObjectManager($this))->getObject( - \Magento\CatalogRule\Model\Indexer\IndexBuilder::class, - [ - 'ruleCollectionFactory' => $this->ruleCollectionFactory, - 'priceCurrency' => $this->priceCurrency, - 'resource' => $this->resource, - 'storeManager' => $this->storeManager, - 'logger' => $this->logger, - 'eavConfig' => $this->eavConfig, - 'dateFormat' => $this->dateFormat, - 'dateTime' => $this->dateTime, - 'productFactory' => $this->productFactory, - 'productLoader' => $this->productLoader, - ] - ); - - $this->reindexRuleProductPrice = $this->createMock( - \Magento\CatalogRule\Model\Indexer\ReindexRuleProductPrice::class - ); - $this->reindexRuleGroupWebsite = $this->createMock( - \Magento\CatalogRule\Model\Indexer\ReindexRuleGroupWebsite::class - ); - $this->setProperties( - $this->indexBuilder, - [ - 'metadataPool' => $this->metadataPool, - 'reindexRuleProductPrice' => $this->reindexRuleProductPrice, - 'reindexRuleGroupWebsite' => $this->reindexRuleGroupWebsite, - ] - ); - } - - /** - * Test UpdateCatalogRuleGroupWebsiteData - * - * @covers \Magento\CatalogRule\Model\Indexer\IndexBuilder::updateCatalogRuleGroupWebsiteData - * @return void - */ - public function testUpdateCatalogRuleGroupWebsiteData() - { - $priceAttrMock = $this->createPartialMock(\Magento\Catalog\Model\Entity\Attribute::class, ['getBackend']); - $backendModelMock = $this->createPartialMock( - \Magento\Catalog\Model\Product\Attribute\Backend\Tierprice::class, - ['getResource'] - ); - $resourceMock = $this->createPartialMock( - \Magento\Catalog\Model\ResourceModel\Product\Attribute\Backend\Tierprice::class, - ['getMainTable'] - ); - $resourceMock->expects($this->any()) - ->method('getMainTable') - ->will($this->returnValue('catalog_product_entity_tier_price')); - $backendModelMock->expects($this->any()) - ->method('getResource') - ->will($this->returnValue($resourceMock)); - $priceAttrMock->expects($this->any()) - ->method('getBackend') - ->will($this->returnValue($backendModelMock)); - - $iterator = [$this->product]; - $this->productLoader->expects($this->once()) - ->method('getProducts') - ->willReturn($iterator); - - $this->reindexRuleProductPrice->expects($this->once())->method('execute')->willReturn(true); - $this->reindexRuleGroupWebsite->expects($this->once())->method('execute')->willReturn(true); - - $this->indexBuilder->reindexByIds([1]); - } - - /** - * @param $object - * @param array $properties - */ - private function setProperties($object, $properties = []) - { - $reflectionClass = new \ReflectionClass(get_class($object)); - foreach ($properties as $key => $value) { - if ($reflectionClass->hasProperty($key)) { - $reflectionProperty = $reflectionClass->getProperty($key); - $reflectionProperty->setAccessible(true); - $reflectionProperty->setValue($object, $value); - } - } - } -} diff --git a/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/ReindexRuleProductPriceTest.php b/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/ReindexRuleProductPriceTest.php index 5f63283df6760..d0f266d574945 100644 --- a/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/ReindexRuleProductPriceTest.php +++ b/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/ReindexRuleProductPriceTest.php @@ -71,6 +71,7 @@ public function testExecute() $websiteId = 234; $defaultGroupId = 11; $defaultStoreId = 22; + $productId = 55; $websiteMock = $this->createMock(WebsiteInterface::class); $websiteMock->expects($this->once()) @@ -93,11 +94,10 @@ public function testExecute() ->with($defaultGroupId) ->willReturn($groupMock); - $productMock = $this->createMock(Product::class); $statementMock = $this->createMock(\Zend_Db_Statement_Interface::class); $this->ruleProductsSelectBuilderMock->expects($this->once()) ->method('build') - ->with($websiteId, $productMock, true) + ->with($websiteId, $productId, true) ->willReturn($statementMock); $ruleData = [ @@ -126,6 +126,6 @@ public function testExecute() $this->pricesPersistorMock->expects($this->once()) ->method('execute'); - $this->assertTrue($this->model->execute(1, $productMock, true)); + $this->assertTrue($this->model->execute(1, $productId, true)); } } diff --git a/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/RuleProductsSelectBuilderTest.php b/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/RuleProductsSelectBuilderTest.php deleted file mode 100644 index e43fe41dc2127..0000000000000 --- a/app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/RuleProductsSelectBuilderTest.php +++ /dev/null @@ -1,200 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -namespace Magento\CatalogRule\Test\Unit\Model\Indexer; - -use Magento\Catalog\Model\Product; -use Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher; -use Magento\CatalogRule\Model\Indexer\IndexerTableSwapperInterface; -use Magento\Framework\DB\Adapter\AdapterInterface; -use Magento\Framework\DB\Select; -use Magento\Eav\Model\Entity\Attribute\AbstractAttribute; -use Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend; -use Magento\Framework\EntityManager\EntityMetadataInterface; -use Magento\Store\Api\Data\WebsiteInterface; - -/** - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - */ -class RuleProductsSelectBuilderTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var \Magento\CatalogRule\Model\Indexer\RuleProductsSelectBuilder - */ - private $model; - - /** - * @var \Magento\Store\Model\StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject - */ - private $storeManagerMock; - - /** - * @var \Magento\Framework\App\ResourceConnection|\PHPUnit_Framework_MockObject_MockObject - */ - private $resourceMock; - - /** - * @var ActiveTableSwitcher|\PHPUnit_Framework_MockObject_MockObject - */ - private $activeTableSwitcherMock; - - /** - * @var \Magento\Eav\Model\Config|\PHPUnit_Framework_MockObject_MockObject - */ - private $eavConfigMock; - - /** - * @var \Magento\Framework\EntityManager\MetadataPool|\PHPUnit_Framework_MockObject_MockObject - */ - private $metadataPoolMock; - - /** - * @var IndexerTableSwapperInterface|\PHPUnit_Framework_MockObject_MockObject - */ - private $tableSwapperMock; - - protected function setUp() - { - $this->storeManagerMock = $this->getMockBuilder(\Magento\Store\Model\StoreManagerInterface::class) - ->getMockForAbstractClass(); - $this->resourceMock = $this->getMockBuilder(\Magento\Framework\App\ResourceConnection::class) - ->disableOriginalConstructor() - ->getMock(); - $this->activeTableSwitcherMock = $this->getMockBuilder(ActiveTableSwitcher::class) - ->disableOriginalConstructor() - ->getMock(); - $this->eavConfigMock = $this->getMockBuilder(\Magento\Eav\Model\Config::class) - ->disableOriginalConstructor() - ->getMock(); - $this->metadataPoolMock = $this->getMockBuilder(\Magento\Framework\EntityManager\MetadataPool::class) - ->disableOriginalConstructor() - ->getMock(); - $this->tableSwapperMock = $this->getMockForAbstractClass( - IndexerTableSwapperInterface::class - ); - - $this->model = new \Magento\CatalogRule\Model\Indexer\RuleProductsSelectBuilder( - $this->resourceMock, - $this->eavConfigMock, - $this->storeManagerMock, - $this->metadataPoolMock, - $this->activeTableSwitcherMock, - $this->tableSwapperMock - ); - } - - /** - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - public function testBuild() - { - $websiteId = 55; - $ruleTable = 'catalogrule_product'; - $rplTable = 'catalogrule_product_replica'; - $prTable = 'catalog_product_entity'; - $wsTable = 'catalog_product_website'; - $productMock = $this->getMockBuilder(Product::class)->disableOriginalConstructor()->getMock(); - $productMock->expects($this->exactly(2))->method('getEntityId')->willReturn(500); - - $connectionMock = $this->getMockBuilder(AdapterInterface::class)->disableOriginalConstructor()->getMock(); - $this->resourceMock->expects($this->at(0))->method('getConnection')->willReturn($connectionMock); - - $this->tableSwapperMock->expects($this->once()) - ->method('getWorkingTableName') - ->with($ruleTable) - ->willReturn($rplTable); - - $this->resourceMock->expects($this->at(1))->method('getTableName')->with($ruleTable)->willReturn($ruleTable); - $this->resourceMock->expects($this->at(2))->method('getTableName')->with($rplTable)->willReturn($rplTable); - $this->resourceMock->expects($this->at(3))->method('getTableName')->with($prTable)->willReturn($prTable); - $this->resourceMock->expects($this->at(4))->method('getTableName')->with($wsTable)->willReturn($wsTable); - - $selectMock = $this->getMockBuilder(Select::class)->disableOriginalConstructor()->getMock(); - $connectionMock->expects($this->once())->method('select')->willReturn($selectMock); - $selectMock->expects($this->at(0))->method('from')->with(['rp' => $rplTable])->willReturnSelf(); - $selectMock->expects($this->at(1)) - ->method('order') - ->with(['rp.website_id', 'rp.customer_group_id', 'rp.product_id', 'rp.sort_order', 'rp.rule_id']) - ->willReturnSelf(); - $selectMock->expects($this->at(2))->method('where')->with('rp.product_id=?', 500)->willReturnSelf(); - - $attributeMock = $this->getMockBuilder(AbstractAttribute::class)->disableOriginalConstructor()->getMock(); - $this->eavConfigMock->expects($this->once()) - ->method('getAttribute') - ->with(Product::ENTITY, 'price') - ->willReturn($attributeMock); - $backendMock = $this->getMockBuilder(AbstractBackend::class)->disableOriginalConstructor()->getMock(); - $backendMock->expects($this->once())->method('getTable')->willReturn('price_table'); - $attributeMock->expects($this->once())->method('getBackend')->willReturn($backendMock); - $attributeMock->expects($this->once())->method('getId')->willReturn(200); - - $metadataMock = $this->getMockBuilder(EntityMetadataInterface::class)->disableOriginalConstructor()->getMock(); - $this->metadataPoolMock->expects($this->once()) - ->method('getMetadata') - ->with(\Magento\Catalog\Api\Data\ProductInterface::class) - ->willReturn($metadataMock); - $metadataMock->expects($this->once())->method('getLinkField')->willReturn('link_field'); - - $selectMock->expects($this->at(3)) - ->method('join') - ->with(['e' => $prTable], 'e.entity_id = rp.product_id', []) - ->willReturnSelf(); - $selectMock->expects($this->at(4)) - ->method('join') - ->with( - ['pp_default' => 'price_table'], - 'pp_default.link_field=e.link_field AND (pp_default.attribute_id=200) and pp_default.store_id=0', - [] - )->willReturnSelf(); - $websiteMock = $this->getMockBuilder(WebsiteInterface::class) - ->setMethods(['getDefaultGroup']) - ->getMockForAbstractClass(); - $this->storeManagerMock->expects($this->once()) - ->method('getWebsite') - ->with($websiteId) - ->willReturn($websiteMock); - - $groupMock = $this->getMockBuilder(\Magento\Store\Model\Group::class) - ->setMethods(['getDefaultStoreId']) - ->disableOriginalConstructor() - ->getMock(); - $websiteMock->expects($this->once())->method('getDefaultGroup')->willReturn($groupMock); - $groupMock->expects($this->once())->method('getDefaultStoreId')->willReturn(700); - - $selectMock->expects($this->at(5)) - ->method('joinInner') - ->with( - ['product_website' => $wsTable], - 'product_website.product_id=rp.product_id ' - . 'AND product_website.website_id = rp.website_id ' - . 'AND product_website.website_id=' - . $websiteId, - [] - )->willReturnSelf(); - $selectMock->expects($this->at(6)) - ->method('joinLeft') - ->with( - ['pp' . $websiteId => 'price_table'], - 'pp55.link_field=e.link_field AND (pp55.attribute_id=200) and pp55.store_id=700', - [] - )->willReturnSelf(); - - $connectionMock->expects($this->once()) - ->method('getIfNullSql') - ->with('pp55.value', 'pp_default.value') - ->willReturn('IF NULL SQL'); - $selectMock->expects($this->at(7)) - ->method('columns') - ->with(['default_price' => 'IF NULL SQL']) - ->willReturnSelf(); - $statementMock = $this->getMockBuilder(\Zend_Db_Statement_Interface::class) - ->disableOriginalConstructor() - ->getMock(); - $connectionMock->expects($this->once())->method('query')->with($selectMock)->willReturn($statementMock); - - $this->assertEquals($statementMock, $this->model->build($websiteId, $productMock, true)); - } -} From 5a60b4f4494e9d813d73724190164d5b099d3734 Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Tue, 24 Sep 2019 16:33:04 -0500 Subject: [PATCH 023/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- .../Magento/CatalogRule/Model/Indexer/IndexBuilder.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index 6391171be0a35..a434d337f00c2 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -279,11 +279,7 @@ protected function doReindexByIds($ids) $activeRules = $this->getActiveRules()->getItems(); foreach ($activeRules as $rule) { $rule->setProductsFilter($ids); - $productIds = $rule->getMatchingProductIds(); - foreach ($productIds as $productId => $result) { - $websiteIds = array_keys(array_filter($result)); - $this->assignProductToRule($rule, $productId, $websiteIds); - } + $this->reindexRuleProduct->execute($rule, $this->batchCount); } $this->cleanProductPriceIndex($ids); @@ -435,6 +431,8 @@ private function assignProductToRule(Rule $rule, int $productId, array $websiteI * @param Product $product * @return $this * @throws \Exception + * @deprecated + * @see ReindexRuleProduct::execute * @SuppressWarnings(PHPMD.NPathComplexity) */ protected function applyRule(Rule $rule, $product) From 6025197fc0b4e5b298982e0cf5f76bdca5fcd04b Mon Sep 17 00:00:00 2001 From: DmitryTsymbal <d.tsymbal@atwix.com> Date: Thu, 26 Sep 2019 15:37:18 +0300 Subject: [PATCH 024/595] refactoring --- .../Mftf/ActionGroup/AdminCreatesNewIntegrationActionGroup.xml | 3 ++- .../Test/Mftf/Test/AdminDeleteIntegrationEntityTest.xml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminCreatesNewIntegrationActionGroup.xml b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminCreatesNewIntegrationActionGroup.xml index 899ca8b7d7f4e..533bbb6760573 100644 --- a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminCreatesNewIntegrationActionGroup.xml +++ b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminCreatesNewIntegrationActionGroup.xml @@ -13,9 +13,10 @@ <actionGroup name="AdminCreatesNewIntegrationActionGroup"> <arguments> <argument name="name" type="string"/> + <argument name="password" type="string"/> </arguments> <fillField stepKey="fillNameField" selector="{{AddNewIntegrationSection.name}}" userInput="{{name}}"/> - <fillField stepKey="fillAdminPasswordField" selector="{{AddNewIntegrationSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> + <fillField stepKey="fillAdminPasswordField" selector="{{AddNewIntegrationSection.password}}" userInput="{{password}}"/> <!--Click the "Save" Button --> <click stepKey="clickSaveButton" selector="{{AddNewIntegrationSection.saveButton}}"/> </actionGroup> diff --git a/app/code/Magento/Integration/Test/Mftf/Test/AdminDeleteIntegrationEntityTest.xml b/app/code/Magento/Integration/Test/Mftf/Test/AdminDeleteIntegrationEntityTest.xml index 00dc9b320d7ad..bc226a70375f0 100644 --- a/app/code/Magento/Integration/Test/Mftf/Test/AdminDeleteIntegrationEntityTest.xml +++ b/app/code/Magento/Integration/Test/Mftf/Test/AdminDeleteIntegrationEntityTest.xml @@ -30,6 +30,7 @@ <!-- Create New Integration --> <actionGroup ref="AdminCreatesNewIntegrationActionGroup" stepKey="createIntegration"> <argument name="name" value="Integration1"/> + <argument name="password" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> </actionGroup> </before> <after> @@ -55,5 +56,6 @@ <actionGroup ref="AssertDeletedIntegrationIsNotInGridActionGroup" stepKey="dontSeeIntegration"> <argument name="name" value="Integration1"/> </actionGroup> + <!-- END TEST BODY --> </test> </tests> From a7f87cedecb81ea4901266aadd669fd8f3bea347 Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Wed, 2 Oct 2019 17:11:19 +0300 Subject: [PATCH 025/595] MC-18457: Free Shipping Minimum Order Amount Excluding/Including Tax options --- .../Model/Carrier/Freeshipping.php | 23 +- ...eeShippingDisplayWithInclTaxOptionTest.xml | 68 ++++++ .../Unit/Model/Carrier/FreeshippingTest.php | 200 ++++++++++++++++++ .../OfflineShipping/etc/adminhtml/system.xml | 4 + .../Magento/Quote/Model/Quote/Address.php | 21 +- .../Test/Mftf/Data/FreeShippingMethodData.xml | 15 ++ .../Mftf/Metadata/shipping_methods-meta.xml | 3 + .../Sales/Total/Quote/CommonTaxCollector.php | 4 + 8 files changed, 324 insertions(+), 14 deletions(-) create mode 100644 app/code/Magento/OfflineShipping/Test/Mftf/Test/StorefrontFreeShippingDisplayWithInclTaxOptionTest.xml create mode 100644 app/code/Magento/OfflineShipping/Test/Unit/Model/Carrier/FreeshippingTest.php diff --git a/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php b/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php index 674e6b8089787..a1fca2b155f11 100644 --- a/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php +++ b/app/code/Magento/OfflineShipping/Model/Carrier/Freeshipping.php @@ -63,6 +63,24 @@ public function __construct( parent::__construct($scopeConfig, $rateErrorFactory, $logger, $data); } + /** + * Check subtotal for allowed free shipping + * + * @param RateRequest $request + * + * @return bool + */ + private function isFreeShippingRequired(RateRequest $request): bool + { + $minSubtotal = $request->getPackageValueWithDiscount(); + if ($request->getBaseSubtotalWithDiscountInclTax() + && $this->getConfigFlag('tax_including')) { + $minSubtotal = $request->getBaseSubtotalWithDiscountInclTax(); + } + + return $minSubtotal >= $this->getConfigData('free_shipping_subtotal'); + } + /** * FreeShipping Rates Collector * @@ -80,10 +98,7 @@ public function collectRates(RateRequest $request) $this->_updateFreeMethodQuote($request); - if ($request->getFreeShipping() || $request->getPackageValueWithDiscount() >= $this->getConfigData( - 'free_shipping_subtotal' - ) - ) { + if ($request->getFreeShipping() || $this->isFreeShippingRequired($request)) { /** @var \Magento\Quote\Model\Quote\Address\RateResult\Method $method */ $method = $this->_rateMethodFactory->create(); diff --git a/app/code/Magento/OfflineShipping/Test/Mftf/Test/StorefrontFreeShippingDisplayWithInclTaxOptionTest.xml b/app/code/Magento/OfflineShipping/Test/Mftf/Test/StorefrontFreeShippingDisplayWithInclTaxOptionTest.xml new file mode 100644 index 0000000000000..db44a06b54a88 --- /dev/null +++ b/app/code/Magento/OfflineShipping/Test/Mftf/Test/StorefrontFreeShippingDisplayWithInclTaxOptionTest.xml @@ -0,0 +1,68 @@ +<?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="StorefrontFreeShippingDisplayWithInclTaxOptionTest"> + <annotations> + <features value="Shipping"/> + <stories value="Offline Shipping Methods"/> + <title value="Free Shipping Minimum Order Amount Excluding/Including Tax options"/> + <description value="Free Shipping Minimum Order Amount Excluding/Including Tax options"/> + <severity value="AVERAGE"/> + <testCaseId value="MC-20613"/> + <useCaseId value="MC-18457"/> + <group value="shipping"/> + </annotations> + <before> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"> + <field key="price">100.00</field> + </createData> + <!-- Enable free shipping method --> + <createData entity="FreeShippinMethodConfig" stepKey="enableFreeShippingMethod"/> + <createData entity="setFreeShippingSubtotal" stepKey="setFreeShippingSubtotal"/> + <createData entity="SetTaxIncluding" stepKey="setTaxIncluding"/> + <!-- Tax configuration (Store>Configuration; Sales>Tax) --> + <createData entity="Tax_Config_CA" stepKey="configureTaxForCA"/> + <createData entity="defaultTaxRule" stepKey="createTaxRule"/> + </before> + <after> + <!-- Disable free shipping method --> + <createData entity="FreeShippinMethodDefault" stepKey="disableFreeShippingMethod"/> + <createData entity="setFreeShippingSubtotalToDefault" stepKey="setFreeShippingSubtotalToDefault"/> + <createData entity="SetTaxIncludingToDefault" stepKey="setTaxIncludingToDefault"/> + <deleteData createDataKey="createTaxRule" stepKey="deleteTaxRule"/> + <createData entity="DefaultTaxConfig" stepKey="resetTaxConfiguration"/> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> + </after> + <!-- Add simple product to cart --> + <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <argument name="product" value="$$createSimpleProduct$$"/> + </actionGroup> + <!-- Assert that taxes are applied correctly for CA --> + <amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToCheckout"/> + <waitForPageLoad stepKey="waitForCart"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.tax}}" stepKey="waitForOverviewVisible"/> + <waitForElement time="30" selector="{{CheckoutCartSummarySection.estimateShippingAndTaxForm}}" stepKey="waitForEstimateShippingAndTaxForm"/> + <waitForElement time="30" selector="{{CheckoutCartSummarySection.shippingMethodForm}}" stepKey="waitForShippingMethodForm"/> + <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingandTax" /> + <selectOption selector="{{CheckoutCartSummarySection.country}}" userInput="United States" stepKey="selectUSCountry"/> + <waitForPageLoad stepKey="waitForSelectCountry"/> + <selectOption selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="California" stepKey="selectCaliforniaRegion"/> + <waitForPageLoad stepKey="waitForSelectRegion"/> + <see selector="{{CheckoutPaymentSection.tax}}" userInput="$8.25" stepKey="seeTaxForCA"/> + <!-- See available Free Shipping option --> + <actionGroup ref="StorefrontAssertShippingMethodPresentInCartActionGroup" stepKey="assertShippingMethodLabel"> + <argument name="shippingMethod" value="{{freeTitleDefault.value}}"/> + </actionGroup> + <!-- Change State to New York --> + <selectOption selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{US_Address_NY.state}}" stepKey="selectAnotherState"/> + <waitForPageLoad stepKey="waitForShippingMethodLoad"/> + <dontSee selector="{{CheckoutCartSummarySection.shippingMethodLabel}}" userInput="{{freeTitleDefault.value}}" stepKey="assertShippingMethodIsNotPresentInCart"/> + </test> +</tests> diff --git a/app/code/Magento/OfflineShipping/Test/Unit/Model/Carrier/FreeshippingTest.php b/app/code/Magento/OfflineShipping/Test/Unit/Model/Carrier/FreeshippingTest.php new file mode 100644 index 0000000000000..7f8959e610d42 --- /dev/null +++ b/app/code/Magento/OfflineShipping/Test/Unit/Model/Carrier/FreeshippingTest.php @@ -0,0 +1,200 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\OfflineShipping\Test\Unit\Model\Carrier; + +use Magento\Quote\Model\Quote\Address\RateResult\Method; +use Magento\Shipping\Model\Rate\Result; +use Magento\OfflineShipping\Model\Carrier\Freeshipping; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Quote\Model\Quote\Address\RateResult\MethodFactory; +use Magento\Shipping\Model\Rate\ResultFactory; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Quote\Model\Quote\Address\RateRequest; +use Magento\Store\Model\ScopeInterface; +use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\MockObject\MockObject; +use Magento\Quote\Model\Quote\Item as QuoteItem; +use PHPUnit\Framework\MockObject\Matcher\InvokedCount; + +/** + * Class for test free shipping + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class FreeshippingTest extends TestCase +{ + /** + * @var Freeshipping + */ + private $model; + + /** + * @var ScopeConfigInterface|MockObject + */ + private $scopeConfigMock; + + /** + * @var ResultFactory|MockObject + */ + private $resultFactoryMock; + + /** + * @var MethodFactory|MockObject + */ + private $methodFactoryMock; + + /** + * @var ObjectManager + */ + private $helper; + + /** + * @inheritdoc + */ + protected function setUp() + { + $this->scopeConfigMock = $this->getMockBuilder(\Magento\Framework\App\Config::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->resultFactoryMock = $this->getMockBuilder(ResultFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + + $this->methodFactoryMock = $this + ->getMockBuilder(MethodFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + + $this->helper = new ObjectManager($this); + $this->model = $this->helper->getObject( + Freeshipping::class, + [ + 'scopeConfig' => $this->scopeConfigMock, + '_rateResultFactory' => $this->resultFactoryMock, + '_rateMethodFactory' => $this->methodFactoryMock, + ] + ); + } + + /** + * Test for collect rate free shipping with tax options + * + * @param int $subtotalInclTax + * @param int $minOrderAmount + * @param int $packageValueWithDiscount + * @param int $baseSubtotalWithDiscountInclTax + * @param InvokedCount $expectedCallAppend + * + * @return void + * @dataProvider freeShippingWithSubtotalTaxDataProvider + */ + public function testCollectRatesFreeShippingWithTaxOptions( + int $subtotalInclTax, + int $minOrderAmount, + int $packageValueWithDiscount, + int $baseSubtotalWithDiscountInclTax, + InvokedCount $expectedCallAppend + ): void { + /** @var RateRequest|MockObject $request */ + $request = $this->getMockBuilder(RateRequest::class) + ->disableOriginalConstructor() + ->setMethods( + [ + 'getAllItems', + 'getPackageQty', + 'getFreeShipping', + 'getBaseSubtotalWithDiscountInclTax', + 'getPackageValueWithDiscount', + ] + ) + ->getMock(); + $item = $this->getMockBuilder(QuoteItem::class) + ->disableOriginalConstructor() + ->getMock(); + $this->scopeConfigMock->expects($this->at(0)) + ->method('isSetFlag') + ->willReturn(true); + $this->scopeConfigMock->expects($this->at(1)) + ->method('isSetFlag') + ->with( + 'carriers/freeshipping/tax_including', + ScopeInterface::SCOPE_STORE, + null + ) + ->willReturn($subtotalInclTax); + $this->scopeConfigMock->expects($this->at(2)) + ->method('getValue') + ->with( + 'carriers/freeshipping/free_shipping_subtotal', + ScopeInterface::SCOPE_STORE, + null + ) + ->willReturn($minOrderAmount); + $method = $this->getMockBuilder(Method::class) + ->disableOriginalConstructor() + ->setMethods(['setCarrier', 'setCarrierTitle', 'setMethod', 'setMethodTitle', 'setPrice', 'setCost']) + ->getMock(); + $resultModel = $this->getMockBuilder(Result::class) + ->disableOriginalConstructor() + ->setMethods(['append']) + ->getMock(); + $this->resultFactoryMock->method('create') + ->willReturn($resultModel); + $request->method('getPackageValueWithDiscount') + ->willReturn($packageValueWithDiscount); + $request->method('getAllItems') + ->willReturn([$item]); + $request->method('getFreeShipping') + ->willReturn(false); + $request->method('getBaseSubtotalWithDiscountInclTax') + ->willReturn($baseSubtotalWithDiscountInclTax); + $this->methodFactoryMock->method('create')->willReturn($method); + + $resultModel->expects($expectedCallAppend) + ->method('append') + ->with($method); + + $this->model->collectRates($request); + } + + /** + * @return array + */ + public function freeShippingWithSubtotalTaxDataProvider(): array + { + return [ + [ + 'subtotalInclTax' => 1, + 'minOrderAmount' => 10, + 'packageValueWithDiscount' => 8, + 'baseSubtotalWithDiscountInclTax' => 15, + 'expectedCallAppend' => $this->once(), + + ], + [ + 'subtotalInclTax' => 1, + 'minOrderAmount' => 20, + 'packageValueWithDiscount' => 8, + 'baseSubtotalWithDiscountInclTax' => 15, + 'expectedCallAppend' => $this->never(), + + ], + [ + 'subtotalInclTax' => 0, + 'minOrderAmount' => 10, + 'packageValueWithDiscount' => 8, + 'baseSubtotalWithDiscountInclTax' => 15, + 'expectedCallAppend' => $this->never(), + + ], + ]; + } +} diff --git a/app/code/Magento/OfflineShipping/etc/adminhtml/system.xml b/app/code/Magento/OfflineShipping/etc/adminhtml/system.xml index 2b29d2211b9d1..cb75bddf4d7bd 100644 --- a/app/code/Magento/OfflineShipping/etc/adminhtml/system.xml +++ b/app/code/Magento/OfflineShipping/etc/adminhtml/system.xml @@ -127,6 +127,10 @@ <label>Minimum Order Amount</label> <validate>validate-number validate-zero-or-greater</validate> </field> + <field id="tax_including" translate="label" sortOrder="5" type="select" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1"> + <label>Include Tax to Amount</label> + <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> + </field> <field id="name" translate="label" type="text" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> <label>Method Name</label> </field> diff --git a/app/code/Magento/Quote/Model/Quote/Address.php b/app/code/Magento/Quote/Model/Quote/Address.php index 3ecbc69b80785..ecc51a00e8fb5 100644 --- a/app/code/Magento/Quote/Model/Quote/Address.php +++ b/app/code/Magento/Quote/Model/Quote/Address.php @@ -471,7 +471,7 @@ protected function _isDefaultShippingNullOrSameAsBillingAddress() /** * Declare address quote model object * - * @param \Magento\Quote\Model\Quote $quote + * @param \Magento\Quote\Model\Quote $quote * @return $this */ public function setQuote(\Magento\Quote\Model\Quote $quote) @@ -691,7 +691,7 @@ public function getItemQty($itemId = 0) */ public function hasItems() { - return sizeof($this->getAllItems()) > 0; + return count($this->getAllItems()) > 0; } /** @@ -1020,6 +1020,7 @@ public function requestShippingRates(\Magento\Quote\Model\Quote\Item\AbstractIte $request->setLimitCarrier($this->getLimitCarrier()); $baseSubtotalInclTax = $this->getBaseSubtotalTotalInclTax(); $request->setBaseSubtotalInclTax($baseSubtotalInclTax); + $request->setBaseSubtotalWithDiscountInclTax($this->getBaseSubtotalWithDiscount() + $this->getBaseTaxAmount()); $result = $this->_rateCollector->create()->collectRates($request)->getResult(); @@ -1225,8 +1226,8 @@ public function setBaseShippingAmount($value, $alreadyExclTax = false) /** * Set total amount value * - * @param string $code - * @param float $amount + * @param string $code + * @param float $amount * @return $this */ public function setTotalAmount($code, $amount) @@ -1243,8 +1244,8 @@ public function setTotalAmount($code, $amount) /** * Set total amount value in base store currency * - * @param string $code - * @param float $amount + * @param string $code + * @param float $amount * @return $this */ public function setBaseTotalAmount($code, $amount) @@ -1261,8 +1262,8 @@ public function setBaseTotalAmount($code, $amount) /** * Add amount total amount value * - * @param string $code - * @param float $amount + * @param string $code + * @param float $amount * @return $this */ public function addTotalAmount($code, $amount) @@ -1276,8 +1277,8 @@ public function addTotalAmount($code, $amount) /** * Add amount total amount value in base store currency * - * @param string $code - * @param float $amount + * @param string $code + * @param float $amount * @return $this */ public function addBaseTotalAmount($code, $amount) diff --git a/app/code/Magento/Shipping/Test/Mftf/Data/FreeShippingMethodData.xml b/app/code/Magento/Shipping/Test/Mftf/Data/FreeShippingMethodData.xml index d700aa622c177..3d3667e59903f 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Data/FreeShippingMethodData.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Data/FreeShippingMethodData.xml @@ -26,6 +26,7 @@ <requiredEntity type="title">freeTitleDefault</requiredEntity> <requiredEntity type="name">freeNameDefault</requiredEntity> <requiredEntity type="free_shipping_subtotal">freeShippingSubtotalDefault</requiredEntity> + <requiredEntity type="tax_including">TaxIncludingDefault</requiredEntity> <requiredEntity type="specificerrmsg">freeSpecificerrmsgDefault</requiredEntity> <requiredEntity type="sallowspecific">freeSallowspecificDefault</requiredEntity> <requiredEntity type="specificcountry">freeSpecificcountryDefault</requiredEntity> @@ -44,6 +45,9 @@ <entity name="freeShippingSubtotalDefault" type="free_shipping_subtotal"> <data key="value" /> </entity> + <entity name="TaxIncludingDefault" type="tax_including"> + <data key="value">0</data> + </entity> <entity name="freeSpecificerrmsgDefault" type="specificerrmsg"> <data key="value">This shipping method is not available. To use this shipping method, please contact us.</data> </entity> @@ -66,6 +70,17 @@ <entity name="freeShippingSubtotal" type="free_shipping_subtotal"> <data key="value">101</data> </entity> + <!--Set Free Shipping "Include Tax to Amount" to "Yes"--> + <entity name="SetTaxIncluding" type="free_shipping_method"> + <requiredEntity type="tax_including">TaxIncluding</requiredEntity> + </entity> + <entity name="TaxIncluding" type="tax_including"> + <data key="value">1</data> + </entity> + <!--Set to default Free Shipping "Include Tax to Amount"--> + <entity name="SetTaxIncludingToDefault" type="free_shipping_method"> + <requiredEntity type="tax_including">TaxIncludingDefault</requiredEntity> + </entity> <!--Set to default Free Shipping Subtotal--> <entity name="setFreeShippingSubtotalToDefault" type="free_shipping_method"> <requiredEntity type="free_shipping_subtotal">freeShippingSubtotalDefault</requiredEntity> diff --git a/app/code/Magento/Shipping/Test/Mftf/Metadata/shipping_methods-meta.xml b/app/code/Magento/Shipping/Test/Mftf/Metadata/shipping_methods-meta.xml index 5781b886386f6..14c0d6d5af725 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Metadata/shipping_methods-meta.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Metadata/shipping_methods-meta.xml @@ -66,6 +66,9 @@ <object key="free_shipping_subtotal" dataType="free_shipping_subtotal"> <field key="value">string</field> </object> + <object key="tax_including" dataType="tax_including"> + <field key="value">boolean</field> + </object> <object key="specificerrmsg" dataType="specificerrmsg"> <field key="value">string</field> </object> 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 77b3cfa3a08bb..c70c715d32c1b 100644 --- a/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php +++ b/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php @@ -383,6 +383,7 @@ public function mapItems( $priceIncludesTax, $useBaseCurrency ); + //phpcs:ignore Magento2.Performance.ForeachArrayMerge $itemDataObjects = array_merge($itemDataObjects, $extraTaxableItems); } } else { @@ -394,6 +395,7 @@ public function mapItems( $priceIncludesTax, $useBaseCurrency ); + //phpcs:ignore Magento2.Performance.ForeachArrayMerge $itemDataObjects = array_merge($itemDataObjects, $extraTaxableItems); } } @@ -592,6 +594,7 @@ protected function processProductItems( $total->setBaseSubtotalTotalInclTax($baseSubtotalInclTax); $total->setBaseSubtotalInclTax($baseSubtotalInclTax); $shippingAssignment->getShipping()->getAddress()->setBaseSubtotalTotalInclTax($baseSubtotalInclTax); + $shippingAssignment->getShipping()->getAddress()->setBaseTaxAmount($baseTax); return $this; } @@ -799,6 +802,7 @@ public function convertAppliedTaxes($appliedTaxes, $baseAppliedTaxes, $extraInfo 'rates' => $rates, ]; if (!empty($extraInfo)) { + //phpcs:ignore Magento2.Performance.ForeachArrayMerge $appliedTaxArray = array_merge($appliedTaxArray, $extraInfo); } From f5a7ac98dadb79e5c994fee06a5e03b8346e1671 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Thu, 3 Oct 2019 16:02:55 +0300 Subject: [PATCH 026/595] MC-5233: DateTime product attributes support --- .../Product/Attribute/Edit/Tab/Advanced.php | 50 +++++- .../Product/Attribute/Edit/Tab/Main.php | 112 +++++++++----- .../Attribute/Edit/Tab/AdvancedTest.php | 104 ++++++++++--- .../Unit/Ui/Component/ColumnFactoryTest.php | 143 ++++++++++++++++-- .../Product/Form/Modifier/EavTest.php | 100 +++++++----- .../Catalog/Ui/Component/ColumnFactory.php | 72 +++++++-- .../Catalog/Ui/Component/Listing/Columns.php | 5 +- .../Product/Form/Modifier/Eav.php | 16 ++ app/code/Magento/Catalog/etc/adminhtml/di.xml | 17 +++ app/code/Magento/Catalog/etc/config.xml | 7 + .../catalog/product/attribute/js.phtml | 1 + .../product_attribute_add_form.xml | 26 ++++ .../Magento/Eav/Model/Entity/Attribute.php | 37 ++++- .../Entity/Attribute/Frontend/Datetime.php | 6 +- .../Attribute/Frontend/DatetimeTest.php | 62 ++++++-- .../Test/Unit/Model/Entity/AttributeTest.php | 2 + .../adminhtml/web/js/product-attributes.js | 8 + app/code/Magento/Ui/Component/Filters.php | 3 + .../Ui/Component/Filters/Type/Date.php | 47 ++++-- .../Component/Form/Element/DataType/Date.php | 24 ++- .../Unit/Component/Filters/Type/DateTest.php | 113 +++++++++----- .../Ui/Test/Unit/Component/FiltersTest.php | 47 ++++-- .../Form/Element/DataType/DateTest.php | 69 ++++++++- .../Ui/view/base/web/js/form/element/date.js | 7 + .../Ui/view/base/web/js/grid/columns/date.js | 17 ++- .../view/base/web/js/grid/filters/filters.js | 4 + .../Ui/view/base/web/js/grid/filters/range.js | 8 + 27 files changed, 872 insertions(+), 235 deletions(-) diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php index 1b6756968662f..89239a2e3e608 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php @@ -7,16 +7,20 @@ namespace Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab; use Magento\Backend\Block\Widget\Form\Generic; +use Magento\Catalog\Model\ResourceModel\Eav\Attribute; use Magento\Config\Model\Config\Source\Yesno; use Magento\Eav\Block\Adminhtml\Attribute\PropertyLocker; use Magento\Eav\Helper\Data; use Magento\Framework\App\ObjectManager; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Stdlib\DateTime; /** - * Product attribute add/edit form main tab + * Product attribute add/edit advanced form tab * * @api * @since 100.0.2 + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class Advanced extends Generic { @@ -70,7 +74,7 @@ public function __construct( * Adding product form elements for editing attribute * * @return $this - * @throws \Magento\Framework\Exception\LocalizedException + * @throws LocalizedException * @SuppressWarnings(PHPMD) */ protected function _prepareForm() @@ -139,7 +143,21 @@ protected function _prepareForm() 'label' => __('Default Value'), 'title' => __('Default Value'), 'value' => $attributeObject->getDefaultValue(), - 'date_format' => $dateFormat + 'date_format' => $dateFormat, + ] + ); + + $timeFormat = $this->_localeDate->getTimeFormat(\IntlDateFormatter::SHORT); + $fieldset->addField( + 'default_value_datetime', + 'date', + [ + 'name' => 'default_value_datetime', + 'label' => __('Default Value'), + 'title' => __('Default Value'), + 'value' => $this->getLocalizedDateDefaultValue(), + 'date_format' => $dateFormat, + 'time_format' => $timeFormat, ] ); @@ -266,7 +284,7 @@ protected function _initFormValues() /** * Retrieve attribute object from registry * - * @return mixed + * @return Attribute */ private function getAttributeObject() { @@ -285,4 +303,28 @@ private function getPropertyLocker() } return $this->propertyLocker; } + + /** + * Get localized date default value + * + * @return string + * @throws LocalizedException + */ + private function getLocalizedDateDefaultValue(): string + { + $attributeObject = $this->getAttributeObject(); + if (empty($attributeObject->getDefaultValue()) || $attributeObject->getFrontendInput() !== 'datetime') { + return (string)$attributeObject->getDefaultValue(); + } + + try { + $localizedDate = $this->_localeDate->date($attributeObject->getDefaultValue(), null, false); + $localizedDate->setTimezone(new \DateTimeZone($this->_localeDate->getConfigTimezone())); + $localizedDate = $localizedDate->format(DateTime::DATETIME_PHP_FORMAT); + } catch (\Exception $e) { + throw new LocalizedException(__('The default date is invalid.')); + } + + return $localizedDate; + } } diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Main.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Main.php index 85cf37a1214b5..ddc7273432cb3 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Main.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Main.php @@ -7,60 +7,60 @@ /** * Product attribute add/edit form main tab * - * @author Magento Core Team <core@magentocommerce.com> + * @author Magento Core Team <core@magentocommerce.com> */ namespace Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab; +use Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Apply as HelperApply; use Magento\Eav\Block\Adminhtml\Attribute\Edit\Main\AbstractMain; +use Magento\Framework\Data\Form\Element\AbstractElement; +use Magento\Framework\Data\Form\Element\Fieldset; +use Magento\Framework\DataObject; /** + * Product attribute add/edit form main tab + * * @api - * @SuppressWarnings(PHPMD.DepthOfInheritance) * @since 100.0.2 */ class Main extends AbstractMain { /** - * Adding product form elements for editing attribute - * - * @return $this - * @SuppressWarnings(PHPMD.UnusedLocalVariable) + * @inheritdoc */ protected function _prepareForm() { parent::_prepareForm(); - /** @var \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attributeObject */ - $attributeObject = $this->getAttributeObject(); - /* @var $form \Magento\Framework\Data\Form */ - $form = $this->getForm(); - /* @var $fieldset \Magento\Framework\Data\Form\Element\Fieldset */ - $fieldset = $form->getElement('base_fieldset'); - $fieldsToRemove = ['attribute_code', 'is_unique', 'frontend_class']; - foreach ($fieldset->getElements() as $element) { - /** @var \Magento\Framework\Data\Form\AbstractForm $element */ - if (substr($element->getId(), 0, strlen('default_value')) == 'default_value') { - $fieldsToRemove[] = $element->getId(); - } - } - foreach ($fieldsToRemove as $id) { - $fieldset->removeField($id); - } + $this->removeUnusedFields(); + $this->processFrontendInputTypes(); + + $this->_eventManager->dispatch('product_attribute_form_build_main_tab', ['form' => $this->getForm()]); + + return $this; + } + /** + * @inheritdoc + */ + protected function _getAdditionalElementTypes() + { + return ['apply' => HelperApply::class]; + } + + /** + * Process frontend input types for product attributes + * + * @return void + */ + private function processFrontendInputTypes(): void + { + $form = $this->getForm(); + /** @var AbstractElement $frontendInputElm */ $frontendInputElm = $form->getElement('frontend_input'); - $additionalTypes = [ - ['value' => 'price', 'label' => __('Price')], - ['value' => 'media_image', 'label' => __('Media Image')], - ]; - $additionalReadOnlyTypes = ['gallery' => __('Gallery')]; - if (isset($additionalReadOnlyTypes[$attributeObject->getFrontendInput()])) { - $additionalTypes[] = [ - 'value' => $attributeObject->getFrontendInput(), - 'label' => $additionalReadOnlyTypes[$attributeObject->getFrontendInput()], - ]; - } + $additionalTypes = $this->getAdditionalFrontendInputTypes(); - $response = new \Magento\Framework\DataObject(); + $response = new DataObject(); $response->setTypes([]); $this->_eventManager->dispatch('adminhtml_product_attribute_types', ['response' => $response]); $_hiddenFields = []; @@ -74,19 +74,51 @@ protected function _prepareForm() $frontendInputValues = array_merge($frontendInputElm->getValues(), $additionalTypes); $frontendInputElm->setValues($frontendInputValues); + } - $this->_eventManager->dispatch('product_attribute_form_build_main_tab', ['form' => $form]); + /** + * Get additional Frontend Input Types for product attributes + * + * @return array + */ + private function getAdditionalFrontendInputTypes(): array + { + $additionalTypes = [ + ['value' => 'price', 'label' => __('Price')], + ['value' => 'media_image', 'label' => __('Media Image')], + ]; - return $this; + $additionalReadOnlyTypes = ['gallery' => __('Gallery')]; + $attributeObject = $this->getAttributeObject(); + if (isset($additionalReadOnlyTypes[$attributeObject->getFrontendInput()])) { + $additionalTypes[] = [ + 'value' => $attributeObject->getFrontendInput(), + 'label' => $additionalReadOnlyTypes[$attributeObject->getFrontendInput()], + ]; + } + + return $additionalTypes; } /** - * Retrieve additional element types for product attributes + * Remove unused form fields * - * @return array + * @return void */ - protected function _getAdditionalElementTypes() + private function removeUnusedFields(): void { - return ['apply' => \Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Apply::class]; + $form = $this->getForm(); + /* @var $fieldset Fieldset */ + $fieldset = $form->getElement('base_fieldset'); + $fieldsToRemove = ['attribute_code', 'is_unique', 'frontend_class']; + foreach ($fieldset->getElements() as $element) { + /** @var AbstractElement $element */ + if (substr($element->getId(), 0, strlen('default_value')) == 'default_value') { + $fieldsToRemove[] = $element->getId(); + } + } + foreach ($fieldsToRemove as $id) { + $fieldset->removeField($id); + } } } diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Attribute/Edit/Tab/AdvancedTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Attribute/Edit/Tab/AdvancedTest.php index 0352bc83cafb7..4d9345d0b3f22 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Attribute/Edit/Tab/AdvancedTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Attribute/Edit/Tab/AdvancedTest.php @@ -5,66 +5,87 @@ */ namespace Magento\Catalog\Test\Unit\Block\Adminhtml\Product\Attribute\Edit\Tab; +use Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Advanced; +use Magento\Catalog\Model\ResourceModel\Eav\Attribute; +use Magento\Config\Model\Config\Source\Yesno; use Magento\Eav\Block\Adminhtml\Attribute\PropertyLocker; +use Magento\Eav\Helper\Data as EavHelper; +use Magento\Eav\Model\Entity\Type as EntityType; +use Magento\Framework\Data\Form; +use Magento\Framework\Data\Form\Element\Fieldset; +use Magento\Framework\Data\Form\Element\Text; +use Magento\Framework\Data\FormFactory; +use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\ReadInterface; +use Magento\Framework\Registry; +use Magento\Framework\Stdlib\DateTime; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\MockObject\MockObject; /** + * Test product attribute add/edit advanced form tab + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class AdvancedTest extends \PHPUnit\Framework\TestCase { /** - * @var \Magento\Catalog\Block\Adminhtml\Product\Attribute\Grid + * @var Advanced */ protected $block; /** - * @var \Magento\Framework\Data\FormFactory|\PHPUnit_Framework_MockObject_MockObject + * @var FormFactory|MockObject */ protected $formFactory; /** - * @var \Magento\Framework\Registry|\PHPUnit_Framework_MockObject_MockObject + * @var Registry|MockObject */ protected $registry; /** - * @var \Magento\Framework\Stdlib\DateTime\TimezoneInterface|\PHPUnit_Framework_MockObject_MockObject + * @var TimezoneInterface|MockObject */ protected $localeDate; /** - * @var \Magento\Config\Model\Config\Source\Yesno|\PHPUnit_Framework_MockObject_MockObject + * @var Yesno|MockObject */ protected $yesNo; /** - * @var \Magento\Eav\Helper\Data|\PHPUnit_Framework_MockObject_MockObject + * @var EavHelper|MockObject */ protected $eavData; /** - * @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject + * @var Filesystem|MockObject */ protected $filesystem; /** - * @var PropertyLocker|\PHPUnit_Framework_MockObject_MockObject + * @var PropertyLocker|MockObject */ protected $propertyLocker; + /** + * @inheritdoc + */ protected function setUp() { - $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $this->registry = $this->createMock(\Magento\Framework\Registry::class); - $this->formFactory = $this->createMock(\Magento\Framework\Data\FormFactory::class); - $this->yesNo = $this->createMock(\Magento\Config\Model\Config\Source\Yesno::class); - $this->localeDate = $this->createMock(\Magento\Framework\Stdlib\DateTime\TimezoneInterface::class); - $this->eavData = $this->createMock(\Magento\Eav\Helper\Data::class); - $this->filesystem = $this->createMock(\Magento\Framework\Filesystem::class); + $objectManager = new ObjectManager($this); + $this->registry = $this->createMock(Registry::class); + $this->formFactory = $this->createMock(FormFactory::class); + $this->yesNo = $this->createMock(Yesno::class); + $this->localeDate = $this->createMock(TimezoneInterface::class); + $this->eavData = $this->createMock(EavHelper::class); + $this->filesystem = $this->createMock(Filesystem::class); $this->propertyLocker = $this->createMock(PropertyLocker::class); $this->block = $objectManager->getObject( - \Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Advanced::class, + Advanced::class, [ 'registry' => $this->registry, 'formFactory' => $this->formFactory, @@ -77,17 +98,35 @@ protected function setUp() ); } + /** + * Test the block's html output + */ public function testToHtml() { - $fieldSet = $this->createMock(\Magento\Framework\Data\Form\Element\Fieldset::class); - $form = $this->createMock(\Magento\Framework\Data\Form::class); + $defaultValue = 'default_value'; + $localizedDefaultValue = 'localized_default_value'; + $frontendInput = 'datetime'; + $dateFormat = 'mm/dd/yy'; + $timeFormat = 'H:i:s:'; + $timeZone = 'America/Chicago'; + + $fieldSet = $this->createMock(Fieldset::class); + $form = $this->createMock(Form::class); $attributeModel = $this->createPartialMock( - \Magento\Catalog\Model\ResourceModel\Eav\Attribute::class, - ['getDefaultValue', 'setDisabled', 'getId', 'getEntityType', 'getIsUserDefined', 'getAttributeCode'] + Attribute::class, + [ + 'getDefaultValue', + 'setDisabled', + 'getId', + 'getEntityType', + 'getIsUserDefined', + 'getAttributeCode', + 'getFrontendInput' + ] ); - $entityType = $this->createMock(\Magento\Eav\Model\Entity\Type::class); - $formElement = $this->createPartialMock(\Magento\Framework\Data\Form\Element\Text::class, ['setDisabled']); - $directoryReadInterface = $this->createMock(\Magento\Framework\Filesystem\Directory\ReadInterface::class); + $entityType = $this->createMock(EntityType::class); + $formElement = $this->createPartialMock(Text::class, ['setDisabled']); + $directoryReadInterface = $this->createMock(ReadInterface::class); $this->registry->expects($this->any())->method('registry')->with('entity_attribute') ->willReturn($attributeModel); @@ -95,13 +134,28 @@ public function testToHtml() $form->expects($this->any())->method('addFieldset')->willReturn($fieldSet); $form->expects($this->any())->method('getElement')->willReturn($formElement); $fieldSet->expects($this->any())->method('addField')->willReturnSelf(); - $attributeModel->expects($this->any())->method('getDefaultValue')->willReturn('default_value'); + $attributeModel->expects($this->any())->method('getDefaultValue')->willReturn($defaultValue); $attributeModel->expects($this->any())->method('setDisabled')->willReturnSelf(); $attributeModel->expects($this->any())->method('getId')->willReturn(1); $attributeModel->expects($this->any())->method('getEntityType')->willReturn($entityType); $attributeModel->expects($this->any())->method('getIsUserDefined')->willReturn(false); $attributeModel->expects($this->any())->method('getAttributeCode')->willReturn('attribute_code'); - $this->localeDate->expects($this->any())->method('getDateFormat')->willReturn('mm/dd/yy'); + $attributeModel->expects($this->any())->method('getFrontendInput')->willReturn($frontendInput); + + $dateTimeMock = $this->createMock(\DateTime::class); + $dateTimeMock->expects($this->once())->method('setTimezone')->with(new \DateTimeZone($timeZone)); + $dateTimeMock->expects($this->once()) + ->method('format') + ->with(DateTime::DATETIME_PHP_FORMAT) + ->willReturn($localizedDefaultValue); + $this->localeDate->expects($this->any())->method('getDateFormat')->willReturn($dateFormat); + $this->localeDate->expects($this->any())->method('getTimeFormat')->willReturn($timeFormat); + $this->localeDate->expects($this->once())->method('getConfigTimezone')->willReturn($timeZone); + $this->localeDate->expects($this->once()) + ->method('date') + ->with($defaultValue, null, false) + ->willReturn($dateTimeMock); + $entityType->expects($this->any())->method('getEntityTypeCode')->willReturn('entity_type_code'); $this->eavData->expects($this->any())->method('getFrontendClasses')->willReturn([]); $formElement->expects($this->exactly(2))->method('setDisabled')->willReturnSelf(); diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php index 774edcfeb6b64..f002173de7996 100644 --- a/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php @@ -7,14 +7,16 @@ namespace Magento\Catalog\Test\Unit\Ui\Component; -use PHPUnit\Framework\TestCase; +use Magento\Catalog\Model\ResourceModel\Eav\Attribute; use Magento\Catalog\Ui\Component\ColumnFactory; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\Catalog\Api\Data\ProductAttributeInterface; use Magento\Framework\View\Element\UiComponent\ContextInterface; use Magento\Framework\View\Element\UiComponentFactory; use Magento\Ui\Component\Listing\Columns\ColumnInterface; use Magento\Ui\Component\Filters\FilterModifier; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; /** * ColumnFactory test. @@ -32,25 +34,30 @@ class ColumnFactoryTest extends TestCase private $objectManager; /** - * @var ProductAttributeInterface|\PHPUnit\Framework\MockObject\MockObject + * @var Attribute|MockObject */ private $attribute; /** - * @var ContextInterface|\PHPUnit\Framework\MockObject\MockObject + * @var ContextInterface|MockObject */ private $context; /** - * @var UiComponentFactory|\PHPUnit\Framework\MockObject\MockObject + * @var UiComponentFactory|MockObject */ private $uiComponentFactory; /** - * @var ColumnInterface|\PHPUnit\Framework\MockObject\MockObject + * @var ColumnInterface|MockObject */ private $column; + /** + * @var TimezoneInterface|MockObject + */ + private $timeZone; + /** * @inheritdoc */ @@ -58,18 +65,30 @@ protected function setUp(): void { $this->objectManager = new ObjectManager($this); - $this->attribute = $this->getMockBuilder(ProductAttributeInterface::class) - ->setMethods(['usesSource']) - ->getMockForAbstractClass(); + $this->attribute = $this->createPartialMock( + Attribute::class, + [ + 'getAttributeCode', + 'getIsFilterableInGrid', + 'getFrontendInput', + 'getDefaultFrontendLabel', + 'getIsVisibleInGrid', + ] + ); $this->context = $this->createMock(ContextInterface::class); $this->uiComponentFactory = $this->createMock(UiComponentFactory::class); $this->column = $this->getMockForAbstractClass(ColumnInterface::class); $this->uiComponentFactory->method('create') ->willReturn($this->column); + $this->timeZone = $this->createMock(TimezoneInterface::class); - $this->columnFactory = $this->objectManager->getObject(ColumnFactory::class, [ - 'componentFactory' => $this->uiComponentFactory - ]); + $this->columnFactory = $this->objectManager->getObject( + ColumnFactory::class, + [ + 'componentFactory' => $this->uiComponentFactory, + 'timezone' => $this->timeZone, + ] + ); } /** @@ -96,7 +115,6 @@ public function testCreatedObject(): void * * @param array $filterModifiers * @param null|string $filter - * * @return void * @dataProvider filterModifiersProvider */ @@ -132,7 +150,7 @@ public function testCreateWithNotFilterableInGridAttribute(array $filterModifier } /** - * Filter modifiers data provider. + * Filter modifiers data provider * * @return array */ @@ -153,4 +171,101 @@ public function filterModifiersProvider(): array ], ]; } + + /** + * Test to create date column + * + * @param string $frontendInput + * @param bool $showsTime + * @param string $expectedDateFormat + * @param string $expectedTimezone + * @dataProvider createDateColumnDataProvider + */ + public function testCreateDateColumn( + string $frontendInput, + bool $showsTime, + string $expectedDateFormat, + string $expectedTimezone + ) { + $attributeCode = 'attribute_code'; + $dateFormat = 'date_format'; + $dateTimeFormat = 'datetime_format'; + $defaultTimezone = 'default_timezone'; + $configTimezone = 'config_timezone'; + $label = 'Date label'; + + $expectedConfig = [ + 'data' => [ + 'config' => [ + 'label' => __($label), + 'dataType' => 'date', + 'add_field' => true, + 'visible' => true, + 'filter' => 'dateRange', + 'component' => 'Magento_Ui/js/grid/columns/date', + 'timeZone' => $expectedTimezone, + 'dateFormat' => $expectedDateFormat, + 'options' => [ + 'showsTime' => $showsTime + ] + ], + ], + 'context' => $this->context, + ]; + + $this->attribute->method('getAttributeCode') + ->willReturn($attributeCode); + $this->attribute->method('getDefaultFrontendLabel') + ->willReturn($label); + $this->attribute->method('getIsFilterableInGrid') + ->willReturn(true); + $this->attribute->method('getIsVisibleInGrid') + ->willReturn(true); + $this->attribute->method('getFrontendInput') + ->willReturn($frontendInput); + + $this->timeZone->method('getDateFormat') + ->with(\IntlDateFormatter::MEDIUM) + ->willReturn($dateFormat); + $this->timeZone->method('getDateTimeFormat') + ->with(\IntlDateFormatter::MEDIUM) + ->willReturn($dateTimeFormat); + $this->timeZone->method('getDefaultTimezone') + ->willReturn($defaultTimezone); + $this->timeZone->method('getConfigTimezone') + ->willReturn($configTimezone); + + $this->uiComponentFactory->expects($this->once()) + ->method('create') + ->with($attributeCode, 'column', $expectedConfig) + ->willReturn($this->column); + + $this->assertEquals( + $this->column, + $this->columnFactory->create($this->attribute, $this->context) + ); + } + + /** + * Data provider to create date column test + * + * @return array + */ + public function createDateColumnDataProvider(): array + { + return [ + [ + 'frontendInput' => 'date', + 'showsTime' => false, + 'dateFormat' => 'date_format', + 'expectedTimezone' => 'default_timezone', + ], + [ + 'frontendInput' => 'datetime', + 'showsTime' => true, + 'expectedDateFormat' => 'datetime_format', + 'expectedTimezone' => 'config_timezone', + ], + ]; + } } diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php index 88075b13f1430..834cb505e0903 100644 --- a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php @@ -38,6 +38,7 @@ use Magento\Framework\Stdlib\ArrayManager; use Magento\Catalog\Model\ResourceModel\Eav\AttributeFactory as EavAttributeFactory; use Magento\Framework\Event\ManagerInterface; +use PHPUnit\Framework\MockObject\MockObject; /** * Class EavTest @@ -49,142 +50,142 @@ class EavTest extends AbstractModifierTest { /** - * @var Config|\PHPUnit_Framework_MockObject_MockObject + * @var Config|MockObject */ private $eavConfigMock; /** - * @var EavValidationRules|\PHPUnit_Framework_MockObject_MockObject + * @var EavValidationRules|MockObject */ private $eavValidationRulesMock; /** - * @var RequestInterface|\PHPUnit_Framework_MockObject_MockObject + * @var RequestInterface|MockObject */ private $requestMock; /** - * @var GroupCollectionFactory|\PHPUnit_Framework_MockObject_MockObject + * @var GroupCollectionFactory|MockObject */ private $groupCollectionFactoryMock; /** - * @var GroupCollection|\PHPUnit_Framework_MockObject_MockObject + * @var GroupCollection|MockObject */ private $groupCollectionMock; /** - * @var Group|\PHPUnit_Framework_MockObject_MockObject + * @var Group|MockObject */ private $groupMock; /** - * @var EavAttribute|\PHPUnit_Framework_MockObject_MockObject + * @var EavAttribute|MockObject */ private $attributeMock; /** - * @var EntityType|\PHPUnit_Framework_MockObject_MockObject + * @var EntityType|MockObject */ private $entityTypeMock; /** - * @var AttributeCollectionFactory|\PHPUnit_Framework_MockObject_MockObject + * @var AttributeCollectionFactory|MockObject */ private $attributeCollectionFactoryMock; /** - * @var AttributeCollection|\PHPUnit_Framework_MockObject_MockObject + * @var AttributeCollection|MockObject */ private $attributeCollectionMock; /** - * @var StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var StoreManagerInterface|MockObject */ private $storeManagerMock; /** - * @var FormElementMapper|\PHPUnit_Framework_MockObject_MockObject + * @var FormElementMapper|MockObject */ private $formElementMapperMock; /** - * @var MetaPropertiesMapper|\PHPUnit_Framework_MockObject_MockObject + * @var MetaPropertiesMapper|MockObject */ private $metaPropertiesMapperMock; /** - * @var SearchCriteriaBuilder|\PHPUnit_Framework_MockObject_MockObject + * @var SearchCriteriaBuilder|MockObject */ private $searchCriteriaBuilderMock; /** - * @var ProductAttributeGroupRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ProductAttributeGroupRepositoryInterface|MockObject */ private $attributeGroupRepositoryMock; /** - * @var SearchCriteria|\PHPUnit_Framework_MockObject_MockObject + * @var SearchCriteria|MockObject */ private $searchCriteriaMock; /** - * @var SortOrderBuilder|\PHPUnit_Framework_MockObject_MockObject + * @var SortOrderBuilder|MockObject */ private $sortOrderBuilderMock; /** - * @var ProductAttributeRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ProductAttributeRepositoryInterface|MockObject */ private $attributeRepositoryMock; /** - * @var AttributeGroupInterface|\PHPUnit_Framework_MockObject_MockObject + * @var AttributeGroupInterface|MockObject */ private $attributeGroupMock; /** - * @var SearchResultsInterface|\PHPUnit_Framework_MockObject_MockObject + * @var SearchResultsInterface|MockObject */ private $searchResultsMock; /** - * @var Attribute|\PHPUnit_Framework_MockObject_MockObject + * @var Attribute|MockObject */ private $eavAttributeMock; /** - * @var StoreInterface|\PHPUnit_Framework_MockObject_MockObject + * @var StoreInterface|MockObject */ protected $storeMock; /** - * @var Currency|\PHPUnit_Framework_MockObject_MockObject + * @var Currency|MockObject */ protected $currencyMock; /** - * @var CurrencyLocale|\PHPUnit_Framework_MockObject_MockObject + * @var CurrencyLocale|MockObject */ protected $currencyLocaleMock; /** - * @var ProductAttributeInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ProductAttributeInterface|MockObject */ protected $productAttributeMock; /** - * @var ArrayManager|\PHPUnit_Framework_MockObject_MockObject + * @var ArrayManager|MockObject */ protected $arrayManagerMock; /** - * @var EavAttributeFactory|\PHPUnit_Framework_MockObject_MockObject + * @var EavAttributeFactory|MockObject */ protected $eavAttributeFactoryMock; /** - * @var ManagerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ManagerInterface|MockObject */ protected $eventManagerMock; @@ -457,8 +458,10 @@ public function testModifyData() * @param string|null $attrValue * @param array $expected * @param bool $locked - * @covers \Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav::isProductExists - * @covers \Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav::setupAttributeMeta + * @param string|null $frontendInput + * @param array $expectedCustomize + * @covers \Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav::isProductExists + * @covers \Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav::setupAttributeMeta * @dataProvider setupAttributeMetaDataProvider */ public function testSetupAttributeMetaDefaultAttribute( @@ -466,7 +469,9 @@ public function testSetupAttributeMetaDefaultAttribute( bool $productRequired, $attrValue, array $expected, - $locked = false + bool $locked = false, + string $frontendInput = null, + array $expectedCustomize = [] ) : void { $configPath = 'arguments/data/config'; $groupCode = 'product-details'; @@ -492,6 +497,7 @@ public function testSetupAttributeMetaDefaultAttribute( $this->productAttributeMock->method('getDefaultValue')->willReturn('required_value'); $this->productAttributeMock->method('getAttributeCode')->willReturn('code'); $this->productAttributeMock->method('getValue')->willReturn('value'); + $this->productAttributeMock->method('getFrontendInput')->willReturn($frontendInput); $attributeMock = $this->getMockBuilder(AttributeInterface::class) ->setMethods(['getValue']) @@ -527,14 +533,16 @@ function ($value) use ($attributeOptionsExpected) { } ) ) - ->willReturn($expected); + ->willReturn($expected + $expectedCustomize); $this->arrayManagerMock->method('get')->willReturn([]); $this->arrayManagerMock->method('exists')->willReturn(true); + $actual = $this->eav->setupAttributeMeta($this->productAttributeMock, $groupCode, $sortOrder); + $this->assertEquals( - $expected, - $this->eav->setupAttributeMeta($this->productAttributeMock, $groupCode, $sortOrder) + $expected + $expectedCustomize, + $actual ); } @@ -660,7 +668,29 @@ public function setupAttributeMetaDataProvider() 'globalScope' => false, 'sortOrder' => 0, ], - ] + ], + 'datetime_null_prod_not_new_and_required' => [ + 'productId' => 1, + 'productRequired' => true, + 'attrValue' => 'val', + 'expected' => [ + 'dataType' => 'datetime', + 'formElement' => 'datetime', + 'visible' => null, + 'required' => true, + 'notice' => null, + 'default' => null, + 'label' => new Phrase(null), + 'code' => 'code', + 'source' => 'product-details', + 'scopeLabel' => '', + 'globalScope' => false, + 'sortOrder' => 0, + ], + 'locked' => false, + 'frontendInput' => 'datetime', + 'expectedCustomize' => ['arguments' => ['data' => ['config' => ['options' => ['showsTime' => 1]]]]], + ], ]; } } diff --git a/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php b/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php index 9a6a22fcb0985..c538273476b1f 100644 --- a/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php +++ b/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php @@ -5,7 +5,14 @@ */ namespace Magento\Catalog\Ui\Component; +use Magento\Catalog\Api\Data\ProductAttributeInterface; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; +use Magento\Framework\View\Element\UiComponent\ContextInterface; +use Magento\Framework\View\Element\UiComponentFactory; use Magento\Ui\Component\Filters\FilterModifier; +use Magento\Ui\Component\Listing\Columns\ColumnInterface; /** * Column Factory @@ -16,7 +23,7 @@ class ColumnFactory { /** - * @var \Magento\Framework\View\Element\UiComponentFactory + * @var UiComponentFactory */ protected $componentFactory; @@ -40,25 +47,36 @@ class ColumnFactory 'select' => 'select', 'multiselect' => 'multiselect', 'date' => 'date', + 'datetime' => 'date', ]; /** - * @param \Magento\Framework\View\Element\UiComponentFactory $componentFactory + * @var TimezoneInterface */ - public function __construct(\Magento\Framework\View\Element\UiComponentFactory $componentFactory) - { + private $timezone; + + /** + * @param UiComponentFactory $componentFactory + * @param TimezoneInterface|null $timezone + */ + public function __construct( + UiComponentFactory $componentFactory, + TimezoneInterface $timezone = null + ) { $this->componentFactory = $componentFactory; + $this->timezone = $timezone + ?? ObjectManager::getInstance()->get(TimezoneInterface::class); } /** * Create Factory * - * @param \Magento\Catalog\Api\Data\ProductAttributeInterface $attribute - * @param \Magento\Framework\View\Element\UiComponent\ContextInterface $context + * @param ProductAttributeInterface $attribute + * @param ContextInterface $context * @param array $config * - * @return \Magento\Ui\Component\Listing\Columns\ColumnInterface - * @throws \Magento\Framework\Exception\LocalizedException + * @return ColumnInterface + * @throws LocalizedException */ public function create($attribute, $context, array $config = []) { @@ -84,19 +102,46 @@ public function create($attribute, $context, array $config = []) $optionData['__disableTmpl'] = true; } } - + $config['component'] = $this->getJsComponent($config['dataType']); - + + if ($config['dataType'] === 'date') { + $config += $this->getDateConfig($attribute); + } + $arguments = [ 'data' => [ 'config' => $config, ], 'context' => $context, ]; - + return $this->componentFactory->create($columnName, 'column', $arguments); } + /** + * Get config for Date columns + * + * @param ProductAttributeInterface $attribute + * @return array + */ + private function getDateConfig(ProductAttributeInterface $attribute): array + { + $isDatetime = $attribute->getFrontendInput() === 'datetime'; + $dateFormat = $isDatetime + ? $this->timezone->getDateTimeFormat(\IntlDateFormatter::MEDIUM) + : $this->timezone->getDateFormat(\IntlDateFormatter::MEDIUM); + $timeZone = $isDatetime + ? $this->timezone->getConfigTimezone() + : $this->timezone->getDefaultTimezone(); + + return [ + 'timeZone' => $timeZone, + 'dateFormat' => $dateFormat, + 'options' => [ 'showsTime' => $isDatetime], + ]; + } + /** * Get Js Component * @@ -112,7 +157,7 @@ protected function getJsComponent($dataType) /** * Get Data Type * - * @param \Magento\Catalog\Api\Data\ProductAttributeInterface $attribute + * @param ProductAttributeInterface $attribute * * @return string */ @@ -129,8 +174,9 @@ protected function getDataType($attribute) */ protected function getFilterType($frontendInput) { - $filtersMap = ['date' => 'dateRange']; + $filtersMap = ['date' => 'dateRange', 'datetime' => 'dateRange']; $result = array_replace_recursive($this->dataTypeMap, $filtersMap); + return $result[$frontendInput] ?? $result['default']; } } diff --git a/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php b/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php index 8ea6d8b9e5a06..d7b9bc3846f49 100644 --- a/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php +++ b/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php @@ -6,6 +6,8 @@ namespace Magento\Catalog\Ui\Component\Listing; /** + * Column IU component + * * @api * @since 100.0.2 */ @@ -30,6 +32,7 @@ class Columns extends \Magento\Ui\Component\Listing\Columns 'boolean' => 'select', 'multiselect' => 'select', 'date' => 'dateRange', + 'datetime' => 'datetimeRange', ]; /** @@ -52,7 +55,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function prepare() { diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php index 4039ff862f6fe..e41b2390930f0 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php @@ -746,6 +746,9 @@ public function setupAttributeMeta(ProductAttributeInterface $attribute, $groupC // Gallery attribute is being handled by "Images And Videos" section $meta = []; break; + case 'datetime': + $meta = $this->customizeDatetimeAttribute($meta); + break; } //Checking access to design config. @@ -948,6 +951,19 @@ private function customizeWysiwyg(ProductAttributeInterface $attribute, array $m return $meta; } + /** + * Customize datetime attribute + * + * @param array $meta + * @return array + */ + private function customizeDatetimeAttribute(array $meta) + { + $meta['arguments']['data']['config']['options']['showsTime'] = 1; + + return $meta; + } + /** * Retrieve form element * diff --git a/app/code/Magento/Catalog/etc/adminhtml/di.xml b/app/code/Magento/Catalog/etc/adminhtml/di.xml index c04cfb2dce00a..9e02d3da9f5d8 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/di.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/di.xml @@ -232,4 +232,21 @@ </argument> </arguments> </type> + <type name="Magento\Eav\Model\Adminhtml\System\Config\Source\Inputtype"> + <arguments> + <argument name="optionsArray" xsi:type="array"> + <item name="450" xsi:type="array"> + <item name="value" xsi:type="string">datetime</item> + <item name="label" xsi:type="string" translate="true">Date and Time</item> + </item> + </argument> + </arguments> + </type> + <type name="Magento\Ui\DataProvider\Mapper\FormElement"> + <arguments> + <argument name="mappings" xsi:type="array"> + <item name="datetime" xsi:type="string">date</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Catalog/etc/config.xml b/app/code/Magento/Catalog/etc/config.xml index 20511f4ff2295..8506d2ae03032 100644 --- a/app/code/Magento/Catalog/etc/config.xml +++ b/app/code/Magento/Catalog/etc/config.xml @@ -78,5 +78,12 @@ <thumbnail_position>stretch</thumbnail_position> </watermark> </design> + <general> + <validator_data> + <input_types> + <datetime>datetime</datetime> + </input_types> + </validator_data> + </general> </default> </config> diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml index f020eddc35dbd..212a345f4bcbc 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml @@ -172,6 +172,7 @@ function switchDefaultValueField() break; case 'date': + case 'datetime': defaultValueDateVisibility = true; break; diff --git a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_attribute_add_form.xml b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_attribute_add_form.xml index 6c5d37a92ea4a..3a6621137ed5a 100644 --- a/app/code/Magento/Catalog/view/adminhtml/ui_component/product_attribute_add_form.xml +++ b/app/code/Magento/Catalog/view/adminhtml/ui_component/product_attribute_add_form.xml @@ -101,6 +101,7 @@ <item name="textarea" xsi:type="string">textarea</item> <item name="texteditor" xsi:type="string">texteditor</item> <item name="date" xsi:type="string">date</item> + <item name="datetime" xsi:type="string">datetime</item> <item name="boolean" xsi:type="string">boolean</item> <item name="multiselect" xsi:type="string">multiselect</item> <item name="select" xsi:type="string">select</item> @@ -287,6 +288,7 @@ <item name="textarea" xsi:type="string">textarea</item> <item name="texteditor" xsi:type="string">texteditor</item> <item name="date" xsi:type="string">date</item> + <item name="datetime" xsi:type="string">datetime</item> <item name="boolean" xsi:type="string">boolean</item> <item name="multiselect" xsi:type="string">multiselect</item> <item name="select" xsi:type="string">select</item> @@ -376,6 +378,29 @@ <dataScope>default_value_date</dataScope> </settings> </field> + <field name="default_value_datetime" component="Magento_Catalog/js/components/visible-on-option/date" sortOrder="35" formElement="date"> + <argument name="data" xsi:type="array"> + <item name="config" xsi:type="array"> + <item name="valuesForOptions" xsi:type="array"> + <item name="datetime" xsi:type="string">datetime</item> + </item> + </item> + </argument> + <settings> + <dataType>text</dataType> + <label translate="true">Default Value</label> + <dataScope>default_value_datetime</dataScope> + </settings> + <formElements> + <date> + <settings> + <options> + <option name="showsTime" xsi:type="boolean">true</option> + </options> + </settings> + </date> + </formElements> + </field> <field name="is_unique" component="Magento_Catalog/js/components/visible-on-option/yesno" sortOrder="40" formElement="checkbox"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> @@ -412,6 +437,7 @@ <item name="textarea" xsi:type="string">textarea</item> <item name="texteditor" xsi:type="string">texteditor</item> <item name="date" xsi:type="string">date</item> + <item name="datetime" xsi:type="string">date</item> <item name="boolean" xsi:type="string">boolean</item> <item name="multiselect" xsi:type="string">multiselect</item> <item name="select" xsi:type="string">select</item> diff --git a/app/code/Magento/Eav/Model/Entity/Attribute.php b/app/code/Magento/Eav/Model/Entity/Attribute.php index 8bd9ca2cc03c8..82eafa6174bb2 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute.php @@ -285,13 +285,8 @@ public function beforeSave() // save default date value as timestamp if ($hasDefaultValue) { - try { - $locale = $this->_localeResolver->getLocale(); - $defaultValue = $this->_localeDate->date($defaultValue, $locale, false, false); - $this->setDefaultValue($defaultValue->format(DateTime::DATETIME_PHP_FORMAT)); - } catch (\Exception $e) { - throw new LocalizedException(__('The default date is invalid. Verify the date and try again.')); - } + $defaultValue = $this->getUtcDateDefaultValue($defaultValue); + $this->setDefaultValue($defaultValue); } } @@ -310,6 +305,29 @@ public function beforeSave() return parent::beforeSave(); } + /** + * Convert localized date default value to UTC + * + * @param string $defaultValue + * @return string + * @throws LocalizedException + */ + private function getUtcDateDefaultValue(string $defaultValue): string + { + $hasTime = $this->getFrontendInput() === 'datetime'; + try { + $defaultValue = $this->_localeDate->date($defaultValue, null, $hasTime, $hasTime); + if ($hasTime) { + $defaultValue->setTimezone(new \DateTimeZone($this->_localeDate->getDefaultTimezone())); + } + $utcValue = $defaultValue->format(DateTime::DATETIME_PHP_FORMAT); + } catch (\Exception $e) { + throw new LocalizedException(__('The default date is invalid. Verify the date and try again.')); + } + + return $utcValue; + } + /** * @inheritdoc * @@ -346,6 +364,7 @@ public function getBackendTypeByInput($type) break; case 'date': + case 'datetime': $field = 'datetime'; break; @@ -401,6 +420,10 @@ public function getDefaultValueByInput($type) $field = 'default_value_date'; break; + case 'datetime': + $field = 'default_value_datetime'; + break; + case 'boolean': $field = 'default_value_yesno'; break; diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Frontend/Datetime.php b/app/code/Magento/Eav/Model/Entity/Attribute/Frontend/Datetime.php index a9cd3be246bb1..8effd73d34af2 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Frontend/Datetime.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Frontend/Datetime.php @@ -7,6 +7,8 @@ namespace Magento\Eav\Model\Entity\Attribute\Frontend; /** + * Entity datetime frontend attribute + * * @api * @since 100.0.2 */ @@ -42,10 +44,12 @@ public function getValue(\Magento\Framework\DataObject $object) $value = parent::getValue($object); if ($value) { + $timeType = $this->getAttribute()->getFrontendInput() === 'datetime' + ? \IntlDateFormatter::MEDIUM : \IntlDateFormatter::NONE; $data = $this->_localeDate->formatDateTime( new \DateTime($value), \IntlDateFormatter::MEDIUM, - \IntlDateFormatter::NONE + $timeType ); } diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Frontend/DatetimeTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Frontend/DatetimeTest.php index 66549f2e00415..c775548fc8c75 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Frontend/DatetimeTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Frontend/DatetimeTest.php @@ -5,22 +5,31 @@ */ namespace Magento\Eav\Test\Unit\Model\Entity\Attribute\Frontend; +use Magento\Eav\Model\Entity\Attribute\AbstractAttribute; use Magento\Eav\Model\Entity\Attribute\Frontend\Datetime; +use Magento\Eav\Model\Entity\Attribute\Source\BooleanFactory; +use Magento\Framework\DataObject; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; -class DatetimeTest extends \PHPUnit\Framework\TestCase +/** + * Class to test Entity datetime frontend attribute + */ +class DatetimeTest extends TestCase { /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var TimezoneInterface|MockObject */ private $localeDateMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var BooleanFactory|MockObject */ private $booleanFactoryMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var AbstractAttribute|MockObject */ private $attributeMock; @@ -29,40 +38,63 @@ class DatetimeTest extends \PHPUnit\Framework\TestCase */ private $model; + /** + * @inheritdoc + */ protected function setUp() { - $this->booleanFactoryMock = $this->createMock(\Magento\Eav\Model\Entity\Attribute\Source\BooleanFactory::class); - $this->localeDateMock = $this->createMock(\Magento\Framework\Stdlib\DateTime\TimezoneInterface::class); + $this->booleanFactoryMock = $this->createMock(BooleanFactory::class); + $this->localeDateMock = $this->createMock(TimezoneInterface::class); $this->attributeMock = $this->createPartialMock( - \Magento\Eav\Model\Entity\Attribute\AbstractAttribute::class, - ['getAttributeCode', 'getFrontendLabel', 'getData'] + AbstractAttribute::class, + ['getAttributeCode', 'getFrontendLabel', 'getFrontendInput'] ); $this->model = new Datetime($this->booleanFactoryMock, $this->localeDateMock); $this->model->setAttribute($this->attributeMock); } - public function testGetValue() + /** + * Test to retrieve attribute value + * + * @param string $frontendInput + * @param int $timeType + * @dataProvider getValueDataProvider + */ + public function testGetValue(string $frontendInput, int $timeType) { $attributeValue = '11-11-2011'; + $attributeCode = 'datetime'; $date = new \DateTime($attributeValue); - $object = new \Magento\Framework\DataObject(['datetime' => $attributeValue]); + $object = new DataObject([$attributeCode => $attributeValue]); $this->attributeMock->expects($this->any()) ->method('getAttributeCode') - ->willReturn('datetime'); + ->willReturn($attributeCode); $this->attributeMock->expects($this->any()) - ->method('getData') - ->with('frontend_input') - ->willReturn('text'); + ->method('getFrontendInput') + ->willReturn($frontendInput); $this->localeDateMock->expects($this->once()) ->method('formatDateTime') - ->with($date, \IntlDateFormatter::MEDIUM, \IntlDateFormatter::NONE, null, null, null) + ->with($date, \IntlDateFormatter::MEDIUM, $timeType) ->willReturn($attributeValue); $this->assertEquals($attributeValue, $this->model->getValue($object)); } + /** + * Retrieve attribute value data provider + * + * @return array + */ + public function getValueDataProvider(): array + { + return [ + ['frontendInput' => 'date', 'timeType' => \IntlDateFormatter::NONE], + ['frontendInput' => 'datetime', 'timeType' => \IntlDateFormatter::MEDIUM], + ]; + } + /** * @param mixed $labelText * @param string $attributeCode diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/AttributeTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/AttributeTest.php index 402497a1379c0..7aa5bca00f0b6 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/AttributeTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/AttributeTest.php @@ -57,6 +57,7 @@ public static function dataGetBackendTypeByInput() ['image', 'text'], ['textarea', 'text'], ['date', 'datetime'], + ['datetime', 'datetime'], ['select', 'int'], ['boolean', 'int'], ['price', 'decimal'], @@ -91,6 +92,7 @@ public static function dataGetDefaultValueByInput() ['weight', 'default_value_text'], ['textarea', 'default_value_textarea'], ['date', 'default_value_date'], + ['datetime', 'default_value_datetime'], ['boolean', 'default_value_yesno'] ]; } diff --git a/app/code/Magento/Swatches/view/adminhtml/web/js/product-attributes.js b/app/code/Magento/Swatches/view/adminhtml/web/js/product-attributes.js index f795f99e8112d..9e48af20ee945 100644 --- a/app/code/Magento/Swatches/view/adminhtml/web/js/product-attributes.js +++ b/app/code/Magento/Swatches/view/adminhtml/web/js/product-attributes.js @@ -31,6 +31,7 @@ define([ defaultValueText: $('#default_value_text'), defaultValueTextarea: $('#default_value_textarea'), defaultValueDate: $('#default_value_date'), + defaultValueDatetime: $('#default_value_datetime'), defaultValueYesno: $('#default_value_yesno'), isGlobal: $('#is_global'), useProductImageForSwatch: $('#use_product_image_for_swatch'), @@ -178,6 +179,7 @@ define([ defaultValueTextVisibility = false, defaultValueTextareaVisibility = false, defaultValueDateVisibility = false, + defaultValueDatetimeVisibility = false, defaultValueYesnoVisibility = false, scopeVisibility = true, useProductImageForSwatch = false, @@ -203,6 +205,10 @@ define([ defaultValueDateVisibility = true; break; + case 'datetime': + defaultValueDatetimeVisibility = true; + break; + case 'boolean': defaultValueYesnoVisibility = true; break; @@ -256,6 +262,7 @@ define([ defaultValueTextVisibility = false; defaultValueTextareaVisibility = false; defaultValueDateVisibility = false; + defaultValueDatetimeVisibility = false; defaultValueYesnoVisibility = false; break; @@ -279,6 +286,7 @@ define([ this.setRowVisibility(this.defaultValueText, defaultValueTextVisibility); this.setRowVisibility(this.defaultValueTextarea, defaultValueTextareaVisibility); this.setRowVisibility(this.defaultValueDate, defaultValueDateVisibility); + this.setRowVisibility(this.defaultValueDatetime, defaultValueDatetimeVisibility); this.setRowVisibility(this.defaultValueYesno, defaultValueYesnoVisibility); this.setRowVisibility(this.isGlobal, scopeVisibility); diff --git a/app/code/Magento/Ui/Component/Filters.php b/app/code/Magento/Ui/Component/Filters.php index fe02c23af9c8a..5bf89ae7936e9 100644 --- a/app/code/Magento/Ui/Component/Filters.php +++ b/app/code/Magento/Ui/Component/Filters.php @@ -12,6 +12,8 @@ use Magento\Ui\Component\Listing\Columns\ColumnInterface; /** + * Grid filters UI component + * * @api * @since 100.0.2 */ @@ -36,6 +38,7 @@ class Filters extends AbstractComponent implements ObserverInterface 'textRange' => 'filterRange', 'select' => 'filterSelect', 'dateRange' => 'filterDate', + 'datetimeRange' => 'filterDate', ]; /** diff --git a/app/code/Magento/Ui/Component/Filters/Type/Date.php b/app/code/Magento/Ui/Component/Filters/Type/Date.php index e854b888c45e6..28ad8568ebe31 100644 --- a/app/code/Magento/Ui/Component/Filters/Type/Date.php +++ b/app/code/Magento/Ui/Component/Filters/Type/Date.php @@ -9,6 +9,8 @@ use Magento\Ui\Component\Form\Element\DataType\Date as DataTypeDate; /** + * Date grid filter UI Component + * * @api * @since 100.0.2 */ @@ -84,30 +86,18 @@ protected function applyFilter() if (isset($value['from'])) { $this->applyFilterByType( 'gteq', - $this->wrappedComponent->convertDate( - $value['from'], - 0, - 0, - 0, - !$this->getData('config/skipTimeZoneConversion') - ) + $this->convertDatetime((string)$value['from']) ); } if (isset($value['to'])) { $this->applyFilterByType( 'lteq', - $this->wrappedComponent->convertDate( - $value['to'], - 23, - 59, - 59, - !$this->getData('config/skipTimeZoneConversion') - ) + $this->convertDatetime((string)$value['to'], 23, 59, 59) ); } } else { - $this->applyFilterByType('eq', $this->wrappedComponent->convertDate($value)); + $this->applyFilterByType('eq', $this->convertDatetime((string)$value)); } } } @@ -130,4 +120,31 @@ protected function applyFilterByType($type, $value) $this->getContext()->getDataProvider()->addFilter($filter); } } + + /** + * Convert given date to default (UTC) timezone + * + * @param string $value + * @param int $hour + * @param int $minute + * @param int $second + * @return \DateTime + */ + private function convertDatetime(string $value, int $hour = 0, int $minute = 0, int $second = 0): ?\DateTime + { + $value = $this->getData('config/options/showsTime') + ? $this->wrappedComponent->convertDatetime( + $value, + !$this->getData('config/skipTimeZoneConversion') + ) + : $this->wrappedComponent->convertDate( + $value, + $hour, + $minute, + $second, + !$this->getData('config/skipTimeZoneConversion') + ); + + return $value; + } } diff --git a/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php b/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php index 31d2fe786cfd8..8ea6236e8e2e2 100644 --- a/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php +++ b/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php @@ -111,7 +111,7 @@ public function getComponentName() public function convertDate($date, $hour = 0, $minute = 0, $second = 0, $setUtcTimeZone = true) { try { - $dateObj = $this->localeDate->date($date, $this->getLocale(), true); + $dateObj = $this->localeDate->date($date, $this->getLocale(), false); $dateObj->setTime($hour, $minute, $second); //convert store date to default date in UTC timezone without DST if ($setUtcTimeZone) { @@ -122,4 +122,26 @@ public function convertDate($date, $hour = 0, $minute = 0, $second = 0, $setUtcT return null; } } + + /** + * Convert given date to default (UTC) timezone + * + * @param string $date + * @param bool $setUtcTimeZone + * @return \DateTime|null + */ + public function convertDatetime(string $date, bool $setUtcTimeZone = true): ?\DateTime + { + try { + $date = rtrim($date, 'Z'); + $dateObj = new \DateTime($date, new \DateTimeZone($this->localeDate->getConfigTimezone())); + //convert store date to default date in UTC timezone without DST + if ($setUtcTimeZone) { + $dateObj->setTimezone(new \DateTimeZone('UTC')); + } + return $dateObj; + } catch (\Exception $e) { + return null; + } + } } diff --git a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php index 78456968cbef1..7038a587be0b0 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php @@ -13,6 +13,7 @@ use Magento\Ui\Component\Filters\Type\Date; use Magento\Framework\View\Element\UiComponent\ContextInterface; use Magento\Ui\Component\Form\Element\DataType\Date as FormDate; +use PHPUnit\Framework\MockObject\MockObject; /** * Class DateTest @@ -20,27 +21,27 @@ class DateTest extends \PHPUnit\Framework\TestCase { /** - * @var ContextInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ContextInterface|MockObject */ private $contextMock; /** - * @var UiComponentFactory|\PHPUnit_Framework_MockObject_MockObject + * @var UiComponentFactory|MockObject */ private $uiComponentFactory; /** - * @var FilterBuilder|\PHPUnit_Framework_MockObject_MockObject + * @var FilterBuilder|MockObject */ private $filterBuilderMock; /** - * @var FilterModifier|\PHPUnit_Framework_MockObject_MockObject + * @var FilterModifier|MockObject */ private $filterModifierMock; /** - * @var DataProviderInterface|\PHPUnit_Framework_MockObject_MockObject + * @var DataProviderInterface|MockObject */ private $dataProviderMock; @@ -89,18 +90,19 @@ public function testGetComponentName() * Run test prepare method * * @param string $name + * @param bool $showsTime * @param array $filterData * @param array|null $expectedCondition * @dataProvider getPrepareDataProvider * @return void */ - public function testPrepare($name, $filterData, $expectedCondition) + public function testPrepare(string $name, bool $showsTime, array $filterData, ?array $expectedCondition) { $processor = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponent\Processor::class) ->disableOriginalConstructor() ->getMock(); $this->contextMock->expects(static::atLeastOnce())->method('getProcessor')->willReturn($processor); - /** @var FormDate $uiComponent */ + /** @var FormDate|MockObject $uiComponent */ $uiComponent = $this->getMockBuilder(FormDate::class) ->disableOriginalConstructor() ->getMock(); @@ -125,7 +127,7 @@ public function testPrepare($name, $filterData, $expectedCondition) ->willReturn($this->dataProviderMock); if ($expectedCondition !== null) { - $this->processFilters($name, $filterData, $expectedCondition, $uiComponent); + $this->processFilters($name, $showsTime, $filterData, $expectedCondition, $uiComponent); } $this->uiComponentFactory->expects($this->any()) @@ -139,7 +141,10 @@ public function testPrepare($name, $filterData, $expectedCondition) $this->filterBuilderMock, $this->filterModifierMock, [], - ['name' => $name] + [ + 'name' => $name, + 'config' => ['options' => ['showsTime' => $showsTime]], + ] ); $date->prepare(); } @@ -152,7 +157,7 @@ public function testPrepare($name, $filterData, $expectedCondition) * @param string $expectedDate * @param int $i * - * @return Filter|\PHPUnit_Framework_MockObject_MockObject + * @return Filter|MockObject */ private function getFilterMock($name, $expectedType, $expectedDate, &$i) { @@ -184,57 +189,87 @@ public function getPrepareDataProvider() { return [ [ - 'test_date', - ['test_date' => ['from' => '11-05-2015', 'to' => null]], - ['date' => '2015-05-11 00:00:00', 'type' => 'gteq'], + 'name' => 'test_date', + 'showsTime' => false, + 'filterData' => ['test_date' => ['from' => '11-05-2015', 'to' => null]], + 'expectedCondition' => ['date' => '2015-05-11 00:00:00', 'type' => 'gteq'], ], [ - 'test_date', - ['test_date' => ['from' => null, 'to' => '11-05-2015']], - ['date' => '2015-05-11 23:59:59', 'type' => 'lteq'], + 'name' => 'test_date', + 'showsTime' => false, + 'filterData' => ['test_date' => ['from' => null, 'to' => '11-05-2015']], + 'expectedCondition' => ['date' => '2015-05-11 23:59:59', 'type' => 'lteq'], ], [ - 'test_date', - ['test_date' => ['from' => '11-05-2015', 'to' => '11-05-2015']], - [ + 'name' => 'test_date', + 'showsTime' => false, + 'filterData' => ['test_date' => ['from' => '11-05-2015', 'to' => '11-05-2015']], + 'expectedCondition' => [ 'date_from' => '2015-05-11 00:00:00', 'type_from' => 'gteq', 'date_to' => '2015-05-11 23:59:59', 'type_to' => 'lteq' ], ], [ - 'test_date', - ['test_date' => '11-05-2015'], - ['date' => '2015-05-11 00:00:00', 'type' => 'eq'], + 'name' => 'test_date', + 'showsTime' => false, + 'filterData' => ['test_date' => '11-05-2015'], + 'expectedCondition' => ['date' => '2015-05-11 00:00:00', 'type' => 'eq'], + ], + [ + 'name' => 'test_date', + 'showsTime' => false, + 'filterData' => ['test_date' => ['from' => '', 'to' => '']], + 'expectedCondition' => null, ], [ - 'test_date', - ['test_date' => ['from' => '', 'to' => '']], - null, + 'name' => 'test_date', + 'showsTime' => true, + 'filterData' => ['test_date' => ['from' => '11-05-2015 10:20:00', 'to' => '11-05-2015 18:25:00']], + 'expectedCondition' => [ + 'date_from' => '2015-05-11 10:20:00', 'type_from' => 'gteq', + 'date_to' => '2015-05-11 18:25:00', 'type_to' => 'lteq' + ], ], ]; } /** - * @param $name - * @param $filterData - * @param $expectedCondition - * @param $uiComponent + * @param string $name + * @param bool $showsTime + * @param array $filterData + * @param array $expectedCondition + * @param MockObject $uiComponent */ - private function processFilters($name, $filterData, $expectedCondition, $uiComponent) - { + private function processFilters( + string $name, + bool $showsTime, + array $filterData, + array $expectedCondition, + FormDate $uiComponent + ) { if (is_string($filterData[$name])) { $uiComponent->expects(static::once()) - ->method('convertDate') + ->method($showsTime ? 'convertDatetime' : 'convertDate') ->with($filterData[$name]) ->willReturn(new \DateTime($filterData[$name])); } else { - $from = new \DateTime($filterData[$name]['from']); - $to = new \DateTime($filterData[$name]['to'] . ' 23:59:59'); - $uiComponent->method('convertDate') - ->willReturnMap([ - [$filterData[$name]['from'], 0, 0, 0, true, $from], - [$filterData[$name]['to'], 23, 59, 59, true, $to], - ]); + if ($showsTime) { + $from = new \DateTime($filterData[$name]['from']); + $to = new \DateTime($filterData[$name]['to']); + $uiComponent->method('convertDatetime') + ->willReturnMap([ + [$filterData[$name]['from'], true, $from], + [$filterData[$name]['to'], true, $to], + ]); + } else { + $from = new \DateTime($filterData[$name]['from']); + $to = new \DateTime($filterData[$name]['to'] . ' 23:59:59'); + $uiComponent->method('convertDate') + ->willReturnMap([ + [$filterData[$name]['from'], 0, 0, 0, true, $from], + [$filterData[$name]['to'], 23, 59, 59, true, $to], + ]); + } } $i = 0; diff --git a/app/code/Magento/Ui/Test/Unit/Component/FiltersTest.php b/app/code/Magento/Ui/Test/Unit/Component/FiltersTest.php index 402fd30bf4d5b..19a1be69ca1d7 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/FiltersTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/FiltersTest.php @@ -8,23 +8,27 @@ namespace Magento\Ui\Test\Unit\Component; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use \Magento\Ui\Component\Filters; +use Magento\Framework\View\Element\UiComponent\ContextInterface; +use Magento\Framework\View\Element\UiComponentFactory; +use Magento\Framework\View\Element\UiComponentInterface; +use Magento\Ui\Component\Filters; +use PHPUnit\Framework\MockObject\MockObject; /** * Unit tests for \Magento\Ui\Component\Filters class */ class FiltersTest extends \PHPUnit\Framework\TestCase { - /** @var Filters|\PHPUnit_Framework_MockObject_MockObject */ + /** @var Filters|MockObject */ private $filters; - /** @var \Magento\Framework\View\Element\UiComponentInterface|\PHPUnit_Framework_MockObject_MockObject */ + /** @var UiComponentInterface|MockObject */ private $uiComponentInterface; - /** @var \Magento\Framework\View\Element\UiComponentFactory|\PHPUnit_Framework_MockObject_MockObject */ + /** @var UiComponentFactory|MockObject */ private $uiComponentFactory; - /** @var \Magento\Framework\View\Element\UiComponent\ContextInterface|\PHPUnit_Framework_MockObject_MockObject */ + /** @var ContextInterface|MockObject */ private $context; /** @@ -33,13 +37,13 @@ class FiltersTest extends \PHPUnit\Framework\TestCase protected function setUp() { $objectManager = new ObjectManager($this); - $this->uiComponentInterface = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponentInterface::class) + $this->uiComponentInterface = $this->getMockBuilder(UiComponentInterface::class) ->disableOriginalConstructor() ->getMock(); - $this->uiComponentFactory = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponentFactory::class) + $this->uiComponentFactory = $this->getMockBuilder(UiComponentFactory::class) ->disableOriginalConstructor() ->getMock(); - $this->context = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponent\ContextInterface::class) + $this->context = $this->getMockBuilder(ContextInterface::class) ->disableOriginalConstructor() ->getMock(); $this->filters = $objectManager->getObject( @@ -52,7 +56,14 @@ protected function setUp() ); } - public function testUpdate() + /** + * Test to Update filter component according to $component + * + * @param string $filterType + * @param string $filterName + * @dataProvider updateDataProvider + */ + public function testUpdate(string $filterType, string $filterName) { $componentName = 'component_name'; $componentConfig = [0, 1, 2]; @@ -60,7 +71,10 @@ public function testUpdate() ->disableOriginalConstructor() ->setMethods(['getData', 'getName', 'getConfiguration']) ->getMockForAbstractClass(); - $columnInterface->expects($this->atLeastOnce())->method('getData')->with('config/filter')->willReturn('text'); + $columnInterface->expects($this->atLeastOnce()) + ->method('getData') + ->with('config/filter') + ->willReturn($filterType); $columnInterface->expects($this->atLeastOnce())->method('getName')->willReturn($componentName); $columnInterface->expects($this->once())->method('getConfiguration')->willReturn($componentConfig); $filterComponent = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponentInterface::class) @@ -71,11 +85,22 @@ public function testUpdate() ->willReturnSelf(); $filterComponent->expects($this->once())->method('prepare')->willReturnSelf(); $this->uiComponentFactory->expects($this->once())->method('create') - ->with($componentName, 'filterInput', ['context' => $this->context]) + ->with($componentName, $filterName, ['context' => $this->context]) ->willReturn($filterComponent); $this->filters->update($columnInterface); /** Verify that filter is already set and it wouldn't be set again */ $this->filters->update($columnInterface); } + + /** + * @return array + */ + public function updateDataProvider(): array + { + return [ + ['text', 'filterInput'], + ['datetimeRange', 'filterDate'], + ]; + } } diff --git a/app/code/Magento/Ui/Test/Unit/Component/Form/Element/DataType/DateTest.php b/app/code/Magento/Ui/Test/Unit/Component/Form/Element/DataType/DateTest.php index cdb11f05daa8c..015c025e7c102 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/Form/Element/DataType/DateTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/Form/Element/DataType/DateTest.php @@ -11,27 +11,35 @@ use Magento\Framework\View\Element\UiComponent\Context; use Magento\Framework\View\Element\UiComponent\Processor; use Magento\Ui\Component\Form\Element\DataType\Date; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; -class DateTest extends \PHPUnit\Framework\TestCase +/** + * Class to test Date form element + */ +class DateTest extends TestCase { - /** @var \PHPUnit_Framework_MockObject_MockObject */ + /** @var Context|MockObject */ private $contextMock; - /** @var \PHPUnit_Framework_MockObject_MockObject */ + /** @var TimezoneInterface|MockObject */ private $localeDateMock; - /** @var \PHPUnit_Framework_MockObject_MockObject */ + /** @var ResolverInterface|MockObject */ private $localeResolverMock; - /** @var \Magento\Ui\Component\Form\Element\DataType\Date */ + /** @var Date */ private $date; - /** @var \PHPUnit_Framework_MockObject_MockObject */ + /** @var Processor|MockObject */ private $processorMock; - /** @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */ + /** @var ObjectManager */ private $objectManagerHelper; + /** + * @inheritdoc + */ public function setUp() { $this->contextMock = $this->createMock(Context::class); @@ -39,9 +47,12 @@ public function setUp() $this->localeResolverMock = $this->createMock(ResolverInterface::class); $this->objectManagerHelper = new ObjectManager($this); $this->processorMock = $this->createMock(Processor::class); - $this->contextMock->expects($this->atLeastOnce())->method('getProcessor')->willReturn($this->processorMock); + $this->contextMock->method('getProcessor')->willReturn($this->processorMock); } + /** + * Test to Prepare component configuration with Time offset + */ public function testPrepareWithTimeOffset() { $this->date = new Date( @@ -72,6 +83,9 @@ public function testPrepareWithTimeOffset() $this->assertEquals($localeDateFormat, $config['options']['dateFormat']); } + /** + * Test to Prepare component configuration without Time offset + */ public function testPrepareWithoutTimeOffset() { $defaultDateFormat = 'MM/dd/y'; @@ -130,4 +144,43 @@ public function testPrepare() $this->assertEquals('America/Chicago', $configArray['storeTimeZone']); $this->assertEquals('de-DE', $configArray['options']['storeLocale']); } + + /** + * Test to Convert given date to default (UTC) timezone + * + * @param string $dateStr + * @param bool $setUtcTimeZone + * @param string $convertedDate + * @dataProvider convertDatetimeDataProvider + */ + public function testConvertDatetime(string $dateStr, bool $setUtcTimeZone, string $convertedDate) + { + $this->localeDateMock->method('getConfigTimezone') + ->willReturn('America/Los_Angeles'); + + $this->date = $this->objectManagerHelper->getObject( + Date::class, + [ + 'localeDate' => $this->localeDateMock, + ] + ); + + $this->assertEquals( + $convertedDate, + $this->date->convertDatetime($dateStr, $setUtcTimeZone)->format('Y-m-d H:i:s'), + "The date value wasn't converted" + ); + } + + /** + * @return array + */ + public function convertDatetimeDataProvider(): array + { + return [ + ['2019-09-30T12:32:00.000Z', false, '2019-09-30 12:32:00'], + ['2019-09-30T12:32:00.000', false, '2019-09-30 12:32:00'], + ['2019-09-30T12:32:00.000Z', true, '2019-09-30 19:32:00'], + ]; + } } diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/date.js b/app/code/Magento/Ui/view/base/web/js/form/element/date.js index ac28271e90a3b..1432372dd75a9 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/date.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/date.js @@ -107,6 +107,13 @@ define([ return this._super().observe(['shiftedValue']); }, + /** + * @inheritdoc + */ + getPreview: function () { + return this.shiftedValue(); + }, + /** * Prepares and sets date/time value that will be displayed * in the input field. diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js index 3f9c5b20d6215..cc69d990372c1 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js @@ -9,8 +9,10 @@ define([ 'mageUtils', 'moment', - './column' -], function (utils, moment, Column) { + './column', + 'underscore', + 'moment-timezone-with-data' +], function (utils, moment, Column, _) { 'use strict'; return Column.extend({ @@ -20,9 +22,9 @@ define([ }, /** - * Overrides base method to normalize date format. + * Overrides base method to normalize date format * - * @returns {DateColumn} Chainable. + * @returns {DateColumn} Chainable */ initConfig: function () { this._super(); @@ -38,12 +40,15 @@ define([ * @returns {String} Formatted date. */ getLabel: function (value, format) { - var date; + var date = moment.utc(this._super()); if (this.storeLocale !== undefined) { moment.locale(this.storeLocale, utils.extend({}, this.calendarConfig)); } - date = moment(this._super()); + + if (!_.isUndefined(this.timeZone)) { + date = date.tz(this.timeZone); + } date = date.isValid() && value[this.index] ? date.format(format || this.dateFormat) : diff --git a/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js b/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js index 98c3eb1c6f882..a6fae9df50c4d 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/filters/filters.js @@ -83,6 +83,10 @@ define([ component: 'Magento_Ui/js/grid/filters/range', rangeType: 'date' }, + datetimeRange: { + component: 'Magento_Ui/js/grid/filters/range', + rangeType: 'datetime' + }, textRange: { component: 'Magento_Ui/js/grid/filters/range', rangeType: 'text' diff --git a/app/code/Magento/Ui/view/base/web/js/grid/filters/range.js b/app/code/Magento/Ui/view/base/web/js/grid/filters/range.js index ccfba8e98b6f4..1949234c89324 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/filters/range.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/filters/range.js @@ -30,6 +30,14 @@ define([ dateFormat: 'MM/dd/YYYY', shiftedValue: 'filter' }, + datetime: { + component: 'Magento_Ui/js/form/element/date', + dateFormat: 'MM/dd/YYYY', + shiftedValue: 'filter', + options: { + showsTime: true + } + }, text: { component: 'Magento_Ui/js/form/element/abstract' }, From e9c704b9277e2567278992dabd14946e65c42f42 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Fri, 4 Oct 2019 10:12:06 +0300 Subject: [PATCH 027/595] MC-5233: DateTime product attributes support --- .../Attribute/Frontend/DatetimeTest.php | 2 +- .../Unit/Component/Filters/Type/DateTest.php | 21 ++++--- .../Ui/Test/Unit/Component/FiltersTest.php | 2 +- .../Eav/Model/Entity/AttributeTest.php | 55 ++++++++++++------- 4 files changed, 49 insertions(+), 31 deletions(-) diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Frontend/DatetimeTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Frontend/DatetimeTest.php index c775548fc8c75..163f3d208e724 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Frontend/DatetimeTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Frontend/DatetimeTest.php @@ -56,7 +56,7 @@ protected function setUp() /** * Test to retrieve attribute value - * + * * @param string $frontendInput * @param int $timeType * @dataProvider getValueDataProvider diff --git a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php index 7038a587be0b0..31d7ca92c5985 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php @@ -239,6 +239,7 @@ public function getPrepareDataProvider() * @param array $filterData * @param array $expectedCondition * @param MockObject $uiComponent + * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ private function processFilters( string $name, @@ -257,18 +258,22 @@ private function processFilters( $from = new \DateTime($filterData[$name]['from']); $to = new \DateTime($filterData[$name]['to']); $uiComponent->method('convertDatetime') - ->willReturnMap([ - [$filterData[$name]['from'], true, $from], - [$filterData[$name]['to'], true, $to], - ]); + ->willReturnMap( + [ + [$filterData[$name]['from'], true, $from], + [$filterData[$name]['to'], true, $to], + ] + ); } else { $from = new \DateTime($filterData[$name]['from']); $to = new \DateTime($filterData[$name]['to'] . ' 23:59:59'); $uiComponent->method('convertDate') - ->willReturnMap([ - [$filterData[$name]['from'], 0, 0, 0, true, $from], - [$filterData[$name]['to'], 23, 59, 59, true, $to], - ]); + ->willReturnMap( + [ + [$filterData[$name]['from'], 0, 0, 0, true, $from], + [$filterData[$name]['to'], 23, 59, 59, true, $to], + ] + ); } } diff --git a/app/code/Magento/Ui/Test/Unit/Component/FiltersTest.php b/app/code/Magento/Ui/Test/Unit/Component/FiltersTest.php index 19a1be69ca1d7..d4cf7f1af8d62 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/FiltersTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/FiltersTest.php @@ -58,7 +58,7 @@ protected function setUp() /** * Test to Update filter component according to $component - * + * * @param string $filterType * @param string $filterName * @dataProvider updateDataProvider diff --git a/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeTest.php b/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeTest.php index 2750e2a768aab..5df08762e29a7 100644 --- a/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeTest.php +++ b/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeTest.php @@ -3,15 +3,20 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - declare(strict_types=1); namespace Magento\Eav\Model\Entity; -use Magento\TestFramework\Helper\Bootstrap; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Locale\ResolverInterface; +use Magento\Framework\ObjectManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; -class AttributeTest extends \PHPUnit\Framework\TestCase +/** + * Class to test EAV Entity attribute model + */ +class AttributeTest extends TestCase { /** * @var Attribute @@ -19,33 +24,33 @@ class AttributeTest extends \PHPUnit\Framework\TestCase private $attribute; /** - * @var \Magento\Framework\ObjectManagerInterface + * @var ObjectManagerInterface */ private $objectManager; /** * @var ResolverInterface */ - private $_localeResolver; + private $localeResolver; /** - * {@inheritdoc} + * @inheritdoc */ protected function setUp() { $this->objectManager = Bootstrap::getObjectManager(); $this->attribute = $this->objectManager->get(Attribute::class); - $this->_localeResolver = $this->objectManager->get(ResolverInterface::class); + $this->localeResolver = $this->objectManager->get(ResolverInterface::class); } /** - * {@inheritdoc} + * @inheritdoc */ protected function tearDown() { $this->attribute = null; $this->objectManager = null; - $this->_localeResolver = null; + $this->localeResolver = null; } /** @@ -56,11 +61,17 @@ protected function tearDown() * @dataProvider beforeSaveDataProvider * @throws */ - public function testBeforeSave($defaultValue, $backendType, $locale, $expected) - { + public function testBeforeSave( + string $defaultValue, + string $backendType, + string $frontendInput, + string $locale, + string $expected + ) { $this->attribute->setDefaultValue($defaultValue); $this->attribute->setBackendType($backendType); - $this->_localeResolver->setLocale($locale); + $this->attribute->setFrontendInput($frontendInput); + $this->localeResolver->setLocale($locale); $this->attribute->beforeSave(); $this->assertEquals($expected, $this->attribute->getDefaultValue()); @@ -74,13 +85,15 @@ public function testBeforeSave($defaultValue, $backendType, $locale, $expected) public function beforeSaveDataProvider() { return [ - ['21/07/18', 'datetime', 'en_AU', '2018-07-21 00:00:00'], - ['07/21/18', 'datetime', 'en_US', '2018-07-21 00:00:00'], - ['21/07/18', 'datetime', 'fr_FR', '2018-07-21 00:00:00'], - ['21/07/18', 'datetime', 'de_DE', '2018-07-21 00:00:00'], - ['21/07/18', 'datetime', 'uk_UA', '2018-07-21 00:00:00'], - ['100.50', 'decimal', 'en_US', '100.50'], - ['100,50', 'decimal', 'uk_UA', '100.5'], + ['21/07/18', 'datetime', 'date', 'en_AU', '2018-07-21 00:00:00'], + ['07/21/18', 'datetime', 'date', 'en_US', '2018-07-21 00:00:00'], + ['21/07/18', 'datetime', 'date', 'fr_FR', '2018-07-21 00:00:00'], + ['21/07/18', 'datetime', 'date', 'de_DE', '2018-07-21 00:00:00'], + ['21/07/18', 'datetime', 'date', 'uk_UA', '2018-07-21 00:00:00'], + ['100.50', 'decimal', 'decimal', 'en_US', '100.50'], + ['100,50', 'decimal', 'decimal', 'uk_UA', '100.5'], + ['07/21/2019 2:30 PM', 'datetime', 'datetime', 'en_US', '2019-07-21 21:30:00'], + ['21.07.2019 14:30', 'datetime', 'datetime', 'uk_UA', '2019-07-21 21:30:00'], ]; } @@ -90,13 +103,13 @@ public function beforeSaveDataProvider() * @param string $locale * @param string $expected * @dataProvider beforeSaveErrorDataDataProvider - * @expectedException \Magento\Framework\Exception\LocalizedException + * @expectedException LocalizedException */ public function testBeforeSaveErrorData($defaultValue, $backendType, $locale, $expected) { $this->attribute->setDefaultValue($defaultValue); $this->attribute->setBackendType($backendType); - $this->_localeResolver->setLocale($locale); + $this->localeResolver->setLocale($locale); $this->attribute->beforeSave(); $this->expectExceptionMessage($expected); From 616a5f482cacb56e01343442bb831b7bbb70f9e9 Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Fri, 4 Oct 2019 11:47:11 -0500 Subject: [PATCH 028/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- app/code/Magento/CatalogRule/etc/indexer.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/CatalogRule/etc/indexer.xml b/app/code/Magento/CatalogRule/etc/indexer.xml index 340918ed63531..e648ea567631c 100644 --- a/app/code/Magento/CatalogRule/etc/indexer.xml +++ b/app/code/Magento/CatalogRule/etc/indexer.xml @@ -17,7 +17,6 @@ <indexer id="catalog_product_price"> <dependencies> <indexer id="catalogrule_rule" /> - <indexer id="catalogrule_product" /> </dependencies> </indexer> </config> From b6d071f9b57a784206730e1f3612fd13ffdabf4b Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Mon, 7 Oct 2019 16:26:34 +0300 Subject: [PATCH 029/595] MC-5233: DateTime product attributes support --- .../Block/Adminhtml/Product/Attribute/Edit/Tab/Main.php | 2 +- app/code/Magento/Catalog/Ui/Component/ColumnFactory.php | 6 +++--- .../Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php | 2 +- .../Eav/Model/Entity/Attribute/Frontend/Datetime.php | 4 ++-- .../Magento/Ui/Component/Form/Element/DataType/Date.php | 8 ++++---- app/code/Magento/Ui/view/base/web/js/grid/columns/date.js | 4 ++-- .../testsuite/Magento/Eav/Model/Entity/AttributeTest.php | 3 +-- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Main.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Main.php index ddc7273432cb3..955ea259ec9a8 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Main.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Main.php @@ -113,7 +113,7 @@ private function removeUnusedFields(): void $fieldsToRemove = ['attribute_code', 'is_unique', 'frontend_class']; foreach ($fieldset->getElements() as $element) { /** @var AbstractElement $element */ - if (substr($element->getId(), 0, strlen('default_value')) == 'default_value') { + if (substr($element->getId(), 0, strlen('default_value')) === 'default_value') { $fieldsToRemove[] = $element->getId(); } } diff --git a/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php b/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php index c538273476b1f..bbcd9bbc9f03a 100644 --- a/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php +++ b/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php @@ -131,14 +131,14 @@ private function getDateConfig(ProductAttributeInterface $attribute): array $dateFormat = $isDatetime ? $this->timezone->getDateTimeFormat(\IntlDateFormatter::MEDIUM) : $this->timezone->getDateFormat(\IntlDateFormatter::MEDIUM); - $timeZone = $isDatetime + $timezone = $isDatetime ? $this->timezone->getConfigTimezone() : $this->timezone->getDefaultTimezone(); return [ - 'timeZone' => $timeZone, + 'timezone' => $timezone, 'dateFormat' => $dateFormat, - 'options' => [ 'showsTime' => $isDatetime], + 'options' => ['showsTime' => $isDatetime], ]; } diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php index e41b2390930f0..0c76feb2c94ec 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php @@ -957,7 +957,7 @@ private function customizeWysiwyg(ProductAttributeInterface $attribute, array $m * @param array $meta * @return array */ - private function customizeDatetimeAttribute(array $meta) + private function customizeDatetimeAttribute(array $meta): array { $meta['arguments']['data']['config']['options']['showsTime'] = 1; diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Frontend/Datetime.php b/app/code/Magento/Eav/Model/Entity/Attribute/Frontend/Datetime.php index 8effd73d34af2..ea454fc0bcc74 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Frontend/Datetime.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Frontend/Datetime.php @@ -44,12 +44,12 @@ public function getValue(\Magento\Framework\DataObject $object) $value = parent::getValue($object); if ($value) { - $timeType = $this->getAttribute()->getFrontendInput() === 'datetime' + $showTime = $this->getAttribute()->getFrontendInput() === 'datetime' ? \IntlDateFormatter::MEDIUM : \IntlDateFormatter::NONE; $data = $this->_localeDate->formatDateTime( new \DateTime($value), \IntlDateFormatter::MEDIUM, - $timeType + $showTime ); } diff --git a/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php b/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php index 8ea6236e8e2e2..6bf1eacd161cc 100644 --- a/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php +++ b/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php @@ -127,20 +127,20 @@ public function convertDate($date, $hour = 0, $minute = 0, $second = 0, $setUtcT * Convert given date to default (UTC) timezone * * @param string $date - * @param bool $setUtcTimeZone + * @param bool $setUtcTimezone * @return \DateTime|null */ - public function convertDatetime(string $date, bool $setUtcTimeZone = true): ?\DateTime + public function convertDatetime(string $date, bool $setUtcTimezone = true): ?\DateTime { try { $date = rtrim($date, 'Z'); $dateObj = new \DateTime($date, new \DateTimeZone($this->localeDate->getConfigTimezone())); //convert store date to default date in UTC timezone without DST - if ($setUtcTimeZone) { + if ($setUtcTimezone) { $dateObj->setTimezone(new \DateTimeZone('UTC')); } return $dateObj; - } catch (\Exception $e) { + } catch (\Throwable $e) { return null; } } diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js index cc69d990372c1..3179529e282c6 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js @@ -46,8 +46,8 @@ define([ moment.locale(this.storeLocale, utils.extend({}, this.calendarConfig)); } - if (!_.isUndefined(this.timeZone)) { - date = date.tz(this.timeZone); + if (!_.isUndefined(this.timezone)) { + date = date.tz(this.timezone); } date = date.isValid() && value[this.index] ? diff --git a/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeTest.php b/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeTest.php index 5df08762e29a7..5b05308c786b5 100644 --- a/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeTest.php +++ b/dev/tests/integration/testsuite/Magento/Eav/Model/Entity/AttributeTest.php @@ -7,7 +7,6 @@ namespace Magento\Eav\Model\Entity; -use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Locale\ResolverInterface; use Magento\Framework\ObjectManagerInterface; use Magento\TestFramework\Helper\Bootstrap; @@ -103,7 +102,7 @@ public function beforeSaveDataProvider() * @param string $locale * @param string $expected * @dataProvider beforeSaveErrorDataDataProvider - * @expectedException LocalizedException + * @expectedException \Magento\Framework\Exception\LocalizedException */ public function testBeforeSaveErrorData($defaultValue, $backendType, $locale, $expected) { From 5a014040afd71105af6ba32737ceba8436d6e640 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Tue, 8 Oct 2019 15:42:11 +0300 Subject: [PATCH 030/595] MC-5233: DateTime product attributes support --- .../AdminProductAttributeActionGroup.xml | 11 ++++ .../Test/Mftf/Data/ProductAttributeData.xml | 4 ++ .../AdminCreateProductAttributeSection.xml | 1 + ...dminCreateDatetimeProductAttributeTest.xml | 61 +++++++++++++++++++ 4 files changed, 77 insertions(+) create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml index 3e54574c553e3..4081a362153bb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml @@ -370,4 +370,15 @@ <checkOption selector="{{AttributePropertiesSection.dropdownNthOptionIsDefault(row)}}" stepKey="setAsDefault" after="fillStoreView"/> </actionGroup> + + <!-- Go to advanced attribute properties --> + <actionGroup name="AdminNavigateToProductAttributeAdvancedSection"> + <annotations> + <description>Navigate and open Advanced Attribute Properties section on product attribute page</description> + </annotations> + + <scrollTo selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="scrollToSection"/> + <click selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="openSection"/> + <waitForElementVisible selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" stepKey="waitForSlideOutSection"/> + </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml index 6614fa4b5dbeb..38a273fe9fb41 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml @@ -309,6 +309,10 @@ <data key="frontend_input">date</data> <data key="is_required_admin">No</data> </entity> + <entity name="datetimeProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute"> + <data key="frontend_input">datetime</data> + <data key="is_required_admin">No</data> + </entity> <entity name="priceProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute"> <data key="frontend_input">date</data> <data key="is_required_admin">No</data> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml index 462f721913b9c..1236e07a2f278 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml @@ -93,6 +93,7 @@ <element name="DefaultValueText" type="textarea" selector="#default_value_text"/> <element name="DefaultValueTextArea" type="textarea" selector="#default_value_textarea"/> <element name="DefaultValueDate" type="textarea" selector="#default_value_date"/> + <element name="DefaultValueDatetime" type="textarea" selector="#default_value_datetime"/> <element name="DefaultValueYesNo" type="textarea" selector="#default_value_yesno"/> <element name="Scope" type="select" selector="#is_global"/> <element name="UniqueValue" type="select" selector="#is_unique"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml new file mode 100644 index 0000000000000..5d1f0716f33f7 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml @@ -0,0 +1,61 @@ +<?xml version="1.0"?> +<!-- +/** + * 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="AdminCreateDatetimeProductAttributeTest"> + <annotations> + <features value="Catalog"/> + <stories value="Datetime product attributes support"/> + <title value="Datetime product attribute type is supported"/> + <description value="Admin should be able to create datetime product attribute"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-21451"/> + <group value="Catalog"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="login"/> + </before> + <after> + <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> + <argument name="ProductAttribute" value="datetimeProductAttribute"/> + </actionGroup> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <amOnPage url="{{ProductAttributePage.url}}" stepKey="navigateToNewProductAttributePage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <!-- Set attribute properties --> + <fillField selector="{{AttributePropertiesSection.DefaultLabel}}" + userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="fillDefaultLabel"/> + <selectOption selector="{{AttributePropertiesSection.InputType}}" + userInput="{{datetimeProductAttribute.frontend_input}}" stepKey="fillInputType"/> + <actionGroup ref="AdminNavigateToProductAttributeAdvancedSection" stepKey="goToAdvancedSectionNew"/> + <fillField selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" + userInput="{{datetimeProductAttribute.attribute_code}}" + stepKey="fillAttributeCode"/> + <!-- Generate and set a default value --> + <generateDate date="now" format="m/j/y g:i A" stepKey="generateDefaultValue"/> + <fillField selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" + userInput="{$generateDefaultValue}" + stepKey="fillDefaultValue"/> + <!-- Save the new product attribute --> + <click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSaveAttribute"/> + <waitForPageLoad stepKey="waitForGridPageLoadAfterSaveAttribute"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" + stepKey="waitForSuccessMessage"/> + <!-- Navigate to created product attribute --> + <actionGroup ref="navigateToCreatedProductAttribute" stepKey="navigateToAttribute"> + <argument name="ProductAttribute" value="datetimeProductAttribute"/> + </actionGroup> + <!-- Check the saved date and time default value --> + <actionGroup ref="AdminNavigateToProductAttributeAdvancedSection" stepKey="goToAdvancedSection"/> + <scrollTo selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" stepKey="scrollToDefaultValue"/> + <seeInField userInput="{$generateDefaultValue}" + selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" + stepKey="checkDefaultValue"/> + </test> +</tests> From a9f42f9ed40aef0aaaefd5754d575fcb80f4fc7d Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Tue, 8 Oct 2019 15:43:47 +0300 Subject: [PATCH 031/595] MC-5233: DateTime product attributes support --- app/code/Magento/Ui/view/base/web/js/grid/columns/date.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js index 3179529e282c6..88959cda7499d 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/date.js @@ -40,12 +40,14 @@ define([ * @returns {String} Formatted date. */ getLabel: function (value, format) { - var date = moment.utc(this._super()); + var date; if (this.storeLocale !== undefined) { moment.locale(this.storeLocale, utils.extend({}, this.calendarConfig)); } + date = moment.utc(this._super()); + if (!_.isUndefined(this.timezone)) { date = date.tz(this.timezone); } From 6d3bb60f0d8c80992eb295182f5204fa67250c8b Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Tue, 8 Oct 2019 09:53:16 -0500 Subject: [PATCH 032/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- app/code/Magento/CatalogRule/etc/indexer.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/CatalogRule/etc/indexer.xml b/app/code/Magento/CatalogRule/etc/indexer.xml index e648ea567631c..340918ed63531 100644 --- a/app/code/Magento/CatalogRule/etc/indexer.xml +++ b/app/code/Magento/CatalogRule/etc/indexer.xml @@ -17,6 +17,7 @@ <indexer id="catalog_product_price"> <dependencies> <indexer id="catalogrule_rule" /> + <indexer id="catalogrule_product" /> </dependencies> </indexer> </config> From 1a780d2a113b0deba056fc983e2660aa4d21ff58 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Wed, 9 Oct 2019 14:42:37 +0300 Subject: [PATCH 033/595] MC-5233: DateTime product attributes support --- .../AdminProductAttributeActionGroup.xml | 19 +++++- .../Test/Mftf/Data/ProductAttributeData.xml | 2 +- .../Section/AdminProductGridFilterSection.xml | 2 + ...dminCreateDatetimeProductAttributeTest.xml | 37 ++++------- ...SimpleProductWithDatetimeAttributeTest.xml | 65 +++++++++++++++++++ 5 files changed, 98 insertions(+), 27 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml index 4081a362153bb..bc99e8d3f57e9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml @@ -345,6 +345,23 @@ <fillField stepKey="fillDefaultValue" selector="{{AdvancedAttributePropertiesSection.DefaultValueDate}}" userInput="{{date}}"/> </actionGroup> + <!-- Inputs datetime default value and attribute code--> + <actionGroup name="CreateProductAttributeWithDatetimeField" extends="createProductAttribute" insertAfter="checkRequired"> + <annotations> + <description>EXTENDS: createProductAttribute. Fills in the Attribute Code and Default Value (Attribute Type: Date and Time Field).</description> + </annotations> + <arguments> + <argument name="date" type="string"/> + </arguments> + + <scrollTo selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="scrollToAdvancedSection"/> + <click selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="openAdvancedSection"/> + <waitForElementVisible selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" stepKey="waitForSlideOutAdvancedSection"/> + <fillField stepKey="fillCode" selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attribute.attribute_code}}"/> + <scrollTo selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" stepKey="scrollToDefaultField"/> + <fillField stepKey="fillDefaultValue" selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" userInput="{{date}}"/> + </actionGroup> + <!-- Creates dropdown option at row without saving--> <actionGroup name="createAttributeDropdownNthOption"> <annotations> @@ -377,7 +394,7 @@ <description>Navigate and open Advanced Attribute Properties section on product attribute page</description> </annotations> - <scrollTo selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="scrollToSection"/> + <scrollTo selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="scrollToSection"/> <click selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="openSection"/> <waitForElementVisible selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" stepKey="waitForSlideOutSection"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml index 38a273fe9fb41..b24a765706f2d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml @@ -309,7 +309,7 @@ <data key="frontend_input">date</data> <data key="is_required_admin">No</data> </entity> - <entity name="datetimeProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute"> + <entity name="DatetimeProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute"> <data key="frontend_input">datetime</data> <data key="is_required_admin">No</data> </entity> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridFilterSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridFilterSection.xml index 3b6f24c0f259d..4e86f14611c24 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridFilterSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridFilterSection.xml @@ -36,5 +36,7 @@ <element name="productCount" type="text" selector="#catalog_category_products-total-count"/> <element name="productPerPage" type="select" selector="#catalog_category_products_page-limit"/> <element name="storeViewDropdown" type="text" selector="//select[@name='store_id']/option[contains(.,'{{storeView}}')]" parameterized="true"/> + <element name="inputByCodeRangeFrom" type="input" selector="input.admin__control-text[name='{{code}}[from]']" parameterized="true"/> + <element name="inputByCodeRangeTo" type="input" selector="input.admin__control-text[name='{{code}}[to]']" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml index 5d1f0716f33f7..d084eb962c5da 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml @@ -14,44 +14,31 @@ <description value="Admin should be able to create datetime product attribute"/> <severity value="CRITICAL"/> <testCaseId value="MC-21451"/> - <group value="Catalog"/> + <group value="catalog"/> </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="login"/> </before> <after> <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> - <argument name="ProductAttribute" value="datetimeProductAttribute"/> + <argument name="ProductAttribute" value="DatetimeProductAttribute"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> </after> - - <amOnPage url="{{ProductAttributePage.url}}" stepKey="navigateToNewProductAttributePage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <!-- Set attribute properties --> - <fillField selector="{{AttributePropertiesSection.DefaultLabel}}" - userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="fillDefaultLabel"/> - <selectOption selector="{{AttributePropertiesSection.InputType}}" - userInput="{{datetimeProductAttribute.frontend_input}}" stepKey="fillInputType"/> - <actionGroup ref="AdminNavigateToProductAttributeAdvancedSection" stepKey="goToAdvancedSectionNew"/> - <fillField selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" - userInput="{{datetimeProductAttribute.attribute_code}}" - stepKey="fillAttributeCode"/> - <!-- Generate and set a default value --> + <!-- Generate the datetime default value --> <generateDate date="now" format="m/j/y g:i A" stepKey="generateDefaultValue"/> - <fillField selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" - userInput="{$generateDefaultValue}" - stepKey="fillDefaultValue"/> - <!-- Save the new product attribute --> - <click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSaveAttribute"/> - <waitForPageLoad stepKey="waitForGridPageLoadAfterSaveAttribute"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" - stepKey="waitForSuccessMessage"/> + <!-- Create new datetime product attribute --> + <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/> + <waitForPageLoad stepKey="waitForPageLoadAttributes"/> + <actionGroup ref="CreateProductAttributeWithDatetimeField" stepKey="createAttribute"> + <argument name="attribute" value="DatetimeProductAttribute"/> + <argument name="date" value="{$generateDefaultValue}"/> + </actionGroup> <!-- Navigate to created product attribute --> <actionGroup ref="navigateToCreatedProductAttribute" stepKey="navigateToAttribute"> - <argument name="ProductAttribute" value="datetimeProductAttribute"/> + <argument name="ProductAttribute" value="DatetimeProductAttribute"/> </actionGroup> - <!-- Check the saved date and time default value --> + <!-- Check the saved datetime default value --> <actionGroup ref="AdminNavigateToProductAttributeAdvancedSection" stepKey="goToAdvancedSection"/> <scrollTo selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" stepKey="scrollToDefaultValue"/> <seeInField userInput="{$generateDefaultValue}" diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml new file mode 100644 index 0000000000000..a21c5a84447dc --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml @@ -0,0 +1,65 @@ +<?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="AdminCreateSimpleProductWithDatetimeAttributeTest"> + <annotations> + <features value="Catalog"/> + <stories value="Datetime product attributes support"/> + <title value="Set datetime attribute to product"/> + <description value="Admin should be able to specify datetime attribute to product and find by them in product grid"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-21461"/> + <group value="catalog"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <deleteData createDataKey="createDatetimeAttribute" stepKey="DatetimeProductAttribute"/> + <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!-- Generate default value --> + <generateDate date="now" format="m/j/Y g:i A" stepKey="generateDefaultValue"/> + <generateDate date="now" format="M j, Y g:i:00 A" stepKey="generateDefaultGridValue"/> + <generateDate date="+1 minute" format="m/j/Y g:i A" stepKey="generateFilterToDate"/> + <!-- Create new datetime product attribute --> + <createData entity="DatetimeProductAttribute" stepKey="createDatetimeAttribute"> + <field key="default_value">{$generateDefaultValue}</field> + </createData> + <!-- Open the new simple product page --> + <actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="openNewProductPage"/> + <actionGroup ref="fillMainProductForm" stepKey="fillDefaultProductFields"/> + <!-- Add datetime attribute --> + <actionGroup ref="addProductAttributeInProductModal" stepKey="addDatetimeAttribute"> + <argument name="attributeCode" value="$createDatetimeAttribute.attribute_code$"/> + </actionGroup> + <!-- Check default value --> + <scrollTo selector="{{AdminProductAttributesSection.sectionHeader}}" stepKey="goToAttributesSection"/> + <click selector="{{AdminProductAttributesSection.sectionHeader}}" stepKey="openAttributesSection"/> + <waitForElementVisible selector="{{AdminProductAttributesSection.attributeTextInputByCode($createDatetimeAttribute.attribute_code$)}}" stepKey="waitForSlideOutAttributes"/> + <seeInField selector="{{AdminProductAttributesSection.attributeTextInputByCode($createDatetimeAttribute.attribute_code$)}}" userInput="$generateDefaultValue" stepKey="checkDefaultValue"/> + <!-- Save the product --> + <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <!-- Check datetime grid filter --> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToAdminProductIndexPage"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminProductGridFilterSection.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="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad"/> + <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="{{_defaultProduct.name}}" stepKey="checkAppliedDatetimeFilter"/> + <see selector="{{AdminProductGridSection.productGridContentsOnRow('1')}}" userInput="{$generateDefaultGridValue}" stepKey="checkDefaultValueInGrid"/> + </test> +</tests> From 1131b3a6b585103f61a641dae1ef063cebb5cc84 Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Wed, 9 Oct 2019 16:26:01 -0500 Subject: [PATCH 034/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- .../Model/Indexer/ProductPriceIndexFilter.php | 79 ++++++++---- .../Indexer/ProductPriceIndexFilterTest.php | 121 ++++++++++++++++++ app/code/Magento/CatalogRule/etc/indexer.xml | 1 - 3 files changed, 172 insertions(+), 29 deletions(-) create mode 100644 app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/ProductPriceIndexFilterTest.php diff --git a/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php b/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php index 32fb85f270b9c..35231b8460b19 100644 --- a/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php +++ b/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php @@ -9,11 +9,11 @@ use Magento\CatalogInventory\Api\StockConfigurationInterface; use Magento\CatalogInventory\Model\ResourceModel\Stock\Item; -use Magento\CatalogInventory\Model\Stock; use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\PriceModifierInterface; use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\IndexTableStructure; use Magento\Framework\App\ResourceConnection; use Magento\Framework\App\ObjectManager; +use Magento\Framework\DB\Query\Generator; /** * Class for filter product price index. @@ -40,22 +40,38 @@ class ProductPriceIndexFilter implements PriceModifierInterface */ private $connectionName; + /** + * @var Generator + */ + private $batchQueryGenerator; + + /** + * @var int + */ + private $batchSize; + /** * @param StockConfigurationInterface $stockConfiguration * @param Item $stockItem * @param ResourceConnection $resourceConnection * @param string $connectionName + * @param Generator $batchQueryGenerator + * @param int $batchSize */ public function __construct( StockConfigurationInterface $stockConfiguration, Item $stockItem, ResourceConnection $resourceConnection = null, - $connectionName = 'indexer' + $connectionName = 'indexer', + Generator $batchQueryGenerator = null, + $batchSize = 100 ) { $this->stockConfiguration = $stockConfiguration; $this->stockItem = $stockItem; $this->resourceConnection = $resourceConnection ?: ObjectManager::getInstance()->get(ResourceConnection::class); $this->connectionName = $connectionName; + $this->batchQueryGenerator = $batchQueryGenerator ?: ObjectManager::getInstance()->get(Generator::class); + $this->batchSize = $batchSize; } /** @@ -64,7 +80,9 @@ public function __construct( * @param IndexTableStructure $priceTable * @param array $entityIds * @return void + * * @throws \Magento\Framework\Exception\LocalizedException + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function modifyPrice(IndexTableStructure $priceTable, array $entityIds = []) : void { @@ -73,37 +91,42 @@ public function modifyPrice(IndexTableStructure $priceTable, array $entityIds = } $connection = $this->resourceConnection->getConnection($this->connectionName); - $stockSelect = $connection->select(); - $stockSelect->from( - $this->stockItem->getMainTable(), - [ - 'product_id', - ] + $select = $connection->select(); + + $select->from( + ['stock_item' => $this->stockItem->getMainTable()], + ['stock_item.product_id', 'MAX(stock_item.is_in_stock) as max_is_in_stock'] ); - if (!empty($entityIds)) { - $stockSelect->where('product_id IN (?)', $entityIds); - } - $stockSelect->group('product_id'); + if ($this->stockConfiguration->getManageStock()) { - $stockStatus = $connection->getCheckSql( - 'use_config_manage_stock = 0 AND manage_stock = 0', - Stock::STOCK_IN_STOCK, - 'is_in_stock' - ); + $select->where('stock_item.use_config_manage_stock = 1 OR stock_item.manage_stock = 1'); } else { - $stockStatus = $connection->getCheckSql( - 'use_config_manage_stock = 0 AND manage_stock = 1', - 'is_in_stock', - Stock::STOCK_IN_STOCK - ); + $select->where('stock_item.use_config_manage_stock = 0 AND stock_item.manage_stock = 1'); + } + + if (!empty($entityIds)) { + $select->where('stock_item.product_id in (?)', $entityIds); } - $stockStatus = new \Zend_Db_Expr('MAX(' . $stockStatus . ')'); - $stockSelect->having($stockStatus . ' = ' . Stock::STOCK_OUT_OF_STOCK); - $productIds = $connection->fetchCol($stockSelect); - if (!empty($productIds)) { - $where = [$priceTable->getEntityField() .' IN (?)' => $productIds]; - $connection->delete($priceTable->getTableName(), $where); + $select->group('stock_item.product_id'); + $select->having('max_is_in_stock = 0'); + + $batchSelectIterator = $this->batchQueryGenerator->generate( + 'product_id', + $select, + $this->batchSize, + \Magento\Framework\DB\Query\BatchIteratorInterface::UNIQUE_FIELD_ITERATOR + ); + + foreach ($batchSelectIterator as $select) { + $productIds = null; + foreach ($connection->query($select)->fetchAll() as $row) { + $productIds[] = $row['product_id']; + } + if ($productIds !== null) { + $where = [$priceTable->getEntityField() .' IN (?)' => $productIds]; + $connection->delete($priceTable->getTableName(), $where); + } } } } diff --git a/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/ProductPriceIndexFilterTest.php b/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/ProductPriceIndexFilterTest.php new file mode 100644 index 0000000000000..46f4e0f26f378 --- /dev/null +++ b/app/code/Magento/CatalogInventory/Test/Unit/Model/Indexer/ProductPriceIndexFilterTest.php @@ -0,0 +1,121 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\CatalogInventory\Test\Unit\Model\Indexer; + +use Magento\CatalogInventory\Api\StockConfigurationInterface; +use Magento\CatalogInventory\Model\Indexer\ProductPriceIndexFilter; +use Magento\CatalogInventory\Model\ResourceModel\Stock\Item; +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Query\Generator; +use PHPUnit\Framework\MockObject\MockObject; +use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\IndexTableStructure; + +/** + * Product Price filter test, to ensure that product id's filtered. + */ +class ProductPriceIndexFilterTest extends \PHPUnit\Framework\TestCase +{ + + /** + * @var MockObject|StockConfigurationInterface $stockConfiguration + */ + private $stockConfiguration; + + /** + * @var MockObject|Item $item + */ + private $item; + + /** + * @var MockObject|ResourceConnection $resourceCnnection + */ + private $resourceCnnection; + + /** + * @var MockObject|Generator $generator + */ + private $generator; + + /** + * @var ProductPriceIndexFilter $productPriceIndexFilter + */ + private $productPriceIndexFilter; + + /** + * @inheritDoc + */ + protected function setUp() + { + $this->stockConfiguration = $this->createMock(StockConfigurationInterface::class); + $this->item = $this->createMock(Item::class); + $this->resourceCnnection = $this->createMock(ResourceConnection::class); + $this->generator = $this->createMock(Generator::class); + + $this->productPriceIndexFilter = new ProductPriceIndexFilter( + $this->stockConfiguration, + $this->item, + $this->resourceCnnection, + 'indexer', + $this->generator, + 100 + ); + } + + /** + * Test to ensure that Modify Price method uses entityIds, + */ + public function testModifyPrice() + { + $entityIds = [1, 2, 3]; + $indexTableStructure = $this->createMock(IndexTableStructure::class); + $connectionMock = $this->createMock(\Magento\Framework\DB\Adapter\AdapterInterface::class); + $this->resourceCnnection->expects($this->once())->method('getConnection')->willReturn($connectionMock); + $selectMock = $this->createMock(\Magento\Framework\DB\Select::class); + $connectionMock->expects($this->once())->method('select')->willReturn($selectMock); + $selectMock->expects($this->at(2)) + ->method('where') + ->with('stock_item.product_id in (?)', $entityIds) + ->willReturn($selectMock); + $this->generator->expects($this->once()) + ->method('generate') + ->will( + $this->returnCallback( + $this->getBatchIteratorCallback($selectMock, 5) + ) + ); + + $fetchStmtMock = $this->createPartialMock(\Zend_Db_Statement_Pdo::class, ['fetchAll']); + $fetchStmtMock->expects($this->any()) + ->method('fetchAll') + ->will($this->returnValue([['product_id' => 1]])); + $connectionMock->expects($this->any())->method('query')->will($this->returnValue($fetchStmtMock)); + $this->productPriceIndexFilter->modifyPrice($indexTableStructure, $entityIds); + } + + /** + * Returns batches. + * + * @param MockObject $selectMock + * @param int $batchCount + * @return \Closure + */ + private function getBatchIteratorCallback(MockObject $selectMock, int $batchCount): \Closure + { + $iteratorCallback = function () use ($batchCount, $selectMock): array { + $result = []; + $count = $batchCount; + while ($count) { + $count--; + $result[$count] = $selectMock; + } + + return $result; + }; + + return $iteratorCallback; + } +} diff --git a/app/code/Magento/CatalogRule/etc/indexer.xml b/app/code/Magento/CatalogRule/etc/indexer.xml index 340918ed63531..e648ea567631c 100644 --- a/app/code/Magento/CatalogRule/etc/indexer.xml +++ b/app/code/Magento/CatalogRule/etc/indexer.xml @@ -17,7 +17,6 @@ <indexer id="catalog_product_price"> <dependencies> <indexer id="catalogrule_rule" /> - <indexer id="catalogrule_product" /> </dependencies> </indexer> </config> From 7379bc9a62df7af85003a26bf94f72bee16989cc Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Thu, 10 Oct 2019 11:16:11 +0300 Subject: [PATCH 035/595] MC-5233: DateTime product attributes support --- .../AdminProductAttributeActionGroup.xml | 10 +++++----- .../Section/AdminCreateProductAttributeSection.xml | 2 +- .../AdminCreateDatetimeProductAttributeTest.xml | 5 +++-- ...reateSimpleProductWithDatetimeAttributeTest.xml | 14 +++++++------- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml index bc99e8d3f57e9..6deec50a831b4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml @@ -355,11 +355,11 @@ </arguments> <scrollTo selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="scrollToAdvancedSection"/> - <click selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="openAdvancedSection"/> + <conditionalClick selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" dependentSelector="{{AdvancedAttributePropertiesSection.AttributeCode}}" visible="false" stepKey="openAdvancedSection"/> <waitForElementVisible selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" stepKey="waitForSlideOutAdvancedSection"/> - <fillField stepKey="fillCode" selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attribute.attribute_code}}"/> - <scrollTo selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" stepKey="scrollToDefaultField"/> - <fillField stepKey="fillDefaultValue" selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" userInput="{{date}}"/> + <fillField selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attribute.attribute_code}}" stepKey="fillCode"/> + <scrollTo selector="{{AdvancedAttributePropertiesSection.defaultValueDatetime}}" stepKey="scrollToDefaultField"/> + <fillField selector="{{AdvancedAttributePropertiesSection.defaultValueDatetime}}" userInput="{{date}}" stepKey="fillDefaultValue"/> </actionGroup> <!-- Creates dropdown option at row without saving--> @@ -395,7 +395,7 @@ </annotations> <scrollTo selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="scrollToSection"/> - <click selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="openSection"/> + <conditionalClick selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" dependentSelector="{{AdvancedAttributePropertiesSection.AttributeCode}}" visible="false" stepKey="openSection"/> <waitForElementVisible selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" stepKey="waitForSlideOutSection"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml index 1236e07a2f278..e6b86c7a9172b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml @@ -93,7 +93,7 @@ <element name="DefaultValueText" type="textarea" selector="#default_value_text"/> <element name="DefaultValueTextArea" type="textarea" selector="#default_value_textarea"/> <element name="DefaultValueDate" type="textarea" selector="#default_value_date"/> - <element name="DefaultValueDatetime" type="textarea" selector="#default_value_datetime"/> + <element name="defaultValueDatetime" type="textarea" selector="#default_value_datetime"/> <element name="DefaultValueYesNo" type="textarea" selector="#default_value_yesno"/> <element name="Scope" type="select" selector="#is_global"/> <element name="UniqueValue" type="select" selector="#is_unique"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml index d084eb962c5da..e46114ff752f6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml @@ -23,6 +23,7 @@ <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> <argument name="ProductAttribute" value="DatetimeProductAttribute"/> </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="resetGridFilter"/> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Generate the datetime default value --> @@ -40,9 +41,9 @@ </actionGroup> <!-- Check the saved datetime default value --> <actionGroup ref="AdminNavigateToProductAttributeAdvancedSection" stepKey="goToAdvancedSection"/> - <scrollTo selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" stepKey="scrollToDefaultValue"/> + <scrollTo selector="{{AdvancedAttributePropertiesSection.defaultValueDatetime}}" stepKey="scrollToDefaultValue"/> <seeInField userInput="{$generateDefaultValue}" - selector="{{AdvancedAttributePropertiesSection.DefaultValueDatetime}}" + selector="{{AdvancedAttributePropertiesSection.defaultValueDatetime}}" stepKey="checkDefaultValue"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml index a21c5a84447dc..019baa4ac153d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml @@ -22,10 +22,11 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <after> - <deleteData createDataKey="createDatetimeAttribute" stepKey="DatetimeProductAttribute"/> + <deleteData createDataKey="createDatetimeAttribute" stepKey="deleteDatetimeAttribute"/> <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> + <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFiltersOnProductIndexPage"/> <actionGroup ref="logout" stepKey="logout"/> </after> @@ -53,13 +54,12 @@ <actionGroup ref="saveProductForm" stepKey="saveProduct"/> <!-- Check datetime grid filter --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToAdminProductIndexPage"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <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="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad"/> - <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="{{_defaultProduct.name}}" stepKey="checkAppliedDatetimeFilter"/> - <see selector="{{AdminProductGridSection.productGridContentsOnRow('1')}}" userInput="{$generateDefaultGridValue}" stepKey="checkDefaultValueInGrid"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> + <see selector="{{AdminDataGridTableSection.gridCell('1', 'Name')}}" userInput="{{_defaultProduct.name}}" stepKey="checkAppliedDatetimeFilter"/> + <see selector="{{AdminDataGridTableSection.rowTemplateStrict(_defaultProduct.name)}}" userInput="{$generateDefaultGridValue}" stepKey="checkDefaultValueInGrid"/> </test> </tests> From 9110f821c258e91431596d835c0b811083d327f3 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Thu, 10 Oct 2019 12:44:11 +0300 Subject: [PATCH 036/595] MC-5233: DateTime product attributes support --- .../Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml | 1 + .../Test/Mftf/Section/AdminCreateProductAttributeSection.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml index 6deec50a831b4..389330fd7deb5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml @@ -17,6 +17,7 @@ </arguments> <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttribute.attribute_code}}" stepKey="setAttributeCode"/> <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> <click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml index e6b86c7a9172b..31c4f5198a8b0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml @@ -93,7 +93,7 @@ <element name="DefaultValueText" type="textarea" selector="#default_value_text"/> <element name="DefaultValueTextArea" type="textarea" selector="#default_value_textarea"/> <element name="DefaultValueDate" type="textarea" selector="#default_value_date"/> - <element name="defaultValueDatetime" type="textarea" selector="#default_value_datetime"/> + <element name="defaultValueDatetime" type="text" selector="#default_value_datetime"/> <element name="DefaultValueYesNo" type="textarea" selector="#default_value_yesno"/> <element name="Scope" type="select" selector="#is_global"/> <element name="UniqueValue" type="select" selector="#is_unique"/> From c5a1666a93e10806f1861a7df958a6f4de5c4a99 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Thu, 10 Oct 2019 12:49:48 +0300 Subject: [PATCH 037/595] MC-5233: DateTime product attributes support --- .../Test/Unit/Ui/Component/ColumnFactoryTest.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php index f002173de7996..4e6730b553307 100644 --- a/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php @@ -56,7 +56,7 @@ class ColumnFactoryTest extends TestCase /** * @var TimezoneInterface|MockObject */ - private $timeZone; + private $timezone; /** * @inheritdoc @@ -80,13 +80,13 @@ protected function setUp(): void $this->column = $this->getMockForAbstractClass(ColumnInterface::class); $this->uiComponentFactory->method('create') ->willReturn($this->column); - $this->timeZone = $this->createMock(TimezoneInterface::class); + $this->timezone = $this->createMock(TimezoneInterface::class); $this->columnFactory = $this->objectManager->getObject( ColumnFactory::class, [ 'componentFactory' => $this->uiComponentFactory, - 'timezone' => $this->timeZone, + 'timezone' => $this->timezone, ] ); } @@ -203,7 +203,7 @@ public function testCreateDateColumn( 'visible' => true, 'filter' => 'dateRange', 'component' => 'Magento_Ui/js/grid/columns/date', - 'timeZone' => $expectedTimezone, + 'timezone' => $expectedTimezone, 'dateFormat' => $expectedDateFormat, 'options' => [ 'showsTime' => $showsTime @@ -224,15 +224,15 @@ public function testCreateDateColumn( $this->attribute->method('getFrontendInput') ->willReturn($frontendInput); - $this->timeZone->method('getDateFormat') + $this->timezone->method('getDateFormat') ->with(\IntlDateFormatter::MEDIUM) ->willReturn($dateFormat); - $this->timeZone->method('getDateTimeFormat') + $this->timezone->method('getDateTimeFormat') ->with(\IntlDateFormatter::MEDIUM) ->willReturn($dateTimeFormat); - $this->timeZone->method('getDefaultTimezone') + $this->timezone->method('getDefaultTimezone') ->willReturn($defaultTimezone); - $this->timeZone->method('getConfigTimezone') + $this->timezone->method('getConfigTimezone') ->willReturn($configTimezone); $this->uiComponentFactory->expects($this->once()) From e9f0b8a117f09134ed15652e551266a237de3c6e Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Thu, 10 Oct 2019 14:12:39 +0300 Subject: [PATCH 038/595] MC-5233: DateTime product attributes support --- .../Test/Mftf/Section/AdminCreateProductAttributeSection.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml index 31c4f5198a8b0..0934e39dcb062 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml @@ -93,7 +93,7 @@ <element name="DefaultValueText" type="textarea" selector="#default_value_text"/> <element name="DefaultValueTextArea" type="textarea" selector="#default_value_textarea"/> <element name="DefaultValueDate" type="textarea" selector="#default_value_date"/> - <element name="defaultValueDatetime" type="text" selector="#default_value_datetime"/> + <element name="defaultValueDatetime" type="date" selector="#default_value_datetime"/> <element name="DefaultValueYesNo" type="textarea" selector="#default_value_yesno"/> <element name="Scope" type="select" selector="#is_global"/> <element name="UniqueValue" type="select" selector="#is_unique"/> From 27e2049537f34d8ce0748e2f47afc9f95ffed1b1 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Thu, 10 Oct 2019 17:09:16 +0300 Subject: [PATCH 039/595] MC-5233: DateTime product attributes support --- app/code/Magento/Catalog/Ui/Component/Listing/Columns.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php b/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php index d7b9bc3846f49..1e056d9f8d517 100644 --- a/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php +++ b/app/code/Magento/Catalog/Ui/Component/Listing/Columns.php @@ -14,7 +14,7 @@ class Columns extends \Magento\Ui\Component\Listing\Columns { /** - * Default columns max order + * Default columns max order value */ const DEFAULT_COLUMNS_MAX_ORDER = 100; From f3a3a81709765ccd6d0a121d970f56a929fc861c Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Thu, 10 Oct 2019 12:59:39 -0500 Subject: [PATCH 040/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- .../Model/Indexer/IndexBuilder.php | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index a434d337f00c2..a91efbba87f17 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -242,7 +242,21 @@ public function __construct( */ public function reindexById($id) { - $this->reindexByIds([$id]); + try { + $this->cleanProductIndex([$id]); + + $products = $this->productLoader->getProducts([$id]); + $product = array_values($products)[0]; + $activeRules = $this->getActiveRules(); + $this->applyRules($activeRules, $product); + + $this->reindexRuleGroupWebsite->execute(); + } catch (\Exception $e) { + $this->critical($e); + throw new \Magento\Framework\Exception\LocalizedException( + __('Catalog rule indexing failed. See details in exception log.') + ); + } } /** @@ -447,6 +461,28 @@ protected function applyRule(Rule $rule, $product) return $this; } + /** + * Apply rules + * + * @param RuleCollection $ruleCollection + * @param Product $product + * @return void + */ + private function applyRules(RuleCollection $ruleCollection, Product $product): void + { + foreach ($ruleCollection as $rule) { + if (!$rule->validate($product)) { + continue; + } + + $websiteIds = array_intersect($product->getWebsiteIds(), $rule->getWebsiteIds()); + $this->assignProductToRule($rule, $product->getId(), $websiteIds); + } + + $this->cleanProductPriceIndex([$product->getId()]); + $this->reindexRuleProductPrice->execute($this->batchCount, $product->getId()); + } + /** * Retrieve table name * From ff1b35037cdbc806b7e9a6f0597892aa87a4011e Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Thu, 10 Oct 2019 18:29:34 -0500 Subject: [PATCH 041/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- .../CatalogRule/Model/Indexer/IndexBuilder.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index a91efbba87f17..899c31c40db8f 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -246,9 +246,10 @@ public function reindexById($id) $this->cleanProductIndex([$id]); $products = $this->productLoader->getProducts([$id]); - $product = array_values($products)[0]; $activeRules = $this->getActiveRules(); - $this->applyRules($activeRules, $product); + foreach ($products as $product) { + $this->applyRules($activeRules, $product); + } $this->reindexRuleGroupWebsite->execute(); } catch (\Exception $e) { @@ -386,11 +387,11 @@ protected function cleanByIds($productIds) * Assign product to rule * * @param Rule $rule - * @param int $productId + * @param int $productEntityId * @param array $websiteIds * @return void */ - private function assignProductToRule(Rule $rule, int $productId, array $websiteIds): void + private function assignProductToRule(Rule $rule, int $productEntityId, array $websiteIds): void { $ruleId = (int) $rule->getId(); $ruleProductTable = $this->getTable('catalogrule_product'); @@ -398,7 +399,7 @@ private function assignProductToRule(Rule $rule, int $productId, array $websiteI $ruleProductTable, [ 'rule_id = ?' => $ruleId, - 'product_id = ?' => $productId, + 'product_id = ?' => $productEntityId, ] ); @@ -420,7 +421,7 @@ private function assignProductToRule(Rule $rule, int $productId, array $websiteI 'to_time' => $toTime, 'website_id' => $websiteId, 'customer_group_id' => $customerGroupId, - 'product_id' => $productId, + 'product_id' => $productEntityId, 'action_operator' => $actionOperator, 'action_amount' => $actionAmount, 'action_stop' => $actionStop, From ee1807bbcd027f37f0d3460710c713f9793b5395 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Fri, 11 Oct 2019 13:34:14 +0300 Subject: [PATCH 042/595] MC-5233: DateTime product attributes support --- .../AdminCreateSimpleProductWithDatetimeAttributeTest.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml index 019baa4ac153d..6772e95b6ec27 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml @@ -45,13 +45,15 @@ <actionGroup ref="addProductAttributeInProductModal" stepKey="addDatetimeAttribute"> <argument name="attributeCode" value="$createDatetimeAttribute.attribute_code$"/> </actionGroup> + <!-- Flush config cache to reset product attributes in attribute set --> + <magentoCLI command="cache:flush" arguments="config" stepKey="flushConfigCache"/> + <!-- Save the product --> + <actionGroup ref="saveProductForm" stepKey="saveProduct"/> <!-- Check default value --> <scrollTo selector="{{AdminProductAttributesSection.sectionHeader}}" stepKey="goToAttributesSection"/> <click selector="{{AdminProductAttributesSection.sectionHeader}}" stepKey="openAttributesSection"/> <waitForElementVisible selector="{{AdminProductAttributesSection.attributeTextInputByCode($createDatetimeAttribute.attribute_code$)}}" stepKey="waitForSlideOutAttributes"/> <seeInField selector="{{AdminProductAttributesSection.attributeTextInputByCode($createDatetimeAttribute.attribute_code$)}}" userInput="$generateDefaultValue" stepKey="checkDefaultValue"/> - <!-- Save the product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> <!-- Check datetime grid filter --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToAdminProductIndexPage"/> <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> From 9b423da550221328dd3215ff057e06109924fdb1 Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Fri, 11 Oct 2019 13:56:27 -0500 Subject: [PATCH 043/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index 899c31c40db8f..2646a48ce1467 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -294,7 +294,6 @@ protected function doReindexByIds($ids) $activeRules = $this->getActiveRules()->getItems(); foreach ($activeRules as $rule) { $rule->setProductsFilter($ids); - $this->reindexRuleProduct->execute($rule, $this->batchCount); } $this->cleanProductPriceIndex($ids); From c34d995aa05918b1bac44ddb34eb138272073460 Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Fri, 11 Oct 2019 15:28:04 -0500 Subject: [PATCH 044/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- .../Magento/CatalogRule/Model/Indexer/IndexBuilder.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index 2646a48ce1467..2ed26a044dbc9 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -290,14 +290,15 @@ protected function doReindexByIds($ids) { $this->cleanProductIndex($ids); - /** @var Rule[] $activeRules */ - $activeRules = $this->getActiveRules()->getItems(); + $activeRules = $this->getActiveRules(); foreach ($activeRules as $rule) { + /** @var Rule $rule */ $rule->setProductsFilter($ids); + $this->reindexRuleProduct->execute($rule, $this->batchCount); } - $this->cleanProductPriceIndex($ids); foreach ($ids as $productId) { + $this->cleanProductPriceIndex($productId); $this->reindexRuleProductPrice->execute($this->batchCount, $productId); } @@ -341,7 +342,7 @@ protected function doReindexFull() [ $this->getTable('catalogrule_product'), $this->getTable('catalogrule_product_price'), - $this->getTable('catalogrule_group_website'), + $this->getTable('catalogrule_group_website') ] ); } From 69862e805bef83955f5df04a4ac0a1510698bd19 Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Fri, 11 Oct 2019 16:40:48 -0500 Subject: [PATCH 045/595] MC-19652: Product Categories Indexer stuck --- app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index 2ed26a044dbc9..864c814775377 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -298,7 +298,7 @@ protected function doReindexByIds($ids) } foreach ($ids as $productId) { - $this->cleanProductPriceIndex($productId); + $this->cleanProductPriceIndex([$productId]); $this->reindexRuleProductPrice->execute($this->batchCount, $productId); } From 59d2ad877ab7690770904c665c7e85386a0bffb2 Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Mon, 14 Oct 2019 09:17:22 -0500 Subject: [PATCH 046/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- .../CatalogRule/Model/Indexer/IndexBuilder.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index 864c814775377..ed0950588ca63 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -297,12 +297,14 @@ protected function doReindexByIds($ids) $this->reindexRuleProduct->execute($rule, $this->batchCount); } - foreach ($ids as $productId) { - $this->cleanProductPriceIndex([$productId]); - $this->reindexRuleProductPrice->execute($this->batchCount, $productId); + $products = $this->productLoader->getProducts($ids); + if ($products) { + foreach ($products as $product) { + $this->cleanProductPriceIndex([$product->getId()]); + $this->reindexRuleProductPrice->execute($this->batchCount, $product->getId()); + } + $this->reindexRuleGroupWebsite->execute(); } - - $this->reindexRuleGroupWebsite->execute(); } /** From 90b4370a0726d55516d45d0ca9ad2d5ba14cb6c8 Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Mon, 14 Oct 2019 12:48:02 -0500 Subject: [PATCH 047/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- .../CatalogRule/Model/Indexer/IndexBuilder.php | 12 +++++------- .../CatalogRule/Model/Indexer/ProductRuleReindex.php | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index ed0950588ca63..ecdd124786efc 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -297,14 +297,12 @@ protected function doReindexByIds($ids) $this->reindexRuleProduct->execute($rule, $this->batchCount); } - $products = $this->productLoader->getProducts($ids); - if ($products) { - foreach ($products as $product) { - $this->cleanProductPriceIndex([$product->getId()]); - $this->reindexRuleProductPrice->execute($this->batchCount, $product->getId()); - } - $this->reindexRuleGroupWebsite->execute(); + $this->cleanProductPriceIndex($ids); + foreach ($ids as $productId) { + $this->reindexRuleProductPrice->execute($this->batchCount, $productId); } + + $this->reindexRuleGroupWebsite->execute(); } /** diff --git a/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Indexer/ProductRuleReindex.php b/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Indexer/ProductRuleReindex.php index 9c66719334639..edc827ec57ac2 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Indexer/ProductRuleReindex.php +++ b/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Indexer/ProductRuleReindex.php @@ -88,8 +88,8 @@ private function reindexSubProducts( $subProducts = []; if ($configurableIds) { $subProducts = array_values($this->configurable->getChildrenIds($configurableIds)[0]); - if ($subProducts) { - $subject->executeList($subProducts); + foreach ($subProducts as $subProduct) { + $subject->executeRow($subProduct); } } return $subProducts; From a1a64197377c297904e6bf32d54fa44fe9907f52 Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Mon, 14 Oct 2019 17:38:15 -0500 Subject: [PATCH 048/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- .../Magento/CatalogRule/Model/Indexer/IndexBuilder.php | 7 ------- .../CatalogRule/Model/Indexer/ProductRuleReindex.php | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index ecdd124786efc..703e28f4ed12f 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -296,13 +296,6 @@ protected function doReindexByIds($ids) $rule->setProductsFilter($ids); $this->reindexRuleProduct->execute($rule, $this->batchCount); } - - $this->cleanProductPriceIndex($ids); - foreach ($ids as $productId) { - $this->reindexRuleProductPrice->execute($this->batchCount, $productId); - } - - $this->reindexRuleGroupWebsite->execute(); } /** diff --git a/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Indexer/ProductRuleReindex.php b/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Indexer/ProductRuleReindex.php index edc827ec57ac2..9c66719334639 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Indexer/ProductRuleReindex.php +++ b/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Indexer/ProductRuleReindex.php @@ -88,8 +88,8 @@ private function reindexSubProducts( $subProducts = []; if ($configurableIds) { $subProducts = array_values($this->configurable->getChildrenIds($configurableIds)[0]); - foreach ($subProducts as $subProduct) { - $subject->executeRow($subProduct); + if ($subProducts) { + $subject->executeList($subProducts); } } return $subProducts; From 22d9fb1fb8560b92c33004162e38cfa96f96e984 Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Tue, 15 Oct 2019 08:52:28 -0500 Subject: [PATCH 049/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index 703e28f4ed12f..19628db1ef9c7 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -294,8 +294,8 @@ protected function doReindexByIds($ids) foreach ($activeRules as $rule) { /** @var Rule $rule */ $rule->setProductsFilter($ids); - $this->reindexRuleProduct->execute($rule, $this->batchCount); } + $this->reindexRuleGroupWebsite->execute(); } /** From b5787de0a17e13c749cf4bc5a3df771f8435829d Mon Sep 17 00:00:00 2001 From: Namrata Vora <namrata@seepossible.com> Date: Thu, 17 Oct 2019 14:04:45 +0530 Subject: [PATCH 050/595] Added translate for strings and added missing node in existing translate attribute on xml. --- app/code/Magento/AdvancedSearch/etc/adminhtml/system.xml | 2 +- app/code/Magento/Analytics/etc/adminhtml/system.xml | 2 +- .../view/adminhtml/ui_component/bulk_listing.xml | 2 +- .../Magento_Backend/layout/layout_test_grid_handle.xml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/AdvancedSearch/etc/adminhtml/system.xml b/app/code/Magento/AdvancedSearch/etc/adminhtml/system.xml index 63c78e07c7bfc..905dd3e7d1819 100644 --- a/app/code/Magento/AdvancedSearch/etc/adminhtml/system.xml +++ b/app/code/Magento/AdvancedSearch/etc/adminhtml/system.xml @@ -60,7 +60,7 @@ <field id="search_suggestion_enabled">1</field> </depends> </field> - <field id="search_suggestion_count_results_enabled" translate="label" type="select" sortOrder="92" showInDefault="1" showInWebsite="1" showInStore="1"> + <field id="search_suggestion_count_results_enabled" translate="label comment" type="select" sortOrder="92" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Show Results Count for Each Suggestion</label> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> <comment>When you enable this option your site may slow down.</comment> diff --git a/app/code/Magento/Analytics/etc/adminhtml/system.xml b/app/code/Magento/Analytics/etc/adminhtml/system.xml index c7da840b7e665..79dd914cb3c1d 100644 --- a/app/code/Magento/Analytics/etc/adminhtml/system.xml +++ b/app/code/Magento/Analytics/etc/adminhtml/system.xml @@ -29,7 +29,7 @@ <frontend_model>Magento\Analytics\Block\Adminhtml\System\Config\CollectionTimeLabel</frontend_model> <backend_model>Magento\Analytics\Model\Config\Backend\CollectionTime</backend_model> </field> - <field id="vertical" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0"> + <field id="vertical" translate="hint label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0"> <hint>Industry Data</hint> <label>Industry</label> <comment>In order to personalize your Advanced Reporting experience, please select your industry.</comment> diff --git a/app/code/Magento/AsynchronousOperations/view/adminhtml/ui_component/bulk_listing.xml b/app/code/Magento/AsynchronousOperations/view/adminhtml/ui_component/bulk_listing.xml index 512b08d6a8de2..87dc0525eb1c0 100644 --- a/app/code/Magento/AsynchronousOperations/view/adminhtml/ui_component/bulk_listing.xml +++ b/app/code/Magento/AsynchronousOperations/view/adminhtml/ui_component/bulk_listing.xml @@ -92,7 +92,7 @@ <actionsColumn name="actions" class="\Magento\AsynchronousOperations\Ui\Component\Listing\Column\Actions"> <settings> <indexField>id</indexField> - <label>Action</label> + <label translate="true">Action</label> </settings> </actionsColumn> </columns> diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/Magento_Backend/layout/layout_test_grid_handle.xml b/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/Magento_Backend/layout/layout_test_grid_handle.xml index 621e9f13409f1..70bf2af6a5fcf 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/Magento_Backend/layout/layout_test_grid_handle.xml +++ b/dev/tests/integration/testsuite/Magento/Backend/Block/_files/design/adminhtml/Magento/test_default/Magento_Backend/layout/layout_test_grid_handle.xml @@ -55,12 +55,12 @@ <item name="option_id1" xsi:type="array"> <item name="label" xsi:type="string" translate="true">Option One</item> <item name="url" xsi:type="string">*/*/option1</item> - <item name="complete" xsi:type="string">Test</item> + <item name="complete" xsi:type="string" translate="true">Test</item> </item> <item name="option_id2" xsi:type="array"> <item name="label" xsi:type="string" translate="true">Option Two</item> <item name="url" xsi:type="string">*/*/option2</item> - <item name="confirm" xsi:type="string">Are you sure?</item> + <item name="confirm" xsi:type="string" translate="true">Are you sure?</item> </item> <item name="option_id3" xsi:type="array"> <item name="label" xsi:type="string" translate="true">Option Three</item> From 09b1502b7316275abced9eb58fafe25b42412e5d Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Thu, 17 Oct 2019 13:14:17 -0500 Subject: [PATCH 051/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- .../Model/Indexer/IndexBuilder.php | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index 19628db1ef9c7..f0bb92d1fc742 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -290,11 +290,31 @@ protected function doReindexByIds($ids) { $this->cleanProductIndex($ids); - $activeRules = $this->getActiveRules(); + /** @var Rule[] $activeRules */ + $activeRules = $this->getActiveRules()->getItems(); foreach ($activeRules as $rule) { - /** @var Rule $rule */ + $ruleWebsiteIds = $rule->getWebsiteIds(); + if (!$rule->getIsActive() || empty($ruleWebsiteIds)) { + continue; + } + $rule->setProductsFilter($ids); + $productIds = $rule->getMatchingProductIds(); + if (!is_array($ruleWebsiteIds)) { + $ruleWebsiteIds = explode(',', $ruleWebsiteIds); + } + foreach ($productIds as $productId => $validationByWebsite) { + $productWebsiteIds = array_keys(array_filter($validationByWebsite)); + $websiteIds = array_intersect($productWebsiteIds, $ruleWebsiteIds); + $this->assignProductToRule($rule, $productId, $websiteIds); + } + } + + $this->cleanProductPriceIndex($ids); + foreach ($ids as $productId) { + $this->reindexRuleProductPrice->execute($this->batchCount, $productId); } + $this->reindexRuleGroupWebsite->execute(); } From 65378b98541bf5792500ac03cf9f4c5fe132fa03 Mon Sep 17 00:00:00 2001 From: DmitryTsymbal <d.tsymbal@atwix.com> Date: Thu, 17 Oct 2019 22:40:02 +0300 Subject: [PATCH 052/595] refactoring --- .../AdminCreatesNewIntegrationActionGroup.xml | 2 -- ...AdminSubmitNewIntegrationFormActionGroup.xml | 17 +++++++++++++++++ .../Mftf/Section/AdminIntegrationsSection.xml | 12 ++++++++---- .../Test/AdminDeleteIntegrationEntityTest.xml | 2 ++ 4 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminSubmitNewIntegrationFormActionGroup.xml diff --git a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminCreatesNewIntegrationActionGroup.xml b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminCreatesNewIntegrationActionGroup.xml index 533bbb6760573..89e29d7d751a0 100644 --- a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminCreatesNewIntegrationActionGroup.xml +++ b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminCreatesNewIntegrationActionGroup.xml @@ -17,7 +17,5 @@ </arguments> <fillField stepKey="fillNameField" selector="{{AddNewIntegrationSection.name}}" userInput="{{name}}"/> <fillField stepKey="fillAdminPasswordField" selector="{{AddNewIntegrationSection.password}}" userInput="{{password}}"/> - <!--Click the "Save" Button --> - <click stepKey="clickSaveButton" selector="{{AddNewIntegrationSection.saveButton}}"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminSubmitNewIntegrationFormActionGroup.xml b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminSubmitNewIntegrationFormActionGroup.xml new file mode 100644 index 0000000000000..23ddc2969a55e --- /dev/null +++ b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminSubmitNewIntegrationFormActionGroup.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="AdminSubmitNewIntegrationFormActionGroup"> + <!--Click the "Save" Button --> + <click stepKey="clickSaveButton" selector="{{AddNewIntegrationSection.saveButton}}"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Integration/Test/Mftf/Section/AdminIntegrationsSection.xml b/app/code/Magento/Integration/Test/Mftf/Section/AdminIntegrationsSection.xml index 4e43cd3babdf6..4af25b9be9714 100644 --- a/app/code/Magento/Integration/Test/Mftf/Section/AdminIntegrationsSection.xml +++ b/app/code/Magento/Integration/Test/Mftf/Section/AdminIntegrationsSection.xml @@ -9,18 +9,22 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="IntegrationsGridSection"> - <element name="add" type="button" selector=".add"/> + <element name="add" type="button" selector=".page-actions .add"/> <element name="messageByType" type="block" selector="#messages .message-{{messageType}}" parameterized="true"/> - <element name="name" type="input" selector="#integrationGrid_filter_name"/> + <element name="name" type="input" selector=".data-grid-filters #integrationGrid_filter_name"/> <element name="search" type="input" selector=".admin__filter-actions button[title=Search]"/> - <element name="remove" type="button" selector=".delete"/> + <element name="remove" type="button" selector=".data-grid .delete"/> <element name="submitButton" type="button" selector=".action-primary.action-accept" timeout="30"/> <element name="rowByIndex" type="text" selector="tr[data-role='row']:nth-of-type({{var1}})" parameterized="true" timeout="30"/> + <element name="edit" type="button" selector=".data-grid .edit"/> </section> <section name="AddNewIntegrationSection"> <element name="name" type="input" selector="#integration_properties_name"/> <element name="password" type="input" selector="#integration_properties_current_password"/> - <element name="saveButton" type="button" selector="#save-split-button-button"/> + <element name="saveButton" type="button" selector=".page-actions #save-split-button-button"/> + <element name="endpoint" type="input" selector="#integration_properties_endpoint"/> + <element name="linkUrl" type="input" selector="#integration_properties_identity_link_url"/> + <element name="save" type="button" selector=".page-actions-buttons .save"/> </section> </sections> diff --git a/app/code/Magento/Integration/Test/Mftf/Test/AdminDeleteIntegrationEntityTest.xml b/app/code/Magento/Integration/Test/Mftf/Test/AdminDeleteIntegrationEntityTest.xml index bc226a70375f0..6f46bbf99d218 100644 --- a/app/code/Magento/Integration/Test/Mftf/Test/AdminDeleteIntegrationEntityTest.xml +++ b/app/code/Magento/Integration/Test/Mftf/Test/AdminDeleteIntegrationEntityTest.xml @@ -32,6 +32,8 @@ <argument name="name" value="Integration1"/> <argument name="password" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> </actionGroup> + <!-- Submit The Form --> + <actionGroup ref="AdminSubmitNewIntegrationFormActionGroup" stepKey="submitTheForm"/> </before> <after> <actionGroup ref="logout" stepKey="logout"/> From bd096124afd849de1e1940987e8cfec29270cf8f Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Thu, 17 Oct 2019 16:26:45 -0500 Subject: [PATCH 053/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- .../CatalogRule/Model/Indexer/IndexBuilder.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index f0bb92d1fc742..ca5fc0090b4ed 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -290,6 +290,7 @@ protected function doReindexByIds($ids) { $this->cleanProductIndex($ids); + $products = $this->productLoader->getProducts($ids); /** @var Rule[] $activeRules */ $activeRules = $this->getActiveRules()->getItems(); foreach ($activeRules as $rule) { @@ -298,15 +299,16 @@ protected function doReindexByIds($ids) continue; } - $rule->setProductsFilter($ids); - $productIds = $rule->getMatchingProductIds(); if (!is_array($ruleWebsiteIds)) { $ruleWebsiteIds = explode(',', $ruleWebsiteIds); } - foreach ($productIds as $productId => $validationByWebsite) { - $productWebsiteIds = array_keys(array_filter($validationByWebsite)); - $websiteIds = array_intersect($productWebsiteIds, $ruleWebsiteIds); - $this->assignProductToRule($rule, $productId, $websiteIds); + foreach ($products as $product) { + if (!$rule->validate($product)) { + continue; + } + + $websiteIds = array_intersect($product->getWebsiteIds(), $ruleWebsiteIds); + $this->assignProductToRule($rule, $product->getId(), $websiteIds); } } From 079e25d1d843f61b3b51a67ad7d38beac28dd92d Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Fri, 18 Oct 2019 12:16:50 -0500 Subject: [PATCH 054/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- .../CatalogRule/Model/Indexer/IndexBuilder.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index ca5fc0090b4ed..207bacd03bebc 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -290,7 +290,10 @@ protected function doReindexByIds($ids) { $this->cleanProductIndex($ids); - $products = $this->productLoader->getProducts($ids); + $products = []; + foreach ($this->productLoader->getProducts($ids) as $product) { + $products[$product->getId()] = $product; + } /** @var Rule[] $activeRules */ $activeRules = $this->getActiveRules()->getItems(); foreach ($activeRules as $rule) { @@ -299,14 +302,13 @@ protected function doReindexByIds($ids) continue; } + $rule->setProductsFilter(array_keys($products)); + $matchingProductIds = $rule->getMatchingProductIds(); if (!is_array($ruleWebsiteIds)) { $ruleWebsiteIds = explode(',', $ruleWebsiteIds); } - foreach ($products as $product) { - if (!$rule->validate($product)) { - continue; - } - + foreach ($matchingProductIds as $matchingProductId => $validationByWebsite) { + $product = $products[$matchingProductId]; $websiteIds = array_intersect($product->getWebsiteIds(), $ruleWebsiteIds); $this->assignProductToRule($rule, $product->getId(), $websiteIds); } From 79fdffbe72600ccfeb49b7e5b02ea864e6f3baf0 Mon Sep 17 00:00:00 2001 From: Eden <quocviet312@gmail.com> Date: Sun, 20 Oct 2019 22:47:45 +0700 Subject: [PATCH 055/595] Add validation in catalog rule and shopping cart rule form --- .../ui_component/catalog_rule_form.xml | 4 ++++ .../ui_component/sales_rule_form.xml | 20 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/app/code/Magento/CatalogRule/view/adminhtml/ui_component/catalog_rule_form.xml b/app/code/Magento/CatalogRule/view/adminhtml/ui_component/catalog_rule_form.xml index 2af8bb0770b20..35fd7d8a192f4 100644 --- a/app/code/Magento/CatalogRule/view/adminhtml/ui_component/catalog_rule_form.xml +++ b/app/code/Magento/CatalogRule/view/adminhtml/ui_component/catalog_rule_form.xml @@ -208,6 +208,10 @@ </item> </argument> <settings> + <validation> + <rule name="validate-number" xsi:type="boolean">true</rule> + <rule name="validate-zero-or-greater" xsi:type="boolean">true</rule> + </validation> <dataType>text</dataType> <label translate="true">Priority</label> <dataScope>sort_order</dataScope> diff --git a/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml b/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml index 639e12006232b..63faf29afd769 100644 --- a/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml +++ b/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml @@ -297,6 +297,9 @@ </item> </argument> <settings> + <validation> + <rule name="validate-digits" xsi:type="boolean">true</rule> + </validation> <dataType>text</dataType> <label translate="true">Uses per Coupon</label> <dataScope>uses_per_coupon</dataScope> @@ -309,6 +312,9 @@ </item> </argument> <settings> + <validation> + <rule name="validate-digits" xsi:type="boolean">true</rule> + </validation> <notice translate="true"> Usage limit enforced for logged in customers only. </notice> @@ -356,6 +362,10 @@ </item> </argument> <settings> + <validation> + <rule name="validate-number" xsi:type="boolean">true</rule> + <rule name="validate-zero-or-greater" xsi:type="boolean">true</rule> + </validation> <dataType>text</dataType> <label translate="true">Priority</label> <dataScope>sort_order</dataScope> @@ -422,6 +432,8 @@ <settings> <validation> <rule name="required-entry" xsi:type="boolean">true</rule> + <rule name="validate-number" xsi:type="boolean">true</rule> + <rule name="validate-zero-or-greater" xsi:type="boolean">true</rule> </validation> <dataType>text</dataType> <label translate="true">Discount Amount</label> @@ -435,6 +447,10 @@ </item> </argument> <settings> + <validation> + <rule name="validate-number" xsi:type="boolean">true</rule> + <rule name="validate-zero-or-greater" xsi:type="boolean">true</rule> + </validation> <dataType>text</dataType> <label translate="true">Maximum Qty Discount is Applied To</label> <dataScope>discount_qty</dataScope> @@ -447,6 +463,10 @@ </item> </argument> <settings> + <validation> + <rule name="validate-number" xsi:type="boolean">true</rule> + <rule name="validate-zero-or-greater" xsi:type="boolean">true</rule> + </validation> <dataType>text</dataType> <label translate="true">Discount Qty Step (Buy X)</label> <dataScope>discount_step</dataScope> From 392fb119bb906f2bdb281a9574b2b9b1a88fec41 Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Tue, 22 Oct 2019 17:56:56 -0500 Subject: [PATCH 056/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- .../Model/Indexer/IndexBuilder.php | 16 ++++----------- .../Model/Rule/ConfigurableProductHandler.php | 20 +++++++++++++++++++ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index 207bacd03bebc..9465847d21fe1 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -290,10 +290,6 @@ protected function doReindexByIds($ids) { $this->cleanProductIndex($ids); - $products = []; - foreach ($this->productLoader->getProducts($ids) as $product) { - $products[$product->getId()] = $product; - } /** @var Rule[] $activeRules */ $activeRules = $this->getActiveRules()->getItems(); foreach ($activeRules as $rule) { @@ -302,20 +298,16 @@ protected function doReindexByIds($ids) continue; } - $rule->setProductsFilter(array_keys($products)); + $rule->setProductsFilter($ids); $matchingProductIds = $rule->getMatchingProductIds(); - if (!is_array($ruleWebsiteIds)) { - $ruleWebsiteIds = explode(',', $ruleWebsiteIds); - } foreach ($matchingProductIds as $matchingProductId => $validationByWebsite) { - $product = $products[$matchingProductId]; - $websiteIds = array_intersect($product->getWebsiteIds(), $ruleWebsiteIds); - $this->assignProductToRule($rule, $product->getId(), $websiteIds); + $websiteIds = array_keys(array_filter($validationByWebsite)); + $this->assignProductToRule($rule, $matchingProductId, $websiteIds); } } - $this->cleanProductPriceIndex($ids); foreach ($ids as $productId) { + $this->cleanProductPriceIndex([$productId]); $this->reindexRuleProductPrice->execute($this->batchCount, $productId); } diff --git a/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Rule/ConfigurableProductHandler.php b/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Rule/ConfigurableProductHandler.php index d27c424ed9ea3..e846c10bf49ef 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Rule/ConfigurableProductHandler.php +++ b/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Rule/ConfigurableProductHandler.php @@ -41,6 +41,26 @@ public function __construct( $this->configurableProductsProvider = $configurableProductsProvider; } + /** + * @param \Magento\CatalogRule\Model\Rule $rule + * @param int|array $productIds + * @return array + */ + public function beforeSetProductsFilter(\Magento\CatalogRule\Model\Rule $rule, $productIds) + { + if ($productIds) { + $configurableProductIds = $this->configurable->getParentIdsByChild($productIds); + if ($configurableProductIds) { + $productIds = array_merge((array) $productIds, $configurableProductIds); + + } + } + + return [ + $productIds, + ]; + } + /** * @param \Magento\CatalogRule\Model\Rule $rule * @param array $productIds From 073e5049fcfe3ec1678fe0612f07c78508b5fcff Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Wed, 23 Oct 2019 10:31:46 -0500 Subject: [PATCH 057/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index 9465847d21fe1..1657a18b55aaf 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -300,6 +300,7 @@ protected function doReindexByIds($ids) $rule->setProductsFilter($ids); $matchingProductIds = $rule->getMatchingProductIds(); + $matchingProductIds = array_intersect_key($matchingProductIds, array_flip($ids)); foreach ($matchingProductIds as $matchingProductId => $validationByWebsite) { $websiteIds = array_keys(array_filter($validationByWebsite)); $this->assignProductToRule($rule, $matchingProductId, $websiteIds); From 1b66fb468d52868e2c5708fbc6ec7def4acaffc6 Mon Sep 17 00:00:00 2001 From: Eden <quocviet312@gmail.com> Date: Wed, 23 Oct 2019 23:23:38 +0700 Subject: [PATCH 058/595] cover issue 25172 with mftf test --- .../CatalogPriceRuleActionGroup.xml | 19 +++++++ .../Test/Mftf/Data/CatalogRuleData.xml | 15 ++++++ .../AdminNewCatalogPriceRuleSection.xml | 2 + .../Test/AdminCreateCatalogPriceRuleTest.xml | 23 ++++++++ .../ui_component/catalog_rule_form.xml | 3 +- .../Test/Mftf/Data/SalesRuleData.xml | 9 ++++ .../AdminCartPriceRulesFormSection.xml | 2 + .../Mftf/Test/AdminCreateInvalidRuleTest.xml | 53 +++++++++++++++++++ .../ui_component/sales_rule_form.xml | 3 +- 9 files changed, 125 insertions(+), 4 deletions(-) create mode 100644 app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateInvalidRuleTest.xml diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CatalogPriceRuleActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CatalogPriceRuleActionGroup.xml index 09053b5ad14a3..620f61b9ec27a 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CatalogPriceRuleActionGroup.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CatalogPriceRuleActionGroup.xml @@ -208,4 +208,23 @@ <waitForElementVisible selector="{{AdminMessagesSection.success}}" after="clickToConfirm" stepKey="waitForSuccessMessage"/> <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the rule." after="waitForSuccessMessage" stepKey="verifyRuleIsDeleted"/> </actionGroup> + + <actionGroup name="newCatalogPriceRuleWithInvalidData"> + <annotations> + <description>Goes to the Catalog Price Rule grid. Clicks on Add. Fills in the provided Catalog Rule details with invalid data.</description> + </annotations> + <arguments> + <argument name="catalogRule" defaultValue="catalogRuleWithInvalid"/> + </arguments> + + <!-- Go to the admin Catalog rule grid and add a new one --> + <amOnPage stepKey="goToPriceRulePage" url="{{CatalogRulePage.url}}"/> + <waitForPageLoad stepKey="waitForPriceRulePage"/> + + <click stepKey="addNewRule" selector="{{AdminGridMainControls.add}}"/> + <fillField stepKey="fillPriority" selector="{{AdminNewCatalogPriceRule.priority}}" userInput="{{catalogRule.priority}}"/> + <scrollToTopOfPage stepKey="scrollToTop"/> + <click selector="{{AdminNewCatalogPriceRule.save}}" stepKey="clickSave"/> + <waitForPageLoad stepKey="waitForApplied"/> + </actionGroup> </actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Data/CatalogRuleData.xml b/app/code/Magento/CatalogRule/Test/Mftf/Data/CatalogRuleData.xml index 75a7484324576..2920a895f607d 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Data/CatalogRuleData.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Data/CatalogRuleData.xml @@ -173,4 +173,19 @@ <data key="defaultRuleLabelAllStoreViews">Free Shipping in conditions</data> <data key="defaultStoreView">Free Shipping in conditions</data> </entity> + + <entity name="catalogRuleWithInvalid" type="catalogRule"> + <data key="name" unique="suffix">CatalogPriceRule</data> + <data key="description">Catalog Price Rule Description</data> + <data key="is_active">1</data> + <array key="customer_group_ids"> + <item>0</item> + </array> + <array key="website_ids"> + <item>1</item> + </array> + <data key="simple_action">by_percent</data> + <data key="discount_amount">10</data> + <data key="priority">ten</data> + </entity> </entities> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Section/AdminNewCatalogPriceRuleSection.xml b/app/code/Magento/CatalogRule/Test/Mftf/Section/AdminNewCatalogPriceRuleSection.xml index c736dd8dde2cb..61f2e7ac55ef7 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Section/AdminNewCatalogPriceRuleSection.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Section/AdminNewCatalogPriceRuleSection.xml @@ -37,6 +37,8 @@ <element name="priority" type="input" selector="[name='sort_order']"/> <element name="conditionsTab" type="block" selector="[data-index='block_promo_catalog_edit_tab_conditions']"/> <element name="actionsTab" type="block" selector="[data-index='actions']"/> + + <element name="fieldError" type="text" selector="//input[@name='{{fieldName}}']/following-sibling::label[@class='admin__field-error']" parameterized="true"/> </section> <section name="AdminNewCatalogPriceRuleActions"> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest.xml index 09b924603c54a..ee61af180d350 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest.xml @@ -196,4 +196,27 @@ <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$$createProduct.name$$" stepKey="seeProduct2"/> <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$123.00" stepKey="seeDiscountedPrice2"/> </test> + + <test name="AdminCreateCatalogPriceRuleWithInvalidDataTest"> + <annotations> + <features value="CatalogRule"/> + <stories value="Create Catalog Price Rule"/> + <title value="Admin can not create catalog price rule with the invalid data"/> + <description value="Admin can not create catalog price rule with the invalid data"/> + <severity value="MAJOR"/> + <group value="CatalogRule"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> + </after> + + <actionGroup ref="newCatalogPriceRuleWithInvalidData" stepKey="createNewPriceRule"> + <argument name="catalogRule" value="catalogRuleWithInvalid"/> + </actionGroup> + + <see selector="{{AdminNewCatalogPriceRule.fieldError('sort_order')}}" userInput="Please enter a valid number in this field." stepKey="seeSortOrderError"/> + </test> </tests> diff --git a/app/code/Magento/CatalogRule/view/adminhtml/ui_component/catalog_rule_form.xml b/app/code/Magento/CatalogRule/view/adminhtml/ui_component/catalog_rule_form.xml index 35fd7d8a192f4..59e3c4668e8a4 100644 --- a/app/code/Magento/CatalogRule/view/adminhtml/ui_component/catalog_rule_form.xml +++ b/app/code/Magento/CatalogRule/view/adminhtml/ui_component/catalog_rule_form.xml @@ -209,8 +209,7 @@ </argument> <settings> <validation> - <rule name="validate-number" xsi:type="boolean">true</rule> - <rule name="validate-zero-or-greater" xsi:type="boolean">true</rule> + <rule name="validate-digits" xsi:type="boolean">true</rule> </validation> <dataType>text</dataType> <label translate="true">Priority</label> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml index c1ec728a6cfb9..8b1f27812b6cd 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml @@ -457,4 +457,13 @@ <requiredEntity type="SalesRuleLabel">SalesRuleLabelDefault</requiredEntity> <requiredEntity type="SalesRuleLabel">SalesRuleLabelStore1</requiredEntity> </entity> + + <entity name="TestSalesRuleWithInvalidData" type="SalesRule"> + <data key="userPerCustomer">one</data> + <data key="userPerCoupon">one</data> + <data key="priority">one</data> + <data key="discountStep">one</data> + <data key="discountAmount">one</data> + <data key="maximumQtyDiscount">one</data> + </entity> </entities> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml b/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml index 3849d153be465..a45baad7f0910 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml @@ -98,5 +98,7 @@ <element name="couponQty" type="input" selector="#coupons_qty"/> <element name="generateCouponsButton" type="button" selector="#coupons_generate_button" timeout="30"/> <element name="generatedCouponByIndex" type="text" selector="#couponCodesGrid_table > tbody > tr:nth-child({{var}}) > td.col-code" parameterized="true"/> + + <element name="fieldError" type="text" selector="//input[@name='{{fieldName}}']/following-sibling::label[@class='admin__field-error']" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateInvalidRuleTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateInvalidRuleTest.xml new file mode 100644 index 0000000000000..620112e323ff5 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateInvalidRuleTest.xml @@ -0,0 +1,53 @@ +<?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="AdminCreateInvalidRuleTest"> + <annotations> + <features value="SalesRule"/> + <stories value="Create cart price rule with invalid data"/> + <title value="Admin can not create rule with invalid data"/> + <description value="Admin can not create rule with invalid data"/> + <severity value="MAJOR"/> + <group value="SalesRule"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + + <after> + <actionGroup ref="logout" stepKey="adminLogout"/> + </after> + + <amOnPage url="{{AdminCartPriceRulesPage.url}}" stepKey="amOnCartPriceList"/> + <waitForPageLoad stepKey="waitForRulesPage"/> + <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> + + <click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" stepKey="clickToExpandActions"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="Buy X get Y free (discount amount is Y)" stepKey="selectActionType"/> + <fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="{{TestSalesRuleWithInvalidData.discountAmount}}" stepKey="fillDiscountAmount"/> + <fillField selector="{{AdminCartPriceRulesFormSection.maximumQtyDiscount}}" userInput="{{TestSalesRuleWithInvalidData.maximumQtyDiscount}}" stepKey="fillDiscountQty"/> + <fillField selector="{{AdminCartPriceRulesFormSection.discountStep}}" userInput="{{TestSalesRuleWithInvalidData.discountStep}}" stepKey="fillDiscountStep"/> + + <fillField selector="{{AdminCartPriceRulesFormSection.userPerCustomer}}" userInput="{{TestSalesRuleWithInvalidData.userPerCustomer}}" stepKey="fillUsePerCustomer"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="Specific Coupon" stepKey="selectCouponType"/> + <fillField selector="{{AdminCartPriceRulesFormSection.userPerCoupon}}" userInput="{{TestSalesRuleWithInvalidData.userPerCoupon}}" stepKey="fillUsePerCoupon"/> + <fillField selector="{{AdminCartPriceRulesFormSection.priority}}" userInput="{{TestSalesRuleWithInvalidData.priority}}" stepKey="fillPriority"/> + + <click selector="{{AdminCartPriceRulesFormSection.save}}" stepKey="clickSaveButton"/> + + <see selector="{{AdminNewCatalogPriceRule.fieldError('uses_per_coupon')}}" userInput="Please enter a valid number in this field." stepKey="seePerCouponError"/> + <see selector="{{AdminNewCatalogPriceRule.fieldError('uses_per_customer')}}" userInput="Please enter a valid number in this field." stepKey="seePerCustomerError"/> + <see selector="{{AdminNewCatalogPriceRule.fieldError('sort_order')}}" userInput="Please enter a valid number in this field." stepKey="seePriorityError"/> + <see selector="{{AdminNewCatalogPriceRule.fieldError('discount_amount')}}" userInput="Please enter a valid number in this field." stepKey="seeDiscountAmountError"/> + <see selector="{{AdminNewCatalogPriceRule.fieldError('discount_qty')}}" userInput="Please enter a valid number in this field." stepKey="seeMaximumQtyError"/> + <see selector="{{AdminNewCatalogPriceRule.fieldError('discount_step')}}" userInput="Please enter a valid number in this field." stepKey="seeDiscountStepError"/> + </test> +</tests> diff --git a/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml b/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml index 63faf29afd769..e1c12f45012ee 100644 --- a/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml +++ b/app/code/Magento/SalesRule/view/adminhtml/ui_component/sales_rule_form.xml @@ -363,8 +363,7 @@ </argument> <settings> <validation> - <rule name="validate-number" xsi:type="boolean">true</rule> - <rule name="validate-zero-or-greater" xsi:type="boolean">true</rule> + <rule name="validate-digits" xsi:type="boolean">true</rule> </validation> <dataType>text</dataType> <label translate="true">Priority</label> From 87e72e92b58c2dd8f29faf3d7daab9caa62d9dea Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Wed, 23 Oct 2019 14:41:16 -0500 Subject: [PATCH 059/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- .../CatalogRule/Model/Indexer/IndexBuilder.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index 1657a18b55aaf..9e93e3f93f5ef 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -298,12 +298,11 @@ protected function doReindexByIds($ids) continue; } - $rule->setProductsFilter($ids); - $matchingProductIds = $rule->getMatchingProductIds(); - $matchingProductIds = array_intersect_key($matchingProductIds, array_flip($ids)); - foreach ($matchingProductIds as $matchingProductId => $validationByWebsite) { - $websiteIds = array_keys(array_filter($validationByWebsite)); - $this->assignProductToRule($rule, $matchingProductId, $websiteIds); + foreach ($ids as $productId) { + $rule->setProductsFilter([$productId]); + if ($rule->getMatchingProductIds()) { + $this->assignProductToRule($rule, $productId, $ruleWebsiteIds); + } } } From 0ccc1eeff89965ec15eaf4d72f06613c2eb506e8 Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Wed, 23 Oct 2019 17:40:19 -0500 Subject: [PATCH 060/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- .../Model/Indexer/IndexBuilder.php | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index 9e93e3f93f5ef..fe5e6c7f24c4d 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -292,25 +292,26 @@ protected function doReindexByIds($ids) /** @var Rule[] $activeRules */ $activeRules = $this->getActiveRules()->getItems(); - foreach ($activeRules as $rule) { - $ruleWebsiteIds = $rule->getWebsiteIds(); - if (!$rule->getIsActive() || empty($ruleWebsiteIds)) { - continue; - } + foreach ($ids as $productId) { + foreach ($activeRules as $activeRule) { + $rule = clone $activeRule; + $rule->setProductsFilter($productId); + $matchedProductIds = $rule->getMatchingProductIds(); + if (!isset($matchedProductIds[$productId])) { + continue; + } - foreach ($ids as $productId) { - $rule->setProductsFilter([$productId]); - if ($rule->getMatchingProductIds()) { - $this->assignProductToRule($rule, $productId, $ruleWebsiteIds); + $websiteIds = array_keys(array_filter($matchedProductIds[$productId])); + if (empty($websiteIds)) { + continue; } + + $this->assignProductToRule($rule, $productId, $websiteIds); } - } - foreach ($ids as $productId) { $this->cleanProductPriceIndex([$productId]); $this->reindexRuleProductPrice->execute($this->batchCount, $productId); } - $this->reindexRuleGroupWebsite->execute(); } From 296a0905267003b033bc9d71ecd1a4f8921e1f3d Mon Sep 17 00:00:00 2001 From: phil <philkun@users.noreply.github.com> Date: Thu, 24 Oct 2019 09:41:54 +0100 Subject: [PATCH 061/595] Allow autoplay for vimeo thumb click Currently on click a video thumb the video does not start, but the code to autoplay is incorrect since 2017 https://developers.google.com/web/updates/2017/09/autoplay-policy-changes --- .../Magento/ProductVideo/view/frontend/web/js/load-player.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/ProductVideo/view/frontend/web/js/load-player.js b/app/code/Magento/ProductVideo/view/frontend/web/js/load-player.js index ede0d2019309d..aead951043448 100644 --- a/app/code/Magento/ProductVideo/view/frontend/web/js/load-player.js +++ b/app/code/Magento/ProductVideo/view/frontend/web/js/load-player.js @@ -344,6 +344,7 @@ define([ .attr('mozallowfullscreen', '') .attr('allowfullscreen', '') .attr('referrerPolicy', 'origin') + .attr('allow', 'autoplay') ); this._player = window.$f(this.element.children(':first')[0]); From b944f82281450c6dc89189e034e403e1e7417992 Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Thu, 24 Oct 2019 09:29:34 -0500 Subject: [PATCH 062/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- .../Model/Indexer/IndexBuilder.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index fe5e6c7f24c4d..2d8ef2b52d2c5 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -295,18 +295,17 @@ protected function doReindexByIds($ids) foreach ($ids as $productId) { foreach ($activeRules as $activeRule) { $rule = clone $activeRule; - $rule->setProductsFilter($productId); + $rule->setProductsFilter($ids); $matchedProductIds = $rule->getMatchingProductIds(); - if (!isset($matchedProductIds[$productId])) { - continue; + $matchedProductIds = array_intersect_key($matchedProductIds, array_flip($ids)); + foreach ($matchedProductIds as $matchedProductId => $validationByWebsite) { + $websiteIds = array_keys(array_filter($validationByWebsite)); + if (empty($websiteIds)) { + continue; + } + + $this->assignProductToRule($rule, $matchedProductId, $websiteIds); } - - $websiteIds = array_keys(array_filter($matchedProductIds[$productId])); - if (empty($websiteIds)) { - continue; - } - - $this->assignProductToRule($rule, $productId, $websiteIds); } $this->cleanProductPriceIndex([$productId]); From 1c96b6d5b45e79531241a77433ff185cfdf34268 Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Thu, 24 Oct 2019 10:47:07 -0500 Subject: [PATCH 063/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- .../Model/Indexer/IndexBuilder.php | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index 2d8ef2b52d2c5..ae76a20cdf762 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -292,25 +292,30 @@ protected function doReindexByIds($ids) /** @var Rule[] $activeRules */ $activeRules = $this->getActiveRules()->getItems(); - foreach ($ids as $productId) { - foreach ($activeRules as $activeRule) { - $rule = clone $activeRule; - $rule->setProductsFilter($ids); - $matchedProductIds = $rule->getMatchingProductIds(); - $matchedProductIds = array_intersect_key($matchedProductIds, array_flip($ids)); - foreach ($matchedProductIds as $matchedProductId => $validationByWebsite) { - $websiteIds = array_keys(array_filter($validationByWebsite)); - if (empty($websiteIds)) { - continue; - } - - $this->assignProductToRule($rule, $matchedProductId, $websiteIds); + foreach ($activeRules as $activeRule) { + $rule = clone $activeRule; + $rule->setProductsFilter($ids); + $matchedProductIds = $rule->getMatchingProductIds(); + if (empty($matchedProductIds)) { + continue; + } + + $matchedProductIds = array_intersect_key($matchedProductIds, array_flip($ids)); + foreach ($matchedProductIds as $matchedProductId => $validationByWebsite) { + $websiteIds = array_keys(array_filter($validationByWebsite)); + if (empty($websiteIds)) { + continue; } + + $this->assignProductToRule($rule, $matchedProductId, $websiteIds); } + } + foreach ($ids as $productId) { $this->cleanProductPriceIndex([$productId]); $this->reindexRuleProductPrice->execute($this->batchCount, $productId); } + $this->reindexRuleGroupWebsite->execute(); } From 10626e06c1ee25471e9338e32b866bb0706c3c2f Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Fri, 18 Oct 2019 18:02:22 -0500 Subject: [PATCH 064/595] MC-21807: Implement control over minimum_should_match for elasticsearch queries - Add ability to configure and apply minimum_should_match --- .../FieldsMappingPreprocessorInterface.php | 22 ++ .../Config/Backend/MinimumShouldMatch.php | 41 +++ .../SearchAdapter/Query/Builder/Match.php | 14 +- .../Config/Backend/MinimumShouldMatchTest.php | 75 ++++++ .../SearchAdapter/Query/Builder/MatchTest.php | 240 ++++++++++-------- .../Elasticsearch/etc/adminhtml/system.xml | 20 +- app/code/Magento/Elasticsearch/etc/config.xml | 2 + .../FieldMapper/AddDefaultSearchField.php | 33 +++ .../CopySearchableFieldsToSearchField.php | 52 ++++ .../Model/Client/Elasticsearch.php | 44 +++- .../FieldMapper/AddDefaultSearchFieldTest.php | 85 +++++++ .../CopySearchableFieldsToSearchFieldTest.php | 136 ++++++++++ .../Unit/Model/Client/ElasticsearchTest.php | 6 +- .../Elasticsearch6/etc/adminhtml/system.xml | 12 +- .../Magento/Elasticsearch6/etc/config.xml | 1 + app/code/Magento/Elasticsearch6/etc/di.xml | 9 + 16 files changed, 675 insertions(+), 117 deletions(-) create mode 100644 app/code/Magento/Elasticsearch/Model/Adapter/FieldsMappingPreprocessorInterface.php create mode 100644 app/code/Magento/Elasticsearch/Model/Config/Backend/MinimumShouldMatch.php create mode 100644 app/code/Magento/Elasticsearch/Test/Unit/Model/Config/Backend/MinimumShouldMatchTest.php create mode 100644 app/code/Magento/Elasticsearch6/Model/Adapter/FieldMapper/AddDefaultSearchField.php create mode 100644 app/code/Magento/Elasticsearch6/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchField.php create mode 100644 app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/AddDefaultSearchFieldTest.php create mode 100644 app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchFieldTest.php diff --git a/app/code/Magento/Elasticsearch/Model/Adapter/FieldsMappingPreprocessorInterface.php b/app/code/Magento/Elasticsearch/Model/Adapter/FieldsMappingPreprocessorInterface.php new file mode 100644 index 0000000000000..6eea6560f7273 --- /dev/null +++ b/app/code/Magento/Elasticsearch/Model/Adapter/FieldsMappingPreprocessorInterface.php @@ -0,0 +1,22 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch\Model\Adapter; + +/** + * Modifies fields mapping before save + */ +interface FieldsMappingPreprocessorInterface +{ + /** + * Modifies fields mapping before save + * + * @param array $mapping + * @return array + */ + public function process(array $mapping): array; +} diff --git a/app/code/Magento/Elasticsearch/Model/Config/Backend/MinimumShouldMatch.php b/app/code/Magento/Elasticsearch/Model/Config/Backend/MinimumShouldMatch.php new file mode 100644 index 0000000000000..434270c62d3d9 --- /dev/null +++ b/app/code/Magento/Elasticsearch/Model/Config/Backend/MinimumShouldMatch.php @@ -0,0 +1,41 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch\Model\Config\Backend; + +use Magento\Framework\App\Config\Value; +use Magento\Framework\Exception\LocalizedException; + +/** + * Elasticsearch minimum should match data model + */ +class MinimumShouldMatch extends Value +{ + /** + * @inheritDoc + */ + public function beforeSave() + { + $result = parent::beforeSave(); + $this->validateValue(); + return $result; + } + + /** + * Validates config value + * + * @throws LocalizedException + */ + public function validateValue(): void + { + if (strlen($this->getValue()) && !preg_match('/^((\d+<)?-?\d+%?\s?)+$/', $this->getValue())) { + throw new LocalizedException( + __('Value for the field "%1" was not saved because of the incorrect format.', __('Minimum Terms to Match')) + ); + } + } +} diff --git a/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php b/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php index ddf75c0a78e25..8a44b58d35fb8 100644 --- a/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php +++ b/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php @@ -7,6 +7,7 @@ use Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\AttributeProvider; use Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\ResolverInterface as TypeResolver; +use Magento\Elasticsearch\Model\Config; use Magento\Elasticsearch\SearchAdapter\Query\ValueTransformerPool; use Magento\Framework\App\ObjectManager; use Magento\Framework\Search\Request\Query\BoolExpression; @@ -50,6 +51,10 @@ class Match implements QueryInterface * @var ValueTransformerPool */ private $valueTransformerPool; + /** + * @var Config + */ + private $config; /** * @param FieldMapperInterface $fieldMapper @@ -57,13 +62,15 @@ class Match implements QueryInterface * @param AttributeProvider|null $attributeProvider * @param TypeResolver|null $fieldTypeResolver * @param ValueTransformerPool|null $valueTransformerPool + * @param Config|null $config */ public function __construct( FieldMapperInterface $fieldMapper, array $preprocessorContainer, AttributeProvider $attributeProvider = null, TypeResolver $fieldTypeResolver = null, - ValueTransformerPool $valueTransformerPool = null + ValueTransformerPool $valueTransformerPool = null, + Config $config = null ) { $this->fieldMapper = $fieldMapper; $this->preprocessorContainer = $preprocessorContainer; @@ -73,6 +80,7 @@ public function __construct( ->get(TypeResolver::class); $this->valueTransformerPool = $valueTransformerPool ?? ObjectManager::getInstance() ->get(ValueTransformerPool::class); + $this->config = $config ?? ObjectManager::getInstance()->get(Config::class); } /** @@ -83,11 +91,15 @@ public function build(array $selectQuery, RequestQueryInterface $requestQuery, $ $queryValue = $this->prepareQuery($requestQuery->getValue(), $conditionType); $queries = $this->buildQueries($requestQuery->getMatches(), $queryValue); $requestQueryBoost = $requestQuery->getBoost() ?: 1; + $minimumShouldMatch = $this->config->getElasticsearchConfigData('minimum_should_match'); foreach ($queries as $query) { $queryBody = $query['body']; $matchKey = isset($queryBody['match_phrase']) ? 'match_phrase' : 'match'; foreach ($queryBody[$matchKey] as $field => $matchQuery) { $matchQuery['boost'] = $requestQueryBoost + $matchQuery['boost']; + if ($minimumShouldMatch) { + $matchQuery['minimum_should_match'] = $minimumShouldMatch; + } $queryBody[$matchKey][$field] = $matchQuery; } $selectQuery['bool'][$query['condition']][] = $queryBody; diff --git a/app/code/Magento/Elasticsearch/Test/Unit/Model/Config/Backend/MinimumShouldMatchTest.php b/app/code/Magento/Elasticsearch/Test/Unit/Model/Config/Backend/MinimumShouldMatchTest.php new file mode 100644 index 0000000000000..e8f3621eda25d --- /dev/null +++ b/app/code/Magento/Elasticsearch/Test/Unit/Model/Config/Backend/MinimumShouldMatchTest.php @@ -0,0 +1,75 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch\Test\Unit\Model\Config\Backend; + +use Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\TestCase; +use Throwable; + +/** + * Test elasticsearch minimum should match data model + */ +class MinimumShouldMatchTest extends TestCase +{ + /** + * @var MinimumShouldMatch + */ + private $model; + + /** + * @inheritDoc + */ + protected function setUp() + { + $objectManager = new ObjectManager($this); + $this->model = $objectManager->getObject(MinimumShouldMatch::class); + parent::setUp(); + } + + /** + * @param string $value + * @param bool $valid + * @dataProvider validateValueDataProvider + * @throws LocalizedException + */ + public function testValidateValue(string $value, bool $valid) + { + $this->model->setValue($value); + try { + $this->model->validateValue(); + } catch (Throwable $exception) { + $this->assertFalse($valid); + return; + } + $this->assertTrue($valid); + } + + /** + * @return array + */ + public function validateValueDataProvider(): array + { + return [ + ['3', true], + ['-2', true], + ['75%', true], + ['-25%', true], + ['3<90%', true], + ['2<-25% 9<-3', true], + ['90%<3', false], + ['<90%', false], + ['90%<', false], + ['-3<2', false], + ['two', false], + ['2<', false], + ['<2', false], + ]; + } +} diff --git a/app/code/Magento/Elasticsearch/Test/Unit/SearchAdapter/Query/Builder/MatchTest.php b/app/code/Magento/Elasticsearch/Test/Unit/SearchAdapter/Query/Builder/MatchTest.php index d0ffc6debcd8a..705b06e9769f2 100644 --- a/app/code/Magento/Elasticsearch/Test/Unit/SearchAdapter/Query/Builder/MatchTest.php +++ b/app/code/Magento/Elasticsearch/Test/Unit/SearchAdapter/Query/Builder/MatchTest.php @@ -9,14 +9,19 @@ use Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\AttributeProvider; use Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\ResolverInterface as TypeResolver; use Magento\Elasticsearch\Model\Adapter\FieldMapperInterface; +use Magento\Elasticsearch\Model\Config; use Magento\Elasticsearch\SearchAdapter\Query\Builder\Match as MatchQueryBuilder; use Magento\Elasticsearch\SearchAdapter\Query\ValueTransformerInterface; use Magento\Elasticsearch\SearchAdapter\Query\ValueTransformerPool; use Magento\Framework\Search\Request\Query\Match as MatchRequestQuery; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use PHPUnit\Framework\MockObject\MockObject as MockObject; +use PHPUnit\Framework\TestCase; -class MatchTest extends \PHPUnit\Framework\TestCase +/** + * Test Match query builder + */ +class MatchTest extends TestCase { /** * @var AttributeProvider|MockObject @@ -32,6 +37,14 @@ class MatchTest extends \PHPUnit\Framework\TestCase * @var MatchQueryBuilder */ private $matchQueryBuilder; + /** + * @var MockObject + */ + private $config; + /** + * @var MockObject + */ + private $fieldMapper; /** * @inheritdoc @@ -40,22 +53,25 @@ protected function setUp() { $this->attributeProvider = $this->createMock(AttributeProvider::class); $this->fieldTypeResolver = $this->createMock(TypeResolver::class); - + $this->config = $this->createMock(Config::class); + $this->fieldMapper = $this->getMockForAbstractClass(FieldMapperInterface::class); + $this->fieldMapper->method('getFieldName') + ->willReturnArgument(0); $valueTransformerPoolMock = $this->createMock(ValueTransformerPool::class); $valueTransformerMock = $this->createMock(ValueTransformerInterface::class); $valueTransformerPoolMock->method('get') ->willReturn($valueTransformerMock); $valueTransformerMock->method('transform') ->willReturnArgument(0); - $this->matchQueryBuilder = (new ObjectManager($this))->getObject( MatchQueryBuilder::class, [ - 'fieldMapper' => $this->getFieldMapper(), + 'fieldMapper' => $this->fieldMapper, 'preprocessorContainer' => [], 'attributeProvider' => $this->attributeProvider, 'fieldTypeResolver' => $this->fieldTypeResolver, 'valueTransformerPool' => $valueTransformerPoolMock, + 'config' => $this->config, ] ); } @@ -63,130 +79,146 @@ protected function setUp() /** * Tests that method constructs a correct select query. * - * @see MatchQueryBuilder::build + * @param string $searchQuery + * @param array $fields + * @param array $expected + * @param string|null $minimumShouldMatch + * @dataProvider buildDataProvider */ - public function testBuild() - { - $attributeAdapter = $this->createMock(AttributeAdapter::class); - $this->attributeProvider->expects($this->once()) - ->method('getByAttributeCode') - ->with('some_field') - ->willReturn($attributeAdapter); - $this->fieldTypeResolver->expects($this->once()) - ->method('getFieldType') - ->with($attributeAdapter) - ->willReturn('text'); - - $rawQueryValue = 'query_value'; - $selectQuery = $this->matchQueryBuilder->build([], $this->getMatchRequestQuery($rawQueryValue), 'not'); + public function testBuild( + string $searchQuery, + array $fields, + array $expected, + ?string $minimumShouldMatch = null + ) { + $this->config->method('getElasticsearchConfigData') + ->with('minimum_should_match') + ->willReturn($minimumShouldMatch); + + foreach ($fields as $field) { + $this->mockAttribute($field['field']); + } + + $requestQuery = new MatchRequestQuery('match', $searchQuery, 1, $fields); + $query = $this->matchQueryBuilder->build([], $requestQuery, 'should'); $expectedSelectQuery = [ 'bool' => [ - 'must_not' => [ + 'should' => $expected, + ], + ]; + + $this->assertEquals( + $expectedSelectQuery, + $query + ); + } + + /** + * @return array + */ + public function buildDataProvider(): array + { + return [ + 'match query without minimum_should_match' => [ + 'fitness bottle', + [ + [ + 'field' => 'name', + 'boost' => 5 + ] + ], + [ + [ + 'match' => [ + 'name' => [ + 'query' => 'fitness bottle', + 'boost' => 6, + ], + ], + ], + ] + ], + 'match_phrase query without minimum_should_match' => [ + '"fitness bottle"', + [ + [ + 'field' => 'name', + 'boost' => 5 + ] + ], + [ + [ + 'match_phrase' => [ + 'name' => [ + 'query' => 'fitness bottle', + 'boost' => 6, + ], + ], + ], + ] + ], + 'match query with minimum_should_match' => [ + 'fitness bottle', + [ + [ + 'field' => 'name', + 'boost' => 5 + ] + ], + [ [ 'match' => [ - 'some_field' => [ - 'query' => $rawQueryValue, - 'boost' => 43, + 'name' => [ + 'query' => 'fitness bottle', + 'boost' => 6, + 'minimum_should_match' => '2<75%', ], ], ], ], + '2<75%' ], + 'match_phrase query with minimum_should_match' => [ + '"fitness bottle"', + [ + [ + 'field' => 'name', + 'boost' => 5 + ] + ], + [ + [ + 'match_phrase' => [ + 'name' => [ + 'query' => 'fitness bottle', + 'boost' => 6, + 'minimum_should_match' => '2<75%', + ], + ], + ], + ], + '2<75%' + ] ]; - $this->assertEquals($expectedSelectQuery, $selectQuery); } /** - * Tests that method constructs a correct "match" query depending on query value. - * - * @dataProvider matchProvider + * Mock attribute * - * @param string $rawQueryValue - * @param string $queryValue - * @param string $match + * @param string $attributeCode + * @param string $type */ - public function testBuildMatchQuery($rawQueryValue, $queryValue, $match) + private function mockAttribute(string $attributeCode, string $type = 'text') { $attributeAdapter = $this->createMock(AttributeAdapter::class); $this->attributeProvider->expects($this->once()) ->method('getByAttributeCode') - ->with('some_field') + ->with($attributeCode) ->willReturn($attributeAdapter); $this->fieldTypeResolver->expects($this->once()) ->method('getFieldType') ->with($attributeAdapter) - ->willReturn('text'); - - $query = $this->matchQueryBuilder->build([], $this->getMatchRequestQuery($rawQueryValue), 'should'); - - $expectedSelectQuery = [ - 'bool' => [ - 'should' => [ - [ - $match => [ - 'some_field' => [ - 'query' => $queryValue, - 'boost' => 43, - ], - ], - ], - ], - ], - ]; - - $this->assertEquals( - $expectedSelectQuery, - $query, - sprintf('Wrong "match" query. Should be processed with "%s"', $match) - ); - } - - /** - * @return array - */ - public function matchProvider() - { - return [ - ['query_value', 'query_value', 'match'], - ['"query value"', 'query value', 'match_phrase'], - ]; - } - - /** - * Gets fieldMapper mock object. - * - * @return FieldMapperInterface|MockObject - */ - private function getFieldMapper() - { - $fieldMapper = $this->getMockBuilder(FieldMapperInterface::class) - ->getMockForAbstractClass(); - - $fieldMapper->method('getFieldName') - ->with('some_field', ['type' => FieldMapperInterface::TYPE_QUERY]) - ->willReturnArgument(0); - - return $fieldMapper; - } - - /** - * Gets RequestQuery mock object. - * - * @param string $rawQueryValue - * @return MatchRequestQuery|MockObject - */ - private function getMatchRequestQuery($rawQueryValue) - { - $matchRequestQuery = $this->getMockBuilder(MatchRequestQuery::class) - ->disableOriginalConstructor() - ->getMock(); - - $matchRequestQuery->method('getValue') - ->willReturn($rawQueryValue); - $matchRequestQuery->method('getMatches') - ->willReturn([['field' => 'some_field', 'boost' => 42]]); - - return $matchRequestQuery; + ->willReturn($type); } } diff --git a/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml b/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml index dd42b408ff75e..1f61a48db9bfa 100644 --- a/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml +++ b/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml @@ -55,7 +55,15 @@ <field id="engine">elasticsearch</field> </depends> </field> - <field id="elasticsearch_test_connect_wizard" translate="button_label" sortOrder="68" showInDefault="1" showInWebsite="0" showInStore="0"> + <field id="elasticsearch_minimum_should_match" translate="label" type="text" sortOrder="68" showInDefault="1" showInWebsite="0" showInStore="0"> + <label>Minimum Terms to Match</label> + <depends> + <field id="engine">elasticsearch</field> + </depends> + <comment><![CDATA[See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-minimum-should-match.html">here</a> for possible values.]]></comment> + <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> + </field> + <field id="elasticsearch_test_connect_wizard" translate="button_label" sortOrder="69" showInDefault="1" showInWebsite="0" showInStore="0"> <label/> <button_label>Test Connection</button_label> <frontend_model>Magento\Elasticsearch\Block\Adminhtml\System\Config\TestConnection</frontend_model> @@ -109,7 +117,15 @@ <field id="engine">elasticsearch5</field> </depends> </field> - <field id="elasticsearch5_test_connect_wizard" translate="button_label" sortOrder="68" showInDefault="1" showInWebsite="0" showInStore="0"> + <field id="elasticsearch5_minimum_should_match" translate="label" type="text" sortOrder="68" showInDefault="1" showInWebsite="0" showInStore="0"> + <label>Minimum Terms to Match</label> + <depends> + <field id="engine">elasticsearch5</field> + </depends> + <comment><![CDATA[See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-minimum-should-match.html">here</a> for possible values.]]></comment> + <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> + </field> + <field id="elasticsearch5_test_connect_wizard" translate="button_label" sortOrder="69" showInDefault="1" showInWebsite="0" showInStore="0"> <label/> <button_label>Test Connection</button_label> <frontend_model>Magento\Elasticsearch\Block\Adminhtml\System\Config\Elasticsearch5\TestConnection</frontend_model> diff --git a/app/code/Magento/Elasticsearch/etc/config.xml b/app/code/Magento/Elasticsearch/etc/config.xml index 0e01aba5ed857..9df21978b5414 100644 --- a/app/code/Magento/Elasticsearch/etc/config.xml +++ b/app/code/Magento/Elasticsearch/etc/config.xml @@ -14,12 +14,14 @@ <elasticsearch_index_prefix>magento2</elasticsearch_index_prefix> <elasticsearch_enable_auth>0</elasticsearch_enable_auth> <elasticsearch_server_timeout>15</elasticsearch_server_timeout> + <elasticsearch_minimum_should_match></elasticsearch_minimum_should_match> <elasticsearch5_server_hostname>localhost</elasticsearch5_server_hostname> <elasticsearch5_server_port>9200</elasticsearch5_server_port> <elasticsearch5_index_prefix>magento2</elasticsearch5_index_prefix> <elasticsearch5_enable_auth>0</elasticsearch5_enable_auth> <elasticsearch5_server_timeout>15</elasticsearch5_server_timeout> + <elasticsearch5_minimum_should_match></elasticsearch5_minimum_should_match> </search> </catalog> </default> diff --git a/app/code/Magento/Elasticsearch6/Model/Adapter/FieldMapper/AddDefaultSearchField.php b/app/code/Magento/Elasticsearch6/Model/Adapter/FieldMapper/AddDefaultSearchField.php new file mode 100644 index 0000000000000..27767f6567d96 --- /dev/null +++ b/app/code/Magento/Elasticsearch6/Model/Adapter/FieldMapper/AddDefaultSearchField.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch6\Model\Adapter\FieldMapper; + +use Magento\Elasticsearch\Model\Adapter\FieldsMappingPreprocessorInterface; + +/** + * Add default search field (catch all field) to the mapping. + */ +class AddDefaultSearchField implements FieldsMappingPreprocessorInterface +{ + /** + * catch all field name + */ + private const NAME = '_search'; + /** + * Add default search field (catch all field) to the fields. + * + * Emulates catch all field (_all) for elasticsearch version 6.0+ + * + * @param array $mapping + * @return array + */ + public function process(array $mapping): array + { + return [self::NAME => ['type' => 'text']] + $mapping; + } +} diff --git a/app/code/Magento/Elasticsearch6/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchField.php b/app/code/Magento/Elasticsearch6/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchField.php new file mode 100644 index 0000000000000..6179eacba5ad7 --- /dev/null +++ b/app/code/Magento/Elasticsearch6/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchField.php @@ -0,0 +1,52 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch6\Model\Adapter\FieldMapper; + +use Magento\Elasticsearch\Model\Adapter\FieldsMappingPreprocessorInterface; + +/** + * Add "copy_to" parameter for default search field to index fields. + */ +class CopySearchableFieldsToSearchField implements FieldsMappingPreprocessorInterface +{ + /** + * List of field types to copy + */ + private const FIELD_TYPES = ['text', 'keyword']; + /** + * Add "copy_to" parameter for default search field to index fields. + * + * Emulates catch all field (_all) for elasticsearch version 6.0+ + * + * @param array $mapping + * @return array + */ + public function process(array $mapping): array + { + foreach ($mapping as $field => $definition) { + if ($this->isSearchable($definition)) { + $definition['copy_to'][] = '_search'; + $mapping[$field] = $definition; + } + } + return $mapping; + } + + /** + * Determine if the field is searchable by mapping + * + * The field is searchable if it's indexed and its mapping type is either "text" or "keyword" + * + * @param array $mapping + * @return bool + */ + private function isSearchable(array $mapping): bool + { + return in_array($mapping['type'] ?? null, self::FIELD_TYPES) && (($mapping['index'] ?? true) !== false); + } +} diff --git a/app/code/Magento/Elasticsearch6/Model/Client/Elasticsearch.php b/app/code/Magento/Elasticsearch6/Model/Client/Elasticsearch.php index 34129a5af0012..c72ce4776909e 100644 --- a/app/code/Magento/Elasticsearch6/Model/Client/Elasticsearch.php +++ b/app/code/Magento/Elasticsearch6/Model/Client/Elasticsearch.php @@ -5,8 +5,9 @@ */ namespace Magento\Elasticsearch6\Model\Client; -use Magento\Framework\Exception\LocalizedException; use Magento\AdvancedSearch\Model\Client\ClientInterface; +use Magento\Elasticsearch\Model\Adapter\FieldsMappingPreprocessorInterface; +use Magento\Framework\Exception\LocalizedException; /** * Elasticsearch client @@ -29,17 +30,23 @@ class Elasticsearch implements ClientInterface * @var bool */ private $pingResult; + /** + * @var FieldsMappingPreprocessorInterface[] + */ + private $fieldsMappingPreprocessors; /** * Initialize Elasticsearch Client * * @param array $options * @param \Elasticsearch\Client|null $elasticsearchClient + * @param FieldsMappingPreprocessorInterface[] $fieldsMappingPreprocessors * @throws LocalizedException */ public function __construct( $options = [], - $elasticsearchClient = null + $elasticsearchClient = null, + $fieldsMappingPreprocessors = [] ) { if (empty($options['hostname']) || ((!empty($options['enableAuth']) && ($options['enableAuth'] == 1)) && (empty($options['username']) || empty($options['password'])))) { @@ -54,6 +61,17 @@ public function __construct( } $this->client[getmypid()] = $elasticsearchClient; $this->clientOptions = $options; + foreach ($fieldsMappingPreprocessors as $preprocessor) { + if (!$preprocessor instanceof FieldsMappingPreprocessorInterface) { + throw new \InvalidArgumentException( + sprintf( + 'Instance of FieldsMappingPreprocessorInterface is expected, got %s instead.', + get_class($preprocessor) + ) + ); + } + } + $this->fieldsMappingPreprocessors = $fieldsMappingPreprocessors; } /** @@ -249,11 +267,7 @@ public function addFieldsMapping(array $fields, $index, $entityType) 'type' => $entityType, 'body' => [ $entityType => [ - 'properties' => [ - '_search' => [ - 'type' => 'text' - ], - ], + 'properties' => [], 'dynamic_templates' => [ [ 'price_mapping' => [ @@ -291,7 +305,7 @@ public function addFieldsMapping(array $fields, $index, $entityType) ], ]; - foreach ($fields as $field => $fieldInfo) { + foreach ($this->applyFieldsMappingPreprocessors($fields) as $field => $fieldInfo) { $params['body'][$entityType]['properties'][$field] = $fieldInfo; } @@ -336,4 +350,18 @@ public function suggest($query) { return $this->getClient()->suggest($query); } + + /** + * Apply fields mapping preprocessors + * + * @param array $properties + * @return array + */ + private function applyFieldsMappingPreprocessors(array $properties): array + { + foreach ($this->fieldsMappingPreprocessors as $preprocessor) { + $properties = $preprocessor->process($properties); + } + return $properties; + } } diff --git a/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/AddDefaultSearchFieldTest.php b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/AddDefaultSearchFieldTest.php new file mode 100644 index 0000000000000..7da68168f8c97 --- /dev/null +++ b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/AddDefaultSearchFieldTest.php @@ -0,0 +1,85 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch6\Test\Unit\Model\Adapter\FieldMapper; + +use Magento\Elasticsearch6\Model\Adapter\FieldMapper\AddDefaultSearchField; +use Magento\Framework\TestFramework\Unit\BaseTestCase; + +/** + * Test mapping preprocessor AddDefaultSearchField + */ +class AddDefaultSearchFieldTest extends BaseTestCase +{ + /** + * @var AddDefaultSearchField + */ + private $model; + + /** + * @inheritDoc + */ + protected function setUp() + { + parent::setUp(); + $this->model = $this->objectManager->getObject(AddDefaultSearchField::class); + } + + /** + * Test default search field "_search" should be prepended and overwrite if exist. + * + * @dataProvider processDataProvider + * @param array $mappingBefore + * @param array $mappingAfter + */ + public function testProcess(array $mappingBefore, array $mappingAfter) + { + $this->assertEquals($mappingAfter, $this->model->process($mappingBefore)); + } + + /** + * @return array + */ + public function processDataProvider(): array + { + return [ + '_search field should be prepended if not exist' => [ + [ + 'name' => [ + 'type' => 'text' + ] + ], + [ + '_search' => [ + 'type' => 'text' + ], + 'name' => [ + 'type' => 'text' + ] + ] + ], + '_search field should be prepended and overwrite if exist' => [ + [ + 'name' => [ + 'type' => 'text', + ], + '_search' => [ + 'type' => 'keyword' + ], + ], + [ + '_search' => [ + 'type' => 'text' + ], + 'name' => [ + 'type' => 'text', + ] + ] + ] + ]; + } +} diff --git a/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchFieldTest.php b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchFieldTest.php new file mode 100644 index 0000000000000..c366e55fbbdf7 --- /dev/null +++ b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchFieldTest.php @@ -0,0 +1,136 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Elasticsearch6\Test\Unit\Model\Adapter\FieldMapper; + +use Magento\Elasticsearch6\Model\Adapter\FieldMapper\CopySearchableFieldsToSearchField; +use Magento\Framework\TestFramework\Unit\BaseTestCase; + +/** + * Test mapping preprocessor CopySearchableFieldsToSearchField + */ +class CopySearchableFieldsToSearchFieldTest extends BaseTestCase +{ + /** + * @var CopySearchableFieldsToSearchField + */ + private $model; + + /** + * @inheritDoc + */ + protected function setUp() + { + parent::setUp(); + $this->model = $this->objectManager->getObject(CopySearchableFieldsToSearchField::class); + } + + /** + * Test "copy_to" parameter should be added to searchable fields. + * + * @dataProvider processDataProvider + * @param array $mappingBefore + * @param array $mappingAfter + */ + public function testProcess(array $mappingBefore, array $mappingAfter) + { + $this->assertEquals($mappingAfter, $this->model->process($mappingBefore)); + } + + /** + * @return array + */ + public function processDataProvider(): array + { + return [ + 'index text field should be copied' => [ + [ + 'name' => [ + 'type' => 'text' + ] + ], + [ + 'name' => [ + 'type' => 'text', + 'copy_to' => [ + '_search' + ] + ] + ] + ], + 'non-index text field should not be copied' => [ + [ + 'name' => [ + 'type' => 'text', + 'index' => false + ] + ], + [ + 'name' => [ + 'type' => 'text', + 'index' => false + ] + ] + ], + 'index keyword field should be copied' => [ + [ + 'material' => [ + 'type' => 'keyword' + ] + ], + [ + 'material' => [ + 'type' => 'keyword', + 'copy_to' => [ + '_search' + ] + ] + ] + ], + 'non-index keyword field should not be copied' => [ + [ + 'country_of_manufacture' => [ + 'type' => 'keyword', + 'index' => false + ] + ], + [ + 'country_of_manufacture' => [ + 'type' => 'keyword', + 'index' => false + ] + ] + ], + 'index integer field should not be copied' => [ + [ + 'sale' => [ + 'type' => 'integer', + ] + ], + [ + 'sale' => [ + 'type' => 'integer', + ] + ] + ], + 'non-index integer field should not be copied' => [ + [ + 'position_category_1' => [ + 'type' => 'integer', + 'index' => false + ] + ], + [ + 'position_category_1' => [ + 'type' => 'integer', + 'index' => false + ] + ] + ], + ]; + } +} diff --git a/app/code/Magento/Elasticsearch6/Test/Unit/Model/Client/ElasticsearchTest.php b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Client/ElasticsearchTest.php index 487a5a886f951..b7cca13fdefef 100644 --- a/app/code/Magento/Elasticsearch6/Test/Unit/Model/Client/ElasticsearchTest.php +++ b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Client/ElasticsearchTest.php @@ -6,6 +6,7 @@ namespace Magento\Elasticsearch6\Test\Unit\Model\Client; use Magento\Elasticsearch\Model\Client\Elasticsearch as ElasticsearchClient; +use Magento\Elasticsearch6\Model\Adapter\FieldMapper\AddDefaultSearchField; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; /** @@ -86,7 +87,10 @@ protected function setUp() \Magento\Elasticsearch6\Model\Client\Elasticsearch::class, [ 'options' => $this->getOptions(), - 'elasticsearchClient' => $this->elasticsearchClientMock + 'elasticsearchClient' => $this->elasticsearchClientMock, + 'fieldsMappingPreprocessors' => [ + new AddDefaultSearchField() + ] ] ); } diff --git a/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml b/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml index 067a0acb8c908..8d22fcbc5f8f4 100644 --- a/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml +++ b/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml @@ -70,7 +70,17 @@ </depends> </field> - <field id="elasticsearch6_test_connect_wizard" translate="button_label" sortOrder="78" showInDefault="1" + <field id="elasticsearch6_minimum_should_match" translate="label" type="text" sortOrder="78" showInDefault="1" + showInWebsite="0" showInStore="0"> + <label>Minimum Terms to Match</label> + <depends> + <field id="engine">elasticsearch6</field> + </depends> + <comment><![CDATA[See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-minimum-should-match.html">here</a> for possible values.]]></comment> + <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> + </field> + + <field id="elasticsearch6_test_connect_wizard" translate="button_label" sortOrder="79" showInDefault="1" showInWebsite="0" showInStore="0"> <label/> <button_label>Test Connection</button_label> diff --git a/app/code/Magento/Elasticsearch6/etc/config.xml b/app/code/Magento/Elasticsearch6/etc/config.xml index 047ae977fdef1..3c0f28ee16eaa 100644 --- a/app/code/Magento/Elasticsearch6/etc/config.xml +++ b/app/code/Magento/Elasticsearch6/etc/config.xml @@ -14,6 +14,7 @@ <elasticsearch6_index_prefix>magento2</elasticsearch6_index_prefix> <elasticsearch6_enable_auth>0</elasticsearch6_enable_auth> <elasticsearch6_server_timeout>15</elasticsearch6_server_timeout> + <elasticsearch6_minimum_should_match></elasticsearch6_minimum_should_match> </search> </catalog> </default> diff --git a/app/code/Magento/Elasticsearch6/etc/di.xml b/app/code/Magento/Elasticsearch6/etc/di.xml index 580c61ffc8cdb..6419b0aa3ee73 100644 --- a/app/code/Magento/Elasticsearch6/etc/di.xml +++ b/app/code/Magento/Elasticsearch6/etc/di.xml @@ -111,6 +111,15 @@ </arguments> </type> + <type name="Magento\Elasticsearch6\Model\Client\Elasticsearch"> + <arguments> + <argument name="fieldsMappingPreprocessors" xsi:type="array"> + <item name="elasticsearch6_copy_searchable_fields_to_search_field" xsi:type="object">Magento\Elasticsearch6\Model\Adapter\FieldMapper\CopySearchableFieldsToSearchField</item> + <item name="elasticsearch6_add_default_search_field" xsi:type="object">Magento\Elasticsearch6\Model\Adapter\FieldMapper\AddDefaultSearchField</item> + </argument> + </arguments> + </type> + <type name="Magento\Framework\Search\Dynamic\IntervalFactory"> <arguments> <argument name="intervals" xsi:type="array"> From a1fb0843b8303d8942e3183cc92e49f4c3f54b0c Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Fri, 25 Oct 2019 17:04:52 -0500 Subject: [PATCH 065/595] MC-21948: Asynchronous image resizing --- .../Observer/CategoryProductIndexer.php | 16 +++++++++++++--- .../Observer/CategoryProductIndexer.php | 18 +++++++++++++++--- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Catalog/Observer/CategoryProductIndexer.php b/app/code/Magento/Catalog/Observer/CategoryProductIndexer.php index ca87efaa87490..bdee84762cac2 100644 --- a/app/code/Magento/Catalog/Observer/CategoryProductIndexer.php +++ b/app/code/Magento/Catalog/Observer/CategoryProductIndexer.php @@ -8,6 +8,7 @@ namespace Magento\Catalog\Observer; use Magento\Catalog\Model\Indexer\Category\Product\Processor; +use Magento\Catalog\Model\Indexer\Category\Flat\State as FlatState; use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; @@ -21,12 +22,21 @@ class CategoryProductIndexer implements ObserverInterface */ private $processor; + /** + * @var FlatState + */ + private $flatState; + /** * @param Processor $processor + * @param FlatState $flatState */ - public function __construct(Processor $processor) - { + public function __construct( + Processor $processor, + FlatState $flatState + ) { $this->processor = $processor; + $this->flatState = $flatState; } /** @@ -35,7 +45,7 @@ public function __construct(Processor $processor) public function execute(Observer $observer): void { $productIds = $observer->getEvent()->getProductIds(); - if (!empty($productIds) && $this->processor->isIndexerScheduled()) { + if (!empty($productIds) && $this->processor->isIndexerScheduled() && $this->flatState->isFlatEnabled()) { $this->processor->markIndexerAsInvalid(); } } diff --git a/app/code/Magento/Elasticsearch/Observer/CategoryProductIndexer.php b/app/code/Magento/Elasticsearch/Observer/CategoryProductIndexer.php index fd2734bb713b3..571799f3b8f4b 100644 --- a/app/code/Magento/Elasticsearch/Observer/CategoryProductIndexer.php +++ b/app/code/Magento/Elasticsearch/Observer/CategoryProductIndexer.php @@ -11,6 +11,7 @@ use Magento\Elasticsearch\Model\Config; use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; +use Magento\Catalog\Model\Indexer\Category\Flat\State as FlatState; /** * Checks if a category has changed products and depends on indexer configuration. @@ -27,14 +28,24 @@ class CategoryProductIndexer implements ObserverInterface */ private $processor; + /** + * @var FlatState + */ + private $flatState; + /** * @param Config $config * @param Processor $processor + * @param FlatState $flatState */ - public function __construct(Config $config, Processor $processor) - { + public function __construct( + Config $config, + Processor $processor, + FlatState $flatState + ) { $this->processor = $processor; $this->config = $config; + $this->flatState = $flatState; } /** @@ -42,12 +53,13 @@ public function __construct(Config $config, Processor $processor) */ public function execute(Observer $observer): void { + return; if (!$this->config->isElasticsearchEnabled()) { return; } $productIds = $observer->getEvent()->getProductIds(); - if (!empty($productIds) && $this->processor->isIndexerScheduled()) { + if (!empty($productIds) && $this->processor->isIndexerScheduled() && $this->flatState->isFlatEnabled()) { $this->processor->markIndexerAsInvalid(); } } From a9f499ed76599deef689eaeb3d0cb9fb02498c49 Mon Sep 17 00:00:00 2001 From: Mauricio Agudelo <mauricio.agudelo@interactiv4.com> Date: Sun, 27 Oct 2019 14:17:08 +0100 Subject: [PATCH 066/595] feature/25312 Add Colombian regions --- .../Setup/Patch/Data/AddDataForColombia.php | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 app/code/Magento/Directory/Setup/Patch/Data/AddDataForColombia.php diff --git a/app/code/Magento/Directory/Setup/Patch/Data/AddDataForColombia.php b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForColombia.php new file mode 100644 index 0000000000000..38a9759828588 --- /dev/null +++ b/app/code/Magento/Directory/Setup/Patch/Data/AddDataForColombia.php @@ -0,0 +1,115 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Directory\Setup\Patch\Data; + +use Magento\Directory\Setup\DataInstaller; +use Magento\Framework\Setup\ModuleDataSetupInterface; +use Magento\Framework\Setup\Patch\DataPatchInterface; + +/** + * Class AddDataForColombia + */ +class AddDataForColombia implements DataPatchInterface +{ + /** + * @var ModuleDataSetupInterface + */ + private $moduleDataSetup; + + /** + * @var \Magento\Directory\Setup\DataInstallerFactory + */ + private $dataInstallerFactory; + + /** + * @param ModuleDataSetupInterface $moduleDataSetup + * @param \Magento\Directory\Setup\DataInstallerFactory $dataInstallerFactory + */ + public function __construct( + ModuleDataSetupInterface $moduleDataSetup, + \Magento\Directory\Setup\DataInstallerFactory $dataInstallerFactory + ) { + $this->moduleDataSetup = $moduleDataSetup; + $this->dataInstallerFactory = $dataInstallerFactory; + } + + /** + * @inheritdoc + */ + public function apply() + { + /** @var DataInstaller $dataInstaller */ + $dataInstaller = $this->dataInstallerFactory->create(); + $dataInstaller->addCountryRegions( + $this->moduleDataSetup->getConnection(), + $this->getDataForColombia() + ); + } + + /** + * Colombia states data. + * + * @return array + */ + private function getDataForColombia() + { + return [ + ['CO', 'CO-AMA', 'Amazonas'], + ['CO', 'CO-ANT', 'Antioquia'], + ['CO', 'CO-ARA', 'Arauca'], + ['CO', 'CO-ATL', 'Atlántico'], + ['CO', 'CO-BOL', 'Bolívar'], + ['CO', 'CO-BOY', 'Boyacá'], + ['CO', 'CO-CAL', 'Caldas'], + ['CO', 'CO-CAQ', 'Caquetá'], + ['CO', 'CO-CAS', 'Casanare'], + ['CO', 'CO-CAU', 'Cauca'], + ['CO', 'CO-CES', 'Cesar'], + ['CO', 'CO-CHO', 'Chocó'], + ['CO', 'CO-COR', 'Córdoba'], + ['CO', 'CO-CUN', 'Cundinamarca'], + ['CO', 'CO-GUA', 'Guainía'], + ['CO', 'CO-GUV', 'Guaviare'], + ['CO', 'CO-HUL', 'Huila'], + ['CO', 'CO-LAG', 'La Guajira'], + ['CO', 'CO-MAG', 'Magdalena'], + ['CO', 'CO-MET', 'Meta'], + ['CO', 'CO-NAR', 'Nariño'], + ['CO', 'CO-NSA', 'Norte de Santander'], + ['CO', 'CO-PUT', 'Putumayo'], + ['CO', 'CO-QUI', 'Quindío'], + ['CO', 'CO-RIS', 'Risaralda'], + ['CO', 'CO-SAP', 'San Andrés y Providencia'], + ['CO', 'CO-SAN', 'Santander'], + ['CO', 'CO-SUC', 'Sucre'], + ['CO', 'CO-TOL', 'Tolima'], + ['CO', 'CO-VAC', 'Valle del Cauca'], + ['CO', 'CO-VAU', 'Vaupés'], + ['CO', 'CO-VID', 'Vichada'], + ]; + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return [ + InitializeDirectoryData::class, + ]; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} From 8e17015310c1975f502cc498531356dbdab1fd80 Mon Sep 17 00:00:00 2001 From: Paavo Pokkinen <paavo.pokkinen@vaimo.com> Date: Sun, 27 Oct 2019 19:36:22 +0200 Subject: [PATCH 067/595] Add Cache-Control header to knockout partials --- pub/static/.htaccess | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pub/static/.htaccess b/pub/static/.htaccess index a5aa6fb0d5cfd..84741c4ebb35e 100644 --- a/pub/static/.htaccess +++ b/pub/static/.htaccess @@ -72,7 +72,7 @@ AddType application/xml xml <IfModule mod_headers.c> - <FilesMatch .*\.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2|json)$> + <FilesMatch .*\.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2|html|json)$> Header append Cache-Control public </FilesMatch> From 708672d94239d9b6c79a300e401b8ead5447ef28 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Tue, 29 Oct 2019 13:43:14 -0500 Subject: [PATCH 068/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- app/code/Magento/Catalog/Model/Category.php | 2 -- .../Model/Indexer/Category/Product.php | 6 +--- .../Indexer/Product/Category/Action/Rows.php | 28 +++++++++++++++++-- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Category.php b/app/code/Magento/Catalog/Model/Category.php index 4ddfd1f3b63a8..a25f1e71bab5b 100644 --- a/app/code/Magento/Catalog/Model/Category.php +++ b/app/code/Magento/Catalog/Model/Category.php @@ -1201,8 +1201,6 @@ public function reindex() || $this->dataHasChangedFor('is_active')) { if (!$productIndexer->isScheduled()) { $productIndexer->reindexList($this->getPathIds()); - } else { - $productIndexer->invalidate(); } } } diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Product.php b/app/code/Magento/Catalog/Model/Indexer/Category/Product.php index af1cda41d8c46..8458549456f41 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Product.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Product.php @@ -133,14 +133,10 @@ public function executeRow($id) protected function executeAction($ids) { $ids = array_unique($ids); - $indexer = $this->indexerRegistry->get(static::INDEXER_ID); /** @var Product\Action\Rows $action */ $action = $this->rowsActionFactory->create(); - if ($indexer->isWorking()) { - $action->execute($ids, true); - } - $action->execute($ids); + $action->execute($ids, true); return $this; } diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php b/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php index 15ba6c8f3758b..5448d6ad589e6 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php @@ -15,6 +15,7 @@ use Magento\Framework\Event\ManagerInterface as EventManagerInterface; use Magento\Framework\Indexer\CacheContext; use Magento\Store\Model\StoreManagerInterface; +use Magento\Framework\DB\Adapter\AdapterInterface; /** * Category rows indexer. @@ -81,9 +82,32 @@ public function execute(array $entityIds = [], $useTempTable = false) $affectedCategories = $this->getCategoryIdsFromIndex($idsToBeReIndexed); - $this->removeEntries(); - + if ($useTempTable) { + foreach ($this->storeManager->getStores() as $store) { + $this->connection->truncateTable($this->getIndexTable($store->getId())); + } + } else { + $this->removeEntries(); + } $this->reindex(); + if ($useTempTable) { + foreach ($this->storeManager->getStores() as $store) { + $this->connection->delete( + $this->tableMaintainer->getMainTable($store->getId()), + ['product_id IN (?)' => $this->limitationByProducts] + ); + $select = $this->connection->select() + ->from($this->tableMaintainer->getMainReplicaTable($store->getId())); + $this->connection->query( + $this->connection->insertFromSelect( + $select, + $this->tableMaintainer->getMainTable($store->getId()), + [], + AdapterInterface::INSERT_ON_DUPLICATE + ) + ); + } + } $affectedCategories = array_merge($affectedCategories, $this->getCategoryIdsFromIndex($idsToBeReIndexed)); From 6e18b9835c54982b1b26b2ba079184a38bfdfcd6 Mon Sep 17 00:00:00 2001 From: Kate Kyzyma <kate@atwix.com> Date: Thu, 31 Oct 2019 15:14:53 +0200 Subject: [PATCH 069/595] Separating the test into 2 individual tests --- ...goryUrlRewriteEntityFirstVariationTest.xml | 52 +++++++++++++++++++ ...ryUrlRewriteEntitySecondVariationTest.xml} | 29 ++--------- 2 files changed, 55 insertions(+), 26 deletions(-) create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteEntityFirstVariationTest.xml rename app/code/Magento/UrlRewrite/Test/Mftf/Test/{AdminDeleteCategoryUrlRewriteEntityTest.xml => AdminDeleteCategoryUrlRewriteEntitySecondVariationTest.xml} (61%) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteEntityFirstVariationTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteEntityFirstVariationTest.xml new file mode 100644 index 0000000000000..c653bf2e910b1 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteEntityFirstVariationTest.xml @@ -0,0 +1,52 @@ +<?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="AdminDeleteCategoryUrlRewriteEntityFirstVariationTest"> + <annotations> + <stories value="Delete category URL rewrite first scenario"/> + <title value="Delete category URL rewrite first scenario"/> + <description value="Login as admin and delete category Url Rewrite"/> + <group value="urlRewrite"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <createData entity="_defaultCategory" stepKey="category"/> + </before> + <after> + <deleteData createDataKey="category" stepKey="deleteCategory"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!--Create the Category Url Rewrite--> + <actionGroup ref="AdminAddUrlRewrite" stepKey="addUrlRewrite"> + <argument name="category" value="$$category.name$$"/> + <argument name="customUrlRewriteValue" value="For Category'"/> + <argument name="storeValue" value="Default Store View"/> + <argument name="requestPath" value="-"/> + <argument name="redirectTypeValue" value="No"/> + <argument name="description" value="End To End Test"/> + </actionGroup> + + <!--Delete the Category Url Rewrite--> + <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <argument name="requestPath" value="-"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> + <argument name="message" value="You deleted the URL rewrite."/> + </actionGroup> + + <!--Verify AssertPageByUrlRewriteIsNotFound--> + <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="checkUrlOnFrontend"> + <argument name="requestPath" value="-"/> + </actionGroup> + + </test> +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteEntityTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteEntitySecondVariationTest.xml similarity index 61% rename from app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteEntityTest.xml rename to app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteEntitySecondVariationTest.xml index d0e976a1f9e3d..f613ee57296e9 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteEntityTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteEntitySecondVariationTest.xml @@ -7,10 +7,10 @@ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminDeleteCategoryUrlRewriteEntityTest"> + <test name="AdminDeleteCategoryUrlRewriteEntitySecondVariationTest"> <annotations> - <stories value="Delete category URL rewrite"/> - <title value="Delete category URL rewrite"/> + <stories value="Delete category URL rewrite second scenario"/> + <title value="Delete category URL rewrite second scenario"/> <description value="Login as admin and delete category Url Rewrite"/> <group value="urlRewrite"/> <group value="mtf_migrated"/> @@ -25,29 +25,6 @@ <actionGroup ref="logout" stepKey="logout"/> </after> - <!--Create the Category Url Rewrite--> - <actionGroup ref="AdminAddUrlRewrite" stepKey="addUrlRewrite"> - <argument name="category" value="$$category.name$$"/> - <argument name="customUrlRewriteValue" value="For Category'"/> - <argument name="storeValue" value="Default Store View"/> - <argument name="requestPath" value="-"/> - <argument name="redirectTypeValue" value="No"/> - <argument name="description" value="End To End Test"/> - </actionGroup> - - <!--Delete the Category Url Rewrite--> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> - <argument name="requestPath" value="-"/> - </actionGroup> - <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> - <argument name="message" value="You deleted the URL rewrite."/> - </actionGroup> - - <!--Verify AssertPageByUrlRewriteIsNotFound--> - <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="checkUrlOnFrontend"> - <argument name="requestPath" value="-"/> - </actionGroup> - <!--Create the Category Url Rewrite--> <actionGroup ref="AdminAddUrlRewrite" stepKey="addUrlRewriteSecondTime"> <argument name="category" value="$$category.name$$"/> From 21189a1d64a40f3ee45bd63f92c823dcde418dbc Mon Sep 17 00:00:00 2001 From: Kate Kyzyma <kate@atwix.com> Date: Thu, 31 Oct 2019 17:30:13 +0200 Subject: [PATCH 070/595] Separating the test into 3 individual tests. --- ...msPageRewriteEntityWithNoRedirectTest.xml} | 68 ++------------- ...eRewriteEntityWithPermanentReirectTest.xml | 85 +++++++++++++++++++ ...RewriteEntityWithTemporaryRedirectTest.xml | 85 +++++++++++++++++++ 3 files changed, 175 insertions(+), 63 deletions(-) rename app/code/Magento/UrlRewrite/Test/Mftf/Test/{AdminUpdateCmsPageRewriteEntityTest.xml => AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml} (53%) create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml similarity index 53% rename from app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityTest.xml rename to app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml index f772c62489a98..81dedfea7a35e 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml @@ -7,10 +7,10 @@ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminUpdateCmsPageRewriteEntityTest"> + <test name="AdminUpdateCmsPageRewriteEntityWithNoRedirectTest"> <annotations> - <stories value="Update CMS Page URL Redirect"/> - <title value="Update CMS Page URL Redirect"/> + <stories value="Update CMS Page URL Redirect With No Redirect"/> + <title value="Update CMS Page URL Redirect With No Redirect"/> <description value="Login as Admin and tried to update the created URL Rewrite for CMS page"/> <group value="cMSContent"/> <group value="mtf_migrated"/> @@ -53,7 +53,7 @@ <argument name="requestPath" value="created-new-cms-page"/> </actionGroup> - <!-- Update URL Rewrite for CMS Page First Attempt --> + <!-- Update URL Rewrite for CMS Page --> <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateUrlRewriteFirstAttempt"> <argument name="storeValue" value="{{customStore.name}}"/> <argument name="requestPath" value="newrequestpath"/> @@ -80,66 +80,8 @@ <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> </actionGroup> - <!--Search created CMS page url rewrite in grid second attempt--> - <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="searchUrlRewriteSecondAttempt"> - <argument name="requestPath" value="newrequestpath"/> - </actionGroup> - - <!-- Update URL Rewrite for CMS Page Second Attempt --> - <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateUrlRewriteSecondAttempt"> - <argument name="storeValue" value="Default Store View"/> - <argument name="requestPath" value="temporaryrequestpath.html"/> - <argument name="redirectTypeValue" value="Temporary (302)"/> - <argument name="description" value="test description_302"/> - </actionGroup> - - <!-- Assert Url Rewrite Save Message --> - <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessageSecondAttempt"> - <argument name="message" value="The URL Rewrite has been saved."/> - </actionGroup> - - <!-- Assert Url Rewrite Cms Page Redirect --> - <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToHomepageSecondAttempt"/> - <actionGroup ref="StorefrontSwitchDefaultStoreViewActionGroup" stepKey="switchToDefaultStoreView"/> - <actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFrontSecondAttempt"> - <argument name="page" value="temporaryrequestpath.html"/> - </actionGroup> - <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPageSecondAttempt"> - <argument name="cmsTitle" value="$$createCMSPage.title$$"/> - <argument name="cmsContent" value="$$createCMSPage.content$$"/> - <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> - </actionGroup> - - <!--Search created CMS page url rewrite in grid third attempt--> - <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="searchUrlRewriteThirdAttempt"> - <argument name="requestPath" value="temporaryrequestpath.html"/> - </actionGroup> - - <!-- Update URL Rewrite for CMS Page Third Attempt --> - <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateUrlRewriteThirdAttempt"> - <argument name="storeValue" value="Default Store View"/> - <argument name="requestPath" value="permanentrequestpath.htm"/> - <argument name="redirectTypeValue" value="Permanent (301)"/> - <argument name="description" value="test_description_301"/> - </actionGroup> - - <!-- Assert Url Rewrite Save Message --> - <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessageThirdAttempt"> - <argument name="message" value="The URL Rewrite has been saved."/> - </actionGroup> - - <!-- Assert Url Rewrite Cms Page Redirect --> - <actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFrontThirdAttempt"> - <argument name="page" value="permanentrequestpath.htm"/> - </actionGroup> - <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPageThirdAttempt"> - <argument name="cmsTitle" value="$$createCMSPage.title$$"/> - <argument name="cmsContent" value="$$createCMSPage.content$$"/> - <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> - </actionGroup> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> - <argument name="requestPath" value="permanentrequestpath.htm"/> + <argument name="requestPath" value="newrequestpath"/> </actionGroup> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteCustomStoreView"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml new file mode 100644 index 0000000000000..f073794896c2c --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml @@ -0,0 +1,85 @@ +<?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="AdminUpdateCmsPageRewriteEntityWithPermanentRedirectTest"> + <annotations> + <stories value="Update CMS Page URL Redirect With Permanent Redirect"/> + <title value="Update CMS Page URL Redirect With Permanent Redirect"/> + <description value="Login as Admin and tried to update the created URL Rewrite for CMS page"/> + <group value="cMSContent"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <createData entity="simpleCmsPage" stepKey="createCMSPage"/> + <actionGroup ref="LoginAsAdmin" stepKey="login"/> + </before> + <after> + <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!--Create Custom Store View--> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"/> + + <!-- Open CMS Edit Page, Get the CMS ID and Modify Store View Option to All Store Views --> + <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage"> + <argument name="CMSPage" value="$$createCMSPage$$"/> + </actionGroup> + <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> + <actionGroup ref="AddStoreViewToCmsPage" stepKey="updateStoreViewForCmsPage"> + <argument name="CMSPage" value="$$createCMSPage$$"/> + <argument name="storeViewName" value="All Store Views"/> + </actionGroup> + + <!--Create CMS Page URL Redirect--> + <actionGroup ref="AdminAddCustomUrlRewrite" stepKey="addCustomUrlRewrite"> + <argument name="customUrlRewriteValue" value="Custom"/> + <argument name="storeValue" value="Default Store View"/> + <argument name="requestPath" value="created-new-cms-page"/> + <argument name="redirectTypeValue" value="No"/> + <argument name="targetPath" value="cms/page/view/page_id/{$cmsId}"/> + <argument name="description" value="Created New CMS Page"/> + </actionGroup> + + <!--Search created CMS page url rewrite in grid--> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="searchUrlRewrite"> + <argument name="requestPath" value="created-new-cms-page"/> + </actionGroup> + + <!-- Update URL Rewrite for CMS Page --> + <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateUrlRewrite"> + <argument name="storeValue" value="Default Store View"/> + <argument name="requestPath" value="permanentrequestpath.htm"/> + <argument name="redirectTypeValue" value="Permanent (301)"/> + <argument name="description" value="test_description_301"/> + </actionGroup> + + <!-- Assert Url Rewrite Save Message --> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> + <argument name="message" value="The URL Rewrite has been saved."/> + </actionGroup> + + <!-- Assert Url Rewrite Cms Page Redirect --> + <actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFront"> + <argument name="page" value="permanentrequestpath.htm"/> + </actionGroup> + <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage"> + <argument name="cmsTitle" value="$$createCMSPage.title$$"/> + <argument name="cmsContent" value="$$createCMSPage.content$$"/> + <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> + </actionGroup> + + <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <argument name="requestPath" value="permanentrequestpath.htm"/> + </actionGroup> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteCustomStoreView"/> + + </test> +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml new file mode 100644 index 0000000000000..8f04fe7cf9ab9 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml @@ -0,0 +1,85 @@ +<?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="AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest"> + <annotations> + <stories value="Update CMS Page URL Redirect With Temporary Redirect"/> + <title value="Update CMS Page URL Redirect With Temporary Redirect"/> + <description value="Login as Admin and tried to update the created URL Rewrite for CMS page"/> + <group value="cMSContent"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <createData entity="simpleCmsPage" stepKey="createCMSPage"/> + <actionGroup ref="LoginAsAdmin" stepKey="login"/> + </before> + <after> + <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!--Create Custom Store View--> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"/> + + <!-- Open CMS Edit Page, Get the CMS ID and Modify Store View Option to All Store Views --> + <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage"> + <argument name="CMSPage" value="$$createCMSPage$$"/> + </actionGroup> + <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> + <actionGroup ref="AddStoreViewToCmsPage" stepKey="updateStoreViewForCmsPage"> + <argument name="CMSPage" value="$$createCMSPage$$"/> + <argument name="storeViewName" value="All Store Views"/> + </actionGroup> + + <!--Create CMS Page URL Redirect--> + <actionGroup ref="AdminAddCustomUrlRewrite" stepKey="addCustomUrlRewrite"> + <argument name="customUrlRewriteValue" value="Custom"/> + <argument name="storeValue" value="Default Store View"/> + <argument name="requestPath" value="created-new-cms-page"/> + <argument name="redirectTypeValue" value="Permanent (301)"/> + <argument name="targetPath" value="cms/page/view/page_id/{$cmsId}"/> + <argument name="description" value="Created New CMS Page"/> + </actionGroup> + + <!--Search created CMS page url rewrite in grid--> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="searchUrlRewrite"> + <argument name="requestPath" value="created-new-cms-page"/> + </actionGroup> + + <!-- Update URL Rewrite for CMS Page --> + <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateUrlRewrite"> + <argument name="storeValue" value="Default Store View"/> + <argument name="requestPath" value="temporaryrequestpath.html"/> + <argument name="redirectTypeValue" value="Temporary (302)"/> + <argument name="description" value="test description_302"/> + </actionGroup> + + <!-- Assert Url Rewrite Save Message --> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> + <argument name="message" value="The URL Rewrite has been saved."/> + </actionGroup> + + <!-- Assert Url Rewrite Cms Page Redirect --> + <actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFront"> + <argument name="page" value="temporaryrequestpath.html"/> + </actionGroup> + <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage"> + <argument name="cmsTitle" value="$$createCMSPage.title$$"/> + <argument name="cmsContent" value="$$createCMSPage.content$$"/> + <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> + </actionGroup> + + <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <argument name="requestPath" value="temporaryrequestpath.html"/> + </actionGroup> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteCustomStoreView"/> + + </test> +</tests> From ef9ef0d61c259c23b3aa4f6c3e04d7862f1211e0 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Thu, 31 Oct 2019 10:48:34 -0500 Subject: [PATCH 071/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- .../Indexer/Category/Product/Action/Rows.php | 88 ++++++++++++++++++- .../Plugin/Product/Category/Action/Rows.php | 51 +++++++++++ app/code/Magento/CatalogSearch/etc/di.xml | 3 + 3 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Product/Category/Action/Rows.php diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php b/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php index 3bd4910767587..a7edcc03de4e6 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php @@ -5,6 +5,17 @@ */ namespace Magento\Catalog\Model\Indexer\Category\Product\Action; +use Magento\Framework\DB\Adapter\AdapterInterface; +use Magento\Framework\Indexer\CacheContext; +use Magento\Framework\Event\ManagerInterface as EventManagerInterface; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\App\ResourceConnection; +use Magento\Store\Model\StoreManagerInterface; +use Magento\Framework\DB\Query\Generator as QueryGenerator; +use Magento\Framework\EntityManager\MetadataPool; +use Magento\Catalog\Model\Config; +use Magento\Catalog\Model\Category; + class Rows extends \Magento\Catalog\Model\Indexer\Category\Product\AbstractAction { /** @@ -14,6 +25,39 @@ class Rows extends \Magento\Catalog\Model\Indexer\Category\Product\AbstractActio */ protected $limitationByCategories; + /** + * @var CacheContext + */ + private $cacheContext; + + /** + * @var EventManagerInterface|null + */ + private $eventManager; + + /** + * @param ResourceConnection $resource + * @param StoreManagerInterface $storeManager + * @param Config $config + * @param QueryGenerator|null $queryGenerator + * @param MetadataPool|null $metadataPool + * @param CacheContext|null $cacheContext + * @param EventManagerInterface|null $eventManager + */ + public function __construct( + ResourceConnection $resource, + StoreManagerInterface $storeManager, + Config $config, + QueryGenerator $queryGenerator = null, + MetadataPool $metadataPool = null, + CacheContext $cacheContext = null, + EventManagerInterface $eventManager = null + ) { + parent::__construct($resource, $storeManager, $config, $queryGenerator, $metadataPool); + $this->cacheContext = $cacheContext ?: ObjectManager::getInstance()->get(CacheContext::class); + $this->eventManager = $eventManager ?: ObjectManager::getInstance()->get(EventManagerInterface::class); + } + /** * Refresh entities index * @@ -26,13 +70,55 @@ public function execute(array $entityIds = [], $useTempTable = false) $this->limitationByCategories = $entityIds; $this->useTempTable = $useTempTable; - $this->removeEntries(); + if ($useTempTable) { + foreach ($this->storeManager->getStores() as $store) { + $this->connection->truncateTable($this->getIndexTable($store->getId())); + } + } else { + $this->removeEntries(); + } $this->reindex(); + if ($useTempTable) { + foreach ($this->storeManager->getStores() as $store) { + $removalCategoryIds = array_diff($this->limitationByCategories, [$this->getRootCategoryId($store)]); + $this->connection->delete( + $this->tableMaintainer->getMainTable($store->getId()), + ['category_id IN (?)' => $removalCategoryIds] + ); + $select = $this->connection->select() + ->from($this->tableMaintainer->getMainReplicaTable($store->getId())); + $this->connection->query( + $this->connection->insertFromSelect( + $select, + $this->tableMaintainer->getMainTable($store->getId()), + [], + AdapterInterface::INSERT_ON_DUPLICATE + ) + ); + } + } + + $this->registerCategories($entityIds); + $this->eventManager->dispatch('clean_cache_by_tags', ['object' => $this->cacheContext]); + return $this; } + /** + * Register categories assigned to products + * + * @param array $categoryIds + * @return void + */ + private function registerCategories(array $categoryIds) + { + if ($categoryIds) { + $this->cacheContext->registerEntities(Category::CACHE_TAG, $categoryIds); + } + } + /** * Return array of all category root IDs + tree root ID * diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Product/Category/Action/Rows.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Product/Category/Action/Rows.php new file mode 100644 index 0000000000000..b8e60b9973731 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Product/Category/Action/Rows.php @@ -0,0 +1,51 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Product\Category\Action; + +use Magento\Framework\Indexer\IndexerRegistry; +use Magento\CatalogSearch\Model\Indexer\Fulltext as FulltextIndexer; +use Magento\Catalog\Model\Indexer\Product\Category\Action\Rows as ActionRows; + +/** + * Catalog search indexer plugin for catalog category products assignment + */ +class Rows +{ + /** + * @var IndexerRegistry + */ + private $indexerRegistry; + + /** + * @param IndexerRegistry $indexerRegistry + */ + public function __construct(IndexerRegistry $indexerRegistry) + { + $this->indexerRegistry = $indexerRegistry; + } + + /** + * Reindex after catalog category product reindex + * + * @param ActionRows $subject + * @param ActionRows $result + * @param array $entityIds + * @param boolean $useTempTable + * @return Rows + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterExecute(ActionRows $subject, ActionRows $result, array $entityIds, $useTempTable) + { + if (!empty($entityIds)) { + $indexer = $this->indexerRegistry->get(FulltextIndexer::INDEXER_ID); + if ($indexer->isScheduled()) { + $indexer->reindexList($entityIds); + } + } + return $result; + } +} diff --git a/app/code/Magento/CatalogSearch/etc/di.xml b/app/code/Magento/CatalogSearch/etc/di.xml index 372b389c545e6..4e5b38878ee52 100644 --- a/app/code/Magento/CatalogSearch/etc/di.xml +++ b/app/code/Magento/CatalogSearch/etc/di.xml @@ -75,6 +75,9 @@ <type name="Magento\Catalog\Model\Product\Action"> <plugin name="catalogsearchFulltextMassAction" type="Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Product\Action"/> </type> + <type name="Magento\Catalog\Model\Indexer\Product\Category\Action\Rows"> + <plugin name="catalogsearchFulltextCategoryAssignment" type="Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Product\Category\Action\Rows"/> + </type> <type name="Magento\Store\Model\ResourceModel\Store"> <plugin name="catalogsearchFulltextIndexerStoreView" type="Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Store\View" /> </type> From 7e1b806d157bafed8aff3bb83663c1d9be068c16 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Thu, 31 Oct 2019 11:36:14 -0500 Subject: [PATCH 072/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- .../Catalog/Model/Indexer/Category/Product/Action/Rows.php | 3 +++ .../Catalog/Test/Unit/Model/Indexer/Category/ProductTest.php | 5 +---- .../Elasticsearch/Observer/CategoryProductIndexer.php | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php b/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php index a7edcc03de4e6..6b6e10c5ca799 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php @@ -16,6 +16,9 @@ use Magento\Catalog\Model\Config; use Magento\Catalog\Model\Category; +/** + * Action for partial reindex + */ class Rows extends \Magento\Catalog\Model\Indexer\Category\Product\AbstractAction { /** diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/ProductTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/ProductTest.php index 7a7c11e95d9b7..fbc59e386305c 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/ProductTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/ProductTest.php @@ -84,7 +84,6 @@ public function testExecuteWithIndexerWorking() { $ids = [1, 2, 3]; - $this->indexerMock->expects($this->once())->method('isWorking')->will($this->returnValue(true)); $this->prepareIndexer(); $rowMock = $this->createPartialMock( @@ -92,7 +91,6 @@ public function testExecuteWithIndexerWorking() ['execute'] ); $rowMock->expects($this->at(0))->method('execute')->with($ids, true)->will($this->returnSelf()); - $rowMock->expects($this->at(1))->method('execute')->with($ids, false)->will($this->returnSelf()); $this->rowsMock->expects($this->once())->method('create')->will($this->returnValue($rowMock)); @@ -103,14 +101,13 @@ public function testExecuteWithIndexerNotWorking() { $ids = [1, 2, 3]; - $this->indexerMock->expects($this->once())->method('isWorking')->will($this->returnValue(false)); $this->prepareIndexer(); $rowMock = $this->createPartialMock( \Magento\Catalog\Model\Indexer\Category\Product\Action\Rows::class, ['execute'] ); - $rowMock->expects($this->once())->method('execute')->with($ids, false)->will($this->returnSelf()); + $rowMock->expects($this->once())->method('execute')->with($ids, true)->will($this->returnSelf()); $this->rowsMock->expects($this->once())->method('create')->will($this->returnValue($rowMock)); diff --git a/app/code/Magento/Elasticsearch/Observer/CategoryProductIndexer.php b/app/code/Magento/Elasticsearch/Observer/CategoryProductIndexer.php index 571799f3b8f4b..e2b3e18a0ffb9 100644 --- a/app/code/Magento/Elasticsearch/Observer/CategoryProductIndexer.php +++ b/app/code/Magento/Elasticsearch/Observer/CategoryProductIndexer.php @@ -53,7 +53,6 @@ public function __construct( */ public function execute(Observer $observer): void { - return; if (!$this->config->isElasticsearchEnabled()) { return; } From a01cd927b9024bf2bf420b5a034aa0d1b918fdec Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Thu, 31 Oct 2019 12:03:41 -0500 Subject: [PATCH 073/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- .../Magento/Catalog/Model/Indexer/Category/Product.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Product.php b/app/code/Magento/Catalog/Model/Indexer/Category/Product.php index 8458549456f41..542232d25f6a3 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Product.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Product.php @@ -133,10 +133,18 @@ public function executeRow($id) protected function executeAction($ids) { $ids = array_unique($ids); + $indexer = $this->indexerRegistry->get(static::INDEXER_ID); /** @var Product\Action\Rows $action */ $action = $this->rowsActionFactory->create(); - $action->execute($ids, true); + if ($indexer->isScheduled()) { + $action->execute($ids, true); + } else { + if ($indexer->isWorking()) { + $action->execute($ids, true); + } + $action->execute($ids); + } return $this; } From 8df7f4b02ca50ef20027531562635c0ac153db7c Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Thu, 31 Oct 2019 13:33:27 -0500 Subject: [PATCH 074/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- app/code/Magento/Catalog/Model/Category.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Catalog/Model/Category.php b/app/code/Magento/Catalog/Model/Category.php index a25f1e71bab5b..a9ba367ed301a 100644 --- a/app/code/Magento/Catalog/Model/Category.php +++ b/app/code/Magento/Catalog/Model/Category.php @@ -1364,6 +1364,7 @@ public function getChildrenData() * @return array * @todo refactor with converter for AbstractExtensibleModel */ + // phpcs:ignore Magento2.FunctionNameRestrictions.MethodDoubleUnderscore public function __toArray() { $data = $this->_data; From 45a2efac12536d3dc3edd19be4cd0cd3f3d66b7b Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Thu, 31 Oct 2019 14:41:18 -0500 Subject: [PATCH 075/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- .../Catalog/Model/Indexer/Category/Product.php | 10 +--------- .../Indexer/Category/Product/Action/Rows.php | 18 +++++++++++++++--- .../Indexer/Product/Category/Action/Rows.php | 18 +++++++++++++++--- 3 files changed, 31 insertions(+), 15 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Product.php b/app/code/Magento/Catalog/Model/Indexer/Category/Product.php index 542232d25f6a3..8458549456f41 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Product.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Product.php @@ -133,18 +133,10 @@ public function executeRow($id) protected function executeAction($ids) { $ids = array_unique($ids); - $indexer = $this->indexerRegistry->get(static::INDEXER_ID); /** @var Product\Action\Rows $action */ $action = $this->rowsActionFactory->create(); - if ($indexer->isScheduled()) { - $action->execute($ids, true); - } else { - if ($indexer->isWorking()) { - $action->execute($ids, true); - } - $action->execute($ids); - } + $action->execute($ids, true); return $this; } diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php b/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php index 6b6e10c5ca799..6ec911805cd13 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php @@ -15,6 +15,8 @@ use Magento\Framework\EntityManager\MetadataPool; use Magento\Catalog\Model\Config; use Magento\Catalog\Model\Category; +use Magento\Framework\Indexer\IndexerRegistry; +use Magento\Catalog\Model\Indexer\Product\Category as ProductCategoryIndexer; /** * Action for partial reindex @@ -38,6 +40,11 @@ class Rows extends \Magento\Catalog\Model\Indexer\Category\Product\AbstractActio */ private $eventManager; + /** + * @var IndexerRegistry + */ + private $indexerRegistry; + /** * @param ResourceConnection $resource * @param StoreManagerInterface $storeManager @@ -46,6 +53,7 @@ class Rows extends \Magento\Catalog\Model\Indexer\Category\Product\AbstractActio * @param MetadataPool|null $metadataPool * @param CacheContext|null $cacheContext * @param EventManagerInterface|null $eventManager + * @param IndexerRegistry|null $indexerRegistry */ public function __construct( ResourceConnection $resource, @@ -54,11 +62,13 @@ public function __construct( QueryGenerator $queryGenerator = null, MetadataPool $metadataPool = null, CacheContext $cacheContext = null, - EventManagerInterface $eventManager = null + EventManagerInterface $eventManager = null, + IndexerRegistry $indexerRegistry = null ) { parent::__construct($resource, $storeManager, $config, $queryGenerator, $metadataPool); $this->cacheContext = $cacheContext ?: ObjectManager::getInstance()->get(CacheContext::class); $this->eventManager = $eventManager ?: ObjectManager::getInstance()->get(EventManagerInterface::class); + $this->indexerRegistry = $indexerRegistry ?: ObjectManager::getInstance()->get(IndexerRegistry::class); } /** @@ -72,8 +82,10 @@ public function execute(array $entityIds = [], $useTempTable = false) { $this->limitationByCategories = $entityIds; $this->useTempTable = $useTempTable; + $indexer = $this->indexerRegistry->get(ProductCategoryIndexer::INDEXER_ID); + $workingState = $indexer->isWorking(); - if ($useTempTable) { + if ($useTempTable && !$workingState) { foreach ($this->storeManager->getStores() as $store) { $this->connection->truncateTable($this->getIndexTable($store->getId())); } @@ -83,7 +95,7 @@ public function execute(array $entityIds = [], $useTempTable = false) $this->reindex(); - if ($useTempTable) { + if ($useTempTable && !$workingState) { foreach ($this->storeManager->getStores() as $store) { $removalCategoryIds = array_diff($this->limitationByCategories, [$this->getRootCategoryId($store)]); $this->connection->delete( diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php b/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php index 5448d6ad589e6..9c7b651987ef1 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php @@ -16,6 +16,8 @@ use Magento\Framework\Indexer\CacheContext; use Magento\Store\Model\StoreManagerInterface; use Magento\Framework\DB\Adapter\AdapterInterface; +use Magento\Framework\Indexer\IndexerRegistry; +use Magento\Catalog\Model\Indexer\Category\Product as CategoryProductIndexer; /** * Category rows indexer. @@ -41,6 +43,11 @@ class Rows extends \Magento\Catalog\Model\Indexer\Category\Product\AbstractActio */ private $eventManager; + /** + * @var IndexerRegistry + */ + private $indexerRegistry; + /** * @param ResourceConnection $resource * @param StoreManagerInterface $storeManager @@ -49,6 +56,7 @@ class Rows extends \Magento\Catalog\Model\Indexer\Category\Product\AbstractActio * @param MetadataPool|null $metadataPool * @param CacheContext|null $cacheContext * @param EventManagerInterface|null $eventManager + * @param IndexerRegistry|null $indexerRegistry */ public function __construct( ResourceConnection $resource, @@ -57,11 +65,13 @@ public function __construct( QueryGenerator $queryGenerator = null, MetadataPool $metadataPool = null, CacheContext $cacheContext = null, - EventManagerInterface $eventManager = null + EventManagerInterface $eventManager = null, + IndexerRegistry $indexerRegistry = null ) { parent::__construct($resource, $storeManager, $config, $queryGenerator, $metadataPool); $this->cacheContext = $cacheContext ?: ObjectManager::getInstance()->get(CacheContext::class); $this->eventManager = $eventManager ?: ObjectManager::getInstance()->get(EventManagerInterface::class); + $this->indexerRegistry = $indexerRegistry ?: ObjectManager::getInstance()->get(IndexerRegistry::class); } /** @@ -79,10 +89,12 @@ public function execute(array $entityIds = [], $useTempTable = false) $this->limitationByProducts = $idsToBeReIndexed; $this->useTempTable = $useTempTable; + $indexer = $this->indexerRegistry->get(CategoryProductIndexer::INDEXER_ID); + $workingState = $indexer->isWorking(); $affectedCategories = $this->getCategoryIdsFromIndex($idsToBeReIndexed); - if ($useTempTable) { + if ($useTempTable && !$workingState) { foreach ($this->storeManager->getStores() as $store) { $this->connection->truncateTable($this->getIndexTable($store->getId())); } @@ -90,7 +102,7 @@ public function execute(array $entityIds = [], $useTempTable = false) $this->removeEntries(); } $this->reindex(); - if ($useTempTable) { + if ($useTempTable && !$workingState) { foreach ($this->storeManager->getStores() as $store) { $this->connection->delete( $this->tableMaintainer->getMainTable($store->getId()), From 2098339082a414457e24c140f449c8f66ed98dc8 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Thu, 31 Oct 2019 15:24:57 -0500 Subject: [PATCH 076/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- app/code/Magento/Catalog/Model/Category.php | 2 +- .../Catalog/Model/Indexer/Category/Product/Action/Rows.php | 2 +- .../Catalog/Model/Indexer/Product/Category/Action/Rows.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Category.php b/app/code/Magento/Catalog/Model/Category.php index a9ba367ed301a..2aafd7ff1c5d8 100644 --- a/app/code/Magento/Catalog/Model/Category.php +++ b/app/code/Magento/Catalog/Model/Category.php @@ -41,6 +41,7 @@ * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @since 100.0.2 + * phpcs:disable Magento2.FunctionNameRestrictions.MethodDoubleUnderscore */ class Category extends \Magento\Catalog\Model\AbstractModel implements \Magento\Framework\DataObject\IdentityInterface, @@ -1364,7 +1365,6 @@ public function getChildrenData() * @return array * @todo refactor with converter for AbstractExtensibleModel */ - // phpcs:ignore Magento2.FunctionNameRestrictions.MethodDoubleUnderscore public function __toArray() { $data = $this->_data; diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php b/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php index 6ec911805cd13..1ad6d4c73a94c 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php @@ -43,7 +43,7 @@ class Rows extends \Magento\Catalog\Model\Indexer\Category\Product\AbstractActio /** * @var IndexerRegistry */ - private $indexerRegistry; + private $indexerRegistry; /** * @param ResourceConnection $resource diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php b/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php index 9c7b651987ef1..1890ac4ad45a7 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php @@ -46,7 +46,7 @@ class Rows extends \Magento\Catalog\Model\Indexer\Category\Product\AbstractActio /** * @var IndexerRegistry */ - private $indexerRegistry; + private $indexerRegistry; /** * @param ResourceConnection $resource From b1118f2ad55b7cc84dbfa814b513825effcd42b1 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Thu, 31 Oct 2019 15:35:16 -0500 Subject: [PATCH 077/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- .../Test/Unit/Model/Indexer/Product/CategoryTest.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/CategoryTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/CategoryTest.php index 74f748ef9bf00..ab0ca8a5bc48a 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/CategoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/CategoryTest.php @@ -84,7 +84,6 @@ public function testExecuteWithIndexerWorking() { $ids = [1, 2, 3]; - $this->indexerMock->expects($this->once())->method('isWorking')->will($this->returnValue(true)); $this->prepareIndexer(); $rowMock = $this->createPartialMock( @@ -92,7 +91,6 @@ public function testExecuteWithIndexerWorking() ['execute'] ); $rowMock->expects($this->at(0))->method('execute')->with($ids, true)->will($this->returnSelf()); - $rowMock->expects($this->at(1))->method('execute')->with($ids, false)->will($this->returnSelf()); $this->rowsMock->expects($this->once())->method('create')->will($this->returnValue($rowMock)); @@ -103,14 +101,13 @@ public function testExecuteWithIndexerNotWorking() { $ids = [1, 2, 3]; - $this->indexerMock->expects($this->once())->method('isWorking')->will($this->returnValue(false)); $this->prepareIndexer(); $rowMock = $this->createPartialMock( \Magento\Catalog\Model\Indexer\Product\Category\Action\Rows::class, ['execute'] ); - $rowMock->expects($this->once())->method('execute')->with($ids, false)->will($this->returnSelf()); + $rowMock->expects($this->once())->method('execute')->with($ids, true)->will($this->returnSelf()); $this->rowsMock->expects($this->once())->method('create')->will($this->returnValue($rowMock)); @@ -123,7 +120,7 @@ public function testExecuteWithIndexerNotWorking() protected function prepareIndexer() { - $this->indexerRegistryMock->expects($this->once()) + $this->indexerRegistryMock->expects($this->any()) ->method('get') ->with(\Magento\Catalog\Model\Indexer\Product\Category::INDEXER_ID) ->will($this->returnValue($this->indexerMock)); From 56ab42350dba7bfd7511c9eea068433638e17b06 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Thu, 31 Oct 2019 15:36:53 -0500 Subject: [PATCH 078/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- .../Test/Unit/Observer/CategoryProductIndexerTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Elasticsearch/Test/Unit/Observer/CategoryProductIndexerTest.php b/app/code/Magento/Elasticsearch/Test/Unit/Observer/CategoryProductIndexerTest.php index adebee0d591ab..944699908b984 100644 --- a/app/code/Magento/Elasticsearch/Test/Unit/Observer/CategoryProductIndexerTest.php +++ b/app/code/Magento/Elasticsearch/Test/Unit/Observer/CategoryProductIndexerTest.php @@ -69,7 +69,6 @@ public function testExecuteIfCategoryHasChangedProducts() { $this->getProductIdsWithEnabledElasticSearch(); $this->processorMock->expects($this->once())->method('isIndexerScheduled')->willReturn(true); - $this->processorMock->expects($this->once())->method('markIndexerAsInvalid'); $this->observer->execute($this->observerMock); } From be24d9005aecac7cbeabdefc2a49771a3d4790cd Mon Sep 17 00:00:00 2001 From: torhoehn <torhoehn@gmail.com> Date: Thu, 31 Oct 2019 23:21:37 +0100 Subject: [PATCH 079/595] add check for attribute option values --- .../Catalog/Controller/Adminhtml/Product/Attribute/Validate.php | 2 +- .../view/adminhtml/web/js/variations/steps/attributes_values.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php index ce6668229d658..dcb7074c0d036 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php @@ -252,7 +252,7 @@ private function checkUniqueOption(DataObject $response, array $options = null) private function checkEmptyOption(DataObject $response, array $optionsForCheck = null) { foreach ($optionsForCheck as $optionValues) { - if (isset($optionValues[0]) && $optionValues[0] == '') { + if (isset($optionValues[0]) && trim($optionValues[0]) == '') { $this->setMessageToResponse($response, [__("The value of Admin scope can't be empty.")]); $response->setError(true); } diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/attributes_values.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/attributes_values.js index 6c790c634ee93..8e057f5cd39dc 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/attributes_values.js +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/attributes_values.js @@ -106,6 +106,7 @@ define([ errorOption, allOptions = []; + newOption.label = $.trim(option.label); if (_.isEmpty(newOption.label)) { return false; } From 691b877be18791030fbfd5599aef8fdf4fe82be2 Mon Sep 17 00:00:00 2001 From: Ravi Chandra <ravi.chandra@krishtechnolabs.com> Date: Fri, 1 Nov 2019 10:09:20 +0530 Subject: [PATCH 080/595] move description before the class name --- .../Magento/Sales/Model/ResourceModel/Status/Collection.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Sales/Model/ResourceModel/Status/Collection.php b/app/code/Magento/Sales/Model/ResourceModel/Status/Collection.php index f429a62fc3f03..f9dc4a7d83ae2 100644 --- a/app/code/Magento/Sales/Model/ResourceModel/Status/Collection.php +++ b/app/code/Magento/Sales/Model/ResourceModel/Status/Collection.php @@ -1,12 +1,14 @@ <?php /** - * Order status grid collection - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Sales\Model\ResourceModel\Status; +/** + * Class Collection + * Oder statuses grid collection + */ class Collection extends \Magento\Sales\Model\ResourceModel\Order\Status\Collection { /** From 27b9d8c0640311096fafb834e312c9e0eef18206 Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@gmail.com> Date: Fri, 1 Nov 2019 08:34:05 +0200 Subject: [PATCH 081/595] MC-17259: Update blank gender it does not saved in direct edits from customer grid --- ...goryHighlightedAndProductDisplayedTest.xml | 4 + ...stomerGenderInCustomersGridActionGroup.xml | 25 ++++++ ...stomerGenderInCustomersGridActionGroup.xml | 22 +++++ ...ustomerGenderOnCustomerFormActionGroup.xml | 23 +++++ .../Customer/Test/Mftf/Data/GenderData.xml | 17 ++++ .../Test/Mftf/Page/AdminCustomerPage.xml | 1 + .../AdminCustomerGridInlineEditorSection.xml | 15 ++++ .../Mftf/Section/AdminCustomerGridSection.xml | 2 + ...hangeCustomerGenderInCustomersGridTest.xml | 83 +++++++++++++++++++ .../view/base/web/js/grid/editing/editor.js | 13 ++- 10 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminUpdateCustomerGenderInCustomersGridActionGroup.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertAdminCustomerGenderInCustomersGridActionGroup.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertAdminCustomerGenderOnCustomerFormActionGroup.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/Data/GenderData.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridInlineEditorSection.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/AdminChangeCustomerGenderInCustomersGridTest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryHighlightedAndProductDisplayedTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryHighlightedAndProductDisplayedTest.xml index 3e72df9133898..ba30c7d0e26e4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryHighlightedAndProductDisplayedTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryHighlightedAndProductDisplayedTest.xml @@ -37,6 +37,10 @@ <createData entity="SimpleProduct" stepKey="product4"> <requiredEntity createDataKey="category2"/> </createData> + + <!-- TODO: REMOVE AFTER FIX MC-21717 --> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="product1" stepKey="deleteProduct1"/> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminUpdateCustomerGenderInCustomersGridActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminUpdateCustomerGenderInCustomersGridActionGroup.xml new file mode 100644 index 0000000000000..12c81e3694c0a --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminUpdateCustomerGenderInCustomersGridActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AdminUpdateCustomerGenderInCustomersGridActionGroup"> + <annotations> + <description>Update customer gender attribute value on customers grid page</description> + </annotations> + <arguments> + <argument name="customerEmail" defaultValue="{{Simple_US_Customer.email}}" type="string"/> + <argument name="genderValue" defaultValue="{{Gender.empty}}" type="string"/> + </arguments> + + <click selector="{{AdminDataGridTableSection.rowTemplate(customerEmail)}}" stepKey="clickCustomersGridRow"/> + <waitForElementVisible selector="{{AdminCustomerGridInlineEditorSection.customerGenderEditor}}" stepKey="waitForGenderElementAppeares"/> + <selectOption userInput="{{genderValue}}" selector="{{AdminCustomerGridInlineEditorSection.customerGenderEditor}}" stepKey="selectGenderValue"/> + <click selector="{{AdminCustomerGridInlineEditorSection.saveInGrid}}" stepKey="saveCustomer"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertAdminCustomerGenderInCustomersGridActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertAdminCustomerGenderInCustomersGridActionGroup.xml new file mode 100644 index 0000000000000..337c66a0539db --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertAdminCustomerGenderInCustomersGridActionGroup.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="AssertAdminCustomerGenderInCustomersGridActionGroup"> + <annotations> + <description>Assert customer genderAttribute value on customers grid page</description> + </annotations> + <arguments> + <argument name="customerEmail" defaultValue="{{Simple_US_Customer.email}}" type="string"/> + <argument name="expectedGenderValue" defaultValue="{{Gender.empty}}" type="string"/> + </arguments> + + <see userInput="{{expectedGenderValue}}" selector="{{AdminCustomerGridSection.customerGenderByEmail(customerEmail)}}" stepKey="assertGenderValue"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertAdminCustomerGenderOnCustomerFormActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertAdminCustomerGenderOnCustomerFormActionGroup.xml new file mode 100644 index 0000000000000..b21b0054b0c78 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertAdminCustomerGenderOnCustomerFormActionGroup.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="AssertAdminCustomerGenderOnCustomerFormActionGroup"> + <annotations> + <description>Validates that the provided Customer Gender is selected on the Admin Customer edit page.</description> + </annotations> + <arguments> + <argument name="customerGender" defaultValue="{{Gender.empty}}" type="string"/> + </arguments> + + <conditionalClick selector="{{AdminCustomerAccountInformationSection.accountInformationTab}}" dependentSelector="{{AdminCustomerAccountInformationSection.gender}}" visible="false" stepKey="clickOnAccountInfoTab"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <seeOptionIsSelected userInput="{{customerGender}}" selector="{{AdminCustomerAccountInformationSection.gender}}" stepKey="verifyNeededCustomerGenderSelected"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/Data/GenderData.xml b/app/code/Magento/Customer/Test/Mftf/Data/GenderData.xml new file mode 100644 index 0000000000000..68dee0ffa31d0 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Data/GenderData.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="Gender" type="gender"> + <data key="empty"/> + <data key="male">Male</data> + <data key="female">Female</data> + <data key="not_specified">Not Specified</data> + </entity> +</entities> diff --git a/app/code/Magento/Customer/Test/Mftf/Page/AdminCustomerPage.xml b/app/code/Magento/Customer/Test/Mftf/Page/AdminCustomerPage.xml index 114c737e361ed..d77dc15840e4c 100644 --- a/app/code/Magento/Customer/Test/Mftf/Page/AdminCustomerPage.xml +++ b/app/code/Magento/Customer/Test/Mftf/Page/AdminCustomerPage.xml @@ -13,5 +13,6 @@ <section name="AdminCustomerMessagesSection"/> <section name="AdminCustomerGridSection"/> <section name="AdminCustomerFiltersSection"/> + <section name="AdminCustomerGridInlineEditorSection"/> </page> </pages> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridInlineEditorSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridInlineEditorSection.xml new file mode 100644 index 0000000000000..d010844cfffcf --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridInlineEditorSection.xml @@ -0,0 +1,15 @@ +<?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="AdminCustomerGridInlineEditorSection"> + <element name="customerGenderEditor" type="select" selector="tr.data-grid-editable-row:not([style*='display: none']) [name='gender']"/> + <element name="saveInGrid" type="button" selector="tr.data-grid-editable-row-actions button.action-primary" timeout="30"/> + </section> +</sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridSection.xml index 91363c614c1f8..9562a902b26da 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridSection.xml @@ -16,5 +16,7 @@ <element name="customerCheckboxByEmail" type="checkbox" selector="//tr[@class='data-row' and //div[text()='{{customerEmail}}']]//input[@type='checkbox']" parameterized="true" timeout="30"/> <element name="customerEditLinkByEmail" type="text" selector="//tr[@class='data-row' and //div[text()='{{customerEmail}}']]//a[@class='action-menu-item']" parameterized="true" timeout="30"/> <element name="customerGroupByEmail" type="text" selector="//tr[@class='data-row' and //div[text()='{{customerEmail}}']]//div[text()='{{customerGroup}}']" parameterized="true"/> + <element name="customerGenderByEmail" type="text" selector="//tr[@class='data-row']//div[text()='{{customerEmail}}']/ancestor::tr/td[count(//div[@data-role='grid-wrapper']//tr//th[contains(., 'Gender')]/preceding-sibling::th) +1]" parameterized="true"/> </section> </sections> + diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminChangeCustomerGenderInCustomersGridTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminChangeCustomerGenderInCustomersGridTest.xml new file mode 100644 index 0000000000000..7ca9a6993f2fc --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminChangeCustomerGenderInCustomersGridTest.xml @@ -0,0 +1,83 @@ +<?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="AdminChangeCustomerGenderInCustomersGridTest"> + <annotations> + <features value="Customer"/> + <stories value="Update Customer"/> + <title value="Gender attribute blank value is saved in direct edits from customer grid"/> + <description value="Check that gender attribute blank value can be saved on customers grid"/> + <severity value="MAJOR"/> + <testCaseId value="MC-22025"/> + <useCaseId value="MC-17259"/> + <group value="customer"/> + </annotations> + <before> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <actionGroup ref="LoginAsAdmin" stepKey="login"/> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <!-- Reset customer grid filter --> + <amOnPage url="{{AdminCustomerPage.url}}" stepKey="goToCustomersGridPage"/> + <waitForPageLoad stepKey="waitForCustomersGrid"/> + <actionGroup ref="AdminResetFilterInCustomerGrid" stepKey="resetFilter"/> + + <actionGroup ref="logout" stepKey="logout"/> + </after> + <!-- Open customers grid page, filter by created customer--> + <actionGroup ref="AdminFilterCustomerByEmail" stepKey="filterCustomerGridByEmail"> + <argument name="email" value="$createCustomer.email$"/> + </actionGroup> + <!-- Check customer is in grid--> + <actionGroup ref="AdminAssertCustomerInCustomersGrid" stepKey="assertCustomerInCustomersGrid"> + <argument name="text" value="$createCustomer.email$"/> + <argument name="row" value="1"/> + </actionGroup> + <!--Check customer Gender value in grid--> + <actionGroup ref="AssertAdminCustomerGenderInCustomersGridActionGroup" stepKey="assertCustomerGenderInCustomersGrid"> + <argument name="customerEmail" value="$createCustomer.email$"/> + </actionGroup> + <!--Update customer Gender to Male--> + <actionGroup ref="AdminUpdateCustomerGenderInCustomersGridActionGroup" stepKey="updateCustomerGenderWithMaleValueInCustomersGrid"> + <argument name="customerEmail" value="$createCustomer.email$"/> + <argument name="genderValue" value="{{Gender.male}}"/> + </actionGroup> + <!--Check customer Gender value in grid--> + <actionGroup ref="AssertAdminCustomerGenderInCustomersGridActionGroup" stepKey="assertCustomerGenderMaleInCustomersGrid"> + <argument name="customerEmail" value="$createCustomer.email$"/> + <argument name="expectedGenderValue" value="{{Gender.male}}"/> + </actionGroup> + <!--Open customer edit page and check Gender value--> + <actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="openCustomerEditPageWithMaleGender"> + <argument name="customerId" value="$createCustomer.id$"/> + </actionGroup> + <actionGroup ref="AssertAdminCustomerGenderOnCustomerFormActionGroup" stepKey="assertCustomerGenderValueIsMaleOnCustomerForm"> + <argument name="customerGender" value="{{Gender.male}}"/> + </actionGroup> + <!--Filter customers grid by email--> + <actionGroup ref="AdminFilterCustomerByEmail" stepKey="filterCustomerByEmailToUpdateWithEmptyGender"> + <argument name="email" value="$createCustomer.email$"/> + </actionGroup> + <!--Update customer Gender to empty value--> + <actionGroup ref="AdminUpdateCustomerGenderInCustomersGridActionGroup" stepKey="updateCustomerGenderWithEmptyValueInCustomersGrid"> + <argument name="customerEmail" value="$createCustomer.email$"/> + </actionGroup> + <!--Check customer Gender value in grid--> + <actionGroup ref="AssertAdminCustomerGenderInCustomersGridActionGroup" stepKey="assertCustomerGenderEmptyInCustomersGrid"> + <argument name="customerEmail" value="$createCustomer.email$"/> + </actionGroup> + <!--Open customer edit page and check Gender value--> + <actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="openCustomerEditPageWithEmptyGender"> + <argument name="customerId" value="$createCustomer.id$"/> + </actionGroup> + <actionGroup ref="AssertAdminCustomerGenderOnCustomerFormActionGroup" stepKey="assertCustomerGenderValueIsEmptyOnCustomerForm"/> + </test> +</tests> diff --git a/app/code/Magento/Ui/view/base/web/js/grid/editing/editor.js b/app/code/Magento/Ui/view/base/web/js/grid/editing/editor.js index ece49cc8fe27c..ad70b200e4420 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/editing/editor.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/editing/editor.js @@ -337,7 +337,18 @@ define([ * @returns {Object} Collection of records data. */ getData: function () { - var data = this.activeRecords.map('getData'); + var data = this.activeRecords.map(function (record) { + var elemKey, + recordData = record.getData(); + + for (elemKey in recordData) { + if (_.isUndefined(recordData[elemKey])) { + recordData[elemKey] = null; + } + } + + return recordData; + }); return _.indexBy(data, this.indexField); }, From 8260aa3a2866c5997827a5a526c4d458303c8e9e Mon Sep 17 00:00:00 2001 From: Paavo Pokkinen <paavo.pokkinen@vaimo.com> Date: Fri, 1 Nov 2019 10:57:55 +0200 Subject: [PATCH 082/595] Add Cache-Control header to nginx sample configuration --- nginx.conf.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf.sample b/nginx.conf.sample index 979ac0be1f537..9219400f6aacd 100644 --- a/nginx.conf.sample +++ b/nginx.conf.sample @@ -109,7 +109,7 @@ location /static/ { rewrite ^/static/(version\d*/)?(.*)$ /static/$2 last; } - location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2|json)$ { + location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2|html|json)$ { add_header Cache-Control "public"; add_header X-Frame-Options "SAMEORIGIN"; expires +1y; From dff4a8c6daebf4056b648529e1e517e0d7958b3c Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Fri, 1 Nov 2019 10:01:39 -0500 Subject: [PATCH 083/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- app/code/Magento/Catalog/Model/Category.php | 1 + .../Catalog/Model/Indexer/Category/Product/Action/Rows.php | 6 ++++-- .../Catalog/Model/Indexer/Product/Category/Action/Rows.php | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Category.php b/app/code/Magento/Catalog/Model/Category.php index 2aafd7ff1c5d8..cefe1d400646e 100644 --- a/app/code/Magento/Catalog/Model/Category.php +++ b/app/code/Magento/Catalog/Model/Category.php @@ -1364,6 +1364,7 @@ public function getChildrenData() * * @return array * @todo refactor with converter for AbstractExtensibleModel + * phpcs:ignore Magento2.FunctionNameRestrictions.MethodDoubleUnderscore */ public function __toArray() { diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php b/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php index 1ad6d4c73a94c..24c9227bb64bd 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php @@ -20,6 +20,8 @@ /** * Action for partial reindex + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class Rows extends \Magento\Catalog\Model\Indexer\Category\Product\AbstractAction { @@ -85,7 +87,7 @@ public function execute(array $entityIds = [], $useTempTable = false) $indexer = $this->indexerRegistry->get(ProductCategoryIndexer::INDEXER_ID); $workingState = $indexer->isWorking(); - if ($useTempTable && !$workingState) { + if ($useTempTable && !$workingState && $indexer->isScheduled()) { foreach ($this->storeManager->getStores() as $store) { $this->connection->truncateTable($this->getIndexTable($store->getId())); } @@ -95,7 +97,7 @@ public function execute(array $entityIds = [], $useTempTable = false) $this->reindex(); - if ($useTempTable && !$workingState) { + if ($useTempTable && !$workingState && $indexer->isScheduled()) { foreach ($this->storeManager->getStores() as $store) { $removalCategoryIds = array_diff($this->limitationByCategories, [$this->getRootCategoryId($store)]); $this->connection->delete( diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php b/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php index 1890ac4ad45a7..ec3d0d57330ec 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php @@ -94,7 +94,7 @@ public function execute(array $entityIds = [], $useTempTable = false) $affectedCategories = $this->getCategoryIdsFromIndex($idsToBeReIndexed); - if ($useTempTable && !$workingState) { + if ($useTempTable && !$workingState && $indexer->isScheduled()) { foreach ($this->storeManager->getStores() as $store) { $this->connection->truncateTable($this->getIndexTable($store->getId())); } @@ -102,7 +102,7 @@ public function execute(array $entityIds = [], $useTempTable = false) $this->removeEntries(); } $this->reindex(); - if ($useTempTable && !$workingState) { + if ($useTempTable && !$workingState && $indexer->isScheduled()) { foreach ($this->storeManager->getStores() as $store) { $this->connection->delete( $this->tableMaintainer->getMainTable($store->getId()), From bd25c1dda66243db4a7de1d7ab1d439ecd4931eb Mon Sep 17 00:00:00 2001 From: DmitryTsymbal <d.tsymbal@atwix.com> Date: Fri, 1 Nov 2019 17:42:55 +0200 Subject: [PATCH 084/595] sections-refactoring --- .../AdminCreatesNewIntegrationActionGroup.xml | 4 ++-- ...AdminDeleteIntegrationEntityActionGroup.xml | 6 +++--- ...igateToCreateIntegrationPageActionGroup.xml | 2 +- ...AdminSearchIntegrationInGridActionGroup.xml | 4 ++-- ...dminSubmitNewIntegrationFormActionGroup.xml | 2 +- ...ssageCreateIntegrationEntityActionGroup.xml | 4 ++-- ...eletedIntegrationIsNotInGridActionGroup.xml | 2 +- ...on.xml => AdminIntegrationsGridSection.xml} | 11 +---------- .../Section/AdminNewIntegrationSection.xml | 18 ++++++++++++++++++ 9 files changed, 31 insertions(+), 22 deletions(-) rename app/code/Magento/Integration/Test/Mftf/Section/{AdminIntegrationsSection.xml => AdminIntegrationsGridSection.xml} (62%) create mode 100644 app/code/Magento/Integration/Test/Mftf/Section/AdminNewIntegrationSection.xml diff --git a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminCreatesNewIntegrationActionGroup.xml b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminCreatesNewIntegrationActionGroup.xml index 89e29d7d751a0..c039a70293269 100644 --- a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminCreatesNewIntegrationActionGroup.xml +++ b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminCreatesNewIntegrationActionGroup.xml @@ -15,7 +15,7 @@ <argument name="name" type="string"/> <argument name="password" type="string"/> </arguments> - <fillField stepKey="fillNameField" selector="{{AddNewIntegrationSection.name}}" userInput="{{name}}"/> - <fillField stepKey="fillAdminPasswordField" selector="{{AddNewIntegrationSection.password}}" userInput="{{password}}"/> + <fillField stepKey="fillNameField" selector="{{AdminNewIntegrationSection.name}}" userInput="{{name}}"/> + <fillField stepKey="fillAdminPasswordField" selector="{{AdminNewIntegrationSection.password}}" userInput="{{password}}"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminDeleteIntegrationEntityActionGroup.xml b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminDeleteIntegrationEntityActionGroup.xml index 87bcff8145184..4a73f6ce4b8df 100644 --- a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminDeleteIntegrationEntityActionGroup.xml +++ b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminDeleteIntegrationEntityActionGroup.xml @@ -9,9 +9,9 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminDeleteIntegrationEntityActionGroup"> - <click stepKey="clickRemoveButon" selector="{{IntegrationsGridSection.remove}}"/> - <waitForElementVisible selector="{{IntegrationsGridSection.submitButton}}" stepKey="waitForConfirmButtonVisible"/> - <click stepKey="clickSubmitButton" selector="{{IntegrationsGridSection.submitButton}}"/> + <click stepKey="clickRemoveButon" selector="{{AdminIntegrationsGridSection.remove}}"/> + <waitForElementVisible selector="{{AdminIntegrationsGridSection.submitButton}}" stepKey="waitForConfirmButtonVisible"/> + <click stepKey="clickSubmitButton" selector="{{AdminIntegrationsGridSection.submitButton}}"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminNavigateToCreateIntegrationPageActionGroup.xml b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminNavigateToCreateIntegrationPageActionGroup.xml index f31102419b665..18deddb3170aa 100644 --- a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminNavigateToCreateIntegrationPageActionGroup.xml +++ b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminNavigateToCreateIntegrationPageActionGroup.xml @@ -12,7 +12,7 @@ <!--Click the "Add New Integration" Button --> <actionGroup name="AdminNavigateToCreateIntegrationPageActionGroup"> - <click stepKey="clickAddNewIntegrationButton" selector="{{IntegrationsGridSection.add}}"/> + <click stepKey="clickAddNewIntegrationButton" selector="{{AdminIntegrationsGridSection.add}}"/> <waitForPageLoad stepKey="waitForNewNIntegrationPageLoaded"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminSearchIntegrationInGridActionGroup.xml b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminSearchIntegrationInGridActionGroup.xml index 6e0b7dc3eb9d5..dcd60a0479db4 100644 --- a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminSearchIntegrationInGridActionGroup.xml +++ b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminSearchIntegrationInGridActionGroup.xml @@ -15,9 +15,9 @@ <!--Reset Search Filters --> <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> <!--Fill Integration Name Field --> - <fillField selector="{{IntegrationsGridSection.name}}" userInput="{{name}}" stepKey="filterByName"/> + <fillField selector="{{AdminIntegrationsGridSection.name}}" userInput="{{name}}" stepKey="filterByName"/> <!--Click "Search" Button --> - <click selector="{{IntegrationsGridSection.search}}" stepKey="doFilter"/> + <click selector="{{AdminIntegrationsGridSection.search}}" stepKey="doFilter"/> <waitForPageLoad stepKey="waitForSitemapPageLoadedAfterFiltering"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminSubmitNewIntegrationFormActionGroup.xml b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminSubmitNewIntegrationFormActionGroup.xml index 23ddc2969a55e..f1dcd5da77c85 100644 --- a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminSubmitNewIntegrationFormActionGroup.xml +++ b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminSubmitNewIntegrationFormActionGroup.xml @@ -11,7 +11,7 @@ <actionGroup name="AdminSubmitNewIntegrationFormActionGroup"> <!--Click the "Save" Button --> - <click stepKey="clickSaveButton" selector="{{AddNewIntegrationSection.saveButton}}"/> + <click stepKey="clickSaveButton" selector="{{AdminNewIntegrationSection.saveButton}}"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertAdminMessageCreateIntegrationEntityActionGroup.xml b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertAdminMessageCreateIntegrationEntityActionGroup.xml index e928149c7f08f..f233c1d9a7f74 100644 --- a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertAdminMessageCreateIntegrationEntityActionGroup.xml +++ b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertAdminMessageCreateIntegrationEntityActionGroup.xml @@ -13,7 +13,7 @@ <argument name="message" type="string" defaultValue="The integration '{{name}}' has been saved."/> <argument name="messageType" type="string" defaultValue="success"/> </arguments> - <waitForElementVisible selector="{{IntegrationsGridSection.messageByType(messageType)}}" stepKey="waitForMessage"/> - <see userInput="{{message}}" selector="{{IntegrationsGridSection.messageByType(messageType)}}" stepKey="verifyMessage"/> + <waitForElementVisible selector="{{AdminIntegrationsGridSection.messageByType(messageType)}}" stepKey="waitForMessage"/> + <see userInput="{{message}}" selector="{{AdminIntegrationsGridSection.messageByType(messageType)}}" stepKey="verifyMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertDeletedIntegrationIsNotInGridActionGroup.xml b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertDeletedIntegrationIsNotInGridActionGroup.xml index 895f147fa8834..a4438b1eb70a7 100644 --- a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertDeletedIntegrationIsNotInGridActionGroup.xml +++ b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertDeletedIntegrationIsNotInGridActionGroup.xml @@ -12,6 +12,6 @@ <arguments> <argument name="name" type="string"/> </arguments> - <dontSee userInput="{{name}}" selector="{{IntegrationsGridSection.rowByIndex('1')}}" stepKey="donSeeIntegration"/> + <dontSee userInput="{{name}}" selector="{{AdminIntegrationsGridSection.rowByIndex('1')}}" stepKey="donSeeIntegration"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Integration/Test/Mftf/Section/AdminIntegrationsSection.xml b/app/code/Magento/Integration/Test/Mftf/Section/AdminIntegrationsGridSection.xml similarity index 62% rename from app/code/Magento/Integration/Test/Mftf/Section/AdminIntegrationsSection.xml rename to app/code/Magento/Integration/Test/Mftf/Section/AdminIntegrationsGridSection.xml index 4af25b9be9714..ae601542f3b37 100644 --- a/app/code/Magento/Integration/Test/Mftf/Section/AdminIntegrationsSection.xml +++ b/app/code/Magento/Integration/Test/Mftf/Section/AdminIntegrationsGridSection.xml @@ -8,7 +8,7 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> - <section name="IntegrationsGridSection"> + <section name="AdminIntegrationsGridSection"> <element name="add" type="button" selector=".page-actions .add"/> <element name="messageByType" type="block" selector="#messages .message-{{messageType}}" parameterized="true"/> <element name="name" type="input" selector=".data-grid-filters #integrationGrid_filter_name"/> @@ -18,13 +18,4 @@ <element name="rowByIndex" type="text" selector="tr[data-role='row']:nth-of-type({{var1}})" parameterized="true" timeout="30"/> <element name="edit" type="button" selector=".data-grid .edit"/> </section> - - <section name="AddNewIntegrationSection"> - <element name="name" type="input" selector="#integration_properties_name"/> - <element name="password" type="input" selector="#integration_properties_current_password"/> - <element name="saveButton" type="button" selector=".page-actions #save-split-button-button"/> - <element name="endpoint" type="input" selector="#integration_properties_endpoint"/> - <element name="linkUrl" type="input" selector="#integration_properties_identity_link_url"/> - <element name="save" type="button" selector=".page-actions-buttons .save"/> - </section> </sections> diff --git a/app/code/Magento/Integration/Test/Mftf/Section/AdminNewIntegrationSection.xml b/app/code/Magento/Integration/Test/Mftf/Section/AdminNewIntegrationSection.xml new file mode 100644 index 0000000000000..3e7214784c2b5 --- /dev/null +++ b/app/code/Magento/Integration/Test/Mftf/Section/AdminNewIntegrationSection.xml @@ -0,0 +1,18 @@ +<?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="AdminNewIntegrationSection"> + <element name="name" type="input" selector="#integration_properties_name"/> + <element name="password" type="input" selector="#integration_properties_current_password"/> + <element name="saveButton" type="button" selector=".page-actions #save-split-button-button"/> + <element name="endpoint" type="input" selector="#integration_properties_endpoint"/> + <element name="linkUrl" type="input" selector="#integration_properties_identity_link_url"/> + <element name="save" type="button" selector=".page-actions-buttons .save"/> + </section> +</sections> From 9d2cdef384431099c187aae97712a4de37bfad1c Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Fri, 1 Nov 2019 14:23:46 -0500 Subject: [PATCH 085/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- .../Magento/Catalog/Model/Indexer/Category/Product.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Product.php b/app/code/Magento/Catalog/Model/Indexer/Category/Product.php index 8458549456f41..c18404bda1fc8 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Product.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Product.php @@ -133,10 +133,15 @@ public function executeRow($id) protected function executeAction($ids) { $ids = array_unique($ids); + $indexer = $this->indexerRegistry->get(static::INDEXER_ID); /** @var Product\Action\Rows $action */ $action = $this->rowsActionFactory->create(); - $action->execute($ids, true); + if ($indexer->isScheduled()) { + $action->execute($ids, true); + } else { + $action->execute($ids); + } return $this; } From c664f00fe82841be4796458080c30e5e235f7fbc Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Fri, 1 Nov 2019 15:09:57 -0500 Subject: [PATCH 086/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- .../Fulltext/Plugin/Product/Category/Action/Rows.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Product/Category/Action/Rows.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Product/Category/Action/Rows.php index b8e60b9973731..2b1844deb114c 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Product/Category/Action/Rows.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Plugin/Product/Category/Action/Rows.php @@ -3,6 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Product\Category\Action; use Magento\Framework\Indexer\IndexerRegistry; @@ -33,12 +35,11 @@ public function __construct(IndexerRegistry $indexerRegistry) * @param ActionRows $subject * @param ActionRows $result * @param array $entityIds - * @param boolean $useTempTable - * @return Rows + * @return ActionRows * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function afterExecute(ActionRows $subject, ActionRows $result, array $entityIds, $useTempTable) + public function afterExecute(ActionRows $subject, ActionRows $result, array $entityIds): ActionRows { if (!empty($entityIds)) { $indexer = $this->indexerRegistry->get(FulltextIndexer::INDEXER_ID); From 0c4bcd899d6a161bf448d00f7c8b20d651441151 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Fri, 1 Nov 2019 17:15:17 -0500 Subject: [PATCH 087/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- .../Catalog/Test/Unit/Model/Indexer/Category/ProductTest.php | 4 ++-- .../Catalog/Test/Unit/Model/Indexer/Product/CategoryTest.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/ProductTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/ProductTest.php index fbc59e386305c..f7dde23e1510e 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/ProductTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Category/ProductTest.php @@ -90,7 +90,7 @@ public function testExecuteWithIndexerWorking() \Magento\Catalog\Model\Indexer\Category\Product\Action\Rows::class, ['execute'] ); - $rowMock->expects($this->at(0))->method('execute')->with($ids, true)->will($this->returnSelf()); + $rowMock->expects($this->at(0))->method('execute')->with($ids)->will($this->returnSelf()); $this->rowsMock->expects($this->once())->method('create')->will($this->returnValue($rowMock)); @@ -107,7 +107,7 @@ public function testExecuteWithIndexerNotWorking() \Magento\Catalog\Model\Indexer\Category\Product\Action\Rows::class, ['execute'] ); - $rowMock->expects($this->once())->method('execute')->with($ids, true)->will($this->returnSelf()); + $rowMock->expects($this->once())->method('execute')->with($ids)->will($this->returnSelf()); $this->rowsMock->expects($this->once())->method('create')->will($this->returnValue($rowMock)); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/CategoryTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/CategoryTest.php index ab0ca8a5bc48a..4e6659f85f5df 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/CategoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/CategoryTest.php @@ -90,7 +90,7 @@ public function testExecuteWithIndexerWorking() \Magento\Catalog\Model\Indexer\Product\Category\Action\Rows::class, ['execute'] ); - $rowMock->expects($this->at(0))->method('execute')->with($ids, true)->will($this->returnSelf()); + $rowMock->expects($this->at(0))->method('execute')->with($ids)->will($this->returnSelf()); $this->rowsMock->expects($this->once())->method('create')->will($this->returnValue($rowMock)); @@ -107,7 +107,7 @@ public function testExecuteWithIndexerNotWorking() \Magento\Catalog\Model\Indexer\Product\Category\Action\Rows::class, ['execute'] ); - $rowMock->expects($this->once())->method('execute')->with($ids, true)->will($this->returnSelf()); + $rowMock->expects($this->once())->method('execute')->with($ids)->will($this->returnSelf()); $this->rowsMock->expects($this->once())->method('create')->will($this->returnValue($rowMock)); From c1937ed4c29c01944f13c244f576da8ad97c263d Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@gmail.com> Date: Mon, 4 Nov 2019 08:00:11 +0200 Subject: [PATCH 088/595] MC-17259: Update blank gender it does not saved in direct edits from customer grid --- .../AdminUpdateCustomerGenderInCustomersGridActionGroup.xml | 2 +- .../AssertAdminCustomerGenderInCustomersGridActionGroup.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminUpdateCustomerGenderInCustomersGridActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminUpdateCustomerGenderInCustomersGridActionGroup.xml index 12c81e3694c0a..0b51140471ab7 100644 --- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminUpdateCustomerGenderInCustomersGridActionGroup.xml +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminUpdateCustomerGenderInCustomersGridActionGroup.xml @@ -18,7 +18,7 @@ </arguments> <click selector="{{AdminDataGridTableSection.rowTemplate(customerEmail)}}" stepKey="clickCustomersGridRow"/> - <waitForElementVisible selector="{{AdminCustomerGridInlineEditorSection.customerGenderEditor}}" stepKey="waitForGenderElementAppeares"/> + <waitForElementVisible selector="{{AdminCustomerGridInlineEditorSection.customerGenderEditor}}" stepKey="waitForGenderElementAppears"/> <selectOption userInput="{{genderValue}}" selector="{{AdminCustomerGridInlineEditorSection.customerGenderEditor}}" stepKey="selectGenderValue"/> <click selector="{{AdminCustomerGridInlineEditorSection.saveInGrid}}" stepKey="saveCustomer"/> </actionGroup> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertAdminCustomerGenderInCustomersGridActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertAdminCustomerGenderInCustomersGridActionGroup.xml index 337c66a0539db..8b73a9c3307e3 100644 --- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertAdminCustomerGenderInCustomersGridActionGroup.xml +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertAdminCustomerGenderInCustomersGridActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AssertAdminCustomerGenderInCustomersGridActionGroup"> <annotations> - <description>Assert customer genderAttribute value on customers grid page</description> + <description>Assert customer "Gender" attribute value on customer grid page</description> </annotations> <arguments> <argument name="customerEmail" defaultValue="{{Simple_US_Customer.email}}" type="string"/> From 08972b4ee14f37651dc000dbd03c2ad317ab0e66 Mon Sep 17 00:00:00 2001 From: vpashovski <vpashovski@extensadev.com> Date: Mon, 4 Nov 2019 18:21:58 +0200 Subject: [PATCH 089/595] Fix issue #22240 Create short name for Database Lock name --- lib/internal/Magento/Framework/Lock/Backend/Database.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Lock/Backend/Database.php b/lib/internal/Magento/Framework/Lock/Backend/Database.php index a5a76ba60f4e2..460c7554cc12c 100644 --- a/lib/internal/Magento/Framework/Lock/Backend/Database.php +++ b/lib/internal/Magento/Framework/Lock/Backend/Database.php @@ -13,6 +13,7 @@ use Magento\Framework\Exception\AlreadyExistsException; use Magento\Framework\Exception\InputException; use Magento\Framework\Phrase; +use Magento\Framework\DB\ExpressionConverter; /** * Implementation of the lock manager on the basis of MySQL. @@ -166,7 +167,8 @@ public function isLocked(string $name): bool */ private function addPrefix(string $name): string { - $name = $this->getPrefix() . '|' . $name; + $prefix = $this->getPrefix() . '|'; + $name = ExpressionConverter::shortenEntityName($prefix . $name, $prefix); if (strlen($name) > 64) { throw new InputException(new Phrase('Lock name too long: %1...', [substr($name, 0, 64)])); From eb16e9e650fafc82d918374ee72576a78666b339 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Mon, 4 Nov 2019 12:36:01 -0600 Subject: [PATCH 090/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- .../Controller/Adminhtml/Category/SaveTest.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Elasticsearch/Controller/Adminhtml/Category/SaveTest.php b/dev/tests/integration/testsuite/Magento/Elasticsearch/Controller/Adminhtml/Category/SaveTest.php index 787e554a947a1..b505e311b9ed0 100644 --- a/dev/tests/integration/testsuite/Magento/Elasticsearch/Controller/Adminhtml/Category/SaveTest.php +++ b/dev/tests/integration/testsuite/Magento/Elasticsearch/Controller/Adminhtml/Category/SaveTest.php @@ -52,6 +52,7 @@ protected function tearDown() /** * Checks a case when indexers are invalidated if products for category were changed. * + * @magentoConfigFixture current_store catalog/frontend/flat_catalog_category true * @magentoDataFixture Magento/Catalog/_files/category_product.php * @magentoDataFixture Magento/Catalog/_files/multiple_products.php */ @@ -77,11 +78,6 @@ public function testExecute() self::equalTo(['You saved the category.']), MessageInterface::TYPE_SUCCESS ); - - $fulltextIndexer = $this->getIndexer(FulltextIndexer::INDEXER_ID); - self::assertTrue($fulltextIndexer->isInvalid(), 'Fulltext indexer should be invalidated.'); - $categoryIndexer = $this->getIndexer(CategoryIndexer::INDEXER_ID); - self::assertTrue($categoryIndexer->isInvalid(), 'Category indexer should be invalidated.'); } /** From 07c55734cac20152f829433f084fec73eb7a1442 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Mon, 4 Nov 2019 14:33:05 -0600 Subject: [PATCH 091/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- app/code/Magento/Catalog/Model/Category.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Category.php b/app/code/Magento/Catalog/Model/Category.php index cefe1d400646e..db6786298c575 100644 --- a/app/code/Magento/Catalog/Model/Category.php +++ b/app/code/Magento/Catalog/Model/Category.php @@ -1359,15 +1359,16 @@ public function getChildrenData() //@codeCoverageIgnoreEnd + //phpcs:disable Magento2.FunctionNameRestrictions.MethodDoubleUnderscore /** * Return Data Object data in array format. * * @return array * @todo refactor with converter for AbstractExtensibleModel - * phpcs:ignore Magento2.FunctionNameRestrictions.MethodDoubleUnderscore */ public function __toArray() { + //phpcs:enable Magento2.FunctionNameRestrictions.MethodDoubleUnderscore $data = $this->_data; $hasToArray = function ($model) { return is_object($model) && method_exists($model, '__toArray') && is_callable([$model, '__toArray']); From dd0f93cbf7a355fbb69e698e03f975889b7d2e34 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Mon, 4 Nov 2019 14:33:44 -0600 Subject: [PATCH 092/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- app/code/Magento/Catalog/Model/Category.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Category.php b/app/code/Magento/Catalog/Model/Category.php index db6786298c575..15b8c658d2428 100644 --- a/app/code/Magento/Catalog/Model/Category.php +++ b/app/code/Magento/Catalog/Model/Category.php @@ -41,7 +41,6 @@ * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @since 100.0.2 - * phpcs:disable Magento2.FunctionNameRestrictions.MethodDoubleUnderscore */ class Category extends \Magento\Catalog\Model\AbstractModel implements \Magento\Framework\DataObject\IdentityInterface, From 0cd4aeae861db9593da45040f9e46691ea340379 Mon Sep 17 00:00:00 2001 From: torhoehn <torhoehn@gmail.com> Date: Mon, 4 Nov 2019 21:41:30 +0100 Subject: [PATCH 093/595] fix static test --- .../adminhtml/web/js/variations/steps/attributes_values.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/attributes_values.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/attributes_values.js index 8e057f5cd39dc..16dbf9ec23cd6 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/attributes_values.js +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/attributes_values.js @@ -106,7 +106,8 @@ define([ errorOption, allOptions = []; - newOption.label = $.trim(option.label); + newOption.label = $.trim(newOption.label); + if (_.isEmpty(newOption.label)) { return false; } From 52e42fb030bd295e95e10d8fc376ad55e2237bfb Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Mon, 4 Nov 2019 15:09:32 -0600 Subject: [PATCH 094/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- ...rifyCategoryProductAndProductCategoryPartialReindexTest.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml index deb6700c56990..5267fd068c86d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml @@ -114,9 +114,12 @@ <argument name="categoryName" value="$$categoryL.name$$"/> </actionGroup> + <!-- Indexer invalidation removed in scope of the MC-21948 implementation --> <!-- "One or more indexers are invalid. Make sure your Magento cron job is running." global warning message appears --> + <!-- <click selector="{{AdminSystemMessagesSection.systemMessagesDropdown}}" stepKey="openMessageSection"/> <see userInput="One or more indexers are invalid. Make sure your Magento cron job is running." selector="{{AdminSystemMessagesSection.warning}}" stepKey="seeWarningMessage"/> + --> <!-- Open categories K, L, M, N on Storefront in order to make sure that new assigments are not applied yet --> <!-- Category K contains only Products B & C --> From 62bb10df6560bed90325f0edd3a8797e44ba6db0 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Mon, 4 Nov 2019 15:12:00 -0600 Subject: [PATCH 095/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- app/code/Magento/Catalog/Model/Category.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Category.php b/app/code/Magento/Catalog/Model/Category.php index 15b8c658d2428..8b072602b2ace 100644 --- a/app/code/Magento/Catalog/Model/Category.php +++ b/app/code/Magento/Catalog/Model/Category.php @@ -1356,9 +1356,6 @@ public function getChildrenData() return $this->getData(self::KEY_CHILDREN_DATA); } - //@codeCoverageIgnoreEnd - - //phpcs:disable Magento2.FunctionNameRestrictions.MethodDoubleUnderscore /** * Return Data Object data in array format. * @@ -1367,7 +1364,6 @@ public function getChildrenData() */ public function __toArray() { - //phpcs:enable Magento2.FunctionNameRestrictions.MethodDoubleUnderscore $data = $this->_data; $hasToArray = function ($model) { return is_object($model) && method_exists($model, '__toArray') && is_callable([$model, '__toArray']); @@ -1387,6 +1383,8 @@ public function __toArray() return $data; } + //@codeCoverageIgnoreEnd + /** * Convert Category model into flat array. * From bdb12d8881411e51cbda6723c8e34ed6e466e6fd Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Mon, 4 Nov 2019 16:35:51 -0600 Subject: [PATCH 096/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- app/code/Magento/Catalog/Model/Category.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Catalog/Model/Category.php b/app/code/Magento/Catalog/Model/Category.php index 8b072602b2ace..70888052b7e02 100644 --- a/app/code/Magento/Catalog/Model/Category.php +++ b/app/code/Magento/Catalog/Model/Category.php @@ -1362,6 +1362,7 @@ public function getChildrenData() * @return array * @todo refactor with converter for AbstractExtensibleModel */ + // phpcs:ignore Magento2.FunctionNameRestrictions.MethodDoubleUnderscore public function __toArray() { $data = $this->_data; From 91b8378752e5a29f8a8d99537dc1827e9e87bdfa Mon Sep 17 00:00:00 2001 From: Serhii Voloshkov <serhii.voloshkov@transoftgroup.com> Date: Tue, 5 Nov 2019 13:28:26 +0200 Subject: [PATCH 097/595] MC-22741: Custom options asterisk issue --- .../product/composite/fieldset/options/type/checkbox.phtml | 2 +- .../product/composite/fieldset/options/type/multi.phtml | 2 +- .../product/composite/fieldset/options/type/radio.phtml | 6 +++--- .../product/composite/fieldset/options/type/select.phtml | 4 ++-- .../product/composite/fieldset/options/type/select.phtml | 2 +- .../product/composite/fieldset/options/view/checkable.phtml | 2 +- .../templates/product/composite/fieldset/downloadable.phtml | 6 +++--- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/checkbox.phtml b/app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/checkbox.phtml index 08e89699b1f71..236f15d6b376c 100644 --- a/app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/checkbox.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/checkbox.phtml @@ -10,7 +10,7 @@ <?php $_selections = $_option->getSelections(); ?> <?php $_skipSaleableCheck = $this->helper(Magento\Catalog\Helper\Product::class)->getSkipSaleableCheck(); ?> -<div class="field admin__field options<?php if ($_option->getRequired()) { echo ' required _required'; } ?>"> +<div class="field admin__field options<?php if ($_option->getRequired()) { echo ' _required'; } ?>"> <label class="label admin__field-label"> <span><?= $block->escapeHtml($_option->getTitle()) ?></span> </label> diff --git a/app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/multi.phtml b/app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/multi.phtml index f4c4e3e51ae09..28b94b21b7889 100644 --- a/app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/multi.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/multi.phtml @@ -9,7 +9,7 @@ <?php $_option = $block->getOption(); ?> <?php $_selections = $_option->getSelections(); ?> <?php $_skipSaleableCheck = $this->helper(Magento\Catalog\Helper\Product::class)->getSkipSaleableCheck(); ?> -<div class="field admin__field <?php if ($_option->getRequired()) { echo ' required'; } ?><?php if ($_option->getDecoratedIsLast()) :?> last<?php endif; ?>"> +<div class="field admin__field <?php if ($_option->getRequired()) { echo ' _required'; } ?><?php if ($_option->getDecoratedIsLast()) :?> last<?php endif; ?>"> <label class="label admin__field-label"><span><?= $block->escapeHtml($_option->getTitle()) ?></span></label> <div class="control admin__field-control"> <?php if (count($_selections) == 1 && $_option->getRequired()) : ?> diff --git a/app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/radio.phtml b/app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/radio.phtml index 0c3835fb32af8..185a9159c8ab3 100644 --- a/app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/radio.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/radio.phtml @@ -12,7 +12,7 @@ <?php $_skipSaleableCheck = $this->helper(Magento\Catalog\Helper\Product::class)->getSkipSaleableCheck(); ?> <?php list($_defaultQty, $_canChangeQty) = $block->getDefaultValues(); ?> -<div class="field admin__field options<?php if ($_option->getRequired()) { echo ' required'; } ?>"> +<div class="field admin__field options<?php if ($_option->getRequired()) { echo ' _required'; } ?>"> <label class="label admin__field-label"><span><?= $block->escapeHtml($_option->getTitle()) ?></span></label> <div class="control admin__field-control"> <div class="nested<?php if ($_option->getDecoratedIsLast()) :?> last<?php endif; ?>"> @@ -39,7 +39,7 @@ <?php foreach ($_selections as $_selection) : ?> <div class="field choice admin__field admin__field-option"> <input type="radio" - class="radio admin__control-radio <?= $_option->getRequired() ? ' validate-one-required-by-name' : '' ?> change-container-classname" + class="radio admin__control-radio <?= $_option->getRequired() ? ' required-entry' : '' ?> change-container-classname" id="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?>-<?= $block->escapeHtmlAttr($_selection->getSelectionId()) ?>" name="bundle_option[<?= $block->escapeHtmlAttr($_option->getId()) ?>]" <?php if ($block->isSelected($_selection)) { echo ' checked="checked"'; } ?> @@ -66,7 +66,7 @@ </label> <div class="control admin__field-control"><input <?php if (!$_canChangeQty) { echo ' disabled="disabled"'; } ?> id="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?>-qty-input" - class="input-text admin__control-text qty<?php if (!$_canChangeQty) { echo ' qty-disabled'; } ?>" + class="input-text admin__control-text qty validate-greater-than-zero<?php if (!$_canChangeQty) { echo ' qty-disabled'; } ?>" type="text" name="bundle_option_qty[<?= $block->escapeHtmlAttr($_option->getId()) ?>]" value="<?= $block->escapeHtmlAttr($_defaultQty) ?>" /> diff --git a/app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/select.phtml b/app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/select.phtml index fbb7f7fbb7b38..047e25a65af2b 100644 --- a/app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/select.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/select.phtml @@ -12,7 +12,7 @@ <?php $_skipSaleableCheck = $this->helper(Magento\Catalog\Helper\Product::class)->getSkipSaleableCheck(); ?> <?php list($_defaultQty, $_canChangeQty) = $block->getDefaultValues(); ?> -<div class="field admin__field option<?php if ($_option->getDecoratedIsLast()) :?> last<?php endif; ?><?php if ($_option->getRequired()) { echo ' required _required'; } ?>"> +<div class="field admin__field option<?php if ($_option->getDecoratedIsLast()) :?> last<?php endif; ?><?php if ($_option->getRequired()) { echo ' _required'; } ?>"> <label class="label admin__field-label"><span><?= $block->escapeHtml($_option->getTitle()) ?></span></label> <div class="control admin__field-control"> <?php if ($block->showSingle()) : ?> @@ -49,7 +49,7 @@ <div class="control admin__field-control"> <input <?php if (!$_canChangeQty) { echo ' disabled="disabled"'; } ?> id="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?>-qty-input" - class="input-text admin__control-text qty<?php if (!$_canChangeQty) { echo ' qty-disabled'; } ?>" + class="input-text admin__control-text qty validate-greater-than-zero<?php if (!$_canChangeQty) { echo ' qty-disabled'; } ?>" type="text" name="bundle_option_qty[<?= $block->escapeHtmlAttr($_option->getId()) ?>]" value="<?= $block->escapeHtmlAttr($_defaultQty) ?>" /> diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/select.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/select.phtml index 2218ce5d29671..243fdb6e603a0 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/select.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/select.phtml @@ -6,7 +6,7 @@ ?> <?php /* @var $block \Magento\Catalog\Block\Product\View\Options\Type\Select */ ?> <?php $_option = $block->getOption(); ?> -<div class="admin__field field<?= $_option->getIsRequire() ? ' required _required' : '' ?>"> +<div class="admin__field field<?= $_option->getIsRequire() ? ' _required' : '' ?>"> <label class="label admin__field-label"> <span><?= $block->escapeHtml($_option->getTitle()) ?></span> </label> diff --git a/app/code/Magento/Catalog/view/base/templates/product/composite/fieldset/options/view/checkable.phtml b/app/code/Magento/Catalog/view/base/templates/product/composite/fieldset/options/view/checkable.phtml index dbc064665d3fe..78d2883d7401a 100644 --- a/app/code/Magento/Catalog/view/base/templates/product/composite/fieldset/options/view/checkable.phtml +++ b/app/code/Magento/Catalog/view/base/templates/product/composite/fieldset/options/view/checkable.phtml @@ -53,7 +53,7 @@ if ($option) : ?> } ?> - <div class="field choice admin__field admin__field-option <?= /* @noEscape */ $option->getIsRequire() ? 'required': '' ?>"> + <div class="field choice admin__field admin__field-option"> <input type="<?= $block->escapeHtmlAttr($optionType) ?>" class="<?= $optionType === Option::OPTION_TYPE_RADIO ? 'radio admin__control-radio' diff --git a/app/code/Magento/Downloadable/view/adminhtml/templates/product/composite/fieldset/downloadable.phtml b/app/code/Magento/Downloadable/view/adminhtml/templates/product/composite/fieldset/downloadable.phtml index 8d471a1e49e7f..17d5b73f49506 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/templates/product/composite/fieldset/downloadable.phtml +++ b/app/code/Magento/Downloadable/view/adminhtml/templates/product/composite/fieldset/downloadable.phtml @@ -18,14 +18,14 @@ </legend><br /> <?php $_links = $block->getLinks(); ?> <?php $_isRequired = $block->getLinkSelectionRequired(); ?> - <div class="field admin__field link <?php if ($_isRequired) { echo ' required _required'; } ?>"> + <div class="field admin__field link<?php if ($_isRequired) { echo ' _required'; } ?>"> <label class="label admin__field-label"><span><?= $block->escapeHtml($block->getLinksTitle()) ?></span></label> <div class="control admin__field-control" id="downloadable-links-list"> <?php foreach ($_links as $_link) : ?> <div class="nested admin__field-option"> <?php if ($_linksPurchasedSeparately) : ?> <input type="checkbox" - class="admin__control-checkbox checkbox<?php if ($_isRequired) :?> validate-one-required-by-name<?php endif; ?> product downloadable link" + class="admin__control-checkbox checkbox<?php if ($_isRequired) :?> required-entry<?php endif; ?> product downloadable link" name="links[]" id="links_<?= $block->escapeHtmlAttr($_link->getId()) ?>" value="<?= $block->escapeHtmlAttr($_link->getId()) ?>" <?= $block->escapeHtml($block->getLinkCheckedValue($_link)) ?> @@ -81,7 +81,7 @@ require(['prototype'], function(){ } } //]]> - + }); </script> <?php endif;?> From 8f004abedbad3211ffa5029f4c32e5d76c65d881 Mon Sep 17 00:00:00 2001 From: Serhii Voloshkov <serhii.voloshkov@transoftgroup.com> Date: Tue, 5 Nov 2019 15:06:38 +0200 Subject: [PATCH 098/595] MC-22741: Custom options asterisk issue --- .../catalog/product/composite/fieldset/options/type/date.phtml | 2 +- .../catalog/product/composite/fieldset/configurable.phtml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/date.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/date.phtml index 8adffb752187b..68a7a3a69cfd3 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/date.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/composite/fieldset/options/type/date.phtml @@ -7,7 +7,7 @@ <?php /* @var $block \Magento\Catalog\Block\Product\View\Options\Type\Date */ ?> <?php $_option = $block->getOption(); ?> <?php $_optionId = (int)$_option->getId(); ?> -<div class="admin__field field<?= $_option->getIsRequire() ? ' required _required' : '' ?>"> +<div class="admin__field field<?= $_option->getIsRequire() ? ' required' : '' ?>"> <label class="label admin__field-label"> <?= $block->escapeHtml($_option->getTitle()) ?> <?= /* @noEscape */ $block->getFormattedPrice() ?> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/composite/fieldset/configurable.phtml b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/composite/fieldset/configurable.phtml index 1166adca97255..844422b2a2d7a 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/composite/fieldset/configurable.phtml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/composite/fieldset/configurable.phtml @@ -17,7 +17,7 @@ </legend> <div class="product-options fieldset admin__fieldset"> <?php foreach ($_attributes as $_attribute) : ?> - <div class="field admin__field _required required"> + <div class="field admin__field required"> <label class="label admin__field-label"><?= $block->escapeHtml($_attribute->getProductAttribute()->getStoreLabel($_product->getStoreId())); ?></label> From 7042986b40f6c5dfdf9fb29264f44681591484b7 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Tue, 5 Nov 2019 08:59:19 -0600 Subject: [PATCH 099/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- app/code/Magento/Catalog/Model/Category.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Category.php b/app/code/Magento/Catalog/Model/Category.php index 70888052b7e02..b60c1c4eb12e9 100644 --- a/app/code/Magento/Catalog/Model/Category.php +++ b/app/code/Magento/Catalog/Model/Category.php @@ -1201,6 +1201,8 @@ public function reindex() || $this->dataHasChangedFor('is_active')) { if (!$productIndexer->isScheduled()) { $productIndexer->reindexList($this->getPathIds()); + } else { + $productIndexer->invalidate(); } } } @@ -1356,6 +1358,8 @@ public function getChildrenData() return $this->getData(self::KEY_CHILDREN_DATA); } + //@codeCoverageIgnoreEnd + /** * Return Data Object data in array format. * @@ -1384,8 +1388,6 @@ public function __toArray() return $data; } - //@codeCoverageIgnoreEnd - /** * Convert Category model into flat array. * From e445f52da65c3c5720022b4909dc0e33685815e9 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Tue, 5 Nov 2019 09:07:53 -0600 Subject: [PATCH 100/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- ...rifyCategoryProductAndProductCategoryPartialReindexTest.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml index 5267fd068c86d..deb6700c56990 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml @@ -114,12 +114,9 @@ <argument name="categoryName" value="$$categoryL.name$$"/> </actionGroup> - <!-- Indexer invalidation removed in scope of the MC-21948 implementation --> <!-- "One or more indexers are invalid. Make sure your Magento cron job is running." global warning message appears --> - <!-- <click selector="{{AdminSystemMessagesSection.systemMessagesDropdown}}" stepKey="openMessageSection"/> <see userInput="One or more indexers are invalid. Make sure your Magento cron job is running." selector="{{AdminSystemMessagesSection.warning}}" stepKey="seeWarningMessage"/> - --> <!-- Open categories K, L, M, N on Storefront in order to make sure that new assigments are not applied yet --> <!-- Category K contains only Products B & C --> From 25d4b53b492f1bc08c1876d0fa4b957791de96da Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Tue, 5 Nov 2019 09:09:08 -0600 Subject: [PATCH 101/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- app/code/Magento/Catalog/Model/Category.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Category.php b/app/code/Magento/Catalog/Model/Category.php index b60c1c4eb12e9..4ddfd1f3b63a8 100644 --- a/app/code/Magento/Catalog/Model/Category.php +++ b/app/code/Magento/Catalog/Model/Category.php @@ -1366,7 +1366,6 @@ public function getChildrenData() * @return array * @todo refactor with converter for AbstractExtensibleModel */ - // phpcs:ignore Magento2.FunctionNameRestrictions.MethodDoubleUnderscore public function __toArray() { $data = $this->_data; From 4dce93e1d3439d23ac822274e20cffb94f85463d Mon Sep 17 00:00:00 2001 From: vpashovski <vpashovski@extensadev.com> Date: Tue, 5 Nov 2019 18:03:06 +0200 Subject: [PATCH 102/595] Remove "|" when prefix is empty Fix Test to lock database with long name --- lib/internal/Magento/Framework/Lock/Backend/Database.php | 2 +- .../Framework/Lock/Test/Unit/Backend/DatabaseTest.php | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/Lock/Backend/Database.php b/lib/internal/Magento/Framework/Lock/Backend/Database.php index 460c7554cc12c..bf59167f2b50d 100644 --- a/lib/internal/Magento/Framework/Lock/Backend/Database.php +++ b/lib/internal/Magento/Framework/Lock/Backend/Database.php @@ -167,7 +167,7 @@ public function isLocked(string $name): bool */ private function addPrefix(string $name): string { - $prefix = $this->getPrefix() . '|'; + $prefix = $this->getPrefix() ? $this->getPrefix() . '|' : ''; $name = ExpressionConverter::shortenEntityName($prefix . $name, $prefix); if (strlen($name) > 64) { diff --git a/lib/internal/Magento/Framework/Lock/Test/Unit/Backend/DatabaseTest.php b/lib/internal/Magento/Framework/Lock/Test/Unit/Backend/DatabaseTest.php index e2a95030bbd1c..fd6fa44bd01ed 100644 --- a/lib/internal/Magento/Framework/Lock/Test/Unit/Backend/DatabaseTest.php +++ b/lib/internal/Magento/Framework/Lock/Test/Unit/Backend/DatabaseTest.php @@ -106,7 +106,6 @@ public function testLock() * @throws \Magento\Framework\Exception\AlreadyExistsException * @throws \Magento\Framework\Exception\InputException * @throws \Zend_Db_Statement_Exception - * @expectedException \Magento\Framework\Exception\InputException */ public function testlockWithTooLongName() { @@ -114,7 +113,11 @@ public function testlockWithTooLongName() ->method('isDbAvailable') ->with() ->willReturn(true); - $this->database->lock('BbXbyf9rIY5xuAVdviQJmh76FyoeeVHTDpcjmcImNtgpO4Hnz4xk76ZGEyYALvrQu'); + $this->statement->expects($this->once()) + ->method('fetchColumn') + ->willReturn(true); + + $this->assertTrue($this->database->lock('BbXbyf9rIY5xuAVdviQJmh76FyoeeVHTDpcjmcImNtgpO4Hnz4xk76ZGEyYALvrQu')); } /** From a81802a9ceed3782da19a4f3a2a8267107b695a2 Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Fri, 25 Oct 2019 17:18:40 -0500 Subject: [PATCH 103/595] MC-22572: Shuffle related, up-sale and cross-sale products either by priority and weight - Fix random order of related, up-sell and cross-sell products - Add support for weighted random order of related, up-sell and cross-sell products --- .../templates/product/list/items.phtml | 10 ++- .../view/frontend/web/js/related-products.js | 77 +++++++++++++++--- .../view/frontend/web/js/upsell-products.js | 78 +++++++++++++++---- 3 files changed, 137 insertions(+), 28 deletions(-) diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml index 926e7c78a7df0..8f1fe3fa6874c 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml @@ -23,6 +23,7 @@ switch ($type = $block->getType()) { $items = $block->getAllItems(); $limit = $block->getPositionLimit(); $shuffle = (int) $block->isShuffled(); + $isWeightedRandom = (int) $block->getRotation()->isWeightedRandom($block->getProductListType()); $canItemsAddToCart = $block->canItemsAddToCart(); $showAddTo = true; @@ -43,6 +44,7 @@ switch ($type = $block->getType()) { $items = $block->getItems(); $limit = 0; $shuffle = 0; + $isWeightedRandom = 0; $canItemsAddToCart = $block->canItemsAddToCart(); $showAddTo = true; @@ -62,6 +64,7 @@ switch ($type = $block->getType()) { $items = $block->getAllItems(); $limit = $block->getPositionLimit(); $shuffle = (int) $block->isShuffled(); + $isWeightedRandom = (int) $block->getRotation()->isWeightedRandom($block->getProductListType()); $showAddTo = false; $showCart = false; @@ -82,6 +85,7 @@ switch ($type = $block->getType()) { $items = $block->getItemCollection()->getItems(); $limit = $block->getItemLimit('upsell'); $shuffle = 0; + $isWeightedRandom = 0; $showAddTo = false; $showCart = false; @@ -156,9 +160,9 @@ switch ($type = $block->getType()) { <?php if ($type == 'related' || $type == 'upsell') :?> <?php if ($type == 'related') :?> -<div class="block <?= $block->escapeHtmlAttr($class) ?>" data-mage-init='{"relatedProducts":{"relatedCheckbox":".related.checkbox"}}' data-limit="<?= $block->escapeHtmlAttr($limit) ?>" data-shuffle="<?= /* @noEscape */ $shuffle ?>"> +<div class="block <?= $block->escapeHtmlAttr($class) ?>" data-mage-init='{"relatedProducts":{"relatedCheckbox":".related.checkbox"}}' data-limit="<?= $block->escapeHtmlAttr($limit) ?>" data-shuffle="<?= /* @noEscape */ $shuffle ?>" data-shuffle-weighted="<?= /* @noEscape */ $isWeightedRandom ?>"> <?php else :?> - <div class="block <?= $block->escapeHtmlAttr($class) ?>" data-mage-init='{"upsellProducts":{}}' data-limit="<?= $block->escapeHtmlAttr($limit) ?>" data-shuffle="<?= /* @noEscape */ $shuffle ?>"> + <div class="block <?= $block->escapeHtmlAttr($class) ?>" data-mage-init='{"upsellProducts":{}}' data-limit="<?= $block->escapeHtmlAttr($limit) ?>" data-shuffle="<?= /* @noEscape */ $shuffle ?>" data-shuffle-weighted="<?= /* @noEscape */ $isWeightedRandom ?>"> <?php endif; ?> <?php else :?> <div class="block <?= $block->escapeHtmlAttr($class) ?>"> @@ -183,7 +187,7 @@ switch ($type = $block->getType()) { <?php endif; ?> <?php endif; ?> <?php if ($type == 'related' || $type == 'upsell') :?> - <li class="item product product-item" style="display: none;"> + <li class="item product product-item" style="display: none;" data-shuffle-group="<?= $block->escapeHtmlAttr($_item->getPriority()) ?>" > <?php else :?> <li class="item product product-item"> <?php endif; ?> diff --git a/app/code/Magento/Catalog/view/frontend/web/js/related-products.js b/app/code/Magento/Catalog/view/frontend/web/js/related-products.js index c875dd8f5d2c7..bc54fdeac5c28 100644 --- a/app/code/Magento/Catalog/view/frontend/web/js/related-products.js +++ b/app/code/Magento/Catalog/view/frontend/web/js/related-products.js @@ -28,10 +28,14 @@ define([ _create: function () { $(this.options.selectAllLink, this.element).on('click', $.proxy(this._selectAllRelated, this)); $(this.options.relatedCheckbox, this.element).on('click', $.proxy(this._addRelatedToProduct, this)); + + if (this.element.data('shuffle')) { + this._shuffle(this.element.find(this.options.elementsSelector)); + } this._showRelatedProducts( this.element.find(this.options.elementsSelector), this.element.data('limit'), - this.element.data('shuffle') + this.element.data('shuffle-weighted') ); }, @@ -69,24 +73,66 @@ define([ ); }, + /* jscs:disable */ + /* eslint-disable */ /** * Show related products according to limit. Shuffle if needed. * @param {*} elements * @param {*} limit - * @param {*} shuffle + * @param weightedRandom * @private */ - _showRelatedProducts: function (elements, limit, shuffle) { - var index; - - if (shuffle) { - this._shuffle(elements); - } + _showRelatedProducts: function (elements, limit, weightedRandom) { + var index, weights = [], random = [], weight = 2, shown = 0, $element, currentGroup, prevGroup; if (limit === 0) { limit = elements.length; } + if (weightedRandom && limit > 0 && limit < elements.length) { + for (index = 0; index < limit; index++) { + $element = $(elements[index]); + if ($element.data('shuffle-group') !== '') { + break; + } + $element.show(); + shown++; + } + limit -= shown; + for (index = elements.length - 1; index >= 0; index--) { + $element = $(elements[index]); + currentGroup = $element.data('shuffle-group'); + if (currentGroup !== '') { + weights.push([index, Math.log(weight)]); + if (typeof prevGroup !== 'undefined' && prevGroup !== currentGroup) { + weight += 2; + } + prevGroup = currentGroup; + } + } + + if (weights.length === 0) { + return; + } + + for (index = 0; index < weights.length; index++) { + random.push([weights[index][0], Math.pow(Math.random(), 1 / weights[index][1])]); + } + + random.sort(function(a, b) { + a = a[1]; + b = b[1]; + return a < b ? 1 : (a > b ? -1 : 0); + }); + index = 0; + while (limit) { + $(elements[random[index][0]]).show(); + limit--; + index++ + } + return; + } + for (index = 0; index < limit; index++) { $(elements[index]).show(); } @@ -96,12 +142,19 @@ define([ /* eslint-disable */ /** * Shuffle an array - * @param {Array} o + * @param {Array} elements * @returns {*} */ - _shuffle: function shuffle(o) { //v1.0 - for (var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); - return o; + _shuffle: function shuffle(elements) { + var parent, child, lastSibling; + if (elements.length) { + parent = $(elements[0]).parent(); + } + while (elements.length) { + child = elements.splice(Math.floor(Math.random() * elements.length), 1)[0]; + lastSibling = parent.find('[data-shuffle-group="' + $(child).data('shuffle-group') + '"]').last(); + lastSibling.after(child); + } } /* jscs:disable */ diff --git a/app/code/Magento/Catalog/view/frontend/web/js/upsell-products.js b/app/code/Magento/Catalog/view/frontend/web/js/upsell-products.js index da2526d5679c8..867011d3d1646 100644 --- a/app/code/Magento/Catalog/view/frontend/web/js/upsell-products.js +++ b/app/code/Magento/Catalog/view/frontend/web/js/upsell-products.js @@ -19,33 +19,78 @@ define([ * @private */ _create: function () { + if (this.element.data('shuffle')) { + this._shuffle(this.element.find(this.options.elementsSelector)); + } this._showUpsellProducts( this.element.find(this.options.elementsSelector), this.element.data('limit'), - this.element.data('shuffle') + this.element.data('shuffle-weighted') ); }, + /* jscs:disable */ + /* eslint-disable */ /** * Show upsell products according to limit. Shuffle if needed. * @param {*} elements * @param {Number} limit - * @param {Boolean} shuffle + * @param {Boolean} weightedRandom * @private */ - _showUpsellProducts: function (elements, limit, shuffle) { - var index; - - if (shuffle) { - this._shuffle(elements); - } + _showUpsellProducts: function (elements, limit, weightedRandom) { + var index, weights = [], random = [], weight = 2, shown = 0, $element, currentGroup, prevGroup; if (limit === 0) { limit = elements.length; } + if (weightedRandom && limit > 0 && limit < elements.length) { + for (index = 0; index < limit; index++) { + $element = $(elements[index]); + if ($element.data('shuffle-group') !== '') { + break; + } + $element.show(); + shown++; + } + limit -= shown; + for (index = elements.length - 1; index >= 0; index--) { + $element = $(elements[index]); + currentGroup = $element.data('shuffle-group'); + if (currentGroup !== '') { + weights.push([index, Math.log(weight)]); + if (typeof prevGroup !== 'undefined' && prevGroup !== currentGroup) { + weight += 2; + } + prevGroup = currentGroup; + } + } + + if (weights.length === 0) { + return; + } + + for (index = 0; index < weights.length; index++) { + random.push([weights[index][0], Math.pow(Math.random(), 1 / weights[index][1])]); + } + + random.sort(function(a, b) { + a = a[1]; + b = b[1]; + return a < b ? 1 : (a > b ? -1 : 0); + }); + index = 0; + while (limit) { + $(elements[random[index][0]]).show(); + limit--; + index++ + } + return; + } + for (index = 0; index < limit; index++) { - $(this.element).find(elements[index]).show(); + $(elements[index]).show(); } }, @@ -53,12 +98,19 @@ define([ /* eslint-disable */ /** * Shuffle an array - * @param o + * @param elements * @returns {*} */ - _shuffle: function shuffle(o){ //v1.0 - for (var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); - return o; + _shuffle: function shuffle(elements){ //v1.0 + var parent, child, lastSibling; + if (elements.length) { + parent = $(elements[0]).parent(); + } + while (elements.length) { + child = elements.splice(Math.floor(Math.random() * elements.length), 1)[0]; + lastSibling = parent.find('[data-shuffle-group="' + $(child).data('shuffle-group') + '"]').last(); + lastSibling.after(child); + } } /* jscs:disable */ From 8132944e9942a0d46811d99127f1706cdd8109ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Tylek?= <pawel.tylek@creativestyle.pl> Date: Thu, 7 Nov 2019 15:27:10 +0100 Subject: [PATCH 104/595] M2C-22619 Fix Tabs widget with Accordion --- lib/web/mage/tabs.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/web/mage/tabs.js b/lib/web/mage/tabs.js index 496a271c631f2..7a313bb7ac1b9 100644 --- a/lib/web/mage/tabs.js +++ b/lib/web/mage/tabs.js @@ -102,21 +102,21 @@ define([ * @private */ _processPanels: function () { - this.contents = this.element.find(this.options.content); + this.contents = this.element.children(this.options.content); - this.collapsibles = this.element.find(this.options.collapsibleElement); + this.collapsibles = this.element.children(this.options.collapsibleElement); this.collapsibles .attr('role', 'presentation') .parent() .attr('role', 'tablist'); - this.headers = this.element.find(this.options.header); + this.headers = this.element.children(this.options.header); if (this.headers.length === 0) { this.headers = this.collapsibles; } - this.triggers = this.element.find(this.options.trigger); + this.triggers = this.element.children(this.options.trigger); if (this.triggers.length === 0) { this.triggers = this.headers; From 8b5818df65ad4ab7ed33fe5933782151f9b0d2cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Corr=C3=AAa=20Gomes?= <rafaelcgstz@gmail.com> Date: Thu, 7 Nov 2019 22:55:40 -0300 Subject: [PATCH 105/595] Contact form > Adding ViewModel --- .../Contact/ViewModel/UserDataProvider.php | 72 +++++++++++++++++++ .../frontend/layout/contact_index_index.xml | 3 + .../view/frontend/templates/form.phtml | 11 +-- 3 files changed, 82 insertions(+), 4 deletions(-) create mode 100644 app/code/Magento/Contact/ViewModel/UserDataProvider.php diff --git a/app/code/Magento/Contact/ViewModel/UserDataProvider.php b/app/code/Magento/Contact/ViewModel/UserDataProvider.php new file mode 100644 index 0000000000000..678f4349b0e88 --- /dev/null +++ b/app/code/Magento/Contact/ViewModel/UserDataProvider.php @@ -0,0 +1,72 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Contact\ViewModel; + +use Magento\Contact\Helper\Data; +use Magento\Framework\View\Element\Block\ArgumentInterface; + +/** + * Provides the user data to fill the form. + */ +class UserDataProvider implements ArgumentInterface +{ + + /** + * @var Data + */ + private $helper; + + /** + * UserDataProvider constructor. + * @param Data $helper + */ + public function __construct( + Data $helper + ) { + $this->helper = $helper; + } + + /** + * Get user name + * + * @return string + */ + public function getUserName() + { + return $this->helper->getPostValue('name') ?: $this->helper->getUserName(); + } + + /** + * Get user email + * + * @return string + */ + public function getUserEmail() + { + return $this->helper->getPostValue('email') ?: $this->helper->getUserEmail(); + } + + /** + * Get user telephone + * + * @return string + */ + public function getUserTelephone() + { + return $this->helper->getPostValue('telephone'); + } + + /** + * Get user comment + * + * @return string + */ + public function getUserComment() + { + return $this->helper->getPostValue('comment'); + } +} diff --git a/app/code/Magento/Contact/view/frontend/layout/contact_index_index.xml b/app/code/Magento/Contact/view/frontend/layout/contact_index_index.xml index 078c1a4ff5621..c7009831d4642 100644 --- a/app/code/Magento/Contact/view/frontend/layout/contact_index_index.xml +++ b/app/code/Magento/Contact/view/frontend/layout/contact_index_index.xml @@ -13,6 +13,9 @@ <referenceContainer name="content"> <block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml"> <container name="form.additional.info" label="Form Additional Info"/> + <arguments> + <argument name="view_model" xsi:type="object">Magento\Contact\ViewModel\UserDataProvider</argument> + </arguments> </block> </referenceContainer> </body> diff --git a/app/code/Magento/Contact/view/frontend/templates/form.phtml b/app/code/Magento/Contact/view/frontend/templates/form.phtml index d64a991bcafad..74708bf276a78 100644 --- a/app/code/Magento/Contact/view/frontend/templates/form.phtml +++ b/app/code/Magento/Contact/view/frontend/templates/form.phtml @@ -6,6 +6,9 @@ // @codingStandardsIgnoreFile /** @var \Magento\Contact\Block\ContactForm $block */ +/** @var \Magento\Contact\ViewModel\UserDataProvider $viewModel */ + +$viewModel = $block->getViewModel(); ?> <form class="form contact" action="<?= $block->escapeUrl($block->getFormAction()) ?>" @@ -19,25 +22,25 @@ <div class="field name required"> <label class="label" for="name"><span><?= $block->escapeHtml(__('Name')) ?></span></label> <div class="control"> - <input name="name" id="name" title="<?= $block->escapeHtmlAttr(__('Name')) ?>" value="<?= $block->escapeHtmlAttr($this->helper('Magento\Contact\Helper\Data')->getPostValue('name') ?: $this->helper('Magento\Contact\Helper\Data')->getUserName()) ?>" class="input-text" type="text" data-validate="{required:true}"/> + <input name="name" id="name" title="<?= $block->escapeHtmlAttr(__('Name')) ?>" value="<?= $block->escapeHtmlAttr($viewModel->getUserName()) ?>" class="input-text" type="text" data-validate="{required:true}"/> </div> </div> <div class="field email required"> <label class="label" for="email"><span><?= $block->escapeHtml(__('Email')) ?></span></label> <div class="control"> - <input name="email" id="email" title="<?= $block->escapeHtmlAttr(__('Email')) ?>" value="<?= $block->escapeHtmlAttr($this->helper('Magento\Contact\Helper\Data')->getPostValue('email') ?: $this->helper('Magento\Contact\Helper\Data')->getUserEmail()) ?>" class="input-text" type="email" data-validate="{required:true, 'validate-email':true}"/> + <input name="email" id="email" title="<?= $block->escapeHtmlAttr(__('Email')) ?>" value="<?= $block->escapeHtmlAttr($viewModel->getUserEmail()) ?>" class="input-text" type="email" data-validate="{required:true, 'validate-email':true}"/> </div> </div> <div class="field telephone"> <label class="label" for="telephone"><span><?= $block->escapeHtml(__('Phone Number')) ?></span></label> <div class="control"> - <input name="telephone" id="telephone" title="<?= $block->escapeHtmlAttr(__('Phone Number')) ?>" value="<?= $block->escapeHtmlAttr($this->helper('Magento\Contact\Helper\Data')->getPostValue('telephone')) ?>" class="input-text" type="text" /> + <input name="telephone" id="telephone" title="<?= $block->escapeHtmlAttr(__('Phone Number')) ?>" value="<?= $block->escapeHtmlAttr($viewModel->getUserTelephone()) ?>" class="input-text" type="text" /> </div> </div> <div class="field comment required"> <label class="label" for="comment"><span><?= $block->escapeHtml(__('What’s on your mind?')) ?></span></label> <div class="control"> - <textarea name="comment" id="comment" title="<?= $block->escapeHtmlAttr(__('What’s on your mind?')) ?>" class="input-text" cols="5" rows="3" data-validate="{required:true}"><?= $block->escapeHtml($this->helper('Magento\Contact\Helper\Data')->getPostValue('comment')) ?></textarea> + <textarea name="comment" id="comment" title="<?= $block->escapeHtmlAttr(__('What’s on your mind?')) ?>" class="input-text" cols="5" rows="3" data-validate="{required:true}"><?= $block->escapeHtml($viewModel->getUserComment()) ?></textarea> </div> </div> <?= $block->getChildHtml('form.additional.info') ?> From b11f053bc29564ef13fb071161b52276a5701ed0 Mon Sep 17 00:00:00 2001 From: Serhii Voloshkov <serhii.voloshkov@transoftgroup.com> Date: Fri, 8 Nov 2019 13:30:01 +0200 Subject: [PATCH 106/595] MC-20259: PUT /V1/products/:sku/media/:entryId is not idempotent --- .../Model/Product/Gallery/CreateHandler.php | 2 +- .../Product/Gallery/GalleryManagement.php | 20 ++-- .../Model/Product/Gallery/UpdateHandler.php | 11 ++ .../MediaGalleryProcessor.php | 12 +- .../Product/Gallery/GalleryManagementTest.php | 27 ++++- ...uteMediaGalleryManagementInterfaceTest.php | 107 ++++++++++++++---- 6 files changed, 135 insertions(+), 44 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Product/Gallery/CreateHandler.php b/app/code/Magento/Catalog/Model/Product/Gallery/CreateHandler.php index b374b754d7de1..225a3a4c44a9b 100644 --- a/app/code/Magento/Catalog/Model/Product/Gallery/CreateHandler.php +++ b/app/code/Magento/Catalog/Model/Product/Gallery/CreateHandler.php @@ -162,7 +162,7 @@ public function execute($product, $arguments = []) if (!empty($image['removed'])) { $clearImages[] = $image['file']; - } elseif (empty($image['value_id'])) { + } elseif (empty($image['value_id']) || !empty($image['recreate'])) { $newFile = $this->moveImageFromTmp($image['file']); $image['new_file'] = $newFile; $newImages[$image['file']] = $image; diff --git a/app/code/Magento/Catalog/Model/Product/Gallery/GalleryManagement.php b/app/code/Magento/Catalog/Model/Product/Gallery/GalleryManagement.php index 9e5cf084c25a1..a9afb7cec45e2 100644 --- a/app/code/Magento/Catalog/Model/Product/Gallery/GalleryManagement.php +++ b/app/code/Magento/Catalog/Model/Product/Gallery/GalleryManagement.php @@ -71,10 +71,12 @@ public function create($sku, ProductAttributeMediaGalleryEntryInterface $entry) $product->setMediaGalleryEntries($existingMediaGalleryEntries); try { $product = $this->productRepository->save($product); - } catch (InputException $inputException) { - throw $inputException; } catch (\Exception $e) { - throw new StateException(__("The product can't be saved.")); + if ($e instanceof InputException) { + throw $e; + } else { + throw new StateException(__("The product can't be saved.")); + } } foreach ($product->getMediaGalleryEntries() as $entry) { @@ -98,19 +100,13 @@ public function update($sku, ProductAttributeMediaGalleryEntryInterface $entry) ); } $found = false; + $entryTypes = (array)$entry->getTypes(); foreach ($existingMediaGalleryEntries as $key => $existingEntry) { - $entryTypes = (array)$entry->getTypes(); - $existingEntryTypes = (array)$existingMediaGalleryEntries[$key]->getTypes(); - $existingMediaGalleryEntries[$key]->setTypes(array_diff($existingEntryTypes, $entryTypes)); + $existingEntryTypes = (array)$existingEntry->getTypes(); + $existingEntry->setTypes(array_diff($existingEntryTypes, $entryTypes)); if ($existingEntry->getId() == $entry->getId()) { $found = true; - - $file = $entry->getContent(); - - if ($file && $file->getBase64EncodedData() || $entry->getFile()) { - $entry->setId(null); - } $existingMediaGalleryEntries[$key] = $entry; } } diff --git a/app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php b/app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php index 189135776b68b..049846ef36490 100644 --- a/app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php +++ b/app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php @@ -5,6 +5,7 @@ */ namespace Magento\Catalog\Model\Product\Gallery; +use Magento\Catalog\Model\ResourceModel\Product\Gallery; use Magento\Framework\EntityManager\Operation\ExtensionInterface; /** @@ -75,6 +76,16 @@ protected function processNewImage($product, array &$image) $image['value_id'], $product->getData($this->metadata->getLinkField()) ); + } elseif (!empty($image['recreate'])) { + $data['value_id'] = $image['value_id']; + $data['value'] = $image['file']; + $data['attribute_id'] = $this->getAttribute()->getAttributeId(); + + if (!empty($image['media_type'])) { + $data['media_type'] = $image['media_type']; + } + + $this->resourceModel->saveDataRow(Gallery::GALLERY_TABLE, $data); } return $data; diff --git a/app/code/Magento/Catalog/Model/ProductRepository/MediaGalleryProcessor.php b/app/code/Magento/Catalog/Model/ProductRepository/MediaGalleryProcessor.php index fdcf2956dbdef..2aa92b8f0316e 100644 --- a/app/code/Magento/Catalog/Model/ProductRepository/MediaGalleryProcessor.php +++ b/app/code/Magento/Catalog/Model/ProductRepository/MediaGalleryProcessor.php @@ -92,7 +92,17 @@ public function processMediaGallery(ProductInterface $product, array $mediaGalle if ($updatedEntry['file'] === null) { unset($updatedEntry['file']); } - $existingMediaGallery[$key] = array_merge($existingEntry, $updatedEntry); + if (isset($updatedEntry['content'])) { + //need to recreate image and reset object + $existingEntry['recreate'] = true; + // phpcs:ignore Magento2.Performance.ForeachArrayMerge + $newEntry = array_merge($existingEntry, $updatedEntry); + $newEntries[] = $newEntry; + unset($existingMediaGallery[$key]); + } else { + // phpcs:ignore Magento2.Performance.ForeachArrayMerge + $existingMediaGallery[$key] = array_merge($existingEntry, $updatedEntry); + } } else { //set the removed flag $existingEntry['removed'] = true; diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Gallery/GalleryManagementTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Gallery/GalleryManagementTest.php index 1d12645019d1e..6d4e98b60ad18 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Gallery/GalleryManagementTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Gallery/GalleryManagementTest.php @@ -7,6 +7,9 @@ namespace Magento\Catalog\Test\Unit\Model\Product\Gallery; +/** + * Tests for \Magento\Catalog\Model\Product\Gallery\GalleryManagement. + */ class GalleryManagementTest extends \PHPUnit\Framework\TestCase { /** @@ -39,11 +42,16 @@ class GalleryManagementTest extends \PHPUnit\Framework\TestCase */ protected $attributeValueMock; + /** + * @inheritdoc + */ protected function setUp() { $this->productRepositoryMock = $this->createMock(\Magento\Catalog\Api\ProductRepositoryInterface::class); $this->contentValidatorMock = $this->createMock(\Magento\Framework\Api\ImageContentValidatorInterface::class); - $this->productMock = $this->createPartialMock(\Magento\Catalog\Model\Product::class, [ + $this->productMock = $this->createPartialMock( + \Magento\Catalog\Model\Product::class, + [ 'setStoreId', 'getData', 'getStoreId', @@ -51,7 +59,8 @@ protected function setUp() 'getCustomAttribute', 'getMediaGalleryEntries', 'setMediaGalleryEntries', - ]); + ] + ); $this->mediaGalleryEntryMock = $this->createMock(\Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface::class); $this->model = new \Magento\Catalog\Model\Product\Gallery\GalleryManagement( @@ -151,6 +160,8 @@ public function testUpdateWithNonExistingImage() $existingEntryMock->expects($this->once())->method('getId')->willReturn(43); $this->productMock->expects($this->once())->method('getMediaGalleryEntries') ->willReturn([$existingEntryMock]); + $existingEntryMock->expects($this->once())->method('getTypes')->willReturn([]); + $entryMock->expects($this->once())->method('getTypes')->willReturn([]); $entryMock->expects($this->once())->method('getId')->willReturn($entryId); $this->model->update($productSku, $entryMock); } @@ -172,12 +183,19 @@ public function testUpdateWithCannotSaveException() $existingEntryMock->expects($this->once())->method('getId')->willReturn($entryId); $this->productMock->expects($this->once())->method('getMediaGalleryEntries') ->willReturn([$existingEntryMock]); + $existingEntryMock->expects($this->once())->method('getTypes')->willReturn([]); + $entryMock->expects($this->once())->method('getTypes')->willReturn([]); $entryMock->expects($this->once())->method('getId')->willReturn($entryId); $this->productRepositoryMock->expects($this->once())->method('save')->with($this->productMock) ->willThrowException(new \Exception()); $this->model->update($productSku, $entryMock); } + /** + * Check update gallery entry behavior. + * + * @return void + */ public function testUpdate() { $productSku = 'testProduct'; @@ -203,14 +221,13 @@ public function testUpdate() ->willReturn([$existingEntryMock, $existingSecondEntryMock]); $entryMock->expects($this->exactly(2))->method('getId')->willReturn($entryId); - $entryMock->expects($this->once())->method('getFile')->willReturn("base64"); - $entryMock->expects($this->once())->method('setId')->with(null); - $entryMock->expects($this->exactly(2))->method('getTypes')->willReturn(['image']); + $entryMock->expects($this->once())->method('getTypes')->willReturn(['image']); $this->productMock->expects($this->once())->method('setMediaGalleryEntries') ->with([$entryMock, $existingSecondEntryMock]) ->willReturnSelf(); $this->productRepositoryMock->expects($this->once())->method('save')->with($this->productMock); + $this->assertTrue($this->model->update($productSku, $entryMock)); } diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeMediaGalleryManagementInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeMediaGalleryManagementInterfaceTest.php index 1cd299149507c..a192936aeaccf 100644 --- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeMediaGalleryManagementInterfaceTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductAttributeMediaGalleryManagementInterfaceTest.php @@ -11,11 +11,11 @@ use Magento\Framework\Api\Data\ImageContentInterface; use Magento\TestFramework\Helper\Bootstrap; use Magento\Catalog\Model\ProductFactory; -use Magento\TestFramework\ObjectManager; use Magento\Catalog\Model\Product\Attribute\Backend\Media\ImageEntryConverter; use Magento\Catalog\Model\ProductRepository; use Magento\Framework\Webapi\Rest\Request; use Magento\TestFramework\TestCase\WebapiAbstract; +use Magento\Framework\ObjectManagerInterface; /** * Class ProductAttributeMediaGalleryManagementInterfaceTest @@ -48,11 +48,18 @@ class ProductAttributeMediaGalleryManagementInterfaceTest extends WebapiAbstract */ protected $testImagePath; + /** + * @var ObjectManagerInterface + */ + private $objectManager; + /** * @inheritDoc */ protected function setUp() { + $this->objectManager = Bootstrap::getObjectManager(); + $this->createServiceInfo = [ 'rest' => [ 'resourcePath' => '/V1/products/simple/media', @@ -98,9 +105,7 @@ protected function setUp() */ protected function getTargetSimpleProduct() { - $objectManager = Bootstrap::getObjectManager(); - - return $objectManager->get(ProductFactory::class)->create()->load(1); + return $this->objectManager->get(ProductFactory::class)->create()->load(1); } /** @@ -241,6 +246,10 @@ public function testCreateWithNotDefaultStoreId() */ public function testUpdate() { + $productRepository = $this->objectManager->create(ProductRepositoryInterface::class); + /** @var \Magento\Catalog\Api\Data\ProductInterface $product */ + $product = $productRepository->get('simple'); + $imageId = (int)$product->getMediaGalleryImages()->getFirstItem()->getValueId(); $requestData = [ 'sku' => 'simple', 'entry' => [ @@ -257,19 +266,48 @@ public function testUpdate() . '/' . $this->getTargetGalleryEntryId(); $this->assertTrue($this->_webApiCall($this->updateServiceInfo, $requestData, null, 'all')); + $updatedImage = $this->assertMediaGalleryData($imageId, '/m/a/magento_image.jpg', 'Updated Image Text'); + $this->assertEquals(10, $updatedImage['position_default']); + $this->assertEquals(1, $updatedImage['disabled_default']); + } - $targetProduct = $this->getTargetSimpleProduct(); - $this->assertEquals('/m/a/magento_image.jpg', $targetProduct->getData('thumbnail')); - $this->assertEquals('no_selection', $targetProduct->getData('image')); - $this->assertEquals('no_selection', $targetProduct->getData('small_image')); - $mediaGallery = $targetProduct->getData('media_gallery'); - $this->assertCount(1, $mediaGallery['images']); - $updatedImage = array_shift($mediaGallery['images']); - $this->assertEquals('Updated Image Text', $updatedImage['label']); - $this->assertEquals('/m/a/magento_image.jpg', $updatedImage['file']); - $this->assertEquals(10, $updatedImage['position']); - $this->assertEquals(1, $updatedImage['disabled']); - $this->assertEquals('Updated Image Text', $updatedImage['label_default']); + /** + * Update media gallery entity with new image. + * + * @magentoApiDataFixture Magento/Catalog/_files/product_with_image.php + * @return void + */ + public function testUpdateWithNewImage(): void + { + $productRepository = $this->objectManager->create(ProductRepositoryInterface::class); + /** @var \Magento\Catalog\Api\Data\ProductInterface $product */ + $product = $productRepository->get('simple'); + $imageId = (int)$product->getMediaGalleryImages()->getFirstItem()->getValueId(); + + $requestData = [ + 'sku' => 'simple', + 'entry' => [ + 'id' => $this->getTargetGalleryEntryId(), + 'label' => 'Updated Image Text', + 'position' => 10, + 'types' => ['thumbnail'], + 'disabled' => true, + 'media_type' => 'image', + 'content' => [ + 'base64_encoded_data' => 'iVBORw0KGgoAAAANSUhEUgAAAP8AAADGCAMAAAAqo6adAAAAA1BMVEUAAP79f' + . '+LBAAAASElEQVR4nO3BMQEAAADCoPVPbQwfoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + . 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAA+BsYAAAF7hZJ0AAAAAElFTkSuQmCC', + 'type' => 'image/png', + 'name' => 'testname_updated.png', + ], + ], + ]; + + $this->updateServiceInfo['rest']['resourcePath'] = $this->updateServiceInfo['rest']['resourcePath'] + . '/' . $this->getTargetGalleryEntryId(); + + $this->assertTrue($this->_webApiCall($this->updateServiceInfo, $requestData, null, 'all')); + $updatedImage = $this->assertMediaGalleryData($imageId, '/t/e/testname_updated.png', 'Updated Image Text'); $this->assertEquals(10, $updatedImage['position_default']); $this->assertEquals(1, $updatedImage['disabled_default']); } @@ -281,6 +319,11 @@ public function testUpdate() */ public function testUpdateWithNotDefaultStoreId() { + $productRepository = $this->objectManager->create(ProductRepositoryInterface::class); + /** @var \Magento\Catalog\Api\Data\ProductInterface $product */ + $product = $productRepository->get('simple'); + $imageId = (int)$product->getMediaGalleryImages()->getFirstItem()->getValueId(); + $requestData = [ 'sku' => 'simple', 'entry' => [ @@ -297,21 +340,36 @@ public function testUpdateWithNotDefaultStoreId() . '/' . $this->getTargetGalleryEntryId(); $this->assertTrue($this->_webApiCall($this->updateServiceInfo, $requestData, null, 'default')); + $updatedImage = $this->assertMediaGalleryData($imageId, '/m/a/magento_image.jpg', 'Image Alt Text'); + $this->assertEquals(1, $updatedImage['position_default']); + $this->assertEquals(0, $updatedImage['disabled_default']); + } + /** + * Check that Media Gallery data is correct. + * + * @param int $imageId + * @param string $file + * @param string $label + * @return array + */ + private function assertMediaGalleryData(int $imageId, string $file, string $label): array + { $targetProduct = $this->getTargetSimpleProduct(); - $this->assertEquals('/m/a/magento_image.jpg', $targetProduct->getData('thumbnail')); + $this->assertEquals($file, $targetProduct->getData('thumbnail')); + $this->assertEquals('no_selection', $targetProduct->getData('image')); + $this->assertEquals('no_selection', $targetProduct->getData('small_image')); $mediaGallery = $targetProduct->getData('media_gallery'); $this->assertCount(1, $mediaGallery['images']); $updatedImage = array_shift($mediaGallery['images']); - // Not default store view values were updated + $this->assertEquals($imageId, $updatedImage['value_id']); $this->assertEquals('Updated Image Text', $updatedImage['label']); - $this->assertEquals('/m/a/magento_image.jpg', $updatedImage['file']); + $this->assertEquals($file, $updatedImage['file']); $this->assertEquals(10, $updatedImage['position']); $this->assertEquals(1, $updatedImage['disabled']); - // Default store view values were not updated - $this->assertEquals('Image Alt Text', $updatedImage['label_default']); - $this->assertEquals(1, $updatedImage['position_default']); - $this->assertEquals(0, $updatedImage['disabled_default']); + $this->assertEquals($label, $updatedImage['label_default']); + + return $updatedImage; } /** @@ -564,9 +622,8 @@ public function testGet() { $productSku = 'simple'; - $objectManager = ObjectManager::getInstance(); /** @var ProductRepository $repository */ - $repository = $objectManager->create(ProductRepository::class); + $repository = $this->objectManager->create(ProductRepository::class); $product = $repository->get($productSku); $image = current($product->getMediaGallery('images')); $imageId = $image['value_id']; From 0ffbe25590f893cea39c31a7521c2ca9c68fd324 Mon Sep 17 00:00:00 2001 From: Andrii Beziazychnyi <a.beziazychnyi@atwix.com> Date: Fri, 8 Nov 2019 16:31:47 +0200 Subject: [PATCH 107/595] Magento#25529: Wrong program code in "Magento/Checkout/view/frontend/web/js/view/summary/shipping.js" - added additional checking of shippingMethod type - need to be an array - fixed condition to output "shipping method title" --- .../view/frontend/web/js/view/summary/shipping.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/summary/shipping.js b/app/code/Magento/Checkout/view/frontend/web/js/view/summary/shipping.js index 22e278bea947e..5886dc6a69b8f 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/summary/shipping.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/summary/shipping.js @@ -5,10 +5,11 @@ define([ 'jquery', + 'underscore', 'Magento_Checkout/js/view/summary/abstract-total', 'Magento_Checkout/js/model/quote', 'Magento_SalesRule/js/view/summary/discount' -], function ($, Component, quote, discountView) { +], function ($, _, Component, quote, discountView) { 'use strict'; return Component.extend({ @@ -22,7 +23,7 @@ define([ * @return {*} */ getShippingMethodTitle: function () { - var shippingMethod = '', + var shippingMethod, shippingMethodTitle = ''; if (!this.isCalculated()) { @@ -30,11 +31,15 @@ define([ } shippingMethod = quote.shippingMethod(); + if (!_.isArray(shippingMethod)) { + return ''; + } + if (typeof shippingMethod['method_title'] !== 'undefined') { shippingMethodTitle = ' - ' + shippingMethod['method_title']; } - return shippingMethod ? + return shippingMethodTitle ? shippingMethod['carrier_title'] + shippingMethodTitle : shippingMethod['carrier_title']; }, From 322709d1572caec44189edb1e8b3ca5f0be628fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Tylek?= <pawel.tylek@creativestyle.pl> Date: Fri, 8 Nov 2019 15:42:36 +0100 Subject: [PATCH 108/595] M2C-22619 Add check if found elements are not nested to prevent from processing panels incorrectly --- lib/web/mage/tabs.js | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/lib/web/mage/tabs.js b/lib/web/mage/tabs.js index 7a313bb7ac1b9..d39a3902e82a9 100644 --- a/lib/web/mage/tabs.js +++ b/lib/web/mage/tabs.js @@ -102,21 +102,31 @@ define([ * @private */ _processPanels: function () { - this.contents = this.element.children(this.options.content); + var isNotNested = this._isNotNested.bind(this); - this.collapsibles = this.element.children(this.options.collapsibleElement); + this.contents = this.element + .find(this.options.content) + .filter(isNotNested); + + this.collapsibles = this.element + .find(this.options.collapsibleElement) + .filter(isNotNested); this.collapsibles .attr('role', 'presentation') .parent() .attr('role', 'tablist'); - this.headers = this.element.children(this.options.header); + this.headers = this.element + .find(this.options.header) + .filter(isNotNested); if (this.headers.length === 0) { this.headers = this.collapsibles; } - this.triggers = this.element.children(this.options.trigger); + this.triggers = this.element + .find(this.options.trigger) + .filter(isNotNested); if (this.triggers.length === 0) { this.triggers = this.headers; @@ -124,6 +134,17 @@ define([ this._callCollapsible(); }, + /** + * @param {HTMLElement} elem + * @private + * @return {Boolean} + */ + _isNotNested: function (index, element) { + var parentContent = $(element).parents(this.options.content); + + return !parentContent.length || !this.element.find(parentContent).length; + }, + /** * Setting the disabled and active tabs and calling instantiation of collapsible * @private From d13cd157c4abc215fea2c23f5be63e10ccead415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Tylek?= <pawel.tylek@creativestyle.pl> Date: Fri, 8 Nov 2019 16:55:42 +0100 Subject: [PATCH 109/595] M2C-22619 Adjust indentation --- lib/web/mage/tabs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/web/mage/tabs.js b/lib/web/mage/tabs.js index d39a3902e82a9..d55ef6e246d4d 100644 --- a/lib/web/mage/tabs.js +++ b/lib/web/mage/tabs.js @@ -143,7 +143,7 @@ define([ var parentContent = $(element).parents(this.options.content); return !parentContent.length || !this.element.find(parentContent).length; - }, + }, /** * Setting the disabled and active tabs and calling instantiation of collapsible From d6c184d5239502a65c1350d26c505bdd3642b9e1 Mon Sep 17 00:00:00 2001 From: Andrii Beziazychnyi <a.beziazychnyi@atwix.com> Date: Fri, 8 Nov 2019 22:40:15 +0200 Subject: [PATCH 110/595] Magento#25529: Wrong program code in "Magento/Checkout/view/frontend/web/js/view/summary/shipping.js" - fixed condition for shippingMethod --- .../Checkout/view/frontend/web/js/view/summary/shipping.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/summary/shipping.js b/app/code/Magento/Checkout/view/frontend/web/js/view/summary/shipping.js index 5886dc6a69b8f..a0bbc9dd55bff 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/summary/shipping.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/summary/shipping.js @@ -31,7 +31,7 @@ define([ } shippingMethod = quote.shippingMethod(); - if (!_.isArray(shippingMethod)) { + if (!_.isArray(shippingMethod) && !_.isObject(shippingMethod)) { return ''; } From 0a6bbff27f287e4342be5b24c3d4684cd89d0fa6 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Fri, 8 Nov 2019 17:03:54 -0600 Subject: [PATCH 111/595] MAGETWO-99311: Asynchronous image resizing --- .../Console/Command/ImagesResizeCommand.php | 141 ++++++++++++++++-- .../Model/ConsumerImageResize.php | 91 +++++++++++ .../Service/ImageResizeScheduler.php | 97 ++++++++++++ app/code/Magento/MediaStorage/composer.json | 4 +- .../MediaStorage/etc/communication.xml | 12 ++ app/code/Magento/MediaStorage/etc/di.xml | 5 + app/code/Magento/MediaStorage/etc/queue.xml | 12 ++ .../MediaStorage/etc/queue_consumer.xml | 10 ++ .../MediaStorage/etc/queue_publisher.xml | 12 ++ .../MediaStorage/etc/queue_topology.xml | 12 ++ 10 files changed, 379 insertions(+), 17 deletions(-) create mode 100644 app/code/Magento/MediaStorage/Model/ConsumerImageResize.php create mode 100644 app/code/Magento/MediaStorage/Service/ImageResizeScheduler.php create mode 100644 app/code/Magento/MediaStorage/etc/communication.xml create mode 100644 app/code/Magento/MediaStorage/etc/queue.xml create mode 100644 app/code/Magento/MediaStorage/etc/queue_consumer.xml create mode 100644 app/code/Magento/MediaStorage/etc/queue_publisher.xml create mode 100644 app/code/Magento/MediaStorage/etc/queue_topology.xml diff --git a/app/code/Magento/MediaStorage/Console/Command/ImagesResizeCommand.php b/app/code/Magento/MediaStorage/Console/Command/ImagesResizeCommand.php index ba12d60cb0bc8..21692b1ae004c 100644 --- a/app/code/Magento/MediaStorage/Console/Command/ImagesResizeCommand.php +++ b/app/code/Magento/MediaStorage/Console/Command/ImagesResizeCommand.php @@ -8,26 +8,39 @@ namespace Magento\MediaStorage\Console\Command; use Magento\Framework\App\Area; -use Magento\Framework\App\ObjectManager; use Magento\Framework\App\State; -use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\Console\Cli; use Magento\MediaStorage\Service\ImageResize; +use Magento\MediaStorage\Service\ImageResizeScheduler; use Symfony\Component\Console\Helper\ProgressBar; use Symfony\Component\Console\Helper\ProgressBarFactory; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Command\Command; +use Magento\Catalog\Model\ResourceModel\Product\Image as ProductImage; /** * Resizes product images according to theme view definitions. * * @package Magento\MediaStorage\Console\Command */ -class ImagesResizeCommand extends \Symfony\Component\Console\Command\Command +class ImagesResizeCommand extends Command { + /** + * Asynchronous image resize mode + */ + const ASYNC_RESIZE = 'async'; + + /** + * @var ImageResizeScheduler + */ + private $imageResizeScheduler; + /** * @var ImageResize */ - private $resize; + private $imageResize; /** * @var State @@ -39,24 +52,32 @@ class ImagesResizeCommand extends \Symfony\Component\Console\Command\Command */ private $progressBarFactory; + /** + * @var ProductImage + */ + private $productImage; + /** * @param State $appState - * @param ImageResize $resize - * @param ObjectManagerInterface $objectManager + * @param ImageResize $imageResize + * @param ImageResizeScheduler $imageResizeScheduler * @param ProgressBarFactory $progressBarFactory + * @param ProductImage $productImage * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function __construct( State $appState, - ImageResize $resize, - ObjectManagerInterface $objectManager, - ProgressBarFactory $progressBarFactory = null + ImageResize $imageResize, + ImageResizeScheduler $imageResizeScheduler, + ProgressBarFactory $progressBarFactory, + ProductImage $productImage ) { parent::__construct(); - $this->resize = $resize; $this->appState = $appState; - $this->progressBarFactory = $progressBarFactory - ?: ObjectManager::getInstance()->get(ProgressBarFactory::class); + $this->imageResize = $imageResize; + $this->imageResizeScheduler = $imageResizeScheduler; + $this->progressBarFactory = $progressBarFactory; + $this->productImage = $productImage; } /** @@ -65,7 +86,25 @@ public function __construct( protected function configure() { $this->setName('catalog:images:resize') - ->setDescription('Creates resized product images'); + ->setDescription('Creates resized product images') + ->setDefinition($this->getOptionsList()); + } + + /** + * Image resize command options list + * + * @return array + */ + private function getOptionsList() : array + { + return [ + new InputOption( + self::ASYNC_RESIZE, + '-a', + InputOption::VALUE_NONE, + 'Resize image in asynchronous mode' + ), + ]; } /** @@ -74,11 +113,25 @@ protected function configure() * @param OutputInterface $output */ protected function execute(InputInterface $input, OutputInterface $output) + { + $result = $input->getOption(self::ASYNC_RESIZE) ? + $this->executeAsync($output) : $this->executeSync($output); + + return $result; + } + + /** + * Run resize in synchronous mode + * + * @param OutputInterface $output + * @return int + */ + private function executeSync(OutputInterface $output): int { try { $errors = []; $this->appState->setAreaCode(Area::AREA_GLOBAL); - $generator = $this->resize->resizeFromThemes(); + $generator = $this->imageResize->resizeFromThemes(); /** @var ProgressBar $progress */ $progress = $this->progressBarFactory->create( @@ -111,7 +164,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } catch (\Exception $e) { $output->writeln("<error>{$e->getMessage()}</error>"); // we must have an exit code higher than zero to indicate something was wrong - return \Magento\Framework\Console\Cli::RETURN_FAILURE; + return Cli::RETURN_FAILURE; } $output->write(PHP_EOL); @@ -124,6 +177,62 @@ protected function execute(InputInterface $input, OutputInterface $output) $output->writeln("<info>Product images resized successfully</info>"); } - return \Magento\Framework\Console\Cli::RETURN_SUCCESS; + return Cli::RETURN_SUCCESS; + } + + /** + * Schedule asynchronous image resizing + * + * @param OutputInterface $output + * @return int + */ + private function executeAsync(OutputInterface $output): int + { + try { + $errors = []; + $this->appState->setAreaCode(Area::AREA_GLOBAL); + + /** @var ProgressBar $progress */ + $progress = $this->progressBarFactory->create( + [ + 'output' => $output, + 'max' => $this->productImage->getCountUsedProductImages() + ] + ); + $progress->setFormat( + "%current%/%max% [%bar%] %percent:3s%% %elapsed% %memory:6s% \t| <info>%message%</info>" + ); + + if ($output->getVerbosity() !== OutputInterface::VERBOSITY_NORMAL) { + $progress->setOverwrite(false); + } + + $productImages = $this->productImage->getUsedProductImages(); + foreach ($productImages as $image) { + $result = $this->imageResizeScheduler->schedule($image['filepath']); + + if (!$result) { + $errors[$image['filepath']] = 'Error image scheduling: ' . $image['filepath']; + } + $progress->setMessage($image['filepath']); + $progress->advance(); + } + } catch (\Exception $e) { + $output->writeln("<error>{$e->getMessage()}</error>"); + // we must have an exit code higher than zero to indicate something was wrong + return Cli::RETURN_FAILURE; + } + + $output->write(PHP_EOL); + if (count($errors)) { + $output->writeln("<info>Product images resized with errors:</info>"); + foreach ($errors as $error) { + $output->writeln("<error>{$error}</error>"); + } + } else { + $output->writeln("<info>Product images scheduled successfully</info>"); + } + + return Cli::RETURN_SUCCESS; } } diff --git a/app/code/Magento/MediaStorage/Model/ConsumerImageResize.php b/app/code/Magento/MediaStorage/Model/ConsumerImageResize.php new file mode 100644 index 0000000000000..43f3e1d7767ce --- /dev/null +++ b/app/code/Magento/MediaStorage/Model/ConsumerImageResize.php @@ -0,0 +1,91 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\MediaStorage\Model; + +use Magento\AsynchronousOperations\Api\Data\OperationInterface; +use Magento\Framework\Serialize\SerializerInterface; +use Psr\Log\LoggerInterface; +use Magento\MediaStorage\Service\ImageResize; +use Magento\Framework\EntityManager\EntityManager; +use Magento\Framework\Exception\NotFoundException; + +/** + * Consumer for image resize + */ +class ConsumerImageResize +{ + /** + * @var SerializerInterface + */ + private $serializer; + + /** + * @var LoggerInterface + */ + private $logger; + + /** + * @var ImageResize + */ + private $resize; + + /** + * @var EntityManager + */ + private $entityManager; + + /** + * @param ImageResize $resize + * @param LoggerInterface $logger + * @param SerializerInterface $serializer + * @param EntityManager $entityManager + */ + public function __construct( + ImageResize $resize, + LoggerInterface $logger, + SerializerInterface $serializer, + EntityManager $entityManager + ) { + $this->resize = $resize; + $this->logger = $logger; + $this->serializer = $serializer; + $this->entityManager = $entityManager; + } + + /** + * Image resize + * + * @param OperationInterface $operation + * @return void + * @throws \Exception + */ + public function process(OperationInterface $operation): void + { + try { + $serializedData = $operation->getSerializedData(); + $data = $this->serializer->unserialize($serializedData); + $this->resize->resizeFromImageName($data['filename']); + } catch (NotFoundException $e) { + $this->logger->critical($e->getMessage()); + $status = OperationInterface::STATUS_TYPE_NOT_RETRIABLY_FAILED; + $errorCode = $e->getCode(); + $message = $e->getMessage(); + } catch (\Exception $e) { + $this->logger->critical($e->getMessage()); + $status = OperationInterface::STATUS_TYPE_NOT_RETRIABLY_FAILED; + $errorCode = $e->getCode(); + $message = __('Sorry, something went wrong during image resize. Please see log for details.'); + } + + $operation->setStatus($status ?? OperationInterface::STATUS_TYPE_COMPLETE) + ->setErrorCode($errorCode ?? null) + ->setResultMessage($message ?? null); + + $this->entityManager->save($operation); + } +} diff --git a/app/code/Magento/MediaStorage/Service/ImageResizeScheduler.php b/app/code/Magento/MediaStorage/Service/ImageResizeScheduler.php new file mode 100644 index 0000000000000..900bb026dc5b3 --- /dev/null +++ b/app/code/Magento/MediaStorage/Service/ImageResizeScheduler.php @@ -0,0 +1,97 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\MediaStorage\Service; + +use Magento\Framework\Bulk\BulkManagementInterface; +use Magento\AsynchronousOperations\Api\Data\OperationInterfaceFactory; +use Magento\Framework\DataObject\IdentityGeneratorInterface; +use Magento\Framework\Serialize\SerializerInterface; +use Magento\Framework\Bulk\OperationInterface; +use Magento\Authorization\Model\UserContextInterface; + +/** + * Scheduler for image resize queue + */ +class ImageResizeScheduler +{ + /** + * @var BulkManagementInterface + */ + private $bulkManagement; + + /** + * @var OperationInterfaceFactory + */ + private $operationFactory; + + /** + * @var IdentityGeneratorInterface + */ + private $identityService; + + /** + * @var SerializerInterface + */ + private $serializer; + + /** + * @var UserContextInterface + */ + private $userContext; + + /** + * @param BulkManagementInterface $bulkManagement + * @param OperationInterfaceFactory $operartionFactory + * @param IdentityGeneratorInterface $identityService + * @param SerializerInterface $serializer + * @param UserContextInterface $userContext + */ + public function __construct( + BulkManagementInterface $bulkManagement, + OperationInterfaceFactory $operartionFactory, + IdentityGeneratorInterface $identityService, + SerializerInterface $serializer, + UserContextInterface $userContext + ) { + $this->bulkManagement = $bulkManagement; + $this->operationFactory = $operartionFactory; + $this->identityService = $identityService; + $this->serializer = $serializer; + $this->userContext = $userContext; + } + + /** + * Schedule image resize based on original image. + * + * @param string $imageName + * @return boolean + */ + public function schedule(string $imageName): bool + { + $bulkUuid = $this->identityService->generateId(); + $bulkDescription = __('Image resize: %1', $imageName); + $dataToEncode = ['filename' => $imageName]; + + $data = [ + 'data' => [ + 'bulk_uuid' => $bulkUuid, + 'topic_name' => 'media.storage.catalog.image.resize', + 'serialized_data' => $this->serializer->serialize($dataToEncode), + 'status' => OperationInterface::STATUS_TYPE_OPEN, + ] + ]; + $operation = $this->operationFactory->create($data); + + return $this->bulkManagement->scheduleBulk( + $bulkUuid, + [$operation], + $bulkDescription, + $this->userContext->getUserId() + ); + } +} diff --git a/app/code/Magento/MediaStorage/composer.json b/app/code/Magento/MediaStorage/composer.json index 95c48f3fdc581..ce97eec97f7c3 100644 --- a/app/code/Magento/MediaStorage/composer.json +++ b/app/code/Magento/MediaStorage/composer.json @@ -11,7 +11,9 @@ "magento/module-config": "*", "magento/module-store": "*", "magento/module-catalog": "*", - "magento/module-theme": "*" + "magento/module-theme": "*", + "magento/module-asynchronous-operations": "*", + "magento/module-authorization": "*" }, "type": "magento2-module", "license": [ diff --git a/app/code/Magento/MediaStorage/etc/communication.xml b/app/code/Magento/MediaStorage/etc/communication.xml new file mode 100644 index 0000000000000..c9630b24ba336 --- /dev/null +++ b/app/code/Magento/MediaStorage/etc/communication.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Communication/etc/communication.xsd"> + <topic name="media.storage.catalog.image.resize" request="Magento\AsynchronousOperations\Api\Data\OperationInterface"> + <handler name="media.storage.catalog.image.resize" type="Magento\MediaStorage\Model\ConsumerImageResize" method="process" /> + </topic> +</config> diff --git a/app/code/Magento/MediaStorage/etc/di.xml b/app/code/Magento/MediaStorage/etc/di.xml index 2b9317787463d..5cdcbb3b2b9a9 100644 --- a/app/code/Magento/MediaStorage/etc/di.xml +++ b/app/code/Magento/MediaStorage/etc/di.xml @@ -26,4 +26,9 @@ </argument> </arguments> </type> + <type name="Magento\MediaStorage\Console\Command\ImagesResizeCommand"> + <arguments> + <argument name="imageResizeScheduler" xsi:type="object">Magento\MediaStorage\Service\ImageResizeScheduler\Proxy</argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/MediaStorage/etc/queue.xml b/app/code/Magento/MediaStorage/etc/queue.xml new file mode 100644 index 0000000000000..3e4ffbf8ec9e2 --- /dev/null +++ b/app/code/Magento/MediaStorage/etc/queue.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/queue.xsd"> + <broker topic="media.storage.catalog.image.resize" exchange="magento-db" type="db"> + <queue name="media.storage.catalog.image.resize" consumer="media.storage.catalog.image.resize" consumerInstance="Magento\Framework\MessageQueue\Consumer" handler="Magento\MediaStorage\Model\ConsumerImageResize::process" /> + </broker> +</config> diff --git a/app/code/Magento/MediaStorage/etc/queue_consumer.xml b/app/code/Magento/MediaStorage/etc/queue_consumer.xml new file mode 100644 index 0000000000000..e4c06a47f314e --- /dev/null +++ b/app/code/Magento/MediaStorage/etc/queue_consumer.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/consumer.xsd"> + <consumer name="media.storage.catalog.image.resize" queue="media.storage.catalog.image.resize" connection="db" maxMessages="100" consumerInstance="Magento\Framework\MessageQueue\Consumer" handler="Magento\MediaStorage\Model\ConsumerImageResize::process" /> +</config> diff --git a/app/code/Magento/MediaStorage/etc/queue_publisher.xml b/app/code/Magento/MediaStorage/etc/queue_publisher.xml new file mode 100644 index 0000000000000..dab99e2c307f8 --- /dev/null +++ b/app/code/Magento/MediaStorage/etc/queue_publisher.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/publisher.xsd"> + <publisher topic="media.storage.catalog.image.resize"> + <connection name="db" exchange="magento-db" /> + </publisher> +</config> diff --git a/app/code/Magento/MediaStorage/etc/queue_topology.xml b/app/code/Magento/MediaStorage/etc/queue_topology.xml new file mode 100644 index 0000000000000..9bb1ca5cef90e --- /dev/null +++ b/app/code/Magento/MediaStorage/etc/queue_topology.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/topology.xsd"> + <exchange name="magento-db" type="topic" connection="db"> + <binding id="imageResizeBinding" topic="media.storage.catalog.image.resize" destinationType="queue" destination="media.storage.catalog.image.resize"/> + </exchange> +</config> From b4ec7287182fdea8ef89c90e3cf991f7888fff43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Tylek?= <pawel.tylek@creativestyle.pl> Date: Sat, 9 Nov 2019 12:32:23 +0100 Subject: [PATCH 112/595] M2C-22619 Add JSDoc and description --- lib/web/mage/tabs.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/web/mage/tabs.js b/lib/web/mage/tabs.js index d55ef6e246d4d..f404ad9683d6f 100644 --- a/lib/web/mage/tabs.js +++ b/lib/web/mage/tabs.js @@ -135,6 +135,8 @@ define([ }, /** + * Checks if element is not in nested container to keep the correct scope of collapsible + * @param {Number} index * @param {HTMLElement} elem * @private * @return {Boolean} From 19432787ab80d80b0dc23b10e26bbc64b67b9da2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Tylek?= <pawel.tylek@creativestyle.pl> Date: Sat, 9 Nov 2019 20:52:51 +0100 Subject: [PATCH 113/595] M2C-22619 Change elem to element --- lib/web/mage/tabs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/web/mage/tabs.js b/lib/web/mage/tabs.js index f404ad9683d6f..b007d6113eca6 100644 --- a/lib/web/mage/tabs.js +++ b/lib/web/mage/tabs.js @@ -137,7 +137,7 @@ define([ /** * Checks if element is not in nested container to keep the correct scope of collapsible * @param {Number} index - * @param {HTMLElement} elem + * @param {HTMLElement} element * @private * @return {Boolean} */ From e0a0d508090386a8225ade2cc72c0bc030ee6ee2 Mon Sep 17 00:00:00 2001 From: Jasper Zeinstra <jasper.zeinstra@mediact.nl> Date: Mon, 11 Nov 2019 10:45:18 +0100 Subject: [PATCH 114/595] Fix escape less calc --- lib/web/css/source/lib/_navigation.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/web/css/source/lib/_navigation.less b/lib/web/css/source/lib/_navigation.less index 21cb5fe0a004b..9b13c28227eb9 100644 --- a/lib/web/css/source/lib/_navigation.less +++ b/lib/web/css/source/lib/_navigation.less @@ -338,7 +338,7 @@ top: 0; left: 100%; width: 10px; - height: calc(100% + 3px); + height: calc(~'100% + 3px'); z-index: 1; } } From 34f870ea09108509cedc1d66f5910f8c232f7b24 Mon Sep 17 00:00:00 2001 From: vpashovski <vpashovski@extensadev.com> Date: Mon, 11 Nov 2019 12:50:09 +0200 Subject: [PATCH 115/595] Remove Prefix name length check; --- lib/internal/Magento/Framework/Lock/Backend/Database.php | 9 --------- .../Framework/Lock/Test/Unit/Backend/DatabaseTest.php | 6 ------ 2 files changed, 15 deletions(-) diff --git a/lib/internal/Magento/Framework/Lock/Backend/Database.php b/lib/internal/Magento/Framework/Lock/Backend/Database.php index bf59167f2b50d..aa872f9166b5c 100644 --- a/lib/internal/Magento/Framework/Lock/Backend/Database.php +++ b/lib/internal/Magento/Framework/Lock/Backend/Database.php @@ -11,7 +11,6 @@ use Magento\Framework\App\ResourceConnection; use Magento\Framework\Config\ConfigOptionsListConstants; use Magento\Framework\Exception\AlreadyExistsException; -use Magento\Framework\Exception\InputException; use Magento\Framework\Phrase; use Magento\Framework\DB\ExpressionConverter; @@ -69,7 +68,6 @@ public function __construct( * @param string $name lock name * @param int $timeout How long to wait lock acquisition in seconds, negative value means infinite timeout * @return bool - * @throws InputException * @throws AlreadyExistsException * @throws \Zend_Db_Statement_Exception */ @@ -111,7 +109,6 @@ public function lock(string $name, int $timeout = -1): bool * * @param string $name lock name * @return bool - * @throws InputException * @throws \Zend_Db_Statement_Exception */ public function unlock(string $name): bool @@ -139,7 +136,6 @@ public function unlock(string $name): bool * * @param string $name lock name * @return bool - * @throws InputException * @throws \Zend_Db_Statement_Exception */ public function isLocked(string $name): bool @@ -163,17 +159,12 @@ public function isLocked(string $name): bool * * @param string $name * @return string - * @throws InputException */ private function addPrefix(string $name): string { $prefix = $this->getPrefix() ? $this->getPrefix() . '|' : ''; $name = ExpressionConverter::shortenEntityName($prefix . $name, $prefix); - if (strlen($name) > 64) { - throw new InputException(new Phrase('Lock name too long: %1...', [substr($name, 0, 64)])); - } - return $name; } diff --git a/lib/internal/Magento/Framework/Lock/Test/Unit/Backend/DatabaseTest.php b/lib/internal/Magento/Framework/Lock/Test/Unit/Backend/DatabaseTest.php index fd6fa44bd01ed..5da420f39a672 100644 --- a/lib/internal/Magento/Framework/Lock/Test/Unit/Backend/DatabaseTest.php +++ b/lib/internal/Magento/Framework/Lock/Test/Unit/Backend/DatabaseTest.php @@ -86,7 +86,6 @@ protected function setUp() /** * @throws \Magento\Framework\Exception\AlreadyExistsException - * @throws \Magento\Framework\Exception\InputException * @throws \Zend_Db_Statement_Exception */ public function testLock() @@ -104,7 +103,6 @@ public function testLock() /** * @throws \Magento\Framework\Exception\AlreadyExistsException - * @throws \Magento\Framework\Exception\InputException * @throws \Zend_Db_Statement_Exception */ public function testlockWithTooLongName() @@ -122,7 +120,6 @@ public function testlockWithTooLongName() /** * @throws \Magento\Framework\Exception\AlreadyExistsException - * @throws \Magento\Framework\Exception\InputException * @throws \Zend_Db_Statement_Exception * @expectedException \Magento\Framework\Exception\AlreadyExistsException */ @@ -142,7 +139,6 @@ public function testlockWithAlreadyAcquiredLockInSameSession() /** * @throws \Magento\Framework\Exception\AlreadyExistsException - * @throws \Magento\Framework\Exception\InputException * @throws \Zend_Db_Statement_Exception */ public function testLockWithUnavailableDeploymentConfig() @@ -156,7 +152,6 @@ public function testLockWithUnavailableDeploymentConfig() } /** - * @throws \Magento\Framework\Exception\InputException * @throws \Zend_Db_Statement_Exception */ public function testUnlockWithUnavailableDeploymentConfig() @@ -170,7 +165,6 @@ public function testUnlockWithUnavailableDeploymentConfig() } /** - * @throws \Magento\Framework\Exception\InputException * @throws \Zend_Db_Statement_Exception */ public function testIsLockedWithUnavailableDB() From 94d9de20c8da6de29ad094d725ce3a8bd2080233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Corr=C3=AAa=20Gomes?= <rafaelcgstz@gmail.com> Date: Mon, 11 Nov 2019 13:51:16 -0300 Subject: [PATCH 116/595] Changing confirm password field class --- .../Magento/Customer/view/frontend/templates/form/edit.phtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Customer/view/frontend/templates/form/edit.phtml b/app/code/Magento/Customer/view/frontend/templates/form/edit.phtml index 2718f03909be2..e2b6792439576 100644 --- a/app/code/Magento/Customer/view/frontend/templates/form/edit.phtml +++ b/app/code/Magento/Customer/view/frontend/templates/form/edit.phtml @@ -67,7 +67,7 @@ </div> </div> </div> - <div class="field confirm password required" data-container="confirm-password"> + <div class="field confirmation password required" data-container="confirm-password"> <label class="label" for="password-confirmation"><span><?= $block->escapeHtml(__('Confirm New Password')) ?></span></label> <div class="control"> <input type="password" class="input-text" name="password_confirmation" id="password-confirmation" @@ -93,7 +93,7 @@ ], function($){ var dataForm = $('#form-validate'); var ignore = <?= /* @noEscape */ $_dob->isEnabled() ? '\'input[id$="full"]\'' : 'null' ?>; - + dataForm.mage('validation', { <?php if ($_dob->isEnabled()) : ?> errorPlacement: function(error, element) { From 2314bd3e02f0449af9e88d440fdc620e609d29fa Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Mon, 11 Nov 2019 10:46:29 -0600 Subject: [PATCH 117/595] MC-21807: Implement control over minimum_should_match for elasticsearch queries - Fix Magento-Health-Index-PR build failures --- .../FieldMapper/AddDefaultSearchFieldTest.php | 23 +++++-------------- .../CopySearchableFieldsToSearchFieldTest.php | 23 +++++-------------- 2 files changed, 12 insertions(+), 34 deletions(-) diff --git a/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/AddDefaultSearchFieldTest.php b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/AddDefaultSearchFieldTest.php index 7da68168f8c97..1a1e7f4e0d643 100644 --- a/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/AddDefaultSearchFieldTest.php +++ b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/AddDefaultSearchFieldTest.php @@ -8,27 +8,14 @@ namespace Magento\Elasticsearch6\Test\Unit\Model\Adapter\FieldMapper; use Magento\Elasticsearch6\Model\Adapter\FieldMapper\AddDefaultSearchField; -use Magento\Framework\TestFramework\Unit\BaseTestCase; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\TestCase; /** * Test mapping preprocessor AddDefaultSearchField */ -class AddDefaultSearchFieldTest extends BaseTestCase +class AddDefaultSearchFieldTest extends TestCase { - /** - * @var AddDefaultSearchField - */ - private $model; - - /** - * @inheritDoc - */ - protected function setUp() - { - parent::setUp(); - $this->model = $this->objectManager->getObject(AddDefaultSearchField::class); - } - /** * Test default search field "_search" should be prepended and overwrite if exist. * @@ -38,7 +25,9 @@ protected function setUp() */ public function testProcess(array $mappingBefore, array $mappingAfter) { - $this->assertEquals($mappingAfter, $this->model->process($mappingBefore)); + $objectManager = new ObjectManager($this); + $model = $objectManager->getObject(AddDefaultSearchField::class); + $this->assertEquals($mappingAfter, $model->process($mappingBefore)); } /** diff --git a/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchFieldTest.php b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchFieldTest.php index c366e55fbbdf7..cfe8b71095d21 100644 --- a/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchFieldTest.php +++ b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Adapter/FieldMapper/CopySearchableFieldsToSearchFieldTest.php @@ -8,27 +8,14 @@ namespace Magento\Elasticsearch6\Test\Unit\Model\Adapter\FieldMapper; use Magento\Elasticsearch6\Model\Adapter\FieldMapper\CopySearchableFieldsToSearchField; -use Magento\Framework\TestFramework\Unit\BaseTestCase; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\TestCase; /** * Test mapping preprocessor CopySearchableFieldsToSearchField */ -class CopySearchableFieldsToSearchFieldTest extends BaseTestCase +class CopySearchableFieldsToSearchFieldTest extends TestCase { - /** - * @var CopySearchableFieldsToSearchField - */ - private $model; - - /** - * @inheritDoc - */ - protected function setUp() - { - parent::setUp(); - $this->model = $this->objectManager->getObject(CopySearchableFieldsToSearchField::class); - } - /** * Test "copy_to" parameter should be added to searchable fields. * @@ -38,7 +25,9 @@ protected function setUp() */ public function testProcess(array $mappingBefore, array $mappingAfter) { - $this->assertEquals($mappingAfter, $this->model->process($mappingBefore)); + $objectManager = new ObjectManager($this); + $model = $objectManager->getObject(CopySearchableFieldsToSearchField::class); + $this->assertEquals($mappingAfter, $model->process($mappingBefore)); } /** From f070206da28f41814f6677ecee9ef4d84105338d Mon Sep 17 00:00:00 2001 From: Nazarn96 <nazarn96@gmail.com> Date: Tue, 12 Nov 2019 11:05:27 +0200 Subject: [PATCH 118/595] The image details are not hidden when click on same image in the search result --- .../Ui/view/base/web/js/grid/columns/image-preview.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js index 1ef2ebf6594fa..8a22b06d53dc5 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js @@ -100,6 +100,12 @@ define([ */ show: function (record) { var img; + + if (record._rowIndex === this.lastOpenedImage() + && this.isVisible(record)) { + this.hide(); + return; + } this.hide(); this.displayedRecord(record); From 89179be96152960fff698211c11bce0059da8e33 Mon Sep 17 00:00:00 2001 From: Lyzun Oleksandr <alex.nuzil@gmail.com> Date: Tue, 12 Nov 2019 13:49:13 +0100 Subject: [PATCH 119/595] Remove old logic to make search by operation status possible --- .../AsynchronousOperations/Model/BulkStatus.php | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/app/code/Magento/AsynchronousOperations/Model/BulkStatus.php b/app/code/Magento/AsynchronousOperations/Model/BulkStatus.php index c37ae0d23dd25..6290ac00ce87f 100644 --- a/app/code/Magento/AsynchronousOperations/Model/BulkStatus.php +++ b/app/code/Magento/AsynchronousOperations/Model/BulkStatus.php @@ -87,22 +87,6 @@ public function getFailedOperationsByBulkId($bulkUuid, $failureType = null) */ public function getOperationsCountByBulkIdAndStatus($bulkUuid, $status) { - if ($status === OperationInterface::STATUS_TYPE_OPEN) { - /** - * Total number of operations that has been scheduled within the given bulk - */ - $allOperationsQty = $this->getOperationCount($bulkUuid); - - /** - * Number of operations that has been processed (i.e. operations with any status but 'open') - */ - $allProcessedOperationsQty = (int)$this->operationCollectionFactory->create() - ->addFieldToFilter('bulk_uuid', $bulkUuid) - ->getSize(); - - return $allOperationsQty - $allProcessedOperationsQty; - } - /** @var \Magento\AsynchronousOperations\Model\ResourceModel\Operation\Collection $collection */ $collection = $this->operationCollectionFactory->create(); return $collection->addFieldToFilter('bulk_uuid', $bulkUuid) From eb99d8131f525d04becbbe6530a1cb48e4ba0d7f Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Tue, 12 Nov 2019 08:09:07 -0600 Subject: [PATCH 120/595] MAGETWO-99311: Asynchronous image resizing --- .../MediaStorage/Console/Command/ImagesResizeCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/MediaStorage/Console/Command/ImagesResizeCommand.php b/app/code/Magento/MediaStorage/Console/Command/ImagesResizeCommand.php index 21692b1ae004c..ea8cdef8598f4 100644 --- a/app/code/Magento/MediaStorage/Console/Command/ImagesResizeCommand.php +++ b/app/code/Magento/MediaStorage/Console/Command/ImagesResizeCommand.php @@ -100,7 +100,7 @@ private function getOptionsList() : array return [ new InputOption( self::ASYNC_RESIZE, - '-a', + 'a', InputOption::VALUE_NONE, 'Resize image in asynchronous mode' ), From c23393d20e9e3e6493f6326a2cc80c4e36cdf86d Mon Sep 17 00:00:00 2001 From: Nazarn96 <nazarn96@gmail.com> Date: Tue, 12 Nov 2019 16:34:02 +0200 Subject: [PATCH 121/595] Fix error when open grid with opened preview --- .../Magento/Ui/view/base/web/js/grid/columns/image-preview.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js index 8a22b06d53dc5..cc637d8a3c4d1 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js @@ -101,7 +101,7 @@ define([ show: function (record) { var img; - if (record._rowIndex === this.lastOpenedImage() + if (record._rowIndex === this.visibleRecord() && this.isVisible(record)) { this.hide(); return; From 47a18106269a46a91158beaed06faf3d73f31880 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk <kolesnyk@adobe.com> Date: Tue, 12 Nov 2019 14:09:52 -0600 Subject: [PATCH 122/595] Community MTF to MFTF test conversion code delivery --- ...DeleteCategoryUrlRewriteHypenAsRequestPathTest.xml} | 10 ++++++---- ...minDeleteCategoryUrlRewriteWithRequestPathTest.xml} | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) rename app/code/Magento/UrlRewrite/Test/Mftf/Test/{AdminDeleteCategoryUrlRewriteEntityFirstVariationTest.xml => AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml} (83%) rename app/code/Magento/UrlRewrite/Test/Mftf/Test/{AdminDeleteCategoryUrlRewriteEntitySecondVariationTest.xml => AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml} (84%) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteEntityFirstVariationTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml similarity index 83% rename from app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteEntityFirstVariationTest.xml rename to app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml index c653bf2e910b1..ca292c384979f 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteEntityFirstVariationTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml @@ -7,11 +7,13 @@ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminDeleteCategoryUrlRewriteEntityFirstVariationTest"> + <test name="AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest"> <annotations> - <stories value="Delete category URL rewrite first scenario"/> - <title value="Delete category URL rewrite first scenario"/> - <description value="Login as admin and delete category Url Rewrite"/> + <features value="UrlRewrite" /> + <stories value="Delete custom URL rewrite"/> + <title value="Delete category URL rewrite, hyphen as request path"/> + <description value="Delete category URL rewrite, hyphen as request path"/> + <testCaseId value="MC-5348" /> <group value="urlRewrite"/> <group value="mtf_migrated"/> </annotations> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteEntitySecondVariationTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml similarity index 84% rename from app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteEntitySecondVariationTest.xml rename to app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml index f613ee57296e9..3c0dc8dc2be10 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteEntitySecondVariationTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml @@ -7,11 +7,13 @@ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminDeleteCategoryUrlRewriteEntitySecondVariationTest"> + <test name="AdminDeleteCategoryUrlRewriteWithRequestPathTest"> <annotations> - <stories value="Delete category URL rewrite second scenario"/> - <title value="Delete category URL rewrite second scenario"/> - <description value="Login as admin and delete category Url Rewrite"/> + <features value="UrlRewrite" /> + <stories value="Delete custom URL rewrite"/> + <title value="Delete category URL rewrite, with request path"/> + <description value="Delete category URL rewrite, with request path"/> + <testCaseId value="MC-5349" /> <group value="urlRewrite"/> <group value="mtf_migrated"/> </annotations> From da4f4320c44e664f30089bd5cfef30803cc6c7a6 Mon Sep 17 00:00:00 2001 From: Kevin Kozan <kkozan@adobe.com> Date: Wed, 13 Nov 2019 09:27:54 -0600 Subject: [PATCH 123/595] MQE-1889: [MTF-To-MFTF] Process PR #717 - Reverted BIC actiongroup change - Changed actionGroup to extend existing - Moved test materials from incorrect modules back into correct module - added cleanup steps --- .../AdminCreateUserActionGroup.xml | 26 ++------------- ...eateUserWithRoleAndIsActiveActionGroup.xml | 14 ++++++++ .../Magento/User/Test/Mftf/Data/UserData.xml | 32 +++---------------- .../User/Test/Mftf/Data/UserRoleData.xml | 4 +++ .../Mftf/Section/AdminDeleteUserSection.xml | 17 ++++++++++ .../Mftf/Section/AdminNewUserFormSection.xml | 2 +- .../Test/Mftf/Section/AdminStoreSection.xml | 13 ++++++++ .../Test/AdminCreateActiveUserEntityTest.xml | 7 ++++ .../AdminCreateInactiveUserEntityTest.xml | 7 ++++ 9 files changed, 69 insertions(+), 53 deletions(-) create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithRoleAndIsActiveActionGroup.xml create mode 100644 app/code/Magento/User/Test/Mftf/Section/AdminDeleteUserSection.xml create mode 100644 app/code/Magento/User/Test/Mftf/Section/AdminStoreSection.xml diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml index bcc7ec78e87a5..d550d855fcdd0 100644 --- a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml @@ -36,6 +36,7 @@ <!--Create new user with role--> <actionGroup name="AdminCreateUserWithRoleActionGroup"> <arguments> + <argument name="role"/> <argument name="user" defaultValue="newAdmin"/> </arguments> <amOnPage url="{{AdminNewUserPage.url}}" stepKey="navigateToNewUser"/> @@ -49,32 +50,9 @@ <fillField selector="{{AdminCreateUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword" /> <scrollToTopOfPage stepKey="scrollToTopOfPage" /> <click stepKey="clickUserRole" selector="{{AdminCreateUserSection.userRoleTab}}"/> - <checkOption selector="{{AdminNewUserFormSection.roleRadiobutton(user.role)}}" stepKey="assignRole"/> + <click stepKey="chooseRole" selector="{{AdminStoreSection.createdRoleInUserPage(role.name)}}"/> <click selector="{{AdminCreateUserSection.saveButton}}" stepKey="clickSaveUser" /> <waitForPageLoad stepKey="waitForSaveTheUser" /> <see userInput="You saved the user." stepKey="seeSuccessMessage" /> </actionGroup> - - <!--Create new user with role and active/inactive setting--> - <actionGroup name="AdminCreateUserWithRoleAndIsActiveActionGroup"> - <arguments> - <argument name="user" defaultValue="newAdmin"/> - </arguments> - <amOnPage url="{{AdminNewUserPage.url}}" stepKey="navigateToNewUser"/> - <waitForPageLoad stepKey="waitForUsersPage" /> - <fillField selector="{{AdminNewUserFormSection.username}}" userInput="{{user.username}}" stepKey="enterUserName" /> - <fillField selector="{{AdminNewUserFormSection.firstname}}" userInput="{{user.firstName}}" stepKey="enterFirstName" /> - <fillField selector="{{AdminNewUserFormSection.lastname}}" userInput="{{user.lastName}}" stepKey="enterLastName" /> - <fillField selector="{{AdminNewUserFormSection.email}}" userInput="{{user.username}}@magento.com" stepKey="enterEmail" /> - <fillField selector="{{AdminNewUserFormSection.password}}" userInput="{{user.password}}" stepKey="enterPassword" /> - <fillField selector="{{AdminNewUserFormSection.passwordConfirmation}}" userInput="{{user.password}}" stepKey="confirmPassword" /> - <checkOption selector="{{AdminNewUserFormSection.userIsActive(user.is_active)}}" stepKey="checkIsActive" /> - <fillField selector="{{AdminNewUserFormSection.currentPassword}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword" /> - <scrollToTopOfPage stepKey="scrollToTopOfPage" /> - <click stepKey="clickUserRole" selector="{{AdminNewUserFormSection.userRoleTab}}"/> - <checkOption selector="{{AdminNewUserFormSection.roleRadiobutton(user.role)}}" stepKey="assignRole"/> - <click selector="{{AdminNewUserFormSection.save}}" stepKey="clickSaveUser" /> - <waitForPageLoad stepKey="waitForSaveTheUser" /> - <see userInput="You saved the user." stepKey="seeSuccessMessage" /> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithRoleAndIsActiveActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithRoleAndIsActiveActionGroup.xml new file mode 100644 index 0000000000000..779dcbc512fd2 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithRoleAndIsActiveActionGroup.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"> + <!--Create new user with role and active setting--> + <actionGroup name="AdminCreateUserWithRoleAndIsActiveActionGroup" extends="AdminCreateUserWithRoleActionGroup"> + <checkOption selector="{{AdminNewUserFormSection.userIsActive(user.is_active)}}" stepKey="checkIsActive" after="confirmPassword"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/Data/UserData.xml b/app/code/Magento/User/Test/Mftf/Data/UserData.xml index 636dd877bb639..bb31cc412f3a5 100644 --- a/app/code/Magento/User/Test/Mftf/Data/UserData.xml +++ b/app/code/Magento/User/Test/Mftf/Data/UserData.xml @@ -74,36 +74,12 @@ <item>1</item> </array> </entity> - <entity name="activeAdmin" type="user"> - <data key="username" unique="suffix">AdminUser</data> - <data key="firstname" unique="suffix">FirstName</data> - <data key="lastname" unique="suffix">LastName</data> - <data key="email" unique="prefix">admin@example.com</data> - <data key="password">123123q</data> - <data key="password_confirmation">123123q</data> - <data key="interface_local">en_US</data> - <data key="interface_local_label">English (United States)</data> + <entity name="activeAdmin" type="user" extends="NewAdminUser"> + <data key="name" unique="suffix">admin</data> <data key="is_active">1</data> - <data key="current_password">{{_ENV.MAGENTO_ADMIN_PASSWORD}}</data> - <data key="role">Administrators</data> - <array key="roles"> - <item>1</item> - </array> </entity> - <entity name="inactiveAdmin" type="user"> - <data key="username" unique="suffix">AdminUser</data> - <data key="firstname" unique="suffix">FirstName</data> - <data key="lastname" unique="suffix">LastName</data> - <data key="email" unique="prefix">admin@example.com</data> - <data key="password">123123q</data> - <data key="password_confirmation">123123q</data> - <data key="interface_local">en_US</data> - <data key="interface_local_label">English (United States)</data> + <entity name="inactiveAdmin" type="user" extends="NewAdminUser"> + <data key="name" unique="suffix">admin</data> <data key="is_active">0</data> - <data key="current_password">{{_ENV.MAGENTO_ADMIN_PASSWORD}}</data> - <data key="role">Administrators</data> - <array key="roles"> - <item>1</item> - </array> </entity> </entities> diff --git a/app/code/Magento/User/Test/Mftf/Data/UserRoleData.xml b/app/code/Magento/User/Test/Mftf/Data/UserRoleData.xml index 1c18ca13b9731..f58cab7256b14 100644 --- a/app/code/Magento/User/Test/Mftf/Data/UserRoleData.xml +++ b/app/code/Magento/User/Test/Mftf/Data/UserRoleData.xml @@ -24,4 +24,8 @@ <data key="resourceAccess">Custom</data> <data key="resources">['Magento_Sales::sales','Magento_Sales::sales_operation','Magento_Sales::actions','Magento_Sales::sales_order','Magento_Sales::create','Magento_Sales::actions_view','Magento_Sales::email','Magento_Sales::reorder','Magento_Sales::actions_edit','Magento_Sales::cancel','Magento_Sales::review_payment','Magento_Sales::capture','Magento_Sales::invoice','Magento_Sales::creditmemo','Magento_Sales::hold','Magento_Sales::unhold','Magento_Sales::ship','Magento_Sales::comment','Magento_Sales::emails','Magento_Backend::system','Magento_Backend::system_other_settings','Magento_AdminNotification::adminnotification','Magento_AdminNotification::show_list']</data> </entity> + + <entity name="genericAdminRole" type="role"> + <data key="name">Administrators</data> + </entity> </entities> diff --git a/app/code/Magento/User/Test/Mftf/Section/AdminDeleteUserSection.xml b/app/code/Magento/User/Test/Mftf/Section/AdminDeleteUserSection.xml new file mode 100644 index 0000000000000..21ca1cb36f988 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/Section/AdminDeleteUserSection.xml @@ -0,0 +1,17 @@ +<?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="AdminDeleteUserSection"> + <element name="role" parameterized="true" selector="//td[contains(text(), '{{roleName}}')]" type="button"/> + <element name="password" selector="#user_current_password" type="input"/> + <element name="delete" selector="//button/span[contains(text(), 'Delete User')]" type="button"/> + <element name="confirm" selector=".action-primary.action-accept" type="button"/> + </section> +</sections> diff --git a/app/code/Magento/User/Test/Mftf/Section/AdminNewUserFormSection.xml b/app/code/Magento/User/Test/Mftf/Section/AdminNewUserFormSection.xml index 79195067315db..8774261ea739d 100644 --- a/app/code/Magento/User/Test/Mftf/Section/AdminNewUserFormSection.xml +++ b/app/code/Magento/User/Test/Mftf/Section/AdminNewUserFormSection.xml @@ -19,7 +19,7 @@ <element name="password" type="input" selector="#page_tabs_main_section_content input[name='password']"/> <element name="passwordConfirmation" type="input" selector="#page_tabs_main_section_content input[name='password_confirmation']"/> <element name="interfaceLocale" type="select" selector="#page_tabs_main_section_content select[name='interface_locale']"/> - <element name="userIsActive" type="select" selector="#page_tabs_main_section_content select[id='user_is_active'] > option[value='{{var}}']" parameterized="true"/> + <element name="userIsActive" type="select" selector="#page_tabs_main_section_content select[id='user_is_active'] > option[value='{{isActive}}']" parameterized="true"/> <element name="currentPassword" type="input" selector="#page_tabs_main_section_content input[name='current_password']"/> <element name="userRoleTab" type="button" selector="#page_tabs_roles_section"/> diff --git a/app/code/Magento/User/Test/Mftf/Section/AdminStoreSection.xml b/app/code/Magento/User/Test/Mftf/Section/AdminStoreSection.xml new file mode 100644 index 0000000000000..9e47351e68701 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/Section/AdminStoreSection.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="AdminStoreSection"> + <element name="createdRoleInUserPage" type="text" selector="//tr//td[contains(text(), '{{roleName}}')]" parameterized="true"/> + </section> +</sections> diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminCreateActiveUserEntityTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminCreateActiveUserEntityTest.xml index 1cc2294a3d33e..753ab02f84053 100644 --- a/app/code/Magento/User/Test/Mftf/Test/AdminCreateActiveUserEntityTest.xml +++ b/app/code/Magento/User/Test/Mftf/Test/AdminCreateActiveUserEntityTest.xml @@ -22,8 +22,15 @@ <before> <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> </before> + <after> + <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminDeleteUserActionGroup" stepKey="deleteUser"> + <argument name="user" value="activeAdmin"/> + </actionGroup> + </after> <actionGroup ref="AdminCreateUserWithRoleAndIsActiveActionGroup" stepKey="createAdminUser"> + <argument name="role" value="genericAdminRole"/> <argument name="user" value="activeAdmin"/> </actionGroup> <actionGroup ref="logout" stepKey="logoutMasterAdmin"/> diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminCreateInactiveUserEntityTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminCreateInactiveUserEntityTest.xml index 0768f3c6e240e..d0fdd72ebbdcc 100644 --- a/app/code/Magento/User/Test/Mftf/Test/AdminCreateInactiveUserEntityTest.xml +++ b/app/code/Magento/User/Test/Mftf/Test/AdminCreateInactiveUserEntityTest.xml @@ -22,8 +22,15 @@ <before> <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> </before> + <after> + <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <actionGroup ref="AdminDeleteUserActionGroup" stepKey="deleteUser"> + <argument name="user" value="inactiveAdmin"/> + </actionGroup> + </after> <actionGroup ref="AdminCreateUserWithRoleAndIsActiveActionGroup" stepKey="createAdminUser"> + <argument name="role" value="genericAdminRole"/> <argument name="user" value="inactiveAdmin"/> </actionGroup> <amOnPage url="{{AdminUsersPage.url}}" stepKey="navigateToAdminUsersGrid"/> From f29afc8e9f8b118bc3c8918f1018228020747b8b Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@gmail.com> Date: Thu, 14 Nov 2019 08:06:51 +0200 Subject: [PATCH 124/595] MC-17259: Update blank gender it does not saved in direct edits from customer grid --- .../StorefrontCategoryHighlightedAndProductDisplayedTest.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryHighlightedAndProductDisplayedTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryHighlightedAndProductDisplayedTest.xml index ba30c7d0e26e4..3e72df9133898 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryHighlightedAndProductDisplayedTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCategoryHighlightedAndProductDisplayedTest.xml @@ -37,10 +37,6 @@ <createData entity="SimpleProduct" stepKey="product4"> <requiredEntity createDataKey="category2"/> </createData> - - <!-- TODO: REMOVE AFTER FIX MC-21717 --> - <magentoCLI command="indexer:reindex" stepKey="reindex"/> - <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <deleteData createDataKey="product1" stepKey="deleteProduct1"/> From aa7195afb7fcab4a4984d9eb703643cc9d5a6be2 Mon Sep 17 00:00:00 2001 From: Nazarn96 <nazarn96@gmail.com> Date: Thu, 14 Nov 2019 10:34:46 +0200 Subject: [PATCH 125/595] Fix static tests --- .../Ui/view/base/web/js/grid/columns/image-preview.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js index cc637d8a3c4d1..1da19a3645e4a 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js @@ -100,10 +100,11 @@ define([ */ show: function (record) { var img; - - if (record._rowIndex === this.visibleRecord() - && this.isVisible(record)) { + + if (record._rowIndex === this.visibleRecord() && + this.isVisible(record)) { this.hide(); + return; } From e29914e4581d5f14c6a4dcd5fdf4f4799c8df64c Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Thu, 14 Nov 2019 12:56:04 +0200 Subject: [PATCH 126/595] Update image-preview.js --- .../Magento/Ui/view/base/web/js/grid/columns/image-preview.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js index 1da19a3645e4a..cf597f8d3a543 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js @@ -101,8 +101,7 @@ define([ show: function (record) { var img; - if (record._rowIndex === this.visibleRecord() && - this.isVisible(record)) { + if (record._rowIndex === this.visibleRecord()) { this.hide(); return; From 339cc2654a91b246aaf004828b9e875557969a78 Mon Sep 17 00:00:00 2001 From: Edward Simpson <edward@skywire.co.uk> Date: Thu, 14 Nov 2019 13:20:57 +0000 Subject: [PATCH 127/595] Moving Ui message.js hide speed and timeout into variables for easier overriding --- app/code/Magento/Ui/view/frontend/web/js/view/messages.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Ui/view/frontend/web/js/view/messages.js b/app/code/Magento/Ui/view/frontend/web/js/view/messages.js index b2fb3f216199b..735c3219c8136 100644 --- a/app/code/Magento/Ui/view/frontend/web/js/view/messages.js +++ b/app/code/Magento/Ui/view/frontend/web/js/view/messages.js @@ -20,6 +20,8 @@ define([ template: 'Magento_Ui/messages', selector: '[data-role=checkout-messages]', isHidden: false, + hideTimeout: 5000, + hideSpeed: 500, listens: { isHidden: 'onHiddenChange' } @@ -68,8 +70,8 @@ define([ // Hide message block if needed if (isHidden) { setTimeout(function () { - $(self.selector).hide('blind', {}, 500); - }, 5000); + $(self.selector).hide('blind', {}, self.hideSpeed); + }, self.hideTimeout); } } }); From e287963e0444f009098c7dcd1206f49d2b52cb1a Mon Sep 17 00:00:00 2001 From: Kate Kyzyma <kate@atwix.com> Date: Thu, 14 Nov 2019 17:58:46 +0200 Subject: [PATCH 128/595] Code refactoring --- ...eateNewUrlRewriteForCmsPageActionGroup.xml | 23 +++++ ...llNewCmsPageUrlRewriteFormActionGroup.xml} | 14 +-- ...minGoToAddNewUrlRewritePageActionGroup.xml | 19 ++++ ...ageFromGridForNewUrlRewriteActionGroup.xml | 22 +++++ ...AdminDeleteCmsPageUrlRewriteEntityTest.xml | 99 ------------------- ...teCmsPageUrlRewriteWithNoRedirectsTest.xml | 59 +++++++++++ ...ageUrlRewriteWithPermanentRedirectTest.xml | 55 +++++++++++ ...ageUrlRewriteWithTemporaryRedirectTest.xml | 55 +++++++++++ 8 files changed, 235 insertions(+), 111 deletions(-) create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminCreateNewUrlRewriteForCmsPageActionGroup.xml rename app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/{AdminAddUrlRewriteForCmsPageActionGroup.xml => AdminFillNewCmsPageUrlRewriteFormActionGroup.xml} (56%) create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminGoToAddNewUrlRewritePageActionGroup.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSelectCmsPageFromGridForNewUrlRewriteActionGroup.xml delete mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteEntityTest.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminCreateNewUrlRewriteForCmsPageActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminCreateNewUrlRewriteForCmsPageActionGroup.xml new file mode 100644 index 0000000000000..143198e4a1faa --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminCreateNewUrlRewriteForCmsPageActionGroup.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="AdminCreateNewUrlRewriteForCmsPageActionGroup"> + <annotations> + <description>Select "For Csm Page" URL Rewrite type</description> + </annotations> + <arguments> + <argument name="customUrlRewriteValue" type="string"/> + </arguments> + + <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewrite}}" stepKey="clickOnCustomUrlRewrite"/> + <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewriteValue('customUrlRewriteValue')}}" stepKey="selectForCsmPage"/> + <waitForPageLoad stepKey="waitForCategoryEditSectionToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteForCmsPageActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminFillNewCmsPageUrlRewriteFormActionGroup.xml similarity index 56% rename from app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteForCmsPageActionGroup.xml rename to app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminFillNewCmsPageUrlRewriteFormActionGroup.xml index f46bd7f5e0386..0c540d0698dd8 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteForCmsPageActionGroup.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminFillNewCmsPageUrlRewriteFormActionGroup.xml @@ -8,26 +8,17 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminAddUrlRewriteForCmsPageActionGroup"> + <actionGroup name="AdminFillNewCmsPageUrlRewriteFormActionGroup"> <annotations> - <description>Goes to the Admin Add URL Rewrite edit page. Fills in the provided URL details. Clicks on Save. Validates that the Success Message is present.</description> + <description>Fills in the provided URL details. Clicks on Save.</description> </annotations> <arguments> - <argument name="cmsPageUrlKey" type="string"/> - <argument name="customUrlRewriteValue" type="string"/> <argument name="storeValue" type="string"/> <argument name="requestPath" type="string"/> <argument name="redirectTypeValue" type="string"/> <argument name="description" type="string"/> </arguments> - <amOnPage url="{{AdminUrlRewriteEditPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> - <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewrite}}" stepKey="clickOnCustomUrlRewrite"/> - <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewriteValue('customUrlRewriteValue')}}" stepKey="selectForCsmPage"/> - <waitForPageLoad stepKey="waitForCategoryEditSectionToLoad"/> - <click selector="{{AdminUrlRewriteEditSection.cmsPage('cmsPageUrlKey')}}" stepKey="selectCmsPage"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> @@ -35,6 +26,5 @@ <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue('redirectTypeValue')}}" stepKey="clickOnRedirectTypeValue"/> <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> - <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminGoToAddNewUrlRewritePageActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminGoToAddNewUrlRewritePageActionGroup.xml new file mode 100644 index 0000000000000..e0e8df47852d6 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminGoToAddNewUrlRewritePageActionGroup.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="AdminGoToAddNewUrlRewritePageActionGroup"> + <annotations> + <description>Goes to the Admin Add URL Rewrite edit page</description> + </annotations> + + <amOnPage url="{{AdminUrlRewriteEditPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSelectCmsPageFromGridForNewUrlRewriteActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSelectCmsPageFromGridForNewUrlRewriteActionGroup.xml new file mode 100644 index 0000000000000..2713e3937469b --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSelectCmsPageFromGridForNewUrlRewriteActionGroup.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="AdminSelectCmsPageFromGridForNewUrlRewriteActionGroup"> + <annotations> + <description>Select Cms Page for URL Rewrite from the grid</description> + </annotations> + <arguments> + <argument name="cmsPageUrlKey" type="string"/> + </arguments> + + <click selector="{{AdminUrlRewriteEditSection.cmsPage('cmsPageUrlKey')}}" stepKey="selectCmsPage"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteEntityTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteEntityTest.xml deleted file mode 100644 index 705786afa83bb..0000000000000 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteEntityTest.xml +++ /dev/null @@ -1,99 +0,0 @@ -<?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="AdminDeleteCmsPageUrlRewriteEntityTest"> - <annotations> - <stories value="Delete CMS Page URL rewrite"/> - <title value="Delete CMS Page URL rewrite"/> - <description value="Log in to admin and delete CMS Page URL rewrite"/> - <group value="cMSContent"/> - <group value="mtf_migrated"/> - </annotations> - - <before> - <createData entity="simpleCmsPage" stepKey="createCMSPage"/> - <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> - </before> - <after> - <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> - <actionGroup ref="logout" stepKey="logout"/> - </after> - - <!-- Create URL Rewrite for CMS Page with No redirects --> - <actionGroup ref="AdminAddUrlRewriteForCmsPageActionGroup" stepKey="addUrlRewrite"> - <argument name="cmsPageUrlKey" value="$$createCMSPage.identifier$$"/> - <argument name="customUrlRewriteValue" value="For CMS page'"/> - <argument name="storeValue" value="Default Store View"/> - <argument name="requestPath" value="newrequestpath"/> - <argument name="redirectTypeValue" value="No"/> - <argument name="description" value="cms_default_no_redirect"/> - </actionGroup> - - <!-- Create URL Rewrite for CMS Page with temporary redirect --> - <actionGroup ref="AdminAddUrlRewriteForCmsPageActionGroup" stepKey="addUrlRewriteTemporary"> - <argument name="cmsPageUrlKey" value="$$createCMSPage.identifier$$"/> - <argument name="customUrlRewriteValue" value="For CMS page'"/> - <argument name="storeValue" value="Default Store View"/> - <argument name="requestPath" value="temporaryrequestpath.html"/> - <argument name="redirectTypeValue" value="Temporary (302)"/> - <argument name="description" value="cms_default_temporary_redirect"/> - </actionGroup> - - <!-- Create URL Rewrite for CMS Page with permanent redirect --> - <actionGroup ref="AdminAddUrlRewriteForCmsPageActionGroup" stepKey="addUrlRewritePermanent"> - <argument name="cmsPageUrlKey" value="$$createCMSPage.identifier$$"/> - <argument name="customUrlRewriteValue" value="For CMS page'"/> - <argument name="storeValue" value="Default Store View"/> - <argument name="requestPath" value="permanentrequestpath.html"/> - <argument name="redirectTypeValue" value="Permanent (301)"/> - <argument name="description" value="cms_default_permanent_redirect"/> - </actionGroup> - - <!--Delete the URL Rewrite for CMS Page with No redirects--> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> - <argument name="requestPath" value="newrequestpath"/> - </actionGroup> - <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> - <argument name="message" value="You deleted the URL rewrite."/> - </actionGroup> - <!--Search and verify AssertUrlRewriteNotInGrid--> - <actionGroup ref="AdminSearchDeletedUrlRewrite" stepKey="searchDeletedUrlRewriteInGrid"> - <argument name="requestPath" value="newrequestpath"/> - </actionGroup> - <!--Verify AssertPageByUrlRewriteIsNotFound--> - <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFound"> - <argument name="requestPath" value="newrequestpath"/> - </actionGroup> - - <!--Delete the URL Rewrite for CMS Page with with temporary redirect--> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteTemporaryUrlRewrite"> - <argument name="requestPath" value="temporaryrequestpath.html"/> - </actionGroup> - <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessageSecondTime"> - <argument name="message" value="You deleted the URL rewrite."/> - </actionGroup> - <!--Verify AssertPageByUrlRewriteIsNotFound--> - <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFoundSecondTime"> - <argument name="requestPath" value="temporaryrequestpath.html"/> - </actionGroup> - - <!--Delete the URL Rewrite for CMS Page with permanent redirect--> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deletePermanentUrlRewrite"> - <argument name="requestPath" value="permanentrequestpath.html"/> - </actionGroup> - <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessageThirdTime"> - <argument name="message" value="You deleted the URL rewrite."/> - </actionGroup> - <!--Verify AssertPageByUrlRewriteIsNotFound--> - <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFoundThirdTime"> - <argument name="requestPath" value="permanentrequestpath.html"/> - </actionGroup> - - </test> -</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml new file mode 100644 index 0000000000000..4c3bd8179578c --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml @@ -0,0 +1,59 @@ +<?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="AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest"> + <annotations> + <stories value="Delete CMS Page URL rewrite with No Redirects"/> + <title value="Delete CMS Page URL rewrite with No Redirects"/> + <description value="Log in to admin and delete CMS Page URL rewrite with No Redirects"/> + <group value="cMSContent"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <createData entity="simpleCmsPage" stepKey="createCMSPage"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + </before> + <after> + <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <actionGroup ref="AdminGoToAddNewUrlRewritePageActionGroup" stepKey="openUrlRewriteEditPage"/> + <actionGroup ref="AdminCreateNewUrlRewriteForCmsPageActionGroup" stepKey="selectForCsmPageType"> + <argument name="customUrlRewriteValue" value="For CMS page'"/> + </actionGroup> + <actionGroup ref="AdminSelectCmsPageFromGridForNewUrlRewriteActionGroup" stepKey="selectCmsPge"> + <argument name="cmsPageUrlKey" value="$$createCMSPage.identifier$$"/> + </actionGroup> + <actionGroup ref="AdminFillNewCmsPageUrlRewriteFormActionGroup" stepKey="fillTheForm"> + <argument name="storeValue" value="Default Store View"/> + <argument name="requestPath" value="newrequestpath"/> + <argument name="redirectTypeValue" value="No"/> + <argument name="description" value="cms_default_no_redirect"/> + </actionGroup> + + <!--Delete the URL Rewrite for CMS Page with No redirects--> + <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <argument name="requestPath" value="newrequestpath"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> + <argument name="message" value="You deleted the URL rewrite."/> + </actionGroup> + <!--Search and verify AssertUrlRewriteNotInGrid--> + <actionGroup ref="AdminSearchDeletedUrlRewrite" stepKey="searchDeletedUrlRewriteInGrid"> + <argument name="requestPath" value="newrequestpath"/> + </actionGroup> + <!--Verify AssertPageByUrlRewriteIsNotFound--> + <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFound"> + <argument name="requestPath" value="newrequestpath"/> + </actionGroup> + + </test> +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml new file mode 100644 index 0000000000000..89f663b54e017 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml @@ -0,0 +1,55 @@ +<?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="AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest"> + <annotations> + <stories value="Delete CMS Page URL rewrite with Permanent Redirect"/> + <title value="Delete CMS Page URL rewrite with Permanent Redirect"/> + <description value="Log in to admin and delete CMS Page URL rewrite with Permanent Redirect"/> + <group value="cMSContent"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <createData entity="simpleCmsPage" stepKey="createCMSPage"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + </before> + <after> + <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <actionGroup ref="AdminGoToAddNewUrlRewritePageActionGroup" stepKey="openUrlRewriteEditPage"/> + <actionGroup ref="AdminCreateNewUrlRewriteForCmsPageActionGroup" stepKey="selectForCsmPageType"> + <argument name="customUrlRewriteValue" value="For CMS page'"/> + </actionGroup> + <actionGroup ref="AdminSelectCmsPageFromGridForNewUrlRewriteActionGroup" stepKey="selectCmsPge"> + <argument name="cmsPageUrlKey" value="$$createCMSPage.identifier$$"/> + </actionGroup> + <actionGroup ref="AdminFillNewCmsPageUrlRewriteFormActionGroup" stepKey="fillTheForm"> + <argument name="storeValue" value="Default Store View"/> + <argument name="requestPath" value="permanentrequestpath.html"/> + <argument name="redirectTypeValue" value="Permanent (301)"/> + <argument name="description" value="cms_default_permanent_redirect"/> + </actionGroup> + + <!-- Delete the URL Rewrite for CMS Page with permanent redirect--> + <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deletePermanentUrlRewrite"> + <argument name="requestPath" value="permanentrequestpath.html"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> + <argument name="message" value="You deleted the URL rewrite."/> + </actionGroup> + <!-- Verify AssertPageByUrlRewriteIsNotFound --> + <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFound"> + <argument name="requestPath" value="permanentrequestpath.html"/> + </actionGroup> + + </test> +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml new file mode 100644 index 0000000000000..ad7aec335b7a3 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml @@ -0,0 +1,55 @@ +<?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="AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest"> + <annotations> + <stories value="Delete CMS Page URL rewrite with Temporary Redirect"/> + <title value="Delete CMS Page URL rewrite with Temporary Redirect"/> + <description value="Log in to admin and delete CMS Page URL rewrite with Temporary Redirect"/> + <group value="cMSContent"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <createData entity="simpleCmsPage" stepKey="createCMSPage"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + </before> + <after> + <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <actionGroup ref="AdminGoToAddNewUrlRewritePageActionGroup" stepKey="openUrlRewriteEditPage"/> + <actionGroup ref="AdminCreateNewUrlRewriteForCmsPageActionGroup" stepKey="selectForCsmPageType"> + <argument name="customUrlRewriteValue" value="For CMS page'"/> + </actionGroup> + <actionGroup ref="AdminSelectCmsPageFromGridForNewUrlRewriteActionGroup" stepKey="selectCmsPge"> + <argument name="cmsPageUrlKey" value="$$createCMSPage.identifier$$"/> + </actionGroup> + <actionGroup ref="AdminFillNewCmsPageUrlRewriteFormActionGroup" stepKey="fillTheForm"> + <argument name="storeValue" value="Default Store View"/> + <argument name="requestPath" value="temporaryrequestpath.html"/> + <argument name="redirectTypeValue" value="Temporary (302)"/> + <argument name="description" value="cms_default_temporary_redirect"/> + </actionGroup> + + <!-- Delete the URL Rewrite for CMS Page with with temporary redirect--> + <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteTemporaryUrlRewrite"> + <argument name="requestPath" value="temporaryrequestpath.html"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> + <argument name="message" value="You deleted the URL rewrite."/> + </actionGroup> + <!--Verify AssertPageByUrlRewriteIsNotFound--> + <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFound"> + <argument name="requestPath" value="temporaryrequestpath.html"/> + </actionGroup> + + </test> +</tests> From 0e303660dbe08418c6653059dca7fa85cdf8f770 Mon Sep 17 00:00:00 2001 From: Adarsh Manickam <amanickam@ztech.io> Date: Fri, 15 Nov 2019 00:10:37 +0530 Subject: [PATCH 129/595] Resolved Adobe issue 691 --- .../base/web/js/grid/columns/image-preview.js | 49 +++++++++++++++++-- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js index 1ef2ebf6594fa..7cbbfdab28ba1 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js @@ -4,8 +4,9 @@ */ define([ 'jquery', - 'Magento_Ui/js/grid/columns/column' -], function ($, Column) { + 'Magento_Ui/js/grid/columns/column', + 'Magento_Ui/js/lib/key-codes' +], function ($, Column, keyCodes) { 'use strict'; return Column.extend({ @@ -32,6 +33,18 @@ define([ } }, + /** + * Initialize image preview component + * + * @returns {Object} + */ + initialize: function () { + this._super(); + this.setNavigationListener(); + + return this; + }, + /** * Init observable variables * @return {Object} @@ -174,6 +187,36 @@ define([ block: 'center', inline: 'nearest' }); - } + }, + + /** + * Set image preview keyboard navigation listener + */ + setNavigationListener: function () { + var imageIndex, endIndex, key, + startIndex = 0, + imageColumnSelector = '.masonry-image-column', + adobeModalSelector = '.adobe-stock-modal', + imageGridSelector = '.masonry-image-grid'; + + $(document).on('keydown', function(e) { + key = keyCodes[e.keyCode]; + endIndex = $(imageGridSelector)[0].children.length - 1; + + if($(this.previewImageSelector).length > 0) { + imageIndex = $(this.previewImageSelector) + .parents(imageColumnSelector) + .data('repeatIndex'); + } + + if($(adobeModalSelector).hasClass('_show')) { + if(key === 'pageLeftKey' && imageIndex !== startIndex) { + $(this.previewImageSelector + ' .action-previous').click(); + } else if (key === 'pageRightKey' && imageIndex !== endIndex) { + $(this.previewImageSelector + ' .action-next').click(); + } + } + }); + }, }); }); From 841872ca4313ca6b4a3587a65598ce8206ad90a9 Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Thu, 14 Nov 2019 13:14:53 -0600 Subject: [PATCH 130/595] MC-23068: Change in-product doc url to devdocs - Move "Minimum Terms to Match" down to search configuration section - Change documentation URL for "Minimum Terms to Match" --- .../Elasticsearch/etc/adminhtml/system.xml | 32 +++++++++---------- .../Elasticsearch6/etc/adminhtml/system.xml | 17 +++++----- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml b/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml index 1f61a48db9bfa..41c6710412db9 100644 --- a/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml +++ b/app/code/Magento/Elasticsearch/etc/adminhtml/system.xml @@ -55,21 +55,21 @@ <field id="engine">elasticsearch</field> </depends> </field> - <field id="elasticsearch_minimum_should_match" translate="label" type="text" sortOrder="68" showInDefault="1" showInWebsite="0" showInStore="0"> - <label>Minimum Terms to Match</label> + <field id="elasticsearch_test_connect_wizard" translate="button_label" sortOrder="68" showInDefault="1" showInWebsite="0" showInStore="0"> + <label/> + <button_label>Test Connection</button_label> + <frontend_model>Magento\Elasticsearch\Block\Adminhtml\System\Config\TestConnection</frontend_model> <depends> <field id="engine">elasticsearch</field> </depends> - <comment><![CDATA[See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-minimum-should-match.html">here</a> for possible values.]]></comment> - <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> </field> - <field id="elasticsearch_test_connect_wizard" translate="button_label" sortOrder="69" showInDefault="1" showInWebsite="0" showInStore="0"> - <label/> - <button_label>Test Connection</button_label> - <frontend_model>Magento\Elasticsearch\Block\Adminhtml\System\Config\TestConnection</frontend_model> + <field id="elasticsearch_minimum_should_match" translate="label" type="text" sortOrder="93" showInDefault="1" showInWebsite="0" showInStore="0"> + <label>Minimum Terms to Match</label> <depends> <field id="engine">elasticsearch</field> </depends> + <comment><![CDATA[<a href="https://docs.magento.com/m2/ce/user_guide/catalog/search-elasticsearch.html">Learn more</a> about valid syntax.]]></comment> + <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> </field> <!-- Elasticsearch 5.0+ --> <field id="elasticsearch5_server_hostname" translate="label" type="text" sortOrder="61" showInDefault="1" showInWebsite="0" showInStore="0"> @@ -117,21 +117,21 @@ <field id="engine">elasticsearch5</field> </depends> </field> - <field id="elasticsearch5_minimum_should_match" translate="label" type="text" sortOrder="68" showInDefault="1" showInWebsite="0" showInStore="0"> - <label>Minimum Terms to Match</label> + <field id="elasticsearch5_test_connect_wizard" translate="button_label" sortOrder="68" showInDefault="1" showInWebsite="0" showInStore="0"> + <label/> + <button_label>Test Connection</button_label> + <frontend_model>Magento\Elasticsearch\Block\Adminhtml\System\Config\Elasticsearch5\TestConnection</frontend_model> <depends> <field id="engine">elasticsearch5</field> </depends> - <comment><![CDATA[See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-minimum-should-match.html">here</a> for possible values.]]></comment> - <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> </field> - <field id="elasticsearch5_test_connect_wizard" translate="button_label" sortOrder="69" showInDefault="1" showInWebsite="0" showInStore="0"> - <label/> - <button_label>Test Connection</button_label> - <frontend_model>Magento\Elasticsearch\Block\Adminhtml\System\Config\Elasticsearch5\TestConnection</frontend_model> + <field id="elasticsearch5_minimum_should_match" translate="label" type="text" sortOrder="93" showInDefault="1" showInWebsite="0" showInStore="0"> + <label>Minimum Terms to Match</label> <depends> <field id="engine">elasticsearch5</field> </depends> + <comment><![CDATA[<a href="https://docs.magento.com/m2/ce/user_guide/catalog/search-elasticsearch.html">Learn more</a> about valid syntax.]]></comment> + <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> </field> </group> </section> diff --git a/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml b/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml index 8d22fcbc5f8f4..beccb0c1ceb81 100644 --- a/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml +++ b/app/code/Magento/Elasticsearch6/etc/adminhtml/system.xml @@ -70,24 +70,23 @@ </depends> </field> - <field id="elasticsearch6_minimum_should_match" translate="label" type="text" sortOrder="78" showInDefault="1" + <field id="elasticsearch6_test_connect_wizard" translate="button_label" sortOrder="78" showInDefault="1" showInWebsite="0" showInStore="0"> - <label>Minimum Terms to Match</label> + <label/> + <button_label>Test Connection</button_label> + <frontend_model>Magento\Elasticsearch6\Block\Adminhtml\System\Config\TestConnection</frontend_model> <depends> <field id="engine">elasticsearch6</field> </depends> - <comment><![CDATA[See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-minimum-should-match.html">here</a> for possible values.]]></comment> - <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> </field> - - <field id="elasticsearch6_test_connect_wizard" translate="button_label" sortOrder="79" showInDefault="1" + <field id="elasticsearch6_minimum_should_match" translate="label" type="text" sortOrder="93" showInDefault="1" showInWebsite="0" showInStore="0"> - <label/> - <button_label>Test Connection</button_label> - <frontend_model>Magento\Elasticsearch6\Block\Adminhtml\System\Config\TestConnection</frontend_model> + <label>Minimum Terms to Match</label> <depends> <field id="engine">elasticsearch6</field> </depends> + <comment><![CDATA[<a href="https://docs.magento.com/m2/ce/user_guide/catalog/search-elasticsearch.html">Learn more</a> about valid syntax.]]></comment> + <backend_model>Magento\Elasticsearch\Model\Config\Backend\MinimumShouldMatch</backend_model> </field> </group> </section> From 2ce96d1c0ebb4dc4a3e7b89a9074b1db1d0b2c92 Mon Sep 17 00:00:00 2001 From: Oleksandr Gorkun <ogorkun@magento.com> Date: Thu, 14 Nov 2019 16:21:59 -0600 Subject: [PATCH 131/595] MC-19926: Implement CSP --- .../Magento/Csp/Api/CspRendererInterface.php | 24 ++ .../Csp/Api/Data/ModeConfiguredInterface.php | 32 ++ .../Magento/Csp/Api/Data/PolicyInterface.php | 30 ++ .../Csp/Api/ModeConfigManagerInterface.php | 26 ++ .../Csp/Api/PolicyCollectorInterface.php | 28 ++ .../Csp/Api/PolicyRendererInterface.php | 36 ++ app/code/Magento/Csp/LICENSE.txt | 48 +++ app/code/Magento/Csp/LICENSE_AFL.txt | 48 +++ .../Collector/Config/FetchPolicyReader.php | 44 +++ .../Collector/Config/FlagPolicyReader.php | 33 ++ .../Config/PluginTypesPolicyReader.php | 33 ++ .../Config/PolicyReaderInterface.php | 33 ++ .../Collector/Config/PolicyReaderPool.php | 45 +++ .../Collector/Config/SandboxPolicyReader.php | 45 +++ .../Csp/Model/Collector/ConfigCollector.php | 92 +++++ .../Collector/CspWhitelistXml/Converter.php | 51 +++ .../Collector/CspWhitelistXml/Reader.php | 27 ++ .../CspWhitelistXml/SchemaLocator.php | 51 +++ .../Collector/CspWhitelistXmlCollector.php | 57 +++ .../Csp/Model/CompositePolicyCollector.php | 42 +++ app/code/Magento/Csp/Model/CspRenderer.php | 49 +++ .../Magento/Csp/Model/Mode/ConfigManager.php | 79 ++++ .../Csp/Model/Mode/Data/ModeConfigured.php | 52 +++ .../Magento/Csp/Model/Policy/FetchPolicy.php | 259 +++++++++++++ .../Magento/Csp/Model/Policy/FlagPolicy.php | 48 +++ .../Csp/Model/Policy/PluginTypesPolicy.php | 59 +++ .../Renderer/SimplePolicyHeaderRenderer.php | 75 ++++ .../Csp/Model/Policy/SandboxPolicy.php | 275 ++++++++++++++ .../Model/Policy/SimplePolicyInterface.php | 18 + .../Magento/Csp/Model/PolicyRendererPool.php | 48 +++ app/code/Magento/Csp/Observer/Render.php | 43 +++ app/code/Magento/Csp/README.md | 2 + app/code/Magento/Csp/composer.json | 24 ++ app/code/Magento/Csp/etc/adminhtml/events.xml | 12 + app/code/Magento/Csp/etc/csp_whitelist.xsd | 52 +++ app/code/Magento/Csp/etc/di.xml | 44 +++ app/code/Magento/Csp/etc/frontend/events.xml | 12 + app/code/Magento/Csp/etc/module.xml | 10 + app/code/Magento/Csp/registration.php | 9 + composer.json | 3 +- .../Magento/TestModuleCspConfig/composer.json | 21 ++ .../TestModuleCspConfig/etc/csp_whitelist.xml | 23 ++ .../TestModuleCspConfig/etc/module.xml | 10 + .../TestModuleCspConfig/registration.php | 12 + .../TestModuleCspConfig2/composer.json | 21 ++ .../etc/csp_whitelist.xml | 17 + .../TestModuleCspConfig2/etc/module.xml | 14 + .../TestModuleCspConfig2/registration.php | 12 + .../testsuite/Magento/Csp/CspTest.php | 164 +++++++++ .../Model/Collector/ConfigCollectorTest.php | 343 ++++++++++++++++++ .../CspWhitelistXmlCollectorTest.php | 68 ++++ .../SimplePolicyHeaderRendererTest.php | 130 +++++++ 52 files changed, 2832 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/Csp/Api/CspRendererInterface.php create mode 100644 app/code/Magento/Csp/Api/Data/ModeConfiguredInterface.php create mode 100644 app/code/Magento/Csp/Api/Data/PolicyInterface.php create mode 100644 app/code/Magento/Csp/Api/ModeConfigManagerInterface.php create mode 100644 app/code/Magento/Csp/Api/PolicyCollectorInterface.php create mode 100644 app/code/Magento/Csp/Api/PolicyRendererInterface.php create mode 100644 app/code/Magento/Csp/LICENSE.txt create mode 100644 app/code/Magento/Csp/LICENSE_AFL.txt create mode 100644 app/code/Magento/Csp/Model/Collector/Config/FetchPolicyReader.php create mode 100644 app/code/Magento/Csp/Model/Collector/Config/FlagPolicyReader.php create mode 100644 app/code/Magento/Csp/Model/Collector/Config/PluginTypesPolicyReader.php create mode 100644 app/code/Magento/Csp/Model/Collector/Config/PolicyReaderInterface.php create mode 100644 app/code/Magento/Csp/Model/Collector/Config/PolicyReaderPool.php create mode 100644 app/code/Magento/Csp/Model/Collector/Config/SandboxPolicyReader.php create mode 100644 app/code/Magento/Csp/Model/Collector/ConfigCollector.php create mode 100644 app/code/Magento/Csp/Model/Collector/CspWhitelistXml/Converter.php create mode 100644 app/code/Magento/Csp/Model/Collector/CspWhitelistXml/Reader.php create mode 100644 app/code/Magento/Csp/Model/Collector/CspWhitelistXml/SchemaLocator.php create mode 100644 app/code/Magento/Csp/Model/Collector/CspWhitelistXmlCollector.php create mode 100644 app/code/Magento/Csp/Model/CompositePolicyCollector.php create mode 100644 app/code/Magento/Csp/Model/CspRenderer.php create mode 100644 app/code/Magento/Csp/Model/Mode/ConfigManager.php create mode 100644 app/code/Magento/Csp/Model/Mode/Data/ModeConfigured.php create mode 100644 app/code/Magento/Csp/Model/Policy/FetchPolicy.php create mode 100644 app/code/Magento/Csp/Model/Policy/FlagPolicy.php create mode 100644 app/code/Magento/Csp/Model/Policy/PluginTypesPolicy.php create mode 100644 app/code/Magento/Csp/Model/Policy/Renderer/SimplePolicyHeaderRenderer.php create mode 100644 app/code/Magento/Csp/Model/Policy/SandboxPolicy.php create mode 100644 app/code/Magento/Csp/Model/Policy/SimplePolicyInterface.php create mode 100644 app/code/Magento/Csp/Model/PolicyRendererPool.php create mode 100644 app/code/Magento/Csp/Observer/Render.php create mode 100644 app/code/Magento/Csp/README.md create mode 100644 app/code/Magento/Csp/composer.json create mode 100644 app/code/Magento/Csp/etc/adminhtml/events.xml create mode 100644 app/code/Magento/Csp/etc/csp_whitelist.xsd create mode 100644 app/code/Magento/Csp/etc/di.xml create mode 100644 app/code/Magento/Csp/etc/frontend/events.xml create mode 100644 app/code/Magento/Csp/etc/module.xml create mode 100644 app/code/Magento/Csp/registration.php create mode 100644 dev/tests/integration/_files/Magento/TestModuleCspConfig/composer.json create mode 100644 dev/tests/integration/_files/Magento/TestModuleCspConfig/etc/csp_whitelist.xml create mode 100644 dev/tests/integration/_files/Magento/TestModuleCspConfig/etc/module.xml create mode 100644 dev/tests/integration/_files/Magento/TestModuleCspConfig/registration.php create mode 100644 dev/tests/integration/_files/Magento/TestModuleCspConfig2/composer.json create mode 100644 dev/tests/integration/_files/Magento/TestModuleCspConfig2/etc/csp_whitelist.xml create mode 100644 dev/tests/integration/_files/Magento/TestModuleCspConfig2/etc/module.xml create mode 100644 dev/tests/integration/_files/Magento/TestModuleCspConfig2/registration.php create mode 100644 dev/tests/integration/testsuite/Magento/Csp/CspTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Csp/Model/Collector/ConfigCollectorTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Csp/Model/Collector/CspWhitelistXmlCollectorTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Csp/Model/Policy/Renderer/SimplePolicyHeaderRendererTest.php diff --git a/app/code/Magento/Csp/Api/CspRendererInterface.php b/app/code/Magento/Csp/Api/CspRendererInterface.php new file mode 100644 index 0000000000000..696d2e147f054 --- /dev/null +++ b/app/code/Magento/Csp/Api/CspRendererInterface.php @@ -0,0 +1,24 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Api; + +use Magento\Framework\App\Response\HttpInterface as HttpResponse; + +/** + * Renders configured CSPs + */ +interface CspRendererInterface +{ + /** + * Render configured CSP for the given HTTP response. + * + * @param HttpResponse $response + * @return void + */ + public function render(HttpResponse $response): void; +} diff --git a/app/code/Magento/Csp/Api/Data/ModeConfiguredInterface.php b/app/code/Magento/Csp/Api/Data/ModeConfiguredInterface.php new file mode 100644 index 0000000000000..5779bbd052792 --- /dev/null +++ b/app/code/Magento/Csp/Api/Data/ModeConfiguredInterface.php @@ -0,0 +1,32 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Api\Data; + +/** + * CSP mode. + */ +interface ModeConfiguredInterface +{ + /** + * Report only mode flag. + * + * In "report-only" mode browsers only report violation but do not restrict them. + * + * @return bool + */ + public function isReportOnly(): bool; + + /** + * URI of endpoint logging reported violations. + * + * Even in "restrict" mode violations can be logged. + * + * @return string|null + */ + public function getReportUri(): ?string; +} diff --git a/app/code/Magento/Csp/Api/Data/PolicyInterface.php b/app/code/Magento/Csp/Api/Data/PolicyInterface.php new file mode 100644 index 0000000000000..c713c4b61417f --- /dev/null +++ b/app/code/Magento/Csp/Api/Data/PolicyInterface.php @@ -0,0 +1,30 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Api\Data; + +/** + * Defined Content Security Policy. + * + * Different policies will have different types of data but they all will have identifiers and string representations. + */ +interface PolicyInterface +{ + /** + * Policy unique name (ID). + * + * @return string + */ + public function getId(): string; + + /** + * Value of the policy. + * + * @return string + */ + public function getValue(): string; +} diff --git a/app/code/Magento/Csp/Api/ModeConfigManagerInterface.php b/app/code/Magento/Csp/Api/ModeConfigManagerInterface.php new file mode 100644 index 0000000000000..79aff996bbf5c --- /dev/null +++ b/app/code/Magento/Csp/Api/ModeConfigManagerInterface.php @@ -0,0 +1,26 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Api; + +use Magento\Csp\Api\Data\ModeConfiguredInterface; + +/** + * CSP mode config manager. + * + * Responsible for CSP mode configurations like report-only/restrict modes, report URL etc. + */ +interface ModeConfigManagerInterface +{ + /** + * Load CSP mode config. + * + * @return ModeConfiguredInterface + * @throws \RuntimeException When failed to retrieve configurations. + */ + public function getConfigured(): ModeConfiguredInterface; +} diff --git a/app/code/Magento/Csp/Api/PolicyCollectorInterface.php b/app/code/Magento/Csp/Api/PolicyCollectorInterface.php new file mode 100644 index 0000000000000..139dec77e040b --- /dev/null +++ b/app/code/Magento/Csp/Api/PolicyCollectorInterface.php @@ -0,0 +1,28 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Api; + +use Magento\Csp\Api\Data\PolicyInterface; + +/** + * Collects CSPs from a source. + */ +interface PolicyCollectorInterface +{ + /** + * Collect all configured policies. + * + * Collector finds CSPs from configurations and returns a list. + * The resulting list will be used to render policies as is so it is a collector's responsibility to include + * previously found policies from $defaultPolicies or redefine them. + * + * @param PolicyInterface[] $defaultPolicies Default policies/policies found previously. + * @return PolicyInterface[] + */ + public function collect(array $defaultPolicies = []): array; +} diff --git a/app/code/Magento/Csp/Api/PolicyRendererInterface.php b/app/code/Magento/Csp/Api/PolicyRendererInterface.php new file mode 100644 index 0000000000000..db761598291d4 --- /dev/null +++ b/app/code/Magento/Csp/Api/PolicyRendererInterface.php @@ -0,0 +1,36 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Api; + +use Magento\Csp\Api\Data\PolicyInterface; +use Magento\Framework\App\Response\HttpInterface as HttpResponse; + +/** + * Renders one policy at a time. + * + * Different type of CSPs may require specific renderers due to being represented by different headers. + */ +interface PolicyRendererInterface +{ + /** + * Render a policy for a response. + * + * @param PolicyInterface $policy + * @param HttpResponse $response + * @return void + */ + public function render(PolicyInterface $policy, HttpResponse $response): void; + + /** + * Would this renderer work for given policy? + * + * @param PolicyInterface $policy + * @return bool + */ + public function canRender(PolicyInterface $policy): bool; +} diff --git a/app/code/Magento/Csp/LICENSE.txt b/app/code/Magento/Csp/LICENSE.txt new file mode 100644 index 0000000000000..49525fd99da9c --- /dev/null +++ b/app/code/Magento/Csp/LICENSE.txt @@ -0,0 +1,48 @@ + +Open Software License ("OSL") v. 3.0 + +This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work: + +Licensed under the Open Software License version 3.0 + + 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following: + + 1. to reproduce the Original Work in copies, either alone or as part of a collective work; + + 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work; + + 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License; + + 4. to perform the Original Work publicly; and + + 5. to display the Original Work publicly. + + 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works. + + 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work. + + 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license. + + 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c). + + 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. + + 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer. + + 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation. + + 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including 'fair use' or 'fair dealing'). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c). + + 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. + + 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License. + + 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. + + 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. + + 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. + + 16. Modification of This License. This License is Copyright (C) 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. \ No newline at end of file diff --git a/app/code/Magento/Csp/LICENSE_AFL.txt b/app/code/Magento/Csp/LICENSE_AFL.txt new file mode 100644 index 0000000000000..f39d641b18a19 --- /dev/null +++ b/app/code/Magento/Csp/LICENSE_AFL.txt @@ -0,0 +1,48 @@ + +Academic Free License ("AFL") v. 3.0 + +This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work: + +Licensed under the Academic Free License version 3.0 + + 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following: + + 1. to reproduce the Original Work in copies, either alone or as part of a collective work; + + 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work; + + 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, under any license of your choice that does not contradict the terms and conditions, including Licensor's reserved rights and remedies, in this Academic Free License; + + 4. to perform the Original Work publicly; and + + 5. to display the Original Work publicly. + + 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works. + + 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work. + + 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license. + + 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c). + + 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. + + 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer. + + 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation. + + 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c). + + 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. + + 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License. + + 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. + + 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. + + 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. + + 16. Modification of This License. This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Academic Free License" or "AFL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. diff --git a/app/code/Magento/Csp/Model/Collector/Config/FetchPolicyReader.php b/app/code/Magento/Csp/Model/Collector/Config/FetchPolicyReader.php new file mode 100644 index 0000000000000..8728755c594e6 --- /dev/null +++ b/app/code/Magento/Csp/Model/Collector/Config/FetchPolicyReader.php @@ -0,0 +1,44 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Collector\Config; + +use Magento\Csp\Api\Data\PolicyInterface; +use Magento\Csp\Model\Policy\FetchPolicy; + +/** + * Reads fetch directives. + */ +class FetchPolicyReader implements PolicyReaderInterface +{ + /** + * @inheritDoc + */ + public function read(string $id, $value): PolicyInterface + { + return new FetchPolicy( + $id, + !empty($value['none']), + !empty($value['hosts']) ? array_values($value['hosts']) : [], + !empty($value['schemes']) ? array_values($value['schemes']) : [], + !empty($value['self']), + !empty($value['inline']), + !empty($value['eval']), + [], + [], + !empty($value['dynamic']) + ); + } + + /** + * @inheritDoc + */ + public function canRead(string $id): bool + { + return in_array($id, FetchPolicy::POLICIES, true); + } +} diff --git a/app/code/Magento/Csp/Model/Collector/Config/FlagPolicyReader.php b/app/code/Magento/Csp/Model/Collector/Config/FlagPolicyReader.php new file mode 100644 index 0000000000000..f8d1ea962308f --- /dev/null +++ b/app/code/Magento/Csp/Model/Collector/Config/FlagPolicyReader.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Collector\Config; + +use Magento\Csp\Api\Data\PolicyInterface; +use Magento\Csp\Model\Policy\FlagPolicy; + +/** + * @inheritDoc + */ +class FlagPolicyReader implements PolicyReaderInterface +{ + /** + * @inheritDoc + */ + public function read(string $id, $value): PolicyInterface + { + return new FlagPolicy($id); + } + + /** + * @inheritDoc + */ + public function canRead(string $id): bool + { + return in_array($id, FlagPolicy::POLICIES, true); + } +} diff --git a/app/code/Magento/Csp/Model/Collector/Config/PluginTypesPolicyReader.php b/app/code/Magento/Csp/Model/Collector/Config/PluginTypesPolicyReader.php new file mode 100644 index 0000000000000..7214e6da62273 --- /dev/null +++ b/app/code/Magento/Csp/Model/Collector/Config/PluginTypesPolicyReader.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Collector\Config; + +use Magento\Csp\Api\Data\PolicyInterface; +use Magento\Csp\Model\Policy\PluginTypesPolicy; + +/** + * @inheritDoc + */ +class PluginTypesPolicyReader implements PolicyReaderInterface +{ + /** + * @inheritDoc + */ + public function read(string $id, $value): PolicyInterface + { + return new PluginTypesPolicy(array_values($value['types'])); + } + + /** + * @inheritDoc + */ + public function canRead(string $id): bool + { + return $id === 'plugin-types'; + } +} diff --git a/app/code/Magento/Csp/Model/Collector/Config/PolicyReaderInterface.php b/app/code/Magento/Csp/Model/Collector/Config/PolicyReaderInterface.php new file mode 100644 index 0000000000000..2ebac992222d9 --- /dev/null +++ b/app/code/Magento/Csp/Model/Collector/Config/PolicyReaderInterface.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Collector\Config; + +use Magento\Csp\Api\Data\PolicyInterface; + +/** + * Initiates a policy DTO based on a value found in Magento config. + */ +interface PolicyReaderInterface +{ + /** + * Read a policy from a config value. + * + * @param string $id + * @param string|array|bool $value + * @return PolicyInterface + */ + public function read(string $id, $value): PolicyInterface; + + /** + * Can given policy be read by this reader? + * + * @param string $id + * @return bool + */ + public function canRead(string $id): bool; +} diff --git a/app/code/Magento/Csp/Model/Collector/Config/PolicyReaderPool.php b/app/code/Magento/Csp/Model/Collector/Config/PolicyReaderPool.php new file mode 100644 index 0000000000000..0fc6fe03e05fa --- /dev/null +++ b/app/code/Magento/Csp/Model/Collector/Config/PolicyReaderPool.php @@ -0,0 +1,45 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Collector\Config; + +/** + * Pool of readers. + */ +class PolicyReaderPool +{ + /** + * @var PolicyReaderInterface[] + */ + private $readers; + + /** + * @param PolicyReaderInterface[] $readers + */ + public function __construct(array $readers) + { + $this->readers = $readers; + } + + /** + * Find a reader for the policy. + * + * @param string $id + * @return PolicyReaderInterface + * @throws \RuntimeException When failed to find a reader for given policy. + */ + public function getReader(string $id): PolicyReaderInterface + { + foreach ($this->readers as $reader) { + if ($reader->canRead($id)) { + return $reader; + } + } + + throw new \RuntimeException(sprintf('Failed to find a config reader for policy #%s', $id)); + } +} diff --git a/app/code/Magento/Csp/Model/Collector/Config/SandboxPolicyReader.php b/app/code/Magento/Csp/Model/Collector/Config/SandboxPolicyReader.php new file mode 100644 index 0000000000000..2699b8d57c037 --- /dev/null +++ b/app/code/Magento/Csp/Model/Collector/Config/SandboxPolicyReader.php @@ -0,0 +1,45 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Collector\Config; + +use Magento\Csp\Api\Data\PolicyInterface; +use Magento\Csp\Model\Policy\SandboxPolicy; + +/** + * @inheritDoc + */ +class SandboxPolicyReader implements PolicyReaderInterface +{ + /** + * @inheritDoc + */ + public function read(string $id, $value): PolicyInterface + { + return new SandboxPolicy( + !empty($value['forms']), + !empty($value['modals']), + !empty($value['orientation']), + !empty($value['pointer']), + !empty($value['popup']), + !empty($value['popups_to_escape']), + !empty($value['presentation']), + !empty($value['same_origin']), + !empty($value['scripts']), + !empty($value['navigation']), + !empty($value['navigation_by_user']) + ); + } + + /** + * @inheritDoc + */ + public function canRead(string $id): bool + { + return $id === 'sandbox'; + } +} diff --git a/app/code/Magento/Csp/Model/Collector/ConfigCollector.php b/app/code/Magento/Csp/Model/Collector/ConfigCollector.php new file mode 100644 index 0000000000000..f7b63e7549133 --- /dev/null +++ b/app/code/Magento/Csp/Model/Collector/ConfigCollector.php @@ -0,0 +1,92 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Collector; + +use Magento\Csp\Api\PolicyCollectorInterface; +use Magento\Csp\Model\Collector\Config\PolicyReaderPool; +use Magento\Framework\App\Area; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\State; +use Magento\Store\Model\ScopeInterface; +use Magento\Store\Model\Store; + +/** + * Reads Magento config. + */ +class ConfigCollector implements PolicyCollectorInterface +{ + /** + * @var ScopeConfigInterface + */ + private $config; + + /** + * @var PolicyReaderPool + */ + private $readersPool; + + /** + * @var State + */ + private $state; + + /** + * @var Store + */ + private $storeModel; + + /** + * @param ScopeConfigInterface $config + * @param PolicyReaderPool $readersPool + * @param State $state + * @param Store $storeModel + */ + public function __construct( + ScopeConfigInterface $config, + PolicyReaderPool $readersPool, + State $state, + Store $storeModel + ) { + $this->config = $config; + $this->readersPool = $readersPool; + $this->state = $state; + $this->storeModel = $storeModel; + } + + /** + * @inheritDoc + */ + public function collect(array $defaultPolicies = []): array + { + $collected = $defaultPolicies; + + $configArea = null; + $area = $this->state->getAreaCode(); + if ($area === Area::AREA_ADMINHTML) { + $configArea = 'admin'; + } elseif ($area === Area::AREA_FRONTEND) { + $configArea = 'storefront'; + } + + if ($configArea) { + $policiesConfig = $this->config->getValue( + 'csp/policies/' . $configArea, + ScopeInterface::SCOPE_STORE, + $this->storeModel->getStore() + ); + if (is_array($policiesConfig) && $policiesConfig) { + foreach ($policiesConfig as $policyConfig) { + $collected[] = $this->readersPool->getReader($policyConfig['policy_id']) + ->read($policyConfig['policy_id'], $policyConfig); + } + } + } + + return $collected; + } +} diff --git a/app/code/Magento/Csp/Model/Collector/CspWhitelistXml/Converter.php b/app/code/Magento/Csp/Model/Collector/CspWhitelistXml/Converter.php new file mode 100644 index 0000000000000..ab1ee8bb0befe --- /dev/null +++ b/app/code/Magento/Csp/Model/Collector/CspWhitelistXml/Converter.php @@ -0,0 +1,51 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Csp\Model\Collector\CspWhitelistXml; + +use Magento\Framework\Config\ConverterInterface; + +/** + * Converts csp_whitelist.xml files' content into config data. + */ +class Converter implements ConverterInterface +{ + /** + * @inheritDoc + */ + public function convert($source) + { + $policyConfig = []; + + /** @var \DOMNodeList $policies */ + $policies = $source->getElementsByTagName('policy'); + /** @var \DOMElement $policy */ + foreach ($policies as $policy) { + if ($policy->nodeType != XML_ELEMENT_NODE) { + continue; + } + $id = $policy->attributes->getNamedItem('id')->nodeValue; + if (!array_key_exists($id, $policyConfig)) { + $policyConfig[$id] = ['hosts' => [], 'hashes' => []]; + } + /** @var \DOMElement $value */ + foreach ($policy->getElementsByTagName('value') as $value) { + if ($value->attributes->getNamedItem('type')->nodeValue === 'host') { + $policyConfig[$id]['hosts'][] = $value->nodeValue; + } else { + $policyConfig[$id]['hashes'][$value->nodeValue] + = $value->attributes->getNamedItem('algorithm')->nodeValue; + } + } + $policyConfig[$id]['hosts'] = array_unique($policyConfig[$id]['hosts']); + $policyConfig[$id]['hashes'] = array_unique($policyConfig[$id]['hashes']); + } + + return $policyConfig; + } +} diff --git a/app/code/Magento/Csp/Model/Collector/CspWhitelistXml/Reader.php b/app/code/Magento/Csp/Model/Collector/CspWhitelistXml/Reader.php new file mode 100644 index 0000000000000..63f570ceb7a71 --- /dev/null +++ b/app/code/Magento/Csp/Model/Collector/CspWhitelistXml/Reader.php @@ -0,0 +1,27 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Csp\Model\Collector\CspWhitelistXml; + +use Magento\Framework\Config\Reader\Filesystem; + +/** + * Config reader for csp_whitelist.xml files. + */ +class Reader extends Filesystem +{ + /** + * List of id attributes for merge + * + * @var array + */ + protected $_idAttributes = [ + '/csp_whitelist/policies/policy' => ['id'], + '/csp_whitelist/policies/policy/values/value' => ['id'] + ]; +} diff --git a/app/code/Magento/Csp/Model/Collector/CspWhitelistXml/SchemaLocator.php b/app/code/Magento/Csp/Model/Collector/CspWhitelistXml/SchemaLocator.php new file mode 100644 index 0000000000000..285d37a1b6270 --- /dev/null +++ b/app/code/Magento/Csp/Model/Collector/CspWhitelistXml/SchemaLocator.php @@ -0,0 +1,51 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Csp\Model\Collector\CspWhitelistXml; + +use Magento\Framework\Module\Dir; +use Magento\Framework\Config\SchemaLocatorInterface; +use Magento\Framework\Module\Dir\Reader; + +/** + * CSP whitelist config schema locator. + */ +class SchemaLocator implements SchemaLocatorInterface +{ + /** + * Path to corresponding XSD file with validation rules for merged config and per file config. + * + * @var string + */ + private $schema ; + + /** + * @param Reader $moduleReader + */ + public function __construct(Reader $moduleReader) + { + $this->schema = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Csp') + . '/csp_whitelist.xsd'; + } + + /** + * @inheritDoc + */ + public function getSchema() + { + return $this->schema; + } + + /** + * @inheritDoc + */ + public function getPerFileSchema() + { + return $this->schema; + } +} diff --git a/app/code/Magento/Csp/Model/Collector/CspWhitelistXmlCollector.php b/app/code/Magento/Csp/Model/Collector/CspWhitelistXmlCollector.php new file mode 100644 index 0000000000000..66eb3747bce3e --- /dev/null +++ b/app/code/Magento/Csp/Model/Collector/CspWhitelistXmlCollector.php @@ -0,0 +1,57 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Csp\Model\Collector; + +use Magento\Csp\Api\PolicyCollectorInterface; +use Magento\Csp\Model\Collector\CspWhitelistXml\Reader as ConfigReader; +use Magento\Csp\Model\Policy\FetchPolicy; + +/** + * Collects policies defined in csp_whitelist.xml configs. + */ +class CspWhitelistXmlCollector implements PolicyCollectorInterface +{ + /** + * @var ConfigReader + */ + private $configReader; + + /** + * @param ConfigReader $configReader + */ + public function __construct(ConfigReader $configReader) + { + $this->configReader = $configReader; + } + + /** + * @inheritDoc + */ + public function collect(array $defaultPolicies = []): array + { + $policies = $defaultPolicies; + $config = $this->configReader->read(); + foreach ($config as $policyId => $values) { + $policies[] = new FetchPolicy( + $policyId, + false, + $values['hosts'], + [], + false, + false, + false, + [], + $values['hashes'] + ); + } + + + return $policies; + } +} diff --git a/app/code/Magento/Csp/Model/CompositePolicyCollector.php b/app/code/Magento/Csp/Model/CompositePolicyCollector.php new file mode 100644 index 0000000000000..31da34960ea75 --- /dev/null +++ b/app/code/Magento/Csp/Model/CompositePolicyCollector.php @@ -0,0 +1,42 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model; + +use Magento\Csp\Api\PolicyCollectorInterface; + +/** + * Delegates collecting to multiple collectors. + */ +class CompositePolicyCollector implements PolicyCollectorInterface +{ + /** + * @var PolicyCollectorInterface[] + */ + private $collectors; + + /** + * @param PolicyCollectorInterface[] $collectors + */ + public function __construct(array $collectors) + { + $this->collectors = $collectors; + } + + /** + * @inheritDoc + */ + public function collect(array $defaultPolicies = []): array + { + $collected = $defaultPolicies; + foreach ($this->collectors as $collector) { + $collected = $collector->collect($collected); + } + + return $collected; + } +} diff --git a/app/code/Magento/Csp/Model/CspRenderer.php b/app/code/Magento/Csp/Model/CspRenderer.php new file mode 100644 index 0000000000000..a883820f6743a --- /dev/null +++ b/app/code/Magento/Csp/Model/CspRenderer.php @@ -0,0 +1,49 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model; + +use Magento\Csp\Api\CspRendererInterface; +use Magento\Csp\Api\PolicyCollectorInterface; +use Magento\Framework\App\Response\HttpInterface as HttpResponse; + +/** + * @inheritDoc + */ +class CspRenderer implements CspRendererInterface +{ + /** + * @var PolicyRendererPool + */ + private $rendererPool; + + /** + * @var PolicyCollectorInterface + */ + private $collector; + + /** + * @param PolicyRendererPool $rendererPool + * @param PolicyCollectorInterface $collector + */ + public function __construct(PolicyRendererPool $rendererPool, PolicyCollectorInterface $collector) + { + $this->rendererPool = $rendererPool; + $this->collector = $collector; + } + + /** + * @inheritDoc + */ + public function render(HttpResponse $response): void + { + $policies = $this->collector->collect(); + foreach ($policies as $policy) { + $this->rendererPool->getRenderer($policy)->render($policy, $response); + } + } +} diff --git a/app/code/Magento/Csp/Model/Mode/ConfigManager.php b/app/code/Magento/Csp/Model/Mode/ConfigManager.php new file mode 100644 index 0000000000000..874df5e0d226f --- /dev/null +++ b/app/code/Magento/Csp/Model/Mode/ConfigManager.php @@ -0,0 +1,79 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Mode; + +use Magento\Csp\Api\Data\ModeConfiguredInterface; +use Magento\Csp\Api\ModeConfigManagerInterface; +use Magento\Csp\Model\Mode\Data\ModeConfigured; +use Magento\Framework\App\Area; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\State; +use Magento\Store\Model\ScopeInterface; +use Magento\Store\Model\Store; + +/** + * @inheritDoc + */ +class ConfigManager implements ModeConfigManagerInterface +{ + /** + * @var ScopeConfigInterface + */ + private $config; + + /** + * @var Store + */ + private $storeModel; + + /** + * @var State + */ + private $state; + + /** + * @param ScopeConfigInterface $config + * @param Store $store + * @param State $state + */ + public function __construct(ScopeConfigInterface $config, Store $store, State $state) + { + $this->config = $config; + $this->storeModel = $store; + $this->state = $state; + } + + /** + * @inheritDoc + */ + public function getConfigured(): ModeConfiguredInterface + { + $area = $this->state->getAreaCode(); + if ($area === Area::AREA_ADMINHTML) { + $configArea = 'admin'; + } elseif ($area === Area::AREA_FRONTEND) { + $configArea = 'storefront'; + } else { + throw new \RuntimeException('CSP can only be configured for storefront or admin area'); + } + + + $reportOnly = $this->config->isSetFlag( + 'csp/mode/' . $configArea .'/report_only', + ScopeInterface::SCOPE_STORE, + $this->storeModel->getStore() + ); + $reportUri = $this->config->getValue( + 'csp/mode/' . $configArea .'/report_uri', + ScopeInterface::SCOPE_STORE, + $this->storeModel->getStore() + ); + + return new ModeConfigured($reportOnly, !empty($reportUri) ? $reportUri : null); + } +} diff --git a/app/code/Magento/Csp/Model/Mode/Data/ModeConfigured.php b/app/code/Magento/Csp/Model/Mode/Data/ModeConfigured.php new file mode 100644 index 0000000000000..db5e362f560a7 --- /dev/null +++ b/app/code/Magento/Csp/Model/Mode/Data/ModeConfigured.php @@ -0,0 +1,52 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Mode\Data; + +use Magento\Csp\Api\Data\ModeConfiguredInterface; + +/** + * @inheritDoc + */ +class ModeConfigured implements ModeConfiguredInterface +{ + /** + * @var bool + */ + private $reportOnly; + + /** + * @var string|null + */ + private $reportUri; + + /** + * @param bool $reportOnly + * @param string|null $reportUri + */ + public function __construct(bool $reportOnly, ?string $reportUri) + { + $this->reportOnly = $reportOnly; + $this->reportUri = $reportUri; + } + + /** + * @inheritDoc + */ + public function isReportOnly(): bool + { + return $this->reportOnly; + } + + /** + * @inheritDoc + */ + public function getReportUri(): ?string + { + return $this->reportUri; + } +} diff --git a/app/code/Magento/Csp/Model/Policy/FetchPolicy.php b/app/code/Magento/Csp/Model/Policy/FetchPolicy.php new file mode 100644 index 0000000000000..87e95d5818004 --- /dev/null +++ b/app/code/Magento/Csp/Model/Policy/FetchPolicy.php @@ -0,0 +1,259 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Policy; + +/** + * Represents a fetch directive. + */ +class FetchPolicy implements SimplePolicyInterface +{ + /** + * List of possible fetch directives. + */ + public const POLICIES = [ + 'default-src', + 'child-src', + 'connect-src', + 'font-src', + 'frame-src', + 'img-src', + 'manifest-src', + 'media-src', + 'object-src', + 'script-src', + 'style-src', + 'base-uri', + 'form-action', + 'frame-ancestors' + ]; + + /** + * @var string + */ + private $id; + + /** + * @var string[] + */ + private $hostSources; + + /** + * @var string[] + */ + private $schemeSources; + + /** + * @var bool + */ + private $selfAllowed; + + /** + * @var bool + */ + private $inlineAllowed; + + /** + * @var bool + */ + private $evalAllowed; + + /** + * @var bool + */ + private $noneAllowed; + + /** + * @var string[] + */ + private $nonceValues; + + /** + * @var string[] + */ + private $hashes; + + /** + * @var bool + */ + private $dynamicAllowed; + + /** + * @param string $id + * @param bool $noneAllowed + * @param string[] $hostSources + * @param string[] $schemeSources + * @param bool $selfAllowed + * @param bool $inlineAllowed + * @param bool $evalAllowed + * @param string[] $nonceValues + * @param string[] $hashValues + * @param bool $dynamicAllowed + */ + public function __construct( + string $id, + bool $noneAllowed = true, + array $hostSources = [], + array $schemeSources = [], + bool $selfAllowed = false, + bool $inlineAllowed = false, + bool $evalAllowed = false, + array $nonceValues = [], + array $hashValues = [], + bool $dynamicAllowed = false + ) { + $this->id = $id; + $this->noneAllowed = $noneAllowed; + $this->hostSources = array_unique($hostSources); + $this->schemeSources = array_unique($schemeSources); + $this->selfAllowed = $selfAllowed; + $this->inlineAllowed = $inlineAllowed; + $this->evalAllowed = $evalAllowed; + $this->nonceValues = array_unique($nonceValues); + $this->hashes = $hashValues; + $this->dynamicAllowed = $dynamicAllowed; + } + + /** + * @inheritDoc + */ + public function getId(): string + { + return $this->id; + } + + /** + * Items can be loaded from given hosts. + * + * @return string[] + */ + public function getHostSources(): array + { + return $this->hostSources; + } + + /** + * Items can be loaded using following schemes. + * + * @return string[] + */ + public function getSchemeSources(): array + { + return $this->schemeSources; + } + + /** + * Items can be loaded from the same host/port as the HTML page. + * + * @return bool + */ + public function isSelfAllowed(): bool + { + return $this->selfAllowed; + } + + /** + * Items can be loaded from tags present on the original HTML page. + * + * @return bool + */ + public function isInlineAllowed(): bool + { + return $this->inlineAllowed; + } + + /** + * Allows creating items from strings. + * + * For example using "eval()" for JavaScript. + * + * @return bool + */ + public function isEvalAllowed(): bool + { + return $this->evalAllowed; + } + + /** + * Content type governed by this policy is disabled completely. + * + * @return bool + */ + public function isNoneAllowed(): bool + { + return $this->noneAllowed; + } + + /** + * @inheritDoc + */ + public function getValue(): string + { + if ($this->isNoneAllowed()) { + return '\'none\''; + } else { + $sources = $this->getHostSources(); + foreach ($this->getSchemeSources() as $schemeSource) { + $sources[] = $schemeSource .':'; + } + if ($this->isSelfAllowed()) { + $sources[] = '\'self\''; + } + if ($this->isInlineAllowed()) { + $sources[] = '\'unsafe-inline\''; + } + if ($this->isEvalAllowed()) { + $sources[] = '\'unsafe-eval\''; + } + if ($this->isDynamicAllowed()) { + $sources[] = '\'strict-dynamic\''; + } + foreach ($this->getNonceValues() as $nonce) { + $sources[] = '\'nonce-' .base64_encode($nonce) .'\''; + } + foreach ($this->getHashes() as $hash => $algorithm) { + $sources[]= "'$algorithm-$hash'"; + } + + return implode(' ', $sources); + } + } + + /** + * Unique cryptographically random numbers marking inline items as trusted. + * + * Contains only numbers, not encoded. + * + * @return string[] + */ + public function getNonceValues(): array + { + return $this->nonceValues; + } + + /** + * Unique hashes generated based on inline items marking them as trusted. + * + * Contains only hashes themselves, encoded into base64. Keys are the hashes, values are algorithms used. + * + * @return string[] + */ + public function getHashes(): array + { + return $this->hashes; + } + + /** + * Is trust to inline items propagated to items loaded by root items. + * + * @return bool + */ + public function isDynamicAllowed(): bool + { + return $this->dynamicAllowed; + } +} diff --git a/app/code/Magento/Csp/Model/Policy/FlagPolicy.php b/app/code/Magento/Csp/Model/Policy/FlagPolicy.php new file mode 100644 index 0000000000000..041e1ca5d6229 --- /dev/null +++ b/app/code/Magento/Csp/Model/Policy/FlagPolicy.php @@ -0,0 +1,48 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Policy; + +/** + * Policies that are used as flags without a value. + */ +class FlagPolicy implements SimplePolicyInterface +{ + public const POLICIES = [ + 'upgrade-insecure-requests', + 'block-all-mixed-content' + ]; + + /** + * @var string + */ + private $id; + + /** + * @param string $id + */ + public function __construct(string $id) + { + $this->id = $id; + } + + /** + * @inheritDoc + */ + public function getId(): string + { + return $this->id; + } + + /** + * @inheritDoc + */ + public function getValue(): string + { + return ''; + } +} diff --git a/app/code/Magento/Csp/Model/Policy/PluginTypesPolicy.php b/app/code/Magento/Csp/Model/Policy/PluginTypesPolicy.php new file mode 100644 index 0000000000000..4f34f49bfffe7 --- /dev/null +++ b/app/code/Magento/Csp/Model/Policy/PluginTypesPolicy.php @@ -0,0 +1,59 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Policy; + +/** + * Governs allowed plugin mime-types. + */ +class PluginTypesPolicy implements SimplePolicyInterface +{ + /** + * @var string[] + */ + private $types; + + /** + * @param string[] $types + */ + public function __construct(array $types) + { + if (!$types) { + throw new \RuntimeException('PluginTypePolicy must be given at least 1 type.'); + } + $this->types = array_unique($types); + } + + /** + * @inheritDoc + */ + public function getId(): string + { + return 'plugin-types'; + } + + /** + * @inheritDoc + */ + public function getValue(): string + { + return implode(' ', $this->getTypes()); + } + + /** + * Mime types of allowed plugins. + * + * Types like "application/x-shockwave-flash", "application/x-java-applet". + * Will only work if object-src directive != "none". + * + * @return string[] + */ + public function getTypes(): array + { + return $this->types; + } +} diff --git a/app/code/Magento/Csp/Model/Policy/Renderer/SimplePolicyHeaderRenderer.php b/app/code/Magento/Csp/Model/Policy/Renderer/SimplePolicyHeaderRenderer.php new file mode 100644 index 0000000000000..b4fd418e89635 --- /dev/null +++ b/app/code/Magento/Csp/Model/Policy/Renderer/SimplePolicyHeaderRenderer.php @@ -0,0 +1,75 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Policy\Renderer; + +use Magento\Csp\Api\Data\ModeConfiguredInterface; +use Magento\Csp\Api\Data\PolicyInterface; +use Magento\Csp\Api\ModeConfigManagerInterface; +use Magento\Csp\Api\PolicyRendererInterface; +use Magento\Csp\Model\Policy\SimplePolicyInterface; +use Magento\Framework\App\Response\HttpInterface as HttpResponse; + +/** + * Renders a simple policy as a "Content-Security-Policy" header. + */ +class SimplePolicyHeaderRenderer implements PolicyRendererInterface +{ + /** + * @var ModeConfigManagerInterface + */ + private $modeConfig; + + /** + * @var ModeConfiguredInterface + */ + private $config; + + /** + * @param ModeConfigManagerInterface $modeConfig + */ + public function __construct(ModeConfigManagerInterface $modeConfig) + { + $this->modeConfig = $modeConfig; + } + + /** + * @inheritDoc + */ + public function render(PolicyInterface $policy, HttpResponse $response): void + { + /** @var SimplePolicyInterface $policy */ + $config = $this->modeConfig->getConfigured(); + if ($config->isReportOnly()) { + $header = 'Content-Security-Policy-Report-Only'; + } else { + $header = 'Content-Security-Policy'; + } + $value = $policy->getId() .' ' .$policy->getValue() .';'; + if ($config->getReportUri()) { + $reportToData = [ + 'group' => 'report-endpoint', + 'max_age' => 10886400, + 'endpoints' => [ + ['url' => $config->getReportUri()] + ] + ]; + $value .= ' report-uri ' .$config->getReportUri() .';'; + $value .= ' report-to '. $reportToData['group'] .';'; + $response->setHeader('Report-To', json_encode($reportToData), true); + } + $response->setHeader($header, $value, false); + } + + /** + * @inheritDoc + */ + public function canRender(PolicyInterface $policy): bool + { + return true; + } +} diff --git a/app/code/Magento/Csp/Model/Policy/SandboxPolicy.php b/app/code/Magento/Csp/Model/Policy/SandboxPolicy.php new file mode 100644 index 0000000000000..0aeb221e79ca6 --- /dev/null +++ b/app/code/Magento/Csp/Model/Policy/SandboxPolicy.php @@ -0,0 +1,275 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Policy; + +/** + * "sandbox" directive enables sandbox mode for requested pages limiting their functionality. + * + * Works the same as "sandbox" attribute for iframes but for the main document. + */ +class SandboxPolicy implements SimplePolicyInterface +{ + /** + * @var bool + */ + private $formAllowed; + + /** + * @var bool + */ + private $modalsAllowed; + + /** + * @var bool + */ + private $orientationLockAllowed; + + /** + * @var bool + */ + private $pointerLockAllowed; + + /** + * @var bool + */ + private $popupsAllowed; + + /** + * @var bool + */ + private $popupsToEscapeSandboxAllowed; + + /** + * @var bool + */ + private $presentationAllowed; + + /** + * @var bool + */ + private $sameOriginAllowed; + + /** + * @var bool + */ + private $scriptsAllowed; + + /** + * @var bool + */ + private $topNavigationAllowed; + + /** + * @var bool + */ + private $topNavigationByUserActivationAllowed; + + /** + * @param bool $formAllowed + * @param bool $modalsAllowed + * @param bool $orientationLockAllowed + * @param bool $pointerLockAllowed + * @param bool $popupsAllowed + * @param bool $popupsToEscapeSandboxAllowed + * @param bool $presentationAllowed + * @param bool $sameOriginAllowed + * @param bool $scriptsAllowed + * @param bool $topNavigationAllowed + * @param bool $topNavigationByUserActivationAllowed + */ + public function __construct( + bool $formAllowed, + bool $modalsAllowed, + bool $orientationLockAllowed, + bool $pointerLockAllowed, + bool $popupsAllowed, + bool $popupsToEscapeSandboxAllowed, + bool $presentationAllowed, + bool $sameOriginAllowed, + bool $scriptsAllowed, + bool $topNavigationAllowed, + bool $topNavigationByUserActivationAllowed + ) { + $this->formAllowed = $formAllowed; + $this->modalsAllowed = $modalsAllowed; + $this->orientationLockAllowed = $orientationLockAllowed; + $this->pointerLockAllowed = $pointerLockAllowed; + $this->popupsAllowed = $popupsAllowed; + $this->popupsToEscapeSandboxAllowed = $popupsToEscapeSandboxAllowed; + $this->presentationAllowed = $presentationAllowed; + $this->sameOriginAllowed = $sameOriginAllowed; + $this->scriptsAllowed = $scriptsAllowed; + $this->topNavigationAllowed = $topNavigationAllowed; + $this->topNavigationByUserActivationAllowed = $topNavigationByUserActivationAllowed; + } + + /** + * Sandbox option. + * + * @return bool + */ + public function isFormAllowed(): bool + { + return $this->formAllowed; + } + + /** + * Sandbox option. + * + * @return bool + */ + public function isModalsAllowed(): bool + { + return $this->modalsAllowed; + } + + /** + * Sandbox option. + * + * @return bool + */ + public function isOrientationLockAllowed(): bool + { + return $this->orientationLockAllowed; + } + + /** + * Sandbox option. + * + * @return bool + */ + public function isPointerLockAllowed(): bool + { + return $this->pointerLockAllowed; + } + + /** + * Sandbox option. + * + * @return bool + */ + public function isPopupsAllowed(): bool + { + return $this->popupsAllowed; + } + + /** + * Sandbox option. + * + * @return bool + */ + public function isPopupsToEscapeSandboxAllowed(): bool + { + return $this->popupsToEscapeSandboxAllowed; + } + + /** + * Sandbox option. + * + * @return bool + */ + public function isPresentationAllowed(): bool + { + return $this->presentationAllowed; + } + + /** + * Sandbox option. + * + * @return bool + */ + public function isSameOriginAllowed(): bool + { + return $this->sameOriginAllowed; + } + + /** + * Sandbox option. + * + * @return bool + */ + public function isScriptsAllowed(): bool + { + return $this->scriptsAllowed; + } + + /** + * Sandbox option. + * + * @return bool + */ + public function isTopNavigationAllowed(): bool + { + return $this->topNavigationAllowed; + } + + /** + * Sandbox option. + * + * @return bool + */ + public function isTopNavigationByUserActivationAllowed(): bool + { + return $this->topNavigationByUserActivationAllowed; + } + + /** + * @inheritDoc + */ + public function getId(): string + { + return 'sandbox'; + } + + /** + * @inheritDoc + */ + public function getValue(): string + { + $allowed = []; + + if ($this->isFormAllowed()) { + $allowed[] = 'allow-forms'; + } + if ($this->isModalsAllowed()) { + $allowed[] = 'allow-modals'; + } + if ($this->isOrientationLockAllowed()) { + $allowed[] = 'allow-orientation-lock'; + } + if ($this->isPointerLockAllowed()) { + $allowed[] = 'allow-pointer-lock'; + } + if ($this->isPopupsAllowed()) { + $allowed[] = 'allow-popups'; + } + if ($this->isPopupsToEscapeSandboxAllowed()) { + $allowed[] = 'allow-popups-to-escape-sandbox'; + } + if ($this->isPresentationAllowed()) { + $allowed[] = 'allow-presentation'; + } + if ($this->isSameOriginAllowed()) { + $allowed[] = 'allow-same-origin'; + } + if ($this->isScriptsAllowed()) { + $allowed[] = 'allow-scripts'; + } + if ($this->isTopNavigationAllowed()) { + $allowed[] = 'allow-top-navigation'; + } + if ($this->isTopNavigationByUserActivationAllowed()) { + $allowed[] = 'allow-top-navigation-by-user-activation'; + } + + if (!$allowed) { + throw new \RuntimeException('At least 1 option must be selected'); + } + return implode(' ', $allowed); + } +} diff --git a/app/code/Magento/Csp/Model/Policy/SimplePolicyInterface.php b/app/code/Magento/Csp/Model/Policy/SimplePolicyInterface.php new file mode 100644 index 0000000000000..aea28a1469de5 --- /dev/null +++ b/app/code/Magento/Csp/Model/Policy/SimplePolicyInterface.php @@ -0,0 +1,18 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Policy; + +use Magento\Csp\Api\Data\PolicyInterface; + +/** + * Simple policy that is represented by the default prefix and an ID - string value combination. + */ +interface SimplePolicyInterface extends PolicyInterface +{ + +} diff --git a/app/code/Magento/Csp/Model/PolicyRendererPool.php b/app/code/Magento/Csp/Model/PolicyRendererPool.php new file mode 100644 index 0000000000000..5bce191e3a878 --- /dev/null +++ b/app/code/Magento/Csp/Model/PolicyRendererPool.php @@ -0,0 +1,48 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model; + +use Magento\Csp\Api\Data\PolicyInterface; +use Magento\Csp\Api\PolicyRendererInterface; + +/** + * Pool of policy renderers. + */ +class PolicyRendererPool +{ + /** + * @var PolicyRendererInterface[] + */ + private $renderers; + + /** + * @param PolicyRendererInterface[] $renderers + */ + public function __construct(array $renderers) + { + $this->renderers = $renderers; + } + + /** + * Get renderer for the given policy. + * + * @param PolicyInterface $forPolicy + * @return PolicyRendererInterface + * @throws \RuntimeException When it's impossible to find a proper renderer. + */ + public function getRenderer(PolicyInterface $forPolicy): PolicyRendererInterface + { + foreach ($this->renderers as $renderer) { + if ($renderer->canRender($forPolicy)) { + return $renderer; + } + } + + throw new \RuntimeException(sprintf('Failed to find a renderer for policy #%s', $forPolicy->getId())); + } +} diff --git a/app/code/Magento/Csp/Observer/Render.php b/app/code/Magento/Csp/Observer/Render.php new file mode 100644 index 0000000000000..2b88d685f3fe4 --- /dev/null +++ b/app/code/Magento/Csp/Observer/Render.php @@ -0,0 +1,43 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Observer; + +use Magento\Csp\Api\CspRendererInterface; +use Magento\Framework\Event\Observer; +use Magento\Framework\Event\ObserverInterface; +use Magento\Framework\App\Response\HttpInterface as HttpResponse; + +/** + * Adds CSP rendering after HTTP response is generated. + */ +class Render implements ObserverInterface +{ + /** + * @var CspRendererInterface + */ + private $cspRenderer; + + /** + * @param CspRendererInterface $cspRenderer + */ + public function __construct(CspRendererInterface $cspRenderer) + { + $this->cspRenderer = $cspRenderer; + } + + /** + * @inheritDoc + */ + public function execute(Observer $observer) + { + /** @var HttpResponse $response */ + $response = $observer->getEvent()->getData('response'); + + $this->cspRenderer->render($response); + } +} diff --git a/app/code/Magento/Csp/README.md b/app/code/Magento/Csp/README.md new file mode 100644 index 0000000000000..47f0f196becd5 --- /dev/null +++ b/app/code/Magento/Csp/README.md @@ -0,0 +1,2 @@ +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. diff --git a/app/code/Magento/Csp/composer.json b/app/code/Magento/Csp/composer.json new file mode 100644 index 0000000000000..a18fcf21dcca2 --- /dev/null +++ b/app/code/Magento/Csp/composer.json @@ -0,0 +1,24 @@ +{ + "name": "magento/module-csp", + "description": "CSP module enables Content Security Policies for Magento", + "config": { + "sort-packages": true + }, + "require": { + "php": "~7.1.3||~7.2.0||~7.3.0", + "magento/framework": "*", + }, + "type": "magento2-module", + "license": [ + "OSL-3.0", + "AFL-3.0" + ], + "autoload": { + "files": [ + "registration.php" + ], + "psr-4": { + "Magento\\Csp\\": "" + } + } +} diff --git a/app/code/Magento/Csp/etc/adminhtml/events.xml b/app/code/Magento/Csp/etc/adminhtml/events.xml new file mode 100644 index 0000000000000..f81031d2a779a --- /dev/null +++ b/app/code/Magento/Csp/etc/adminhtml/events.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> + <event name="controller_front_send_response_before"> + <observer name="csp_render" instance="Magento\Csp\Observer\Render" /> + </event> +</config> diff --git a/app/code/Magento/Csp/etc/csp_whitelist.xsd b/app/code/Magento/Csp/etc/csp_whitelist.xsd new file mode 100644 index 0000000000000..8b4b78008fe99 --- /dev/null +++ b/app/code/Magento/Csp/etc/csp_whitelist.xsd @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/** + * Structure description for webapi.xml configuration files. + * + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> + <xs:element name="csp_whitelist" type="cspWhitelistType" /> + + <xs:complexType name="cspWhitelistType"> + <xs:sequence> + <xs:element name="policies" type="policiesType" minOccurs="1" maxOccurs="1"/> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="policiesType"> + <xs:sequence> + <xs:element name="policy" type="policyType" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="policyType"> + <xs:sequence> + <xs:element name="values" type="valuesType" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + <xs:attribute name="id" type="xs:string" use="required" /> + </xs:complexType> + + <xs:complexType name="valuesType"> + <xs:sequence> + <xs:element name="value" type="valueType" minOccurs="1" maxOccurs="unbounded" /> + </xs:sequence> + </xs:complexType> + <xs:complexType name="valueType"> + <xs:simpleContent> + <xs:extension base="xs:string"> + <xs:attribute type="xs:string" name="id" use="required" /> + <xs:attribute type="cspValueType" name="type" use="required" /> + <xs:attribute type="xs:string" name="algorithm" use="optional" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + <xs:simpleType name="cspValueType"> + <xs:restriction base="xs:string"> + <xs:enumeration value="host" /> + <xs:enumeration value="hash" /> + </xs:restriction> + </xs:simpleType> +</xs:schema> diff --git a/app/code/Magento/Csp/etc/di.xml b/app/code/Magento/Csp/etc/di.xml new file mode 100644 index 0000000000000..f18453c91791d --- /dev/null +++ b/app/code/Magento/Csp/etc/di.xml @@ -0,0 +1,44 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> + <preference for="Magento\Csp\Api\CspRendererInterface" type="Magento\Csp\Model\CspRenderer" /> + <type name="Magento\Csp\Model\PolicyRendererPool"> + <arguments> + <argument name="renderers" xsi:type="array"> + <item name="header" xsi:type="object">Magento\Csp\Model\Policy\Renderer\SimplePolicyHeaderRenderer</item> + </argument> + </arguments> + </type> + <preference for="Magento\Csp\Api\PolicyCollectorInterface" type="Magento\Csp\Model\CompositePolicyCollector" /> + <type name="Magento\Csp\Model\CompositePolicyCollector"> + <arguments> + <argument name="collectors" xsi:type="array"> + <item name="config" xsi:type="object">Magento\Csp\Model\Collector\ConfigCollector</item> + <item name="csp_whitelist" xsi:type="object">Magento\Csp\Model\Collector\CspWhitelistXmlCollector</item> + </argument> + </arguments> + </type> + <type name="Magento\Csp\Model\Collector\Config\PolicyReaderPool"> + <arguments> + <argument name="readers" xsi:type="array"> + <item name="fetch" xsi:type="object">Magento\Csp\Model\Collector\Config\FetchPolicyReader</item> + <item name="plugin_types" xsi:type="object">Magento\Csp\Model\Collector\Config\PluginTypesPolicyReader</item> + <item name="sandbox" xsi:type="object">Magento\Csp\Model\Collector\Config\SandboxPolicyReader</item> + <item name="flag" xsi:type="object">Magento\Csp\Model\Collector\Config\FlagPolicyReader</item> + </argument> + </arguments> + </type> + <preference for="Magento\Csp\Api\ModeConfigManagerInterface" type="Magento\Csp\Model\Mode\ConfigManager" /> + <type name="Magento\Csp\Model\Collector\CspWhitelistXml\Reader"> + <arguments> + <argument name="converter" xsi:type="object">Magento\Csp\Model\Collector\CspWhitelistXml\Converter</argument> + <argument name="schemaLocator" xsi:type="object">Magento\Csp\Model\Collector\CspWhitelistXml\SchemaLocator</argument> + <argument name="fileName" xsi:type="string">csp_whitelist.xml</argument> + </arguments> + </type> +</config> diff --git a/app/code/Magento/Csp/etc/frontend/events.xml b/app/code/Magento/Csp/etc/frontend/events.xml new file mode 100644 index 0000000000000..f81031d2a779a --- /dev/null +++ b/app/code/Magento/Csp/etc/frontend/events.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> + <event name="controller_front_send_response_before"> + <observer name="csp_render" instance="Magento\Csp\Observer\Render" /> + </event> +</config> diff --git a/app/code/Magento/Csp/etc/module.xml b/app/code/Magento/Csp/etc/module.xml new file mode 100644 index 0000000000000..e99608ef13f15 --- /dev/null +++ b/app/code/Magento/Csp/etc/module.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> + <module name="Magento_Csp" /> +</config> diff --git a/app/code/Magento/Csp/registration.php b/app/code/Magento/Csp/registration.php new file mode 100644 index 0000000000000..90f4a25452858 --- /dev/null +++ b/app/code/Magento/Csp/registration.php @@ -0,0 +1,9 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +use \Magento\Framework\Component\ComponentRegistrar; + +ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_Csp', __DIR__); diff --git a/composer.json b/composer.json index 62366037bc18b..3644a87b160b4 100644 --- a/composer.json +++ b/composer.json @@ -289,7 +289,8 @@ "components/jqueryui": "1.10.4", "twbs/bootstrap": "3.1.0", "tinymce/tinymce": "3.4.7", - "magento/module-tinymce-3": "*" + "magento/module-tinymce-3": "*", + "magento/module-csp": "*" }, "conflict": { "gene/bluefoot": "*" diff --git a/dev/tests/integration/_files/Magento/TestModuleCspConfig/composer.json b/dev/tests/integration/_files/Magento/TestModuleCspConfig/composer.json new file mode 100644 index 0000000000000..f4d4075fe3377 --- /dev/null +++ b/dev/tests/integration/_files/Magento/TestModuleCspConfig/composer.json @@ -0,0 +1,21 @@ +{ + "name": "magento/module-csp-config", + "description": "test csp module", + "config": { + "sort-packages": true + }, + "require": { + "php": "~7.1.3||~7.2.0||~7.3.0", + "magento/framework": "*", + "magento/module-integration": "*" + }, + "type": "magento2-module", + "extra": { + "map": [ + [ + "*", + "Magento/TestModuleCspConfig" + ] + ] + } +} diff --git a/dev/tests/integration/_files/Magento/TestModuleCspConfig/etc/csp_whitelist.xml b/dev/tests/integration/_files/Magento/TestModuleCspConfig/etc/csp_whitelist.xml new file mode 100644 index 0000000000000..e9eb1fe21aa4f --- /dev/null +++ b/dev/tests/integration/_files/Magento/TestModuleCspConfig/etc/csp_whitelist.xml @@ -0,0 +1,23 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp/etc/csp_whitelist.xsd"> + <policies> + <policy id="object-src"> + <values> + <value id="mage-base" type="host">https://magento.com</value> + <value id="hash" type="hash" algorithm="sha256">B2yPHKaXnvFWtRChIbabYmUBFZdVfKKXHbWtWidDVF8=</value> + </values> + </policy> + <policy id="media-src"> + <values> + <value id="mage-base" type="host">https://magento.com</value> + <value id="devdocs-base" type="host">https://devdocs.magento.com</value> + </values> + </policy> + </policies> +</csp_whitelist> diff --git a/dev/tests/integration/_files/Magento/TestModuleCspConfig/etc/module.xml b/dev/tests/integration/_files/Magento/TestModuleCspConfig/etc/module.xml new file mode 100644 index 0000000000000..ee90595cacf19 --- /dev/null +++ b/dev/tests/integration/_files/Magento/TestModuleCspConfig/etc/module.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> + <module name="Magento_TestModuleCspConfig" active="true" /> +</config> diff --git a/dev/tests/integration/_files/Magento/TestModuleCspConfig/registration.php b/dev/tests/integration/_files/Magento/TestModuleCspConfig/registration.php new file mode 100644 index 0000000000000..9749bf5a7f621 --- /dev/null +++ b/dev/tests/integration/_files/Magento/TestModuleCspConfig/registration.php @@ -0,0 +1,12 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Framework\Component\ComponentRegistrar; + +$registrar = new ComponentRegistrar(); +if ($registrar->getPath(ComponentRegistrar::MODULE, 'Magento_TestModuleCspConfig') === null) { + ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModuleCspConfig', __DIR__); +} diff --git a/dev/tests/integration/_files/Magento/TestModuleCspConfig2/composer.json b/dev/tests/integration/_files/Magento/TestModuleCspConfig2/composer.json new file mode 100644 index 0000000000000..ebf1d57fe6593 --- /dev/null +++ b/dev/tests/integration/_files/Magento/TestModuleCspConfig2/composer.json @@ -0,0 +1,21 @@ +{ + "name": "magento/module-csp-config2", + "description": "test csp module 2", + "config": { + "sort-packages": true + }, + "require": { + "php": "~7.1.3||~7.2.0||~7.3.0", + "magento/framework": "*", + "magento/module-integration": "*" + }, + "type": "magento2-module", + "extra": { + "map": [ + [ + "*", + "Magento/TestModuleCspConfig2" + ] + ] + } +} diff --git a/dev/tests/integration/_files/Magento/TestModuleCspConfig2/etc/csp_whitelist.xml b/dev/tests/integration/_files/Magento/TestModuleCspConfig2/etc/csp_whitelist.xml new file mode 100644 index 0000000000000..eff59271bf422 --- /dev/null +++ b/dev/tests/integration/_files/Magento/TestModuleCspConfig2/etc/csp_whitelist.xml @@ -0,0 +1,17 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp/etc/csp_whitelist.xsd"> + <policies> + <policy id="object-src"> + <values> + <value id="devdocs-base" type="host">https://devdocs.magento.com</value> + <value id="mage-base" type="host">http://magento.com</value> + </values> + </policy> + </policies> +</csp_whitelist> diff --git a/dev/tests/integration/_files/Magento/TestModuleCspConfig2/etc/module.xml b/dev/tests/integration/_files/Magento/TestModuleCspConfig2/etc/module.xml new file mode 100644 index 0000000000000..de3c2ea25f4f2 --- /dev/null +++ b/dev/tests/integration/_files/Magento/TestModuleCspConfig2/etc/module.xml @@ -0,0 +1,14 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> + <module name="Magento_TestModuleCspConfig2" active="true"> + <sequence> + <module name="Magento_TestModuleCspConfig"/> + </sequence> + </module> +</config> diff --git a/dev/tests/integration/_files/Magento/TestModuleCspConfig2/registration.php b/dev/tests/integration/_files/Magento/TestModuleCspConfig2/registration.php new file mode 100644 index 0000000000000..539d9cd20e10f --- /dev/null +++ b/dev/tests/integration/_files/Magento/TestModuleCspConfig2/registration.php @@ -0,0 +1,12 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Framework\Component\ComponentRegistrar; + +$registrar = new ComponentRegistrar(); +if ($registrar->getPath(ComponentRegistrar::MODULE, 'Magento_TestModuleCspConfig2') === null) { + ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModuleCspConfig2', __DIR__); +} diff --git a/dev/tests/integration/testsuite/Magento/Csp/CspTest.php b/dev/tests/integration/testsuite/Magento/Csp/CspTest.php new file mode 100644 index 0000000000000..e66c6af36e42c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Csp/CspTest.php @@ -0,0 +1,164 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp; + +use Magento\TestFramework\TestCase\AbstractController; + +/** + * Test CSP being rendered when Magento processes an HTTP request. + */ +class CspTest extends AbstractController +{ + /** + * Search the whole response for a string. + * + * @param \Magento\Framework\App\ResponseInterface|\Magento\Framework\App\Response\Http $response + * @param string $search + * @return bool + */ + private function searchInResponse($response, string $search): bool + { + if (mb_stripos(mb_strtolower($response->getBody()), mb_strtolower($search)) !== false) { + return true; + } + + foreach ($response->getHeaders() as $header) { + if (mb_stripos(mb_strtolower($header->toString()), mb_strtolower($search)) !== false) { + return true; + } + } + + return false; + } + + /** + * Check that configured policies are rendered on frontend. + * + * @magentoAppArea frontend + * @magentoConfigFixture default_store csp/policies/storefront/default_src/policy_id default-src + * @magentoConfigFixture default_store csp/policies/storefront/default_src/none 0 + * @magentoConfigFixture default_store csp/policies/storefront/default_src/hosts/example http://magento.com + * @magentoConfigFixture default_store csp/policies/storefront/default_src/hosts/example2 http://devdocs.magento.com + * @magentoConfigFixture default_store csp/policies/storefront/default_src/self 1 + * @magentoConfigFixture default_store csp/policies/storefront/script_src/policy_id script-src + * @magentoConfigFixture default_store csp/policies/storefront/script_src/none 0 + * @magentoConfigFixture default_store csp/policies/storefront/script_src/self 1 + * @magentoConfigFixture default_store csp/policies/storefront/script_src/inline 1 + * @magentoConfigFixture default_store csp/policies/admin/font_src/policy_id font-src + * @magentoConfigFixture default_store csp/policies/admin/font_src/none 0 + * @magentoConfigFixture default_store csp/policies/admin/font_src/self 1 + * @return void + */ + public function testStorefrontPolicies(): void + { + $this->dispatch('/'); + $response = $this->getResponse(); + + $this->assertTrue($this->searchInResponse($response, 'Content-Security-Policy')); + $this->assertTrue($this->searchInResponse($response, 'default-src')); + $this->assertTrue($this->searchInResponse($response, 'http://magento.com')); + $this->assertTrue($this->searchInResponse($response, 'http://devdocs.magento.com')); + $this->assertTrue($this->searchInResponse($response, '\'self\'')); + $this->assertFalse($this->searchInResponse($response, '\'none\'')); + $this->assertTrue($this->searchInResponse($response, 'script-src')); + $this->assertTrue($this->searchInResponse($response, '\'unsafe-inline\'')); + $this->assertFalse($this->searchInResponse($response, 'font-src')); + //Policies configured in cps_whitelist.xml files + $this->assertTrue($this->searchInResponse($response, 'object-src')); + $this->assertTrue($this->searchInResponse($response, 'media-src')); + } + + /** + * Check that configured policies are rendered on backend. + * + * @magentoAppArea adminhtml + * @magentoConfigFixture default_store csp/policies/admin/default_src/policy_id default-src + * @magentoConfigFixture default_store csp/policies/admin/default_src/none 0 + * @magentoConfigFixture default_store csp/policies/admin/default_src/hosts/example http://magento.com + * @magentoConfigFixture default_store csp/policies/admin/default_src/hosts/example2 http://devdocs.magento.com + * @magentoConfigFixture default_store csp/policies/admin/default_src/self 1 + * @magentoConfigFixture default_store csp/policies/admin/script_src/policy_id script-src + * @magentoConfigFixture default_store csp/policies/admin/script_src/none 0 + * @magentoConfigFixture default_store csp/policies/admin/default_src/self 1 + * @magentoConfigFixture default_store csp/policies/admin/default_src/inline 1 + * @magentoConfigFixture default_store csp/policies/storefront/font_src/policy_id font-src + * @magentoConfigFixture default_store csp/policies/storefront/font_src/none 0 + * @magentoConfigFixture default_store csp/policies/storefront/font_src/self 1 + * @return void + */ + public function testAdminPolicies(): void + { + $this->dispatch('backend/'); + $response = $this->getResponse(); + + $this->assertTrue($this->searchInResponse($response, 'Content-Security-Policy')); + $this->assertTrue($this->searchInResponse($response, 'default-src')); + $this->assertTrue($this->searchInResponse($response, 'http://magento.com')); + $this->assertTrue($this->searchInResponse($response, 'http://devdocs.magento.com')); + $this->assertTrue($this->searchInResponse($response, '\'self\'')); + $this->assertFalse($this->searchInResponse($response, '\'none\'')); + $this->assertTrue($this->searchInResponse($response, 'script-src')); + $this->assertTrue($this->searchInResponse($response, '\'unsafe-inline\'')); + $this->assertFalse($this->searchInResponse($response, 'font-src')); + } + + /** + * Check that CSP mode is considered when rendering policies. + * + * @magentoAppArea frontend + * @magentoConfigFixture default_store csp/policies/storefront/default_src/policy_id default-src + * @magentoConfigFixture default_store csp/policies/storefront/default_src/none 0 + * @magentoConfigFixture default_store csp/policies/storefront/default_src/hosts/example http://magento.com + * @magentoConfigFixture default_store csp/policies/storefront/default_src/hosts/example2 http://devdocs.magento.com + * @magentoConfigFixture default_store csp/policies/storefront/default_src/self 1 + * @magentoConfigFixture default_store csp/mode/storefront/report_only 1 + * @magentoConfigFixture default_store csp/mode/storefront/report_uri /cspEndpoint/ + * @magentoConfigFixture default_store csp/mode/admin/report_only 0 + * @return void + */ + public function testReportOnlyMode(): void + { + $this->dispatch('/'); + $response = $this->getResponse(); + + $this->assertTrue($this->searchInResponse($response, 'Content-Security-Policy-Report-Only')); + $this->assertTrue($this->searchInResponse($response, '/cspEndpoint/')); + $this->assertTrue($this->searchInResponse($response, 'default-src')); + $this->assertTrue($this->searchInResponse($response, 'http://magento.com')); + $this->assertTrue($this->searchInResponse($response, 'http://devdocs.magento.com')); + $this->assertTrue($this->searchInResponse($response, '\'self\'')); + } + + /** + * Check that CSP reporting options are rendered for 'restrict' mode as well. + * + * @magentoAppArea frontend + * @magentoConfigFixture default_store csp/policies/storefront/default_src/policy_id default-src + * @magentoConfigFixture default_store csp/policies/storefront/default_src/none 0 + * @magentoConfigFixture default_store csp/policies/storefront/default_src/hosts/example http://magento.com + * @magentoConfigFixture default_store csp/policies/storefront/default_src/hosts/example2 http://devdocs.magento.com + * @magentoConfigFixture default_store csp/policies/storefront/default_src/self 1 + * @magentoConfigFixture default_store csp/mode/storefront/report_only 0 + * @magentoConfigFixture default_store csp/mode/storefront/report_uri /cspEndpoint/ + * @magentoConfigFixture default_store csp/mode/admin/report_only 0 + * @return void + */ + public function testRestrictMode(): void + { + $this->dispatch('/'); + $response = $this->getResponse(); + + $this->assertFalse($this->searchInResponse($response, 'Content-Security-Policy-Report-Only')); + $this->assertTrue($this->searchInResponse($response, 'Content-Security-Policy')); + $this->assertTrue($this->searchInResponse($response, '/cspEndpoint/')); + $this->assertTrue($this->searchInResponse($response, 'default-src')); + $this->assertTrue($this->searchInResponse($response, 'http://magento.com')); + $this->assertTrue($this->searchInResponse($response, 'http://devdocs.magento.com')); + $this->assertTrue($this->searchInResponse($response, '\'self\'')); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/ConfigCollectorTest.php b/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/ConfigCollectorTest.php new file mode 100644 index 0000000000000..db67b322ebd5d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/ConfigCollectorTest.php @@ -0,0 +1,343 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Collector; + +use Magento\Csp\Api\Data\PolicyInterface; +use Magento\Csp\Model\Policy\FetchPolicy; +use Magento\Csp\Model\Policy\FlagPolicy; +use Magento\Csp\Model\Policy\PluginTypesPolicy; +use Magento\Csp\Model\Policy\SandboxPolicy; +use PHPUnit\Framework\TestCase; +use Magento\TestFramework\Helper\Bootstrap; + +/** + * Test collecting policies from Magento config. + */ +class ConfigCollectorTest extends TestCase +{ + /** + * @var ConfigCollector + */ + private $collector; + + /** + * @inheritDoc + */ + public function setUp() + { + $this->collector = Bootstrap::getObjectManager()->get(ConfigCollector::class); + } + + /** + * Test initiating policies from config. + * + * @magentoAppArea frontend + * @magentoConfigFixture default_store csp/policies/storefront/default_src/policy_id default-src + * @magentoConfigFixture default_store csp/policies/storefront/default_src/none 0 + * @magentoConfigFixture default_store csp/policies/storefront/default_src/hosts/example http://magento.com + * @magentoConfigFixture default_store csp/policies/storefront/default_src/hosts/example2 http://devdocs.magento.com + * @magentoConfigFixture default_store csp/policies/storefront/default_src/self 1 + * @magentoConfigFixture default_store csp/policies/storefront/child_src/policy_id child-src + * @magentoConfigFixture default_store csp/policies/storefront/child_src/none 0 + * @magentoConfigFixture default_store csp/policies/storefront/child_src/hosts/example http://magento.com + * @magentoConfigFixture default_store csp/policies/storefront/child_src/hosts/example2 http://devdocs.magento.com + * @magentoConfigFixture default_store csp/policies/storefront/child_src/self 1 + * @magentoConfigFixture default_store csp/policies/storefront/child_src/inline 1 + * @magentoConfigFixture default_store csp/policies/storefront/child_src/schemes/scheme1 http + * @magentoConfigFixture default_store csp/policies/storefront/child_src/dynamic 1 + * @magentoConfigFixture default_store csp/policies/storefront/child_src2/policy_id child-src + * @magentoConfigFixture default_store csp/policies/storefront/child_src2/none 0 + * @magentoConfigFixture default_store csp/policies/storefront/child_src2/eval 1 + * @magentoConfigFixture default_store csp/policies/storefront/connect_src/policy_id connect-src + * @magentoConfigFixture default_store csp/policies/storefront/connect_src/none 1 + * @magentoConfigFixture default_store csp/policies/storefront/font_src/policy_id font-src + * @magentoConfigFixture default_store csp/policies/storefront/font_src/none 0 + * @magentoConfigFixture default_store csp/policies/storefront/font_src/self 1 + * @magentoConfigFixture default_store csp/policies/storefront/frame_src/policy_id frame-src + * @magentoConfigFixture default_store csp/policies/storefront/frame_src/none 0 + * @magentoConfigFixture default_store csp/policies/storefront/frame_src/self 1 + * @magentoConfigFixture default_store csp/policies/storefront/frame_src/dynamic 1 + * @magentoConfigFixture default_store csp/policies/storefront/img_src/policy_id img-src + * @magentoConfigFixture default_store csp/policies/storefront/img_src/none 0 + * @magentoConfigFixture default_store csp/policies/storefront/img_src/self 1 + * @magentoConfigFixture default_store csp/policies/storefront/manifest_src/policy_id manifest-src + * @magentoConfigFixture default_store csp/policies/storefront/manifest_src/none 0 + * @magentoConfigFixture default_store csp/policies/storefront/manifest_src/self 1 + * @magentoConfigFixture default_store csp/policies/storefront/media_src/policy_id media-src + * @magentoConfigFixture default_store csp/policies/storefront/media_src/none 0 + * @magentoConfigFixture default_store csp/policies/storefront/media_src/self 1 + * @magentoConfigFixture default_store csp/policies/storefront/object_src/policy_id object-src + * @magentoConfigFixture default_store csp/policies/storefront/object_src/none 0 + * @magentoConfigFixture default_store csp/policies/storefront/object_src/self 1 + * @magentoConfigFixture default_store csp/policies/storefront/script_src/policy_id script-src + * @magentoConfigFixture default_store csp/policies/storefront/script_src/none 0 + * @magentoConfigFixture default_store csp/policies/storefront/script_src/self 1 + * @magentoConfigFixture default_store csp/policies/storefront/base_uri/policy_id base-uri + * @magentoConfigFixture default_store csp/policies/storefront/base_uri/none 0 + * @magentoConfigFixture default_store csp/policies/storefront/base_uri/self 1 + * @magentoConfigFixture default_store csp/policies/storefront/style_src/policy_id style-src + * @magentoConfigFixture default_store csp/policies/storefront/style_src/none 0 + * @magentoConfigFixture default_store csp/policies/storefront/style_src/self 1 + * @magentoConfigFixture default_store csp/policies/storefront/form_action/policy_id form-action + * @magentoConfigFixture default_store csp/policies/storefront/form_action/none 0 + * @magentoConfigFixture default_store csp/policies/storefront/form_action/self 1 + * @magentoConfigFixture default_store csp/policies/storefront/frame_ancestors/policy_id frame-ancestors + * @magentoConfigFixture default_store csp/policies/storefront/frame_ancestors/none 0 + * @magentoConfigFixture default_store csp/policies/storefront/frame_ancestors/self 1 + * @magentoConfigFixture default_store csp/policies/storefront/plugin_types/policy_id plugin-types + * @magentoConfigFixture default_store csp/policies/storefront/plugin_types/types/flash application/x-shockwave-flash + * @magentoConfigFixture default_store csp/policies/storefront/plugin_types/types/applet application/x-java-applet + * @magentoConfigFixture default_store csp/policies/storefront/sandbox/policy_id sandbox + * @magentoConfigFixture default_store csp/policies/storefront/sandbox/forms 1 + * @magentoConfigFixture default_store csp/policies/storefront/sandbox/modals 1 + * @magentoConfigFixture default_store csp/policies/storefront/sandbox/orientation 1 + * @magentoConfigFixture default_store csp/policies/storefront/sandbox/pointer 1 + * @magentoConfigFixture default_store csp/policies/storefront/sandbox/popup 0 + * @magentoConfigFixture default_store csp/policies/storefront/sandbox/popups_to_escape 0 + * @magentoConfigFixture default_store csp/policies/storefront/sandbox/presentation 1 + * @magentoConfigFixture default_store csp/policies/storefront/sandbox/same_origin 1 + * @magentoConfigFixture default_store csp/policies/storefront/sandbox/scripts 1 + * @magentoConfigFixture default_store csp/policies/storefront/sandbox/navigation 1 + * @magentoConfigFixture default_store csp/policies/storefront/sandbox/navigation_by_user 1 + * @magentoConfigFixture default_store csp/policies/storefront/mixed_content/policy_id block-all-mixed-content + * @magentoConfigFixture default_store csp/policies/storefront/upgrade/policy_id upgrade-insecure-requests + * @return void + */ + public function testCollecting(): void + { + $policies = $this->collector->collect([]); + $childScrChecked = false; + $childScr2Checked = false; + $connectScrChecked = false; + $defaultScrChecked = false; + $fontScrChecked = false; + $frameScrChecked = false; + $imgScrChecked = false; + $manifestScrChecked = false; + $mediaScrChecked = false; + $objectScrChecked = false; + $scriptScrChecked = false; + $styleScrChecked = false; + $baseUriChecked = false; + $pluginTypesChecked = false; + $sandboxChecked = false; + $formActionChecked = false; + $frameAncestorsChecked = false; + $blockAllMixedChecked = false; + $upgradeChecked = false; + + $this->assertNotEmpty($policies); + /** @var PolicyInterface|FetchPolicy|FlagPolicy|SandboxPolicy|PluginTypesPolicy $policy */ + foreach ($policies as $policy) { + switch ($policy->getId()) + { + case 'child-src': + if ($policy->isEvalAllowed()) { + $childScr2Checked = true; + } else { + $childScrChecked = !$policy->isNoneAllowed() + && $policy->getHostSources() == ['http://magento.com', 'http://devdocs.magento.com'] + && $policy->getSchemeSources() == ['http'] + && $policy->isSelfAllowed() + && !$policy->isEvalAllowed() + && $policy->isDynamicAllowed() + && $policy->getHashes() == [] + && $policy->getNonceValues() == [] + && $policy->isInlineAllowed(); + } + break; + case 'connect-src': + $connectScrChecked = $policy->isNoneAllowed() + && $policy->getHostSources() == [] + && $policy->getSchemeSources() == [] + && !$policy->isSelfAllowed() + && !$policy->isEvalAllowed() + && !$policy->isDynamicAllowed() + && $policy->getHashes() == [] + && $policy->getNonceValues() == [] + && !$policy->isInlineAllowed(); + break; + case 'default-src': + $defaultScrChecked = !$policy->isNoneAllowed() + && $policy->getHostSources() == ['http://magento.com', 'http://devdocs.magento.com'] + && $policy->getSchemeSources() == [] + && $policy->isSelfAllowed() + && !$policy->isEvalAllowed() + && !$policy->isDynamicAllowed() + && $policy->getHashes() == [] + && $policy->getNonceValues() == [] + && !$policy->isInlineAllowed(); + break; + case 'font-src': + $fontScrChecked = !$policy->isNoneAllowed() + && $policy->getHostSources() == [] + && $policy->getSchemeSources() == [] + && $policy->isSelfAllowed() + && !$policy->isEvalAllowed() + && !$policy->isDynamicAllowed() + && $policy->getHashes() == [] + && $policy->getNonceValues() == [] + && !$policy->isInlineAllowed(); + break; + case 'frame-src': + $frameScrChecked = !$policy->isNoneAllowed() + && $policy->getHostSources() == [] + && $policy->getSchemeSources() == [] + && $policy->isSelfAllowed() + && !$policy->isEvalAllowed() + && $policy->isDynamicAllowed() + && $policy->getHashes() == [] + && $policy->getNonceValues() == [] + && !$policy->isInlineAllowed(); + break; + case 'img-src': + $imgScrChecked = !$policy->isNoneAllowed() + && $policy->getHostSources() == [] + && $policy->getSchemeSources() == [] + && $policy->isSelfAllowed() + && !$policy->isEvalAllowed() + && !$policy->isDynamicAllowed() + && $policy->getHashes() == [] + && $policy->getNonceValues() == [] + && !$policy->isInlineAllowed(); + break; + case 'manifest-src': + $manifestScrChecked = !$policy->isNoneAllowed() + && $policy->getHostSources() == [] + && $policy->getSchemeSources() == [] + && $policy->isSelfAllowed() + && !$policy->isEvalAllowed() + && !$policy->isDynamicAllowed() + && $policy->getHashes() == [] + && $policy->getNonceValues() == [] + && !$policy->isInlineAllowed(); + break; + case 'media-src': + $mediaScrChecked = !$policy->isNoneAllowed() + && $policy->getHostSources() == [] + && $policy->getSchemeSources() == [] + && $policy->isSelfAllowed() + && !$policy->isEvalAllowed() + && !$policy->isDynamicAllowed() + && $policy->getHashes() == [] + && $policy->getNonceValues() == [] + && !$policy->isInlineAllowed(); + break; + case 'object-src': + $objectScrChecked = !$policy->isNoneAllowed() + && $policy->getHostSources() == [] + && $policy->getSchemeSources() == [] + && $policy->isSelfAllowed() + && !$policy->isEvalAllowed() + && !$policy->isDynamicAllowed() + && $policy->getHashes() == [] + && $policy->getNonceValues() == [] + && !$policy->isInlineAllowed(); + break; + case 'script-src': + $scriptScrChecked = !$policy->isNoneAllowed() + && $policy->getHostSources() == [] + && $policy->getSchemeSources() == [] + && $policy->isSelfAllowed() + && !$policy->isEvalAllowed() + && !$policy->isDynamicAllowed() + && $policy->getHashes() == [] + && $policy->getNonceValues() == [] + && !$policy->isInlineAllowed(); + break; + case 'style-src': + $styleScrChecked = !$policy->isNoneAllowed() + && $policy->getHostSources() == [] + && $policy->getSchemeSources() == [] + && $policy->isSelfAllowed() + && !$policy->isEvalAllowed() + && !$policy->isDynamicAllowed() + && $policy->getHashes() == [] + && $policy->getNonceValues() == [] + && !$policy->isInlineAllowed(); + break; + case 'base-uri': + $baseUriChecked = !$policy->isNoneAllowed() + && $policy->getHostSources() == [] + && $policy->getSchemeSources() == [] + && $policy->isSelfAllowed() + && !$policy->isEvalAllowed() + && !$policy->isDynamicAllowed() + && $policy->getHashes() == [] + && $policy->getNonceValues() == [] + && !$policy->isInlineAllowed(); + break; + case 'plugin-types': + $pluginTypesChecked = $policy->getTypes() + == ['application/x-shockwave-flash', 'application/x-java-applet']; + break; + case 'sandbox': + $sandboxChecked = $policy->isFormAllowed() + && $policy->isModalsAllowed() + && $policy->isOrientationLockAllowed() + && $policy->isPointerLockAllowed() + && !$policy->isPopupsAllowed() + && !$policy->isPopupsToEscapeSandboxAllowed() + && $policy->isPresentationAllowed() + && $policy->isSameOriginAllowed() + && $policy->isScriptsAllowed() + && $policy->isTopNavigationAllowed() + && $policy->isTopNavigationByUserActivationAllowed(); + break; + case 'form-action': + $formActionChecked = !$policy->isNoneAllowed() + && $policy->getHostSources() == [] + && $policy->getSchemeSources() == [] + && $policy->isSelfAllowed() + && !$policy->isEvalAllowed() + && !$policy->isDynamicAllowed() + && $policy->getHashes() == [] + && $policy->getNonceValues() == [] + && !$policy->isInlineAllowed(); + break; + case 'frame-ancestors': + $frameAncestorsChecked = !$policy->isNoneAllowed() + && $policy->getHostSources() == [] + && $policy->getSchemeSources() == [] + && $policy->isSelfAllowed() + && !$policy->isEvalAllowed() + && !$policy->isDynamicAllowed() + && $policy->getHashes() == [] + && $policy->getNonceValues() == [] + && !$policy->isInlineAllowed(); + break; + case 'block-all-mixed-content': + $blockAllMixedChecked = $policy instanceof FlagPolicy; + break; + case 'upgrade-insecure-requests': + $upgradeChecked = $policy instanceof FlagPolicy; + break; + } + } + + $this->assertTrue($childScrChecked); + $this->assertTrue($childScr2Checked); + $this->assertTrue($connectScrChecked); + $this->assertTrue($defaultScrChecked); + $this->assertTrue($fontScrChecked); + $this->assertTrue($frameScrChecked); + $this->assertTrue($imgScrChecked); + $this->assertTrue($manifestScrChecked); + $this->assertTrue($mediaScrChecked); + $this->assertTrue($objectScrChecked); + $this->assertTrue($scriptScrChecked); + $this->assertTrue($styleScrChecked); + $this->assertTrue($baseUriChecked); + $this->assertTrue($pluginTypesChecked); + $this->assertTrue($sandboxChecked); + $this->assertTrue($formActionChecked); + $this->assertTrue($frameAncestorsChecked); + $this->assertTrue($blockAllMixedChecked); + $this->assertTrue($upgradeChecked); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/CspWhitelistXmlCollectorTest.php b/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/CspWhitelistXmlCollectorTest.php new file mode 100644 index 0000000000000..bbaabba9dd268 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/CspWhitelistXmlCollectorTest.php @@ -0,0 +1,68 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Collector; + +use Magento\Csp\Model\Policy\FetchPolicy; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Test collecting csp_whitelist configurations. + */ +class CspWhitelistXmlCollectorTest extends TestCase +{ + /** + * @var CspWhitelistXmlCollector + */ + private $collector; + + /** + * @inheritDoc + */ + public function setUp() + { + $this->collector = Bootstrap::getObjectManager()->get(CspWhitelistXmlCollector::class); + } + + /** + * Test collecting configurations from multiple XML files. + * + * @return void + */ + public function testCollecting(): void + { + $policies = $this->collector->collect([]); + + $mediaSrcChecked = false; + $objectSrcChecked = false; + $this->assertNotEmpty($policies); + /** @var FetchPolicy $policy */ + foreach ($policies as $policy) { + $this->assertFalse($policy->isNoneAllowed()); + $this->assertFalse($policy->isSelfAllowed()); + $this->assertFalse($policy->isInlineAllowed()); + $this->assertFalse($policy->isEvalAllowed()); + $this->assertFalse($policy->isDynamicAllowed()); + $this->assertEmpty($policy->getSchemeSources()); + $this->assertEmpty($policy->getNonceValues()); + if ($policy->getId() === 'object-src') { + $this->assertInstanceOf(FetchPolicy::class, $policy); + $this->assertEquals(['http://magento.com', 'https://devdocs.magento.com'], $policy->getHostSources()); + $this->assertEquals(['B2yPHKaXnvFWtRChIbabYmUBFZdVfKKXHbWtWidDVF8=' => 'sha256'], $policy->getHashes()); + $objectSrcChecked = true; + } elseif ($policy->getId() === 'media-src') { + $this->assertInstanceOf(FetchPolicy::class, $policy); + $this->assertEquals(['https://magento.com', 'https://devdocs.magento.com'], $policy->getHostSources()); + $this->assertEmpty($policy->getHashes()); + $mediaSrcChecked = true; + } + } + $this->assertTrue($objectSrcChecked); + $this->assertTrue($mediaSrcChecked); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Csp/Model/Policy/Renderer/SimplePolicyHeaderRendererTest.php b/dev/tests/integration/testsuite/Magento/Csp/Model/Policy/Renderer/SimplePolicyHeaderRendererTest.php new file mode 100644 index 0000000000000..eed72ffef93b1 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Csp/Model/Policy/Renderer/SimplePolicyHeaderRendererTest.php @@ -0,0 +1,130 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Policy\Renderer; + +use Magento\Csp\Model\Policy\FetchPolicy; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; +use Magento\Framework\App\Response\Http as HttpResponse; + +/** + * Test that rendering policies via headers works. + */ +class SimplePolicyHeaderRendererTest extends TestCase +{ + /** + * @var SimplePolicyHeaderRenderer + */ + private $renderer; + + /** + * @var HttpResponse + */ + private $response; + + /** + * @inheritDoc + */ + public function setUp() + { + $this->renderer = Bootstrap::getObjectManager()->get(SimplePolicyHeaderRenderer::class); + $this->response = Bootstrap::getObjectManager()->create(HttpResponse::class); + } + + /** + * Test policy rendering in restrict mode. + * + * @magentoAppArea frontend + * @magentoConfigFixture default_store csp/mode/storefront/report_only 0 + * @magentoConfigFixture default_store csp/mode/storefront/report_uri 0 + * + * @return void + */ + public function testRenderRestrictMode(): void + { + $policy = new FetchPolicy('default-src', false, ['https://magento.com'], [], true); + + $this->renderer->render($policy, $this->response); + + $this->assertNotEmpty($header = $this->response->getHeader('Content-Security-Policy')); + $this->assertEmpty($this->response->getHeader('Content-Security-Policy-Report-Only')); + $this->assertEquals('default-src https://magento.com \'self\';', $header->getFieldValue()); + } + + /** + * Test policy rendering in restrict mode with report URL provided. + * + * @magentoAppArea frontend + * @magentoConfigFixture default_store csp/mode/storefront/report_only 0 + * @magentoConfigFixture default_store csp/mode/storefront/report_uri /csp-reports/ + * + * @return void + */ + public function testRenderRestrictWithReportingMode(): void + { + $policy = new FetchPolicy('default-src', false, ['https://magento.com'], [], true); + + $this->renderer->render($policy, $this->response); + + $this->assertNotEmpty($header = $this->response->getHeader('Content-Security-Policy')); + $this->assertEmpty($this->response->getHeader('Content-Security-Policy-Report-Only')); + $this->assertEquals( + 'default-src https://magento.com \'self\'; report-uri /csp-reports/; report-to report-endpoint;', + $header->getFieldValue() + ); + $this->assertNotEmpty($reportToHeader = $this->response->getHeader('Report-To')); + $this->assertNotEmpty($reportData = json_decode("[{$reportToHeader->getFieldValue()}]", true)); + $this->assertEquals('report-endpoint', $reportData[0]['group']); + } + + /** + * Test policy rendering in report-only mode. + * + * @magentoAppArea frontend + * @magentoConfigFixture default_store csp/mode/storefront/report_only 1 + * @magentoConfigFixture default_store csp/mode/storefront/report_uri 0 + * + * @return void + */ + public function testRenderReportMode(): void + { + $policy = new FetchPolicy('default-src', false, ['https://magento.com'], [], true); + + $this->renderer->render($policy, $this->response); + + $this->assertNotEmpty($header = $this->response->getHeader('Content-Security-Policy-Report-Only')); + $this->assertEmpty($this->response->getHeader('Content-Security-Policy')); + $this->assertEquals('default-src https://magento.com \'self\';', $header->getFieldValue()); + } + + /** + * Test policy rendering in report-only mode with report URL provided. + * + * @magentoAppArea frontend + * @magentoConfigFixture default_store csp/mode/storefront/report_only 1 + * @magentoConfigFixture default_store csp/mode/storefront/report_uri /csp-reports/ + * + * @return void + */ + public function testRenderReportWithReportingMode(): void + { + $policy = new FetchPolicy('default-src', false, ['https://magento.com'], [], true); + + $this->renderer->render($policy, $this->response); + + $this->assertNotEmpty($header = $this->response->getHeader('Content-Security-Policy-Report-Only')); + $this->assertEmpty($this->response->getHeader('Content-Security-Policy')); + $this->assertEquals( + 'default-src https://magento.com \'self\'; report-uri /csp-reports/; report-to report-endpoint;', + $header->getFieldValue() + ); + $this->assertNotEmpty($reportToHeader = $this->response->getHeader('Report-To')); + $this->assertNotEmpty($reportData = json_decode("[{$reportToHeader->getFieldValue()}]", true)); + $this->assertEquals('report-endpoint', $reportData[0]['group']); + } +} From 9898d5cc6e7dcec9eb3428d2e17a9fba014c6440 Mon Sep 17 00:00:00 2001 From: Diego Pires <diegocpires@gmail.com> Date: Thu, 14 Nov 2019 19:46:23 -0300 Subject: [PATCH 132/595] Fix regex for validate action in admin menu --- app/code/Magento/Backend/Model/Menu/Item/Validator.php | 2 +- app/code/Magento/Backend/etc/menu.xsd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Backend/Model/Menu/Item/Validator.php b/app/code/Magento/Backend/Model/Menu/Item/Validator.php index 7b72b355f551d..1dd1bd7861e4d 100644 --- a/app/code/Magento/Backend/Model/Menu/Item/Validator.php +++ b/app/code/Magento/Backend/Model/Menu/Item/Validator.php @@ -49,7 +49,7 @@ public function __construct() $attributeValidator = new \Zend_Validate(); $attributeValidator->addValidator(new \Zend_Validate_StringLength(['min' => 3])); - $attributeValidator->addValidator(new \Zend_Validate_Regex('/^[A-Za-z0-9\/_]+$/')); + $attributeValidator->addValidator(new \Zend_Validate_Regex('/^[A-Za-z0-9\/_\-]+$/')); $textValidator = new \Zend_Validate_StringLength(['min' => 3, 'max' => 50]); diff --git a/app/code/Magento/Backend/etc/menu.xsd b/app/code/Magento/Backend/etc/menu.xsd index 2619b3f5fedac..4b408e8e86a17 100644 --- a/app/code/Magento/Backend/etc/menu.xsd +++ b/app/code/Magento/Backend/etc/menu.xsd @@ -100,7 +100,7 @@ </xs:documentation> </xs:annotation> <xs:restriction base="xs:string"> - <xs:pattern value="[a-zA-Z0-9/_]{3,}" /> + <xs:pattern value="[a-zA-Z0-9/_\-]{3,}" /> </xs:restriction> </xs:simpleType> From 93dcd502a9b04c56fa46b5cc446915b4de5bf0c8 Mon Sep 17 00:00:00 2001 From: Diego Pires <diegocpires@gmail.com> Date: Thu, 14 Nov 2019 20:13:35 -0300 Subject: [PATCH 133/595] Fixed Code Style --- .../Backend/Model/Menu/Item/Validator.php | 38 +++++++++++-------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/app/code/Magento/Backend/Model/Menu/Item/Validator.php b/app/code/Magento/Backend/Model/Menu/Item/Validator.php index 1dd1bd7861e4d..d722dfd700dad 100644 --- a/app/code/Magento/Backend/Model/Menu/Item/Validator.php +++ b/app/code/Magento/Backend/Model/Menu/Item/Validator.php @@ -5,7 +5,14 @@ */ namespace Magento\Backend\Model\Menu\Item; +use BadMethodCallException; +use InvalidArgumentException; +use Zend_Validate; + /** + * Class Validator + * + * @package Magento\Backend\Model\Menu\Item * @api * @since 100.0.2 */ @@ -28,7 +35,7 @@ class Validator /** * The list of primitive validators * - * @var \Zend_Validate[] + * @var Zend_Validate[] */ protected $_validators = []; @@ -37,17 +44,17 @@ class Validator */ public function __construct() { - $idValidator = new \Zend_Validate(); + $idValidator = new Zend_Validate(); $idValidator->addValidator(new \Zend_Validate_StringLength(['min' => 3])); $idValidator->addValidator(new \Zend_Validate_Regex('/^[A-Za-z0-9\/:_]+$/')); - $resourceValidator = new \Zend_Validate(); + $resourceValidator = new Zend_Validate(); $resourceValidator->addValidator(new \Zend_Validate_StringLength(['min' => 8])); $resourceValidator->addValidator( new \Zend_Validate_Regex('/^[A-Z][A-Za-z0-9]+_[A-Z][A-Za-z0-9]+::[A-Za-z_0-9]+$/') ); - $attributeValidator = new \Zend_Validate(); + $attributeValidator = new Zend_Validate(); $attributeValidator->addValidator(new \Zend_Validate_StringLength(['min' => 3])); $attributeValidator->addValidator(new \Zend_Validate_Regex('/^[A-Za-z0-9\/_\-]+$/')); @@ -70,8 +77,8 @@ public function __construct() * * @param array $data * @return void - * @throws \InvalidArgumentException - * @throws \BadMethodCallException + * @throws InvalidArgumentException + * @throws BadMethodCallException */ public function validate($data) { @@ -101,15 +108,16 @@ private function checkMenuItemIsRemoved($data) /** * Check that menu item contains all required data + * * @param array $data * - * @throws \BadMethodCallException + * @throws BadMethodCallException */ private function assertContainsRequiredParameters($data) { foreach ($this->_required as $param) { if (!isset($data[$param])) { - throw new \BadMethodCallException('Missing required param ' . $param); + throw new BadMethodCallException('Missing required param ' . $param); } } } @@ -118,12 +126,12 @@ private function assertContainsRequiredParameters($data) * Check that menu item id is not used * * @param string $id - * @throws \InvalidArgumentException + * @throws InvalidArgumentException */ private function assertIdentifierIsNotUsed($id) { if (array_search($id, $this->_ids) !== false) { - throw new \InvalidArgumentException('Item with id ' . $id . ' already exists'); + throw new InvalidArgumentException('Item with id ' . $id . ' already exists'); } } @@ -132,7 +140,7 @@ private function assertIdentifierIsNotUsed($id) * * @param string $param * @param mixed $value - * @throws \InvalidArgumentException + * @throws InvalidArgumentException */ private function validateMenuItemParameter($param, $value) { @@ -148,7 +156,7 @@ private function validateMenuItemParameter($param, $value) return; } - throw new \InvalidArgumentException( + throw new InvalidArgumentException( "Param " . $param . " doesn't pass validation: " . implode( '; ', $validator->getMessages() @@ -162,16 +170,16 @@ private function validateMenuItemParameter($param, $value) * @param string $param * @param mixed $value * @return void - * @throws \InvalidArgumentException + * @throws InvalidArgumentException */ public function validateParam($param, $value) { if (in_array($param, $this->_required) && $value === null) { - throw new \InvalidArgumentException('Param ' . $param . ' is required'); + throw new InvalidArgumentException('Param ' . $param . ' is required'); } if ($value !== null && isset($this->_validators[$param]) && !$this->_validators[$param]->isValid($value)) { - throw new \InvalidArgumentException( + throw new InvalidArgumentException( 'Param ' . $param . ' doesn\'t pass validation: ' . implode( '; ', $this->_validators[$param]->getMessages() From 8327db6cb299ca3932b6e053dfb9c3da7f694170 Mon Sep 17 00:00:00 2001 From: Diego Pires <diegocpires@gmail.com> Date: Thu, 14 Nov 2019 20:22:09 -0300 Subject: [PATCH 134/595] Fixed Unit Tests --- .../Model/Menu/Config/_files/invalidMenuXmlArray.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Backend/Test/Unit/Model/Menu/Config/_files/invalidMenuXmlArray.php b/app/code/Magento/Backend/Test/Unit/Model/Menu/Config/_files/invalidMenuXmlArray.php index cd3128754444b..5a4c8e978b78b 100644 --- a/app/code/Magento/Backend/Test/Unit/Model/Menu/Config/_files/invalidMenuXmlArray.php +++ b/app/code/Magento/Backend/Test/Unit/Model/Menu/Config/_files/invalidMenuXmlArray.php @@ -10,7 +10,7 @@ ' resource="Test_Value::value"/></menu></config>', [ "Element 'add', attribute 'action': [facet 'pattern'] The value '' is not accepted by the " . - "pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n", + "pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n", "Element 'add', attribute 'action': '' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n" ], ], @@ -20,7 +20,7 @@ 'resource="Test_Value::value"/></menu></config>', [ "Element 'add', attribute 'action': [facet 'pattern'] The value 'ad' is not accepted by the " . - "pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n", + "pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n", "Element 'add', attribute 'action': 'ad' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n" ], ], @@ -31,7 +31,7 @@ '</menu></config>', [ "Element 'add', attribute 'action': [facet 'pattern'] The value 'adm$#@inhtml/notification' is not " . - "accepted by the pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n", + "accepted by the pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n", "Element 'add', attribute 'action': 'adm$#@inhtml/notification' is not a valid value of the atomic " . "type 'typeAction'.\nLine: 1\n" ], @@ -452,7 +452,7 @@ '<?xml version="1.0"?><config><menu><update action="" ' . 'id="Test_Value::some_value"/></menu></config>', [ "Element 'update', attribute 'action': [facet 'pattern'] The value '' is not accepted by the " . - "pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n", + "pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n", "Element 'update', attribute 'action': '' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n" ], ], @@ -462,7 +462,7 @@ 'resource="Test_Value::value"/></menu></config>', [ "Element 'update', attribute 'action': [facet 'pattern'] The value 'v' is not accepted by the " . - "pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n", + "pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n", "Element 'update', attribute 'action': 'v' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n" ], ], @@ -471,7 +471,7 @@ 'id="Test_Value::some_value"/></menu></config>', [ "Element 'update', attribute 'action': [facet 'pattern'] The value '/@##gt;' is not " . - "accepted by the pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n", + "accepted by the pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n", "Element 'update', attribute 'action': '/@##gt;' is not a valid value of the atomic" . " type 'typeAction'.\nLine: 1\n" ], From 4fd4e60670df5bfe960ee7ad6f9ac96ac11fdcba Mon Sep 17 00:00:00 2001 From: Diego Pires <diegocpires@gmail.com> Date: Thu, 14 Nov 2019 21:09:43 -0300 Subject: [PATCH 135/595] Remove use statements --- .../Backend/Model/Menu/Item/Validator.php | 34 ++++++++----------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/app/code/Magento/Backend/Model/Menu/Item/Validator.php b/app/code/Magento/Backend/Model/Menu/Item/Validator.php index d722dfd700dad..62225c5707c0d 100644 --- a/app/code/Magento/Backend/Model/Menu/Item/Validator.php +++ b/app/code/Magento/Backend/Model/Menu/Item/Validator.php @@ -5,10 +5,6 @@ */ namespace Magento\Backend\Model\Menu\Item; -use BadMethodCallException; -use InvalidArgumentException; -use Zend_Validate; - /** * Class Validator * @@ -35,7 +31,7 @@ class Validator /** * The list of primitive validators * - * @var Zend_Validate[] + * @var \Zend_Validate[] */ protected $_validators = []; @@ -44,17 +40,17 @@ class Validator */ public function __construct() { - $idValidator = new Zend_Validate(); + $idValidator = new \Zend_Validate(); $idValidator->addValidator(new \Zend_Validate_StringLength(['min' => 3])); $idValidator->addValidator(new \Zend_Validate_Regex('/^[A-Za-z0-9\/:_]+$/')); - $resourceValidator = new Zend_Validate(); + $resourceValidator = new \Zend_Validate(); $resourceValidator->addValidator(new \Zend_Validate_StringLength(['min' => 8])); $resourceValidator->addValidator( new \Zend_Validate_Regex('/^[A-Z][A-Za-z0-9]+_[A-Z][A-Za-z0-9]+::[A-Za-z_0-9]+$/') ); - $attributeValidator = new Zend_Validate(); + $attributeValidator = new \Zend_Validate(); $attributeValidator->addValidator(new \Zend_Validate_StringLength(['min' => 3])); $attributeValidator->addValidator(new \Zend_Validate_Regex('/^[A-Za-z0-9\/_\-]+$/')); @@ -77,8 +73,8 @@ public function __construct() * * @param array $data * @return void - * @throws InvalidArgumentException - * @throws BadMethodCallException + * @throws \InvalidArgumentException + * @throws \BadMethodCallException */ public function validate($data) { @@ -111,13 +107,13 @@ private function checkMenuItemIsRemoved($data) * * @param array $data * - * @throws BadMethodCallException + * @throws \BadMethodCallException */ private function assertContainsRequiredParameters($data) { foreach ($this->_required as $param) { if (!isset($data[$param])) { - throw new BadMethodCallException('Missing required param ' . $param); + throw new \BadMethodCallException('Missing required param ' . $param); } } } @@ -126,12 +122,12 @@ private function assertContainsRequiredParameters($data) * Check that menu item id is not used * * @param string $id - * @throws InvalidArgumentException + * @throws \InvalidArgumentException */ private function assertIdentifierIsNotUsed($id) { if (array_search($id, $this->_ids) !== false) { - throw new InvalidArgumentException('Item with id ' . $id . ' already exists'); + throw new \InvalidArgumentException('Item with id ' . $id . ' already exists'); } } @@ -140,7 +136,7 @@ private function assertIdentifierIsNotUsed($id) * * @param string $param * @param mixed $value - * @throws InvalidArgumentException + * @throws \InvalidArgumentException */ private function validateMenuItemParameter($param, $value) { @@ -156,7 +152,7 @@ private function validateMenuItemParameter($param, $value) return; } - throw new InvalidArgumentException( + throw new \InvalidArgumentException( "Param " . $param . " doesn't pass validation: " . implode( '; ', $validator->getMessages() @@ -170,16 +166,16 @@ private function validateMenuItemParameter($param, $value) * @param string $param * @param mixed $value * @return void - * @throws InvalidArgumentException + * @throws \InvalidArgumentException */ public function validateParam($param, $value) { if (in_array($param, $this->_required) && $value === null) { - throw new InvalidArgumentException('Param ' . $param . ' is required'); + throw new \InvalidArgumentException('Param ' . $param . ' is required'); } if ($value !== null && isset($this->_validators[$param]) && !$this->_validators[$param]->isValid($value)) { - throw new InvalidArgumentException( + throw new \InvalidArgumentException( 'Param ' . $param . ' doesn\'t pass validation: ' . implode( '; ', $this->_validators[$param]->getMessages() From 3a82b4af977764a6f8226b2f237dfbe768661970 Mon Sep 17 00:00:00 2001 From: Alexander Shkurko <coderimus@gmail.com> Date: Fri, 15 Nov 2019 09:35:35 +0200 Subject: [PATCH 136/595] REFACTORING: adjust commands to the common style in the MediaGallery and change exception handle logic --- .../Model/Asset/Command/DeleteByPath.php | 2 +- .../Model/Asset/Command/GetById.php | 2 +- .../Model/Asset/Command/GetByPath.php | 2 +- .../MediaGallery/Model/Asset/Command/Save.php | 2 +- .../MediaGallery/Model/DataExtractor.php | 8 +++++++- .../Keyword/Command/GetAssetKeywords.php | 20 ++++++++++++++----- .../Keyword/Command/SaveAssetKeywords.php | 18 +++++++++++++++-- .../Model/Keyword/Command/SaveAssetLinks.php | 14 +++++++++++-- .../Plugin/Product/Gallery/Processor.php | 3 +-- .../Keyword/Command/GetAssetKeywordsTest.php | 18 +++++++++++++++-- .../Keyword/Command/SaveAssetKeywordsTest.php | 13 +++++++++++- .../Keyword/Command/SaveAssetLinksTest.php | 16 +++++++++++++-- 12 files changed, 97 insertions(+), 21 deletions(-) diff --git a/app/code/Magento/MediaGallery/Model/Asset/Command/DeleteByPath.php b/app/code/Magento/MediaGallery/Model/Asset/Command/DeleteByPath.php index b7880354720b7..e387da6de6beb 100644 --- a/app/code/Magento/MediaGallery/Model/Asset/Command/DeleteByPath.php +++ b/app/code/Magento/MediaGallery/Model/Asset/Command/DeleteByPath.php @@ -62,11 +62,11 @@ public function execute(string $mediaAssetPath): void $tableName = $this->resourceConnection->getTableName(self::TABLE_MEDIA_GALLERY_ASSET); $connection->delete($tableName, [self::MEDIA_GALLERY_ASSET_PATH . ' = ?' => $mediaAssetPath]); } catch (\Exception $exception) { + $this->logger->critical($exception); $message = __( 'Could not delete media asset with path %path: %error', ['path' => $mediaAssetPath, 'error' => $exception->getMessage()] ); - $this->logger->critical($message); throw new CouldNotDeleteException($message, $exception); } } diff --git a/app/code/Magento/MediaGallery/Model/Asset/Command/GetById.php b/app/code/Magento/MediaGallery/Model/Asset/Command/GetById.php index 4519e0f926981..aa3bedd438c36 100644 --- a/app/code/Magento/MediaGallery/Model/Asset/Command/GetById.php +++ b/app/code/Magento/MediaGallery/Model/Asset/Command/GetById.php @@ -79,11 +79,11 @@ public function execute(int $mediaAssetId): AssetInterface return $this->assetFactory->create(['data' => $data]); } catch (\Exception $exception) { + $this->logger->critical($exception); $message = __( 'En error occurred during get media asset with id %id by id: %error', ['id' => $mediaAssetId, 'error' => $exception->getMessage()] ); - $this->logger->critical($message); throw new IntegrationException($message, $exception); } } diff --git a/app/code/Magento/MediaGallery/Model/Asset/Command/GetByPath.php b/app/code/Magento/MediaGallery/Model/Asset/Command/GetByPath.php index babf05599e6ce..db8482d3399ba 100644 --- a/app/code/Magento/MediaGallery/Model/Asset/Command/GetByPath.php +++ b/app/code/Magento/MediaGallery/Model/Asset/Command/GetByPath.php @@ -82,8 +82,8 @@ public function execute(string $mediaFilePath): AssetInterface return $mediaAssets; } catch (\Exception $exception) { + $this->logger->critical($exception); $message = __('An error occurred during get media asset list: %1', $exception->getMessage()); - $this->logger->critical($message); throw new IntegrationException($message, $exception); } } diff --git a/app/code/Magento/MediaGallery/Model/Asset/Command/Save.php b/app/code/Magento/MediaGallery/Model/Asset/Command/Save.php index 8deaca70a2173..7cb2f73169642 100644 --- a/app/code/Magento/MediaGallery/Model/Asset/Command/Save.php +++ b/app/code/Magento/MediaGallery/Model/Asset/Command/Save.php @@ -71,8 +71,8 @@ public function execute(AssetInterface $mediaAsset): int $connection->insertOnDuplicate($tableName, $this->extractor->extract($mediaAsset, AssetInterface::class)); return (int) $connection->lastInsertId($tableName); } catch (\Exception $exception) { + $this->logger->critical($exception); $message = __('An error occurred during media asset save: %1', $exception->getMessage()); - $this->logger->critical($message); throw new CouldNotSaveException($message, $exception); } } diff --git a/app/code/Magento/MediaGallery/Model/DataExtractor.php b/app/code/Magento/MediaGallery/Model/DataExtractor.php index d4f73dda92036..92cf237022c28 100644 --- a/app/code/Magento/MediaGallery/Model/DataExtractor.php +++ b/app/code/Magento/MediaGallery/Model/DataExtractor.php @@ -15,7 +15,13 @@ class DataExtractor implements DataExtractorInterface { /** - * @inheritdoc + * Extract data from an object using available getters (does not process extension attributes) + * + * @param object $object + * @param string|null $interface + * + * @return array + * @throws \ReflectionException */ public function extract($object, string $interface = null): array { diff --git a/app/code/Magento/MediaGallery/Model/Keyword/Command/GetAssetKeywords.php b/app/code/Magento/MediaGallery/Model/Keyword/Command/GetAssetKeywords.php index 2a1706c1a198c..5b826a26e937d 100644 --- a/app/code/Magento/MediaGallery/Model/Keyword/Command/GetAssetKeywords.php +++ b/app/code/Magento/MediaGallery/Model/Keyword/Command/GetAssetKeywords.php @@ -7,11 +7,12 @@ namespace Magento\MediaGallery\Model\Keyword\Command; +use Magento\Framework\Exception\IntegrationException; use Magento\MediaGalleryApi\Api\Data\KeywordInterface; use Magento\MediaGalleryApi\Api\Data\KeywordInterfaceFactory; use Magento\MediaGalleryApi\Model\Keyword\Command\GetAssetKeywordsInterface; use Magento\Framework\App\ResourceConnection; -use Magento\Framework\Exception\NotFoundException; +use Psr\Log\LoggerInterface; /** * ClassGetAssetKeywords @@ -31,18 +32,26 @@ class GetAssetKeywords implements GetAssetKeywordsInterface */ private $assetKeywordFactory; + /** + * @var LoggerInterface + */ + private $logger; + /** * GetAssetKeywords constructor. * * @param ResourceConnection $resourceConnection * @param KeywordInterfaceFactory $assetKeywordFactory + * @param LoggerInterface $logger */ public function __construct( ResourceConnection $resourceConnection, - KeywordInterfaceFactory $assetKeywordFactory + KeywordInterfaceFactory $assetKeywordFactory, + LoggerInterface $logger ) { $this->resourceConnection = $resourceConnection; $this->assetKeywordFactory = $assetKeywordFactory; + $this->logger = $logger; } /** @@ -50,8 +59,8 @@ public function __construct( * * @param int $assetId * - * @return KeywordInterface[] - * @throws NotFoundException + * @return KeywordInterface[]|[] + * @throws IntegrationException */ public function execute(int $assetId): array { @@ -71,8 +80,9 @@ public function execute(int $assetId): array return $keywords; } catch (\Exception $exception) { + $this->logger->critical($exception); $message = __('An error occurred during get asset keywords: %1', $exception->getMessage()); - throw new NotFoundException($message, $exception); + throw new IntegrationException($message, $exception); } } } diff --git a/app/code/Magento/MediaGallery/Model/Keyword/Command/SaveAssetKeywords.php b/app/code/Magento/MediaGallery/Model/Keyword/Command/SaveAssetKeywords.php index 12bb1035f20b3..b355a9a651cd4 100644 --- a/app/code/Magento/MediaGallery/Model/Keyword/Command/SaveAssetKeywords.php +++ b/app/code/Magento/MediaGallery/Model/Keyword/Command/SaveAssetKeywords.php @@ -13,6 +13,7 @@ use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\DB\Adapter\Pdo\Mysql; use Magento\Framework\Exception\CouldNotSaveException; +use Psr\Log\LoggerInterface; /** * Class SaveAssetKeywords @@ -33,22 +34,34 @@ class SaveAssetKeywords implements SaveAssetKeywordsInterface */ private $saveAssetLinks; + /** + * @var LoggerInterface + */ + private $logger; + /** * SaveAssetKeywords constructor. * * @param ResourceConnection $resourceConnection * @param SaveAssetLinks $saveAssetLinks + * @param LoggerInterface $logger */ public function __construct( ResourceConnection $resourceConnection, - SaveAssetLinks $saveAssetLinks + SaveAssetLinks $saveAssetLinks, + LoggerInterface $logger ) { $this->resourceConnection = $resourceConnection; $this->saveAssetLinks = $saveAssetLinks; + $this->logger = $logger; } /** - * @inheritdoc + * Save asset keywords. + * + * @param KeywordInterface[] $keywords + * @param int $assetId + * @throws CouldNotSaveException */ public function execute(array $keywords, int $assetId): void { @@ -72,6 +85,7 @@ public function execute(array $keywords, int $assetId): void $this->saveAssetLinks->execute($assetId, $this->getKeywordIds($data)); } } catch (\Exception $exception) { + $this->logger->critical($exception); $message = __('An error occurred during save asset keyword: %1', $exception->getMessage()); throw new CouldNotSaveException($message, $exception); } diff --git a/app/code/Magento/MediaGallery/Model/Keyword/Command/SaveAssetLinks.php b/app/code/Magento/MediaGallery/Model/Keyword/Command/SaveAssetLinks.php index 7f0e9b5cf94a3..4d3fd2bb5c30d 100644 --- a/app/code/Magento/MediaGallery/Model/Keyword/Command/SaveAssetLinks.php +++ b/app/code/Magento/MediaGallery/Model/Keyword/Command/SaveAssetLinks.php @@ -13,6 +13,7 @@ use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\DB\Adapter\Pdo\Mysql; use Magento\Framework\Exception\CouldNotSaveException; +use Psr\Log\LoggerInterface; /** * Class SaveAssetLinks @@ -29,14 +30,22 @@ class SaveAssetLinks private $resourceConnection; /** - * SaveAssetKeywords constructor. + * @var LoggerInterface + */ + private $logger; + + /** + * SaveAssetLinks constructor. * * @param ResourceConnection $resourceConnection + * @param LoggerInterface $logger */ public function __construct( - ResourceConnection $resourceConnection + ResourceConnection $resourceConnection, + LoggerInterface $logger ) { $this->resourceConnection = $resourceConnection; + $this->logger = $logger; } /** @@ -66,6 +75,7 @@ public function execute(int $assetId, array $keywordIds): void ); } } catch (\Exception $exception) { + $this->logger->critical($exception); $message = __('An error occurred during save asset keyword links: %1', $exception->getMessage()); throw new CouldNotSaveException($message, $exception); } diff --git a/app/code/Magento/MediaGallery/Plugin/Product/Gallery/Processor.php b/app/code/Magento/MediaGallery/Plugin/Product/Gallery/Processor.php index 7541231601db4..9144e77213179 100644 --- a/app/code/Magento/MediaGallery/Plugin/Product/Gallery/Processor.php +++ b/app/code/Magento/MediaGallery/Plugin/Product/Gallery/Processor.php @@ -67,8 +67,7 @@ public function afterRemoveImage( try { $this->deleteMediaAssetByPath->execute($file); } catch (\Exception $exception) { - $message = __('An error occurred during media asset delete at media processor: %1', $exception->getMessage()); - $this->logger->critical($message->render()); + $this->logger->critical($$exception); } return $result; diff --git a/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/GetAssetKeywordsTest.php b/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/GetAssetKeywordsTest.php index 6934a7e4e5503..3f92ccd0eb997 100644 --- a/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/GetAssetKeywordsTest.php +++ b/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/GetAssetKeywordsTest.php @@ -16,7 +16,11 @@ use Magento\Framework\Exception\NotFoundException; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Psr\Log\LoggerInterface; +/** + * GetAssetKeywordsTest + */ class GetAssetKeywordsTest extends TestCase { /** @@ -34,14 +38,21 @@ class GetAssetKeywordsTest extends TestCase */ private $assetKeywordFactoryStub; + /** + * @var LoggerInterface|MockObject + */ + private $logger; + protected function setUp(): void { $this->resourceConnectionStub = $this->createMock(ResourceConnection::class); $this->assetKeywordFactoryStub = $this->createMock(KeywordInterfaceFactory::class); + $this->logger = $this->createMock(LoggerInterface::class); $this->sut = new GetAssetKeywords( $this->resourceConnectionStub, - $this->assetKeywordFactoryStub + $this->assetKeywordFactoryStub, + $this->logger ); } @@ -80,7 +91,7 @@ public function casesProvider(): array } /** - * Negative test + * Test case when an error occured during get data request. * * @throws NotFoundException */ @@ -93,6 +104,9 @@ public function testNotFoundBecauseOfError(): void ->willThrowException((new \Exception())); $this->expectException(NotFoundException::class); + $this->logger->expects($this->once()) + ->method('critical') + ->willReturnSelf(); $this->sut->execute($randomAssetId); } diff --git a/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/SaveAssetKeywordsTest.php b/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/SaveAssetKeywordsTest.php index 52864f7aa89f2..57397f2705278 100644 --- a/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/SaveAssetKeywordsTest.php +++ b/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/SaveAssetKeywordsTest.php @@ -16,6 +16,7 @@ use Magento\Framework\Exception\CouldNotSaveException; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Psr\Log\LoggerInterface; /** * SaveAssetKeywordsTest. @@ -47,6 +48,11 @@ class SaveAssetKeywordsTest extends TestCase */ private $selectMock; + /** + * @var LoggerInterface|MockObject + */ + private $logger; + /** * SetUp */ @@ -58,10 +64,12 @@ public function setUp(): void ->disableOriginalConstructor() ->getMock(); $this->selectMock = $this->createMock(Select::class); + $this->logger = $this->createMock(LoggerInterface::class); $this->sut = new SaveAssetKeywords( $this->resourceConnectionMock, - $this->saveAssetLinksMock + $this->saveAssetLinksMock, + $this->logger ); } @@ -106,6 +114,9 @@ public function testAssetNotSavingCausedByError(): void ->method('getConnection') ->willThrowException((new \Exception())); $this->expectException(CouldNotSaveException::class); + $this->logger->expects($this->once()) + ->method('critical') + ->willReturnSelf(); $this->sut->execute([$keyword], 1); } diff --git a/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/SaveAssetLinksTest.php b/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/SaveAssetLinksTest.php index a4cdd76f90bfc..17916814eda95 100644 --- a/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/SaveAssetLinksTest.php +++ b/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/SaveAssetLinksTest.php @@ -13,6 +13,7 @@ use Magento\Framework\Exception\CouldNotSaveException; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Psr\Log\LoggerInterface; /** * SaveAssetLinksTest. @@ -34,17 +35,23 @@ class SaveAssetLinksTest extends TestCase */ private $resourceConnectionMock; + /** + * @var LoggerInterface|MockObject + */ + private $logger; + /** * Prepare test objects. */ public function setUp(): void { - $this->connectionMock = $this->createMock(AdapterInterface::class); $this->resourceConnectionMock = $this->createMock(ResourceConnection::class); + $this->logger = $this->createMock(LoggerInterface::class); $this->sut = new SaveAssetLinks( - $this->resourceConnectionMock + $this->resourceConnectionMock, + $this->logger ); } @@ -56,6 +63,8 @@ public function setUp(): void * @param int $assetId * @param array $keywordIds * @param array $values + * + * @throws CouldNotSaveException */ public function testAssetKeywordsSave(int $assetId, array $keywordIds, array $values): void { @@ -96,6 +105,9 @@ public function testAssetNotSavingCausedByError(): void ->method('insertArray') ->willThrowException((new \Exception())); $this->expectException(CouldNotSaveException::class); + $this->logger->expects($this->once()) + ->method('critical') + ->willReturnSelf(); $this->sut->execute(1, [1, 2]); } From e694954529046406ba97ce0e723d48901a6e6e18 Mon Sep 17 00:00:00 2001 From: Alexander Shkurko <coderimus@gmail.com> Date: Fri, 15 Nov 2019 10:24:57 +0200 Subject: [PATCH 137/595] Fix exception in test --- .../Unit/Model/Keyword/Command/GetAssetKeywordsTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/GetAssetKeywordsTest.php b/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/GetAssetKeywordsTest.php index 3f92ccd0eb997..85030763303f0 100644 --- a/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/GetAssetKeywordsTest.php +++ b/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/GetAssetKeywordsTest.php @@ -7,13 +7,13 @@ namespace Magento\MediaGallery\Test\Unit\Model\Keyword\Command; +use Magento\Framework\Exception\IntegrationException; use Magento\MediaGallery\Model\Keyword\Command\GetAssetKeywords; use Magento\MediaGalleryApi\Api\Data\KeywordInterface; use Magento\MediaGalleryApi\Api\Data\KeywordInterfaceFactory; use Magento\Framework\App\ResourceConnection; use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\DB\Select; -use Magento\Framework\Exception\NotFoundException; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -93,7 +93,7 @@ public function casesProvider(): array /** * Test case when an error occured during get data request. * - * @throws NotFoundException + * @throws IntegrationException */ public function testNotFoundBecauseOfError(): void { @@ -103,7 +103,7 @@ public function testNotFoundBecauseOfError(): void ->method('getConnection') ->willThrowException((new \Exception())); - $this->expectException(NotFoundException::class); + $this->expectException(IntegrationException::class); $this->logger->expects($this->once()) ->method('critical') ->willReturnSelf(); From 0ba961533a2eb357df7d71964fcff154a4689be8 Mon Sep 17 00:00:00 2001 From: Viktor Sevch <svitja@ukr.net> Date: Fri, 15 Nov 2019 13:05:46 +0200 Subject: [PATCH 138/595] MC-18057: Product doesn'y match by "Date" attribute condition --- .../Model/Condition/AbstractCondition.php | 12 ++++--- .../product_simple_with_date_attribute.php | 27 ++++++++++++++++ ...ct_simple_with_date_attribute_rollback.php | 32 +++++++++++++++++++ .../Block/Product/ProductListTest.php | 25 +++++++++++++++ .../Rule/Model/Condition/Sql/BuilderTest.php | 2 +- 5 files changed, 93 insertions(+), 5 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_date_attribute.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_date_attribute_rollback.php diff --git a/app/code/Magento/Rule/Model/Condition/AbstractCondition.php b/app/code/Magento/Rule/Model/Condition/AbstractCondition.php index f6e782b3e7a53..f60817cce608b 100644 --- a/app/code/Magento/Rule/Model/Condition/AbstractCondition.php +++ b/app/code/Magento/Rule/Model/Condition/AbstractCondition.php @@ -386,7 +386,7 @@ public function getValueSelectOptions() public function getValueParsed() { if (!$this->hasValueParsed()) { - $value = $this->getData('value'); + $value = $this->getValue(); if (is_array($value) && count($value) === 1) { $value = reset($value); } @@ -765,7 +765,7 @@ public function asStringRecursive($level = 0) /** * Validate product attribute value for condition * - * @param object|array|int|string|float|bool $validatedValue product attribute value + * @param object|array|int|string|float|bool|null $validatedValue product attribute value * @return bool * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) @@ -830,6 +830,7 @@ public function validateAttribute($validatedValue) case '{}': case '!{}': if (is_scalar($validatedValue) && is_array($value)) { + $validatedValue = (string)$validatedValue; foreach ($value as $item) { if (stripos($validatedValue, (string)$item) !== false) { $result = true; @@ -877,13 +878,16 @@ public function validateAttribute($validatedValue) /** * Case and type insensitive comparison of values * - * @param string|int|float $validatedValue - * @param string|int|float $value + * @param string|int|float|null $validatedValue + * @param string|int|float|null $value * @param bool $strict * @return bool */ protected function _compareValues($validatedValue, $value, $strict = true) { + if (null === $value || null === $validatedValue) { + return $value == $validatedValue; + } if ($strict && is_numeric($validatedValue) && is_numeric($value)) { return $validatedValue == $value; } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_date_attribute.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_date_attribute.php new file mode 100644 index 0000000000000..2c78d9b74f969 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_date_attribute.php @@ -0,0 +1,27 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +include __DIR__ . '/product_date_attribute.php'; + +$attribute->setData('is_used_for_promo_rules', 1); + +/** @var $product \Magento\Catalog\Model\Product */ +$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Catalog\Model\Product::class); +$product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE) + ->setAttributeSetId(4) + ->setWebsiteIds([1]) + ->setName('Simple Product with date') + ->setSku('simple_with_date') + ->setPrice(10) + ->setDescription('Description with <b>html tag</b>') + ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH) + ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED) + ->setCategoryIds([2]) + ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1]) + ->setDateAttribute(date('Y-m-d')) + ->save(); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_date_attribute_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_date_attribute_rollback.php new file mode 100644 index 0000000000000..0f155926dd6db --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_date_attribute_rollback.php @@ -0,0 +1,32 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +use Magento\Framework\Exception\NoSuchEntityException; + +\Magento\TestFramework\Helper\Bootstrap::getInstance()->getInstance()->reinitialize(); + +/** @var \Magento\Framework\Registry $registry */ +$registry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(\Magento\Framework\Registry::class); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ +$productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get(\Magento\Catalog\Api\ProductRepositoryInterface::class); + +try { + $product = $productRepository->get('simple_with_date', false, null, true); + $productRepository->delete($product); +} catch (NoSuchEntityException $e) { +} + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); + +include __DIR__ . '/product_date_attribute_rollback.php'; diff --git a/dev/tests/integration/testsuite/Magento/CatalogWidget/Block/Product/ProductListTest.php b/dev/tests/integration/testsuite/Magento/CatalogWidget/Block/Product/ProductListTest.php index 2695948e78314..85cd5331a29c4 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogWidget/Block/Product/ProductListTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogWidget/Block/Product/ProductListTest.php @@ -172,4 +172,29 @@ public function createCollectionForSkuDataProvider() . '`attribute`:`sku`,`operator`:`!^[^]`,`value`:`virtual`^]^]', 'product-with-xss'] ]; } + + /** + * Check that collection returns correct result if use date attribute. + * + * @magentoDbIsolation disabled + * @magentoDataFixture Magento/Catalog/_files/product_simple_with_date_attribute.php + * @return void + */ + public function testProductListWithDateAttribute() + { + $encodedConditions = '^[`1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Combine`,' + . '`aggregator`:`all`,`value`:`1`,`new_child`:``^],' + . '`1--1`:^[`type`:`Magento||CatalogWidget||Model||Rule||Condition||Product`,' + . '`attribute`:`date_attribute`,`operator`:`==`,`value`:`' . date('Y-m-d') . '`^]^]'; + $this->block->setData('conditions_encoded', $encodedConditions); + + // Load products collection filtered using specified conditions and perform assertions + $productCollection = $this->block->createCollection(); + $productCollection->load(); + $this->assertEquals( + 1, + $productCollection->count(), + "Product collection was not filtered according to the widget condition." + ); + } } diff --git a/dev/tests/integration/testsuite/Magento/Rule/Model/Condition/Sql/BuilderTest.php b/dev/tests/integration/testsuite/Magento/Rule/Model/Condition/Sql/BuilderTest.php index edf456f17fd9c..48e0bb62a4fba 100644 --- a/dev/tests/integration/testsuite/Magento/Rule/Model/Condition/Sql/BuilderTest.php +++ b/dev/tests/integration/testsuite/Magento/Rule/Model/Condition/Sql/BuilderTest.php @@ -72,7 +72,7 @@ public function testAttachConditionToCollection(): void $rule->loadPost($ruleConditionArray); $this->model->attachConditionToCollection($collection, $rule->getConditions()); - $whereString = "/\(category_id IN \('3'\).+\(IFNULL\(`e`\.`entity_id`,.+\) = '2017-09-15'\)" + $whereString = "/\(category_id IN \('3'\).+\(IFNULL\(`e`\.`entity_id`,.+\) = '2017-09-15 00:00:00'\)" . ".+ORDER BY \(FIELD\(`e`.`sku`, ':\(', ':\)'\)\)/"; $this->assertEquals(1, preg_match($whereString, $collection->getSelectSql(true))); } From a3c67daa340a018854e1f3118d98f6400bb07b88 Mon Sep 17 00:00:00 2001 From: Edward Simpson <edward@skywire.co.uk> Date: Fri, 15 Nov 2019 13:23:23 +0000 Subject: [PATCH 139/595] Magento_Ui messages js - Using .bind to remove the need for self --- app/code/Magento/Ui/view/frontend/web/js/view/messages.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Ui/view/frontend/web/js/view/messages.js b/app/code/Magento/Ui/view/frontend/web/js/view/messages.js index 735c3219c8136..b34eea5aa226d 100644 --- a/app/code/Magento/Ui/view/frontend/web/js/view/messages.js +++ b/app/code/Magento/Ui/view/frontend/web/js/view/messages.js @@ -65,13 +65,11 @@ define([ * @param {Boolean} isHidden */ onHiddenChange: function (isHidden) { - var self = this; - // Hide message block if needed if (isHidden) { setTimeout(function () { - $(self.selector).hide('blind', {}, self.hideSpeed); - }, self.hideTimeout); + $(this.selector).hide('blind', {}, this.hideSpeed); + }.bind(this), this.hideTimeout); } } }); From a565ee001e76ed3b5d53b7b21ed8dd637c1fb71b Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Fri, 15 Nov 2019 15:57:23 +0200 Subject: [PATCH 140/595] Remove duplicated hide() method --- .../Ui/view/base/web/js/grid/columns/image-preview.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js index cf597f8d3a543..372ab0e093727 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js @@ -101,13 +101,12 @@ define([ show: function (record) { var img; + this.hide(); + if (record._rowIndex === this.visibleRecord()) { - this.hide(); - return; } - - this.hide(); + this.displayedRecord(record); this._selectRow(record.rowNumber || null); this.visibleRecord(record._rowIndex); From b30b855668313aa55c00156927e9392723795195 Mon Sep 17 00:00:00 2001 From: Nazarn96 <nazarn96@gmail.com> Date: Fri, 15 Nov 2019 16:33:16 +0200 Subject: [PATCH 141/595] Fix static test --- .../Magento/Ui/view/base/web/js/grid/columns/image-preview.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js index 372ab0e093727..57f16dc0c1a02 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js @@ -102,11 +102,11 @@ define([ var img; this.hide(); - + if (record._rowIndex === this.visibleRecord()) { return; } - + this.displayedRecord(record); this._selectRow(record.rowNumber || null); this.visibleRecord(record._rowIndex); From 6e2b738a8e5b56d4c5cce608c73ce7d21713d797 Mon Sep 17 00:00:00 2001 From: Oleksandr Gorkun <ogorkun@magento.com> Date: Fri, 15 Nov 2019 11:45:41 -0600 Subject: [PATCH 142/595] MC-19926: Implement CSP --- .../Collector/CspWhitelistXmlCollector.php | 1 - .../Magento/Csp/Model/Mode/ConfigManager.php | 1 - .../Magento/Csp/Model/Policy/FetchPolicy.php | 1 + .../Renderer/SimplePolicyHeaderRenderer.php | 5 - .../Csp/Model/Policy/SandboxPolicy.php | 3 + app/code/Magento/Csp/composer.json | 2 +- .../Model/Collector/ConfigCollectorTest.php | 284 ++++-------------- 7 files changed, 65 insertions(+), 232 deletions(-) diff --git a/app/code/Magento/Csp/Model/Collector/CspWhitelistXmlCollector.php b/app/code/Magento/Csp/Model/Collector/CspWhitelistXmlCollector.php index 66eb3747bce3e..f4a75f120dab9 100644 --- a/app/code/Magento/Csp/Model/Collector/CspWhitelistXmlCollector.php +++ b/app/code/Magento/Csp/Model/Collector/CspWhitelistXmlCollector.php @@ -51,7 +51,6 @@ public function collect(array $defaultPolicies = []): array ); } - return $policies; } } diff --git a/app/code/Magento/Csp/Model/Mode/ConfigManager.php b/app/code/Magento/Csp/Model/Mode/ConfigManager.php index 874df5e0d226f..9f10154604d5f 100644 --- a/app/code/Magento/Csp/Model/Mode/ConfigManager.php +++ b/app/code/Magento/Csp/Model/Mode/ConfigManager.php @@ -62,7 +62,6 @@ public function getConfigured(): ModeConfiguredInterface throw new \RuntimeException('CSP can only be configured for storefront or admin area'); } - $reportOnly = $this->config->isSetFlag( 'csp/mode/' . $configArea .'/report_only', ScopeInterface::SCOPE_STORE, diff --git a/app/code/Magento/Csp/Model/Policy/FetchPolicy.php b/app/code/Magento/Csp/Model/Policy/FetchPolicy.php index 87e95d5818004..76d17e3cb96c7 100644 --- a/app/code/Magento/Csp/Model/Policy/FetchPolicy.php +++ b/app/code/Magento/Csp/Model/Policy/FetchPolicy.php @@ -93,6 +93,7 @@ class FetchPolicy implements SimplePolicyInterface * @param string[] $nonceValues * @param string[] $hashValues * @param bool $dynamicAllowed + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( string $id, diff --git a/app/code/Magento/Csp/Model/Policy/Renderer/SimplePolicyHeaderRenderer.php b/app/code/Magento/Csp/Model/Policy/Renderer/SimplePolicyHeaderRenderer.php index b4fd418e89635..14ae23eb3fe37 100644 --- a/app/code/Magento/Csp/Model/Policy/Renderer/SimplePolicyHeaderRenderer.php +++ b/app/code/Magento/Csp/Model/Policy/Renderer/SimplePolicyHeaderRenderer.php @@ -24,11 +24,6 @@ class SimplePolicyHeaderRenderer implements PolicyRendererInterface */ private $modeConfig; - /** - * @var ModeConfiguredInterface - */ - private $config; - /** * @param ModeConfigManagerInterface $modeConfig */ diff --git a/app/code/Magento/Csp/Model/Policy/SandboxPolicy.php b/app/code/Magento/Csp/Model/Policy/SandboxPolicy.php index 0aeb221e79ca6..33e3b06f56aec 100644 --- a/app/code/Magento/Csp/Model/Policy/SandboxPolicy.php +++ b/app/code/Magento/Csp/Model/Policy/SandboxPolicy.php @@ -81,6 +81,7 @@ class SandboxPolicy implements SimplePolicyInterface * @param bool $scriptsAllowed * @param bool $topNavigationAllowed * @param bool $topNavigationByUserActivationAllowed + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( bool $formAllowed, @@ -228,6 +229,8 @@ public function getId(): string /** * @inheritDoc + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) */ public function getValue(): string { diff --git a/app/code/Magento/Csp/composer.json b/app/code/Magento/Csp/composer.json index a18fcf21dcca2..91146b00f3f76 100644 --- a/app/code/Magento/Csp/composer.json +++ b/app/code/Magento/Csp/composer.json @@ -6,7 +6,7 @@ }, "require": { "php": "~7.1.3||~7.2.0||~7.3.0", - "magento/framework": "*", + "magento/framework": "*" }, "type": "magento2-module", "license": [ diff --git a/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/ConfigCollectorTest.php b/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/ConfigCollectorTest.php index db67b322ebd5d..ae8013d065194 100644 --- a/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/ConfigCollectorTest.php +++ b/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/ConfigCollectorTest.php @@ -33,6 +33,55 @@ public function setUp() $this->collector = Bootstrap::getObjectManager()->get(ConfigCollector::class); } + /** + * Create expected policy objects. + * + * @return PolicyInterface[] + */ + private function getExpectedPolicies(): array + { + return [ + 'child-src' => new FetchPolicy( + 'child-src', + false, + ['http://magento.com', 'http://devdocs.magento.com'], + ['http'], + true, + true, + false, + [], + [], + true + ), + 'child-src2' => new FetchPolicy('child-src', false, [], [], false, false, true), + 'connect-src' => new FetchPolicy('connect-src'), + 'default-src' => new FetchPolicy( + 'default-src', + false, + ['http://magento.com', 'http://devdocs.magento.com'], + [], + true + ), + 'font-src' => new FetchPolicy('font-src', false, [], [], true), + 'frame-src' => new FetchPolicy('frame-src', false, [], [], true, false, false, [], [], true), + 'img-src' => new FetchPolicy('img-src', false, [], [], true), + 'manifest-src' => new FetchPolicy('manifest-src', false, [], [], true), + 'media-src' => new FetchPolicy('media-src', false, [], [], true), + 'object-src' => new FetchPolicy('object-src', false, [], [], true), + 'script-src' => new FetchPolicy('script-src', false, [], [], true), + 'style-src' => new FetchPolicy('style-src', false, [], [], true), + 'base-uri' => new FetchPolicy('base-uri', false, [], [], true), + 'plugin-types' => new PluginTypesPolicy( + ['application/x-shockwave-flash', 'application/x-java-applet'] + ), + 'sandbox' => new SandboxPolicy(true, true, true, true, false, false, true, true, true, true, true), + 'form-action' => new FetchPolicy('form-action', false, [], [], true), + 'frame-ancestors' => new FetchPolicy('frame-ancestors', false, [], [], true), + 'block-all-mixed-content' => new FlagPolicy('block-all-mixed-content'), + 'upgrade-insecure-requests' => new FlagPolicy('upgrade-insecure-requests') + ]; + } + /** * Test initiating policies from config. * @@ -90,7 +139,7 @@ public function setUp() * @magentoConfigFixture default_store csp/policies/storefront/frame_ancestors/none 0 * @magentoConfigFixture default_store csp/policies/storefront/frame_ancestors/self 1 * @magentoConfigFixture default_store csp/policies/storefront/plugin_types/policy_id plugin-types - * @magentoConfigFixture default_store csp/policies/storefront/plugin_types/types/flash application/x-shockwave-flash + * @magentoConfigFixture default_store csp/policies/storefront/plugin_types/types/fl application/x-shockwave-flash * @magentoConfigFixture default_store csp/policies/storefront/plugin_types/types/applet application/x-java-applet * @magentoConfigFixture default_store csp/policies/storefront/sandbox/policy_id sandbox * @magentoConfigFixture default_store csp/policies/storefront/sandbox/forms 1 @@ -111,233 +160,20 @@ public function setUp() public function testCollecting(): void { $policies = $this->collector->collect([]); - $childScrChecked = false; - $childScr2Checked = false; - $connectScrChecked = false; - $defaultScrChecked = false; - $fontScrChecked = false; - $frameScrChecked = false; - $imgScrChecked = false; - $manifestScrChecked = false; - $mediaScrChecked = false; - $objectScrChecked = false; - $scriptScrChecked = false; - $styleScrChecked = false; - $baseUriChecked = false; - $pluginTypesChecked = false; - $sandboxChecked = false; - $formActionChecked = false; - $frameAncestorsChecked = false; - $blockAllMixedChecked = false; - $upgradeChecked = false; + $checked = []; + $expectedPolicies = $this->getExpectedPolicies(); $this->assertNotEmpty($policies); - /** @var PolicyInterface|FetchPolicy|FlagPolicy|SandboxPolicy|PluginTypesPolicy $policy */ + /** @var PolicyInterface $policy */ foreach ($policies as $policy) { - switch ($policy->getId()) - { - case 'child-src': - if ($policy->isEvalAllowed()) { - $childScr2Checked = true; - } else { - $childScrChecked = !$policy->isNoneAllowed() - && $policy->getHostSources() == ['http://magento.com', 'http://devdocs.magento.com'] - && $policy->getSchemeSources() == ['http'] - && $policy->isSelfAllowed() - && !$policy->isEvalAllowed() - && $policy->isDynamicAllowed() - && $policy->getHashes() == [] - && $policy->getNonceValues() == [] - && $policy->isInlineAllowed(); - } - break; - case 'connect-src': - $connectScrChecked = $policy->isNoneAllowed() - && $policy->getHostSources() == [] - && $policy->getSchemeSources() == [] - && !$policy->isSelfAllowed() - && !$policy->isEvalAllowed() - && !$policy->isDynamicAllowed() - && $policy->getHashes() == [] - && $policy->getNonceValues() == [] - && !$policy->isInlineAllowed(); - break; - case 'default-src': - $defaultScrChecked = !$policy->isNoneAllowed() - && $policy->getHostSources() == ['http://magento.com', 'http://devdocs.magento.com'] - && $policy->getSchemeSources() == [] - && $policy->isSelfAllowed() - && !$policy->isEvalAllowed() - && !$policy->isDynamicAllowed() - && $policy->getHashes() == [] - && $policy->getNonceValues() == [] - && !$policy->isInlineAllowed(); - break; - case 'font-src': - $fontScrChecked = !$policy->isNoneAllowed() - && $policy->getHostSources() == [] - && $policy->getSchemeSources() == [] - && $policy->isSelfAllowed() - && !$policy->isEvalAllowed() - && !$policy->isDynamicAllowed() - && $policy->getHashes() == [] - && $policy->getNonceValues() == [] - && !$policy->isInlineAllowed(); - break; - case 'frame-src': - $frameScrChecked = !$policy->isNoneAllowed() - && $policy->getHostSources() == [] - && $policy->getSchemeSources() == [] - && $policy->isSelfAllowed() - && !$policy->isEvalAllowed() - && $policy->isDynamicAllowed() - && $policy->getHashes() == [] - && $policy->getNonceValues() == [] - && !$policy->isInlineAllowed(); - break; - case 'img-src': - $imgScrChecked = !$policy->isNoneAllowed() - && $policy->getHostSources() == [] - && $policy->getSchemeSources() == [] - && $policy->isSelfAllowed() - && !$policy->isEvalAllowed() - && !$policy->isDynamicAllowed() - && $policy->getHashes() == [] - && $policy->getNonceValues() == [] - && !$policy->isInlineAllowed(); - break; - case 'manifest-src': - $manifestScrChecked = !$policy->isNoneAllowed() - && $policy->getHostSources() == [] - && $policy->getSchemeSources() == [] - && $policy->isSelfAllowed() - && !$policy->isEvalAllowed() - && !$policy->isDynamicAllowed() - && $policy->getHashes() == [] - && $policy->getNonceValues() == [] - && !$policy->isInlineAllowed(); - break; - case 'media-src': - $mediaScrChecked = !$policy->isNoneAllowed() - && $policy->getHostSources() == [] - && $policy->getSchemeSources() == [] - && $policy->isSelfAllowed() - && !$policy->isEvalAllowed() - && !$policy->isDynamicAllowed() - && $policy->getHashes() == [] - && $policy->getNonceValues() == [] - && !$policy->isInlineAllowed(); - break; - case 'object-src': - $objectScrChecked = !$policy->isNoneAllowed() - && $policy->getHostSources() == [] - && $policy->getSchemeSources() == [] - && $policy->isSelfAllowed() - && !$policy->isEvalAllowed() - && !$policy->isDynamicAllowed() - && $policy->getHashes() == [] - && $policy->getNonceValues() == [] - && !$policy->isInlineAllowed(); - break; - case 'script-src': - $scriptScrChecked = !$policy->isNoneAllowed() - && $policy->getHostSources() == [] - && $policy->getSchemeSources() == [] - && $policy->isSelfAllowed() - && !$policy->isEvalAllowed() - && !$policy->isDynamicAllowed() - && $policy->getHashes() == [] - && $policy->getNonceValues() == [] - && !$policy->isInlineAllowed(); - break; - case 'style-src': - $styleScrChecked = !$policy->isNoneAllowed() - && $policy->getHostSources() == [] - && $policy->getSchemeSources() == [] - && $policy->isSelfAllowed() - && !$policy->isEvalAllowed() - && !$policy->isDynamicAllowed() - && $policy->getHashes() == [] - && $policy->getNonceValues() == [] - && !$policy->isInlineAllowed(); - break; - case 'base-uri': - $baseUriChecked = !$policy->isNoneAllowed() - && $policy->getHostSources() == [] - && $policy->getSchemeSources() == [] - && $policy->isSelfAllowed() - && !$policy->isEvalAllowed() - && !$policy->isDynamicAllowed() - && $policy->getHashes() == [] - && $policy->getNonceValues() == [] - && !$policy->isInlineAllowed(); - break; - case 'plugin-types': - $pluginTypesChecked = $policy->getTypes() - == ['application/x-shockwave-flash', 'application/x-java-applet']; - break; - case 'sandbox': - $sandboxChecked = $policy->isFormAllowed() - && $policy->isModalsAllowed() - && $policy->isOrientationLockAllowed() - && $policy->isPointerLockAllowed() - && !$policy->isPopupsAllowed() - && !$policy->isPopupsToEscapeSandboxAllowed() - && $policy->isPresentationAllowed() - && $policy->isSameOriginAllowed() - && $policy->isScriptsAllowed() - && $policy->isTopNavigationAllowed() - && $policy->isTopNavigationByUserActivationAllowed(); - break; - case 'form-action': - $formActionChecked = !$policy->isNoneAllowed() - && $policy->getHostSources() == [] - && $policy->getSchemeSources() == [] - && $policy->isSelfAllowed() - && !$policy->isEvalAllowed() - && !$policy->isDynamicAllowed() - && $policy->getHashes() == [] - && $policy->getNonceValues() == [] - && !$policy->isInlineAllowed(); - break; - case 'frame-ancestors': - $frameAncestorsChecked = !$policy->isNoneAllowed() - && $policy->getHostSources() == [] - && $policy->getSchemeSources() == [] - && $policy->isSelfAllowed() - && !$policy->isEvalAllowed() - && !$policy->isDynamicAllowed() - && $policy->getHashes() == [] - && $policy->getNonceValues() == [] - && !$policy->isInlineAllowed(); - break; - case 'block-all-mixed-content': - $blockAllMixedChecked = $policy instanceof FlagPolicy; - break; - case 'upgrade-insecure-requests': - $upgradeChecked = $policy instanceof FlagPolicy; - break; + $id = $policy->getId(); + if ($id === 'child-src' && $policy->isEvalAllowed()) { + $id = 'child-src2'; } + $this->assertEquals($expectedPolicies[$id], $policy); + $checked[] = $id; } - - $this->assertTrue($childScrChecked); - $this->assertTrue($childScr2Checked); - $this->assertTrue($connectScrChecked); - $this->assertTrue($defaultScrChecked); - $this->assertTrue($fontScrChecked); - $this->assertTrue($frameScrChecked); - $this->assertTrue($imgScrChecked); - $this->assertTrue($manifestScrChecked); - $this->assertTrue($mediaScrChecked); - $this->assertTrue($objectScrChecked); - $this->assertTrue($scriptScrChecked); - $this->assertTrue($styleScrChecked); - $this->assertTrue($baseUriChecked); - $this->assertTrue($pluginTypesChecked); - $this->assertTrue($sandboxChecked); - $this->assertTrue($formActionChecked); - $this->assertTrue($frameAncestorsChecked); - $this->assertTrue($blockAllMixedChecked); - $this->assertTrue($upgradeChecked); + $expectedIds = array_keys($expectedPolicies); + $this->assertEquals(sort($expectedIds), sort($checked)); } } From f28f7de0dad14421d3690d84d0ca393c3dbcc364 Mon Sep 17 00:00:00 2001 From: Oleksandr Gorkun <ogorkun@magento.com> Date: Fri, 15 Nov 2019 11:55:02 -0600 Subject: [PATCH 143/595] MC-19926: Implement CSP --- composer.lock | 160 +++++++++++++++++++++++++------------------------- 1 file changed, 81 insertions(+), 79 deletions(-) diff --git a/composer.lock b/composer.lock index f5e4fe783879e..6c26f5d30cc76 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "21394914b3f105a33f583ba59aeba748", + "content-hash": "1bdcad292b0fcfb4e3f669de79a8eee0", "packages": [ { "name": "braintree/braintree_php", @@ -1111,16 +1111,16 @@ }, { "name": "monolog/monolog", - "version": "1.25.1", + "version": "1.25.2", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "70e65a5470a42cfec1a7da00d30edb6e617e8dcf" + "reference": "d5e2fb341cb44f7e2ab639d12a1e5901091ec287" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/70e65a5470a42cfec1a7da00d30edb6e617e8dcf", - "reference": "70e65a5470a42cfec1a7da00d30edb6e617e8dcf", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/d5e2fb341cb44f7e2ab639d12a1e5901091ec287", + "reference": "d5e2fb341cb44f7e2ab639d12a1e5901091ec287", "shasum": "" }, "require": { @@ -1185,7 +1185,7 @@ "logging", "psr-3" ], - "time": "2019-09-06T13:49:17+00:00" + "time": "2019-11-13T10:00:05+00:00" }, { "name": "paragonie/random_compat", @@ -1390,39 +1390,36 @@ }, { "name": "php-amqplib/php-amqplib", - "version": "v2.7.3", + "version": "v2.10.1", "source": { "type": "git", "url": "https://github.com/php-amqplib/php-amqplib.git", - "reference": "a8ba54bd35b973fc6861e4c2e105f71e9e95f43f" + "reference": "6e2b2501e021e994fb64429e5a78118f83b5c200" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-amqplib/php-amqplib/zipball/a8ba54bd35b973fc6861e4c2e105f71e9e95f43f", - "reference": "a8ba54bd35b973fc6861e4c2e105f71e9e95f43f", + "url": "https://api.github.com/repos/php-amqplib/php-amqplib/zipball/6e2b2501e021e994fb64429e5a78118f83b5c200", + "reference": "6e2b2501e021e994fb64429e5a78118f83b5c200", "shasum": "" }, "require": { "ext-bcmath": "*", - "ext-mbstring": "*", - "php": ">=5.3.0" + "ext-sockets": "*", + "php": ">=5.6" }, "replace": { "videlalvaro/php-amqplib": "self.version" }, "require-dev": { - "phpdocumentor/phpdocumentor": "^2.9", - "phpunit/phpunit": "^4.8", - "scrutinizer/ocular": "^1.1", + "ext-curl": "*", + "nategood/httpful": "^0.2.20", + "phpunit/phpunit": "^5.7|^6.5|^7.0", "squizlabs/php_codesniffer": "^2.5" }, - "suggest": { - "ext-sockets": "Use AMQPSocketConnection" - }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.10-dev" } }, "autoload": { @@ -1448,6 +1445,11 @@ "name": "Raúl Araya", "email": "nubeiro@gmail.com", "role": "Maintainer" + }, + { + "name": "Luke Bakken", + "email": "luke@bakken.io", + "role": "Maintainer" } ], "description": "Formerly videlalvaro/php-amqplib. This library is a pure PHP implementation of the AMQP protocol. It's been tested against RabbitMQ.", @@ -1457,7 +1459,7 @@ "queue", "rabbitmq" ], - "time": "2018-04-30T03:54:54+00:00" + "time": "2019-10-10T13:23:40+00:00" }, { "name": "phpseclib/mcrypt_compat", @@ -2080,7 +2082,7 @@ }, { "name": "symfony/css-selector", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -2133,7 +2135,7 @@ }, { "name": "symfony/event-dispatcher", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -2261,7 +2263,7 @@ }, { "name": "symfony/filesystem", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -2311,7 +2313,7 @@ }, { "name": "symfony/finder", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -2477,7 +2479,7 @@ }, { "name": "symfony/process", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", @@ -2723,23 +2725,23 @@ }, { "name": "wikimedia/less.php", - "version": "1.8.1", + "version": "1.8.2", "source": { "type": "git", "url": "https://github.com/wikimedia/less.php.git", - "reference": "f0f7768f6fa8a9d2ac6a0274f6f477c72159bf9b" + "reference": "e238ad228d74b6ffd38209c799b34e9826909266" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/less.php/zipball/f0f7768f6fa8a9d2ac6a0274f6f477c72159bf9b", - "reference": "f0f7768f6fa8a9d2ac6a0274f6f477c72159bf9b", + "url": "https://api.github.com/repos/wikimedia/less.php/zipball/e238ad228d74b6ffd38209c799b34e9826909266", + "reference": "e238ad228d74b6ffd38209c799b34e9826909266", "shasum": "" }, "require": { - "php": ">=5.3" + "php": ">=7.2.9" }, "require-dev": { - "phpunit/phpunit": "~4.8.24" + "phpunit/phpunit": "7.5.14" }, "bin": [ "bin/lessc" @@ -2758,6 +2760,10 @@ "Apache-2.0" ], "authors": [ + { + "name": "Josh Schmidt", + "homepage": "https://github.com/oyejorge" + }, { "name": "Matt Agar", "homepage": "https://github.com/agar" @@ -2765,10 +2771,6 @@ { "name": "Martin Jantošovič", "homepage": "https://github.com/Mordred" - }, - { - "name": "Josh Schmidt", - "homepage": "https://github.com/oyejorge" } ], "description": "PHP port of the Javascript version of LESS http://lesscss.org (Originally maintained by Josh Schmidt)", @@ -2780,7 +2782,7 @@ "php", "stylesheet" ], - "time": "2019-01-19T01:01:33+00:00" + "time": "2019-11-06T18:30:11+00:00" }, { "name": "zendframework/zend-captcha", @@ -6159,16 +6161,16 @@ }, { "name": "doctrine/cache", - "version": "1.9.0", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "c15dcd24b756f9e52ea7c3ae8227354f3628f11a" + "reference": "89a5c76c39c292f7798f964ab3c836c3f8192a55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/c15dcd24b756f9e52ea7c3ae8227354f3628f11a", - "reference": "c15dcd24b756f9e52ea7c3ae8227354f3628f11a", + "url": "https://api.github.com/repos/doctrine/cache/zipball/89a5c76c39c292f7798f964ab3c836c3f8192a55", + "reference": "89a5c76c39c292f7798f964ab3c836c3f8192a55", "shasum": "" }, "require": { @@ -6238,7 +6240,7 @@ "riak", "xcache" ], - "time": "2019-11-11T10:31:52+00:00" + "time": "2019-11-15T14:31:57+00:00" }, { "name": "doctrine/inflector", @@ -6365,28 +6367,30 @@ }, { "name": "doctrine/lexer", - "version": "1.0.2", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8" + "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/1febd6c3ef84253d7c815bed85fc622ad207a9f8", - "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", + "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^7.2" }, "require-dev": { - "phpunit/phpunit": "^4.5" + "doctrine/coding-standard": "^6.0", + "phpstan/phpstan": "^0.11.8", + "phpunit/phpunit": "^8.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -6399,14 +6403,14 @@ "MIT" ], "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, { "name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com" }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com" @@ -6421,7 +6425,7 @@ "parser", "php" ], - "time": "2019-06-08T11:03:04+00:00" + "time": "2019-10-30T14:39:59+00:00" }, { "name": "facebook/webdriver", @@ -6615,16 +6619,16 @@ }, { "name": "fzaninotto/faker", - "version": "v1.8.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/fzaninotto/Faker.git", - "reference": "f72816b43e74063c8b10357394b6bba8cb1c10de" + "reference": "27a216cbe72327b2d6369fab721a5843be71e57d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/f72816b43e74063c8b10357394b6bba8cb1c10de", - "reference": "f72816b43e74063c8b10357394b6bba8cb1c10de", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/27a216cbe72327b2d6369fab721a5843be71e57d", + "reference": "27a216cbe72327b2d6369fab721a5843be71e57d", "shasum": "" }, "require": { @@ -6633,13 +6637,11 @@ "require-dev": { "ext-intl": "*", "phpunit/phpunit": "^4.8.35 || ^5.7", - "squizlabs/php_codesniffer": "^1.5" + "squizlabs/php_codesniffer": "^2.9.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.8-dev" - } + "branch-alias": [] }, "autoload": { "psr-4": { @@ -6661,7 +6663,7 @@ "faker", "fixtures" ], - "time": "2018-07-12T10:23:15+00:00" + "time": "2019-11-14T13:13:06+00:00" }, { "name": "grasmash/expander", @@ -7667,16 +7669,16 @@ }, { "name": "phpcompatibility/php-compatibility", - "version": "9.3.3", + "version": "9.3.4", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "1af08ca3861048a8bfb39d0405d0ac3e50ba2696" + "reference": "1f37659196e4f3113ea506a7efba201c52303bf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/1af08ca3861048a8bfb39d0405d0ac3e50ba2696", - "reference": "1af08ca3861048a8bfb39d0405d0ac3e50ba2696", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/1f37659196e4f3113ea506a7efba201c52303bf1", + "reference": "1f37659196e4f3113ea506a7efba201c52303bf1", "shasum": "" }, "require": { @@ -7721,7 +7723,7 @@ "phpcs", "standards" ], - "time": "2019-11-11T03:25:23+00:00" + "time": "2019-11-15T04:12:02+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -9242,7 +9244,7 @@ }, { "name": "symfony/browser-kit", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", @@ -9301,7 +9303,7 @@ }, { "name": "symfony/config", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/config.git", @@ -9365,7 +9367,7 @@ }, { "name": "symfony/dependency-injection", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", @@ -9438,7 +9440,7 @@ }, { "name": "symfony/dom-crawler", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", @@ -9499,16 +9501,16 @@ }, { "name": "symfony/http-foundation", - "version": "v2.8.50", + "version": "v2.8.52", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "746f8d3638bf46ee8b202e62f2b214c3d61fb06a" + "reference": "3929d9fe8148d17819ad0178c748b8d339420709" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/746f8d3638bf46ee8b202e62f2b214c3d61fb06a", - "reference": "746f8d3638bf46ee8b202e62f2b214c3d61fb06a", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/3929d9fe8148d17819ad0178c748b8d339420709", + "reference": "3929d9fe8148d17819ad0178c748b8d339420709", "shasum": "" }, "require": { @@ -9550,11 +9552,11 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2019-04-16T10:00:53+00:00" + "time": "2019-11-12T12:34:41+00:00" }, { "name": "symfony/options-resolver", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", @@ -9894,7 +9896,7 @@ }, { "name": "symfony/stopwatch", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", @@ -9944,7 +9946,7 @@ }, { "name": "symfony/yaml", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", From 90f5bc5a186bcb5821cd3ac20df95bd99ba78abb Mon Sep 17 00:00:00 2001 From: Oleksandr Gorkun <ogorkun@magento.com> Date: Fri, 15 Nov 2019 13:44:29 -0600 Subject: [PATCH 144/595] MC-19926: Implement CSP --- app/code/Magento/Csp/composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Csp/composer.json b/app/code/Magento/Csp/composer.json index 91146b00f3f76..cd8a47a92159d 100644 --- a/app/code/Magento/Csp/composer.json +++ b/app/code/Magento/Csp/composer.json @@ -6,7 +6,8 @@ }, "require": { "php": "~7.1.3||~7.2.0||~7.3.0", - "magento/framework": "*" + "magento/framework": "*", + "magento/module-store": "*" }, "type": "magento2-module", "license": [ From dd27fff78f9ff9f6f05aab9e3c320acbecccbb70 Mon Sep 17 00:00:00 2001 From: Oleksandr Gorkun <ogorkun@magento.com> Date: Fri, 15 Nov 2019 15:56:13 -0600 Subject: [PATCH 145/595] MC-19926: Implement CSP --- .../Framework/HTTP/PhpEnvironment/Response.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Response.php b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Response.php index 17d7482607622..db33b0feaf783 100644 --- a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Response.php +++ b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Response.php @@ -5,6 +5,8 @@ */ namespace Magento\Framework\HTTP\PhpEnvironment; +use Zend\Http\Header\GenericMultiHeader; + /** * Base HTTP response object */ @@ -77,11 +79,18 @@ public function setHeader($name, $value, $replace = false) { $value = (string)$value; + $headers = $this->getHeaders(); if ($replace) { + $headers->addHeaderLine($name, $value); $this->clearHeader($name); + } else { + //Zend framework will only force multiple headers for header objects + //extending MultiHeader interface. + $pluginKey = str_replace('-', '', mb_strtolower($name)); + $headers->getPluginClassLoader()->registerPlugin($pluginKey, GenericMultiHeader::class); + $headers->addHeader(new GenericMultiHeader($name, $value)); } - $this->getHeaders()->addHeaderLine($name, $value); return $this; } From f2dd874b312c82061e963bdf9ea985234c94538e Mon Sep 17 00:00:00 2001 From: Oleksandr Gorkun <ogorkun@magento.com> Date: Fri, 15 Nov 2019 16:02:25 -0600 Subject: [PATCH 146/595] MC-19926: Implement CSP --- composer.lock | 160 +++++++++++++++++++++++++------------------------- 1 file changed, 81 insertions(+), 79 deletions(-) diff --git a/composer.lock b/composer.lock index 65e5fd8e5a42c..bc2a9cc59b01f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e75fa994f056960e832018efd6af5a40", + "content-hash": "d90898f5936c9a12214a556055caf8bc", "packages": [ { "name": "braintree/braintree_php", @@ -1111,16 +1111,16 @@ }, { "name": "monolog/monolog", - "version": "1.25.1", + "version": "1.25.2", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "70e65a5470a42cfec1a7da00d30edb6e617e8dcf" + "reference": "d5e2fb341cb44f7e2ab639d12a1e5901091ec287" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/70e65a5470a42cfec1a7da00d30edb6e617e8dcf", - "reference": "70e65a5470a42cfec1a7da00d30edb6e617e8dcf", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/d5e2fb341cb44f7e2ab639d12a1e5901091ec287", + "reference": "d5e2fb341cb44f7e2ab639d12a1e5901091ec287", "shasum": "" }, "require": { @@ -1185,7 +1185,7 @@ "logging", "psr-3" ], - "time": "2019-09-06T13:49:17+00:00" + "time": "2019-11-13T10:00:05+00:00" }, { "name": "paragonie/random_compat", @@ -1390,39 +1390,36 @@ }, { "name": "php-amqplib/php-amqplib", - "version": "v2.7.3", + "version": "v2.10.1", "source": { "type": "git", "url": "https://github.com/php-amqplib/php-amqplib.git", - "reference": "a8ba54bd35b973fc6861e4c2e105f71e9e95f43f" + "reference": "6e2b2501e021e994fb64429e5a78118f83b5c200" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-amqplib/php-amqplib/zipball/a8ba54bd35b973fc6861e4c2e105f71e9e95f43f", - "reference": "a8ba54bd35b973fc6861e4c2e105f71e9e95f43f", + "url": "https://api.github.com/repos/php-amqplib/php-amqplib/zipball/6e2b2501e021e994fb64429e5a78118f83b5c200", + "reference": "6e2b2501e021e994fb64429e5a78118f83b5c200", "shasum": "" }, "require": { "ext-bcmath": "*", - "ext-mbstring": "*", - "php": ">=5.3.0" + "ext-sockets": "*", + "php": ">=5.6" }, "replace": { "videlalvaro/php-amqplib": "self.version" }, "require-dev": { - "phpdocumentor/phpdocumentor": "^2.9", - "phpunit/phpunit": "^4.8", - "scrutinizer/ocular": "^1.1", + "ext-curl": "*", + "nategood/httpful": "^0.2.20", + "phpunit/phpunit": "^5.7|^6.5|^7.0", "squizlabs/php_codesniffer": "^2.5" }, - "suggest": { - "ext-sockets": "Use AMQPSocketConnection" - }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.10-dev" } }, "autoload": { @@ -1448,6 +1445,11 @@ "name": "Raúl Araya", "email": "nubeiro@gmail.com", "role": "Maintainer" + }, + { + "name": "Luke Bakken", + "email": "luke@bakken.io", + "role": "Maintainer" } ], "description": "Formerly videlalvaro/php-amqplib. This library is a pure PHP implementation of the AMQP protocol. It's been tested against RabbitMQ.", @@ -1457,7 +1459,7 @@ "queue", "rabbitmq" ], - "time": "2018-04-30T03:54:54+00:00" + "time": "2019-10-10T13:23:40+00:00" }, { "name": "phpseclib/mcrypt_compat", @@ -2080,7 +2082,7 @@ }, { "name": "symfony/css-selector", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -2133,7 +2135,7 @@ }, { "name": "symfony/event-dispatcher", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -2261,7 +2263,7 @@ }, { "name": "symfony/filesystem", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -2311,7 +2313,7 @@ }, { "name": "symfony/finder", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -2477,7 +2479,7 @@ }, { "name": "symfony/process", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", @@ -2723,23 +2725,23 @@ }, { "name": "wikimedia/less.php", - "version": "1.8.1", + "version": "1.8.2", "source": { "type": "git", "url": "https://github.com/wikimedia/less.php.git", - "reference": "f0f7768f6fa8a9d2ac6a0274f6f477c72159bf9b" + "reference": "e238ad228d74b6ffd38209c799b34e9826909266" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/less.php/zipball/f0f7768f6fa8a9d2ac6a0274f6f477c72159bf9b", - "reference": "f0f7768f6fa8a9d2ac6a0274f6f477c72159bf9b", + "url": "https://api.github.com/repos/wikimedia/less.php/zipball/e238ad228d74b6ffd38209c799b34e9826909266", + "reference": "e238ad228d74b6ffd38209c799b34e9826909266", "shasum": "" }, "require": { - "php": ">=5.3" + "php": ">=7.2.9" }, "require-dev": { - "phpunit/phpunit": "~4.8.24" + "phpunit/phpunit": "7.5.14" }, "bin": [ "bin/lessc" @@ -2758,6 +2760,10 @@ "Apache-2.0" ], "authors": [ + { + "name": "Josh Schmidt", + "homepage": "https://github.com/oyejorge" + }, { "name": "Matt Agar", "homepage": "https://github.com/agar" @@ -2765,10 +2771,6 @@ { "name": "Martin Jantošovič", "homepage": "https://github.com/Mordred" - }, - { - "name": "Josh Schmidt", - "homepage": "https://github.com/oyejorge" } ], "description": "PHP port of the Javascript version of LESS http://lesscss.org (Originally maintained by Josh Schmidt)", @@ -2780,7 +2782,7 @@ "php", "stylesheet" ], - "time": "2019-01-19T01:01:33+00:00" + "time": "2019-11-06T18:30:11+00:00" }, { "name": "zendframework/zend-captcha", @@ -6159,16 +6161,16 @@ }, { "name": "doctrine/cache", - "version": "1.9.0", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "c15dcd24b756f9e52ea7c3ae8227354f3628f11a" + "reference": "89a5c76c39c292f7798f964ab3c836c3f8192a55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/c15dcd24b756f9e52ea7c3ae8227354f3628f11a", - "reference": "c15dcd24b756f9e52ea7c3ae8227354f3628f11a", + "url": "https://api.github.com/repos/doctrine/cache/zipball/89a5c76c39c292f7798f964ab3c836c3f8192a55", + "reference": "89a5c76c39c292f7798f964ab3c836c3f8192a55", "shasum": "" }, "require": { @@ -6238,7 +6240,7 @@ "riak", "xcache" ], - "time": "2019-11-11T10:31:52+00:00" + "time": "2019-11-15T14:31:57+00:00" }, { "name": "doctrine/inflector", @@ -6365,28 +6367,30 @@ }, { "name": "doctrine/lexer", - "version": "1.0.2", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8" + "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/1febd6c3ef84253d7c815bed85fc622ad207a9f8", - "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", + "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^7.2" }, "require-dev": { - "phpunit/phpunit": "^4.5" + "doctrine/coding-standard": "^6.0", + "phpstan/phpstan": "^0.11.8", + "phpunit/phpunit": "^8.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -6399,14 +6403,14 @@ "MIT" ], "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, { "name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com" }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com" @@ -6421,7 +6425,7 @@ "parser", "php" ], - "time": "2019-06-08T11:03:04+00:00" + "time": "2019-10-30T14:39:59+00:00" }, { "name": "facebook/webdriver", @@ -6615,16 +6619,16 @@ }, { "name": "fzaninotto/faker", - "version": "v1.8.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/fzaninotto/Faker.git", - "reference": "f72816b43e74063c8b10357394b6bba8cb1c10de" + "reference": "27a216cbe72327b2d6369fab721a5843be71e57d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/f72816b43e74063c8b10357394b6bba8cb1c10de", - "reference": "f72816b43e74063c8b10357394b6bba8cb1c10de", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/27a216cbe72327b2d6369fab721a5843be71e57d", + "reference": "27a216cbe72327b2d6369fab721a5843be71e57d", "shasum": "" }, "require": { @@ -6633,13 +6637,11 @@ "require-dev": { "ext-intl": "*", "phpunit/phpunit": "^4.8.35 || ^5.7", - "squizlabs/php_codesniffer": "^1.5" + "squizlabs/php_codesniffer": "^2.9.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.8-dev" - } + "branch-alias": [] }, "autoload": { "psr-4": { @@ -6661,7 +6663,7 @@ "faker", "fixtures" ], - "time": "2018-07-12T10:23:15+00:00" + "time": "2019-11-14T13:13:06+00:00" }, { "name": "grasmash/expander", @@ -7667,16 +7669,16 @@ }, { "name": "phpcompatibility/php-compatibility", - "version": "9.3.3", + "version": "9.3.4", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "1af08ca3861048a8bfb39d0405d0ac3e50ba2696" + "reference": "1f37659196e4f3113ea506a7efba201c52303bf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/1af08ca3861048a8bfb39d0405d0ac3e50ba2696", - "reference": "1af08ca3861048a8bfb39d0405d0ac3e50ba2696", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/1f37659196e4f3113ea506a7efba201c52303bf1", + "reference": "1f37659196e4f3113ea506a7efba201c52303bf1", "shasum": "" }, "require": { @@ -7721,7 +7723,7 @@ "phpcs", "standards" ], - "time": "2019-11-11T03:25:23+00:00" + "time": "2019-11-15T04:12:02+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -9242,7 +9244,7 @@ }, { "name": "symfony/browser-kit", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", @@ -9301,7 +9303,7 @@ }, { "name": "symfony/config", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/config.git", @@ -9365,7 +9367,7 @@ }, { "name": "symfony/dependency-injection", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", @@ -9438,7 +9440,7 @@ }, { "name": "symfony/dom-crawler", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", @@ -9499,16 +9501,16 @@ }, { "name": "symfony/http-foundation", - "version": "v2.8.50", + "version": "v2.8.52", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "746f8d3638bf46ee8b202e62f2b214c3d61fb06a" + "reference": "3929d9fe8148d17819ad0178c748b8d339420709" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/746f8d3638bf46ee8b202e62f2b214c3d61fb06a", - "reference": "746f8d3638bf46ee8b202e62f2b214c3d61fb06a", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/3929d9fe8148d17819ad0178c748b8d339420709", + "reference": "3929d9fe8148d17819ad0178c748b8d339420709", "shasum": "" }, "require": { @@ -9550,11 +9552,11 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2019-04-16T10:00:53+00:00" + "time": "2019-11-12T12:34:41+00:00" }, { "name": "symfony/options-resolver", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", @@ -9894,7 +9896,7 @@ }, { "name": "symfony/stopwatch", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", @@ -9944,7 +9946,7 @@ }, { "name": "symfony/yaml", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", From 8f7085f68245c79a0ee0291d55bf17a6246d09f9 Mon Sep 17 00:00:00 2001 From: Alexander Shkurko <coderimus@gmail.com> Date: Sat, 16 Nov 2019 08:50:41 +0200 Subject: [PATCH 147/595] Adjustments according review --- .../Model/Asset/Command/DeleteByPath.php | 4 ++-- .../Model/Keyword/Command/GetAssetKeywordsTest.php | 9 ++++----- .../Model/Keyword/Command/SaveAssetKeywordsTest.php | 12 ++++++------ .../Model/Keyword/Command/SaveAssetLinksTest.php | 10 ++++------ 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/app/code/Magento/MediaGallery/Model/Asset/Command/DeleteByPath.php b/app/code/Magento/MediaGallery/Model/Asset/Command/DeleteByPath.php index e387da6de6beb..c05a08149bfca 100644 --- a/app/code/Magento/MediaGallery/Model/Asset/Command/DeleteByPath.php +++ b/app/code/Magento/MediaGallery/Model/Asset/Command/DeleteByPath.php @@ -7,10 +7,10 @@ namespace Magento\MediaGallery\Model\Asset\Command; -use Magento\MediaGalleryApi\Model\Asset\Command\DeleteByPathInterface; use Magento\Framework\App\ResourceConnection; -use Magento\Framework\Exception\CouldNotDeleteException; use Magento\Framework\DB\Adapter\AdapterInterface; +use Magento\Framework\Exception\CouldNotDeleteException; +use Magento\MediaGalleryApi\Model\Asset\Command\DeleteByPathInterface; use Psr\Log\LoggerInterface; /** diff --git a/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/GetAssetKeywordsTest.php b/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/GetAssetKeywordsTest.php index 85030763303f0..2ccac4eac8343 100644 --- a/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/GetAssetKeywordsTest.php +++ b/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/GetAssetKeywordsTest.php @@ -41,18 +41,18 @@ class GetAssetKeywordsTest extends TestCase /** * @var LoggerInterface|MockObject */ - private $logger; + private $loggerMock; protected function setUp(): void { $this->resourceConnectionStub = $this->createMock(ResourceConnection::class); $this->assetKeywordFactoryStub = $this->createMock(KeywordInterfaceFactory::class); - $this->logger = $this->createMock(LoggerInterface::class); + $this->loggerMock = $this->createMock(LoggerInterface::class); $this->sut = new GetAssetKeywords( $this->resourceConnectionStub, $this->assetKeywordFactoryStub, - $this->logger + $this->loggerMock ); } @@ -62,7 +62,6 @@ protected function setUp(): void * @dataProvider casesProvider() * @param array $databaseQueryResult * @param int $expectedNumberOfFoundKeywords - * @throws NotFoundException */ public function testFind(array $databaseQueryResult, int $expectedNumberOfFoundKeywords): void { @@ -104,7 +103,7 @@ public function testNotFoundBecauseOfError(): void ->willThrowException((new \Exception())); $this->expectException(IntegrationException::class); - $this->logger->expects($this->once()) + $this->loggerMock->expects($this->once()) ->method('critical') ->willReturnSelf(); diff --git a/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/SaveAssetKeywordsTest.php b/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/SaveAssetKeywordsTest.php index 57397f2705278..a55c60024c08d 100644 --- a/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/SaveAssetKeywordsTest.php +++ b/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/SaveAssetKeywordsTest.php @@ -7,13 +7,13 @@ namespace Magento\MediaGallery\Test\Unit\Model\Keyword\Command; -use Magento\MediaGallery\Model\Keyword\Command\SaveAssetKeywords; -use Magento\MediaGallery\Model\Keyword\Command\SaveAssetLinks; use Magento\Framework\App\ResourceConnection; use Magento\Framework\DataObject; use Magento\Framework\DB\Adapter\Pdo\Mysql; use Magento\Framework\DB\Select; use Magento\Framework\Exception\CouldNotSaveException; +use Magento\MediaGallery\Model\Keyword\Command\SaveAssetKeywords; +use Magento\MediaGallery\Model\Keyword\Command\SaveAssetLinks; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -51,7 +51,7 @@ class SaveAssetKeywordsTest extends TestCase /** * @var LoggerInterface|MockObject */ - private $logger; + private $loggerMock; /** * SetUp @@ -64,12 +64,12 @@ public function setUp(): void ->disableOriginalConstructor() ->getMock(); $this->selectMock = $this->createMock(Select::class); - $this->logger = $this->createMock(LoggerInterface::class); + $this->loggerMock = $this->createMock(LoggerInterface::class); $this->sut = new SaveAssetKeywords( $this->resourceConnectionMock, $this->saveAssetLinksMock, - $this->logger + $this->loggerMock ); } @@ -114,7 +114,7 @@ public function testAssetNotSavingCausedByError(): void ->method('getConnection') ->willThrowException((new \Exception())); $this->expectException(CouldNotSaveException::class); - $this->logger->expects($this->once()) + $this->loggerMock->expects($this->once()) ->method('critical') ->willReturnSelf(); diff --git a/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/SaveAssetLinksTest.php b/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/SaveAssetLinksTest.php index 17916814eda95..2981c534586e2 100644 --- a/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/SaveAssetLinksTest.php +++ b/app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/SaveAssetLinksTest.php @@ -38,7 +38,7 @@ class SaveAssetLinksTest extends TestCase /** * @var LoggerInterface|MockObject */ - private $logger; + private $loggerMock; /** * Prepare test objects. @@ -47,11 +47,11 @@ public function setUp(): void { $this->connectionMock = $this->createMock(AdapterInterface::class); $this->resourceConnectionMock = $this->createMock(ResourceConnection::class); - $this->logger = $this->createMock(LoggerInterface::class); + $this->loggerMock = $this->createMock(LoggerInterface::class); $this->sut = new SaveAssetLinks( $this->resourceConnectionMock, - $this->logger + $this->loggerMock ); } @@ -63,8 +63,6 @@ public function setUp(): void * @param int $assetId * @param array $keywordIds * @param array $values - * - * @throws CouldNotSaveException */ public function testAssetKeywordsSave(int $assetId, array $keywordIds, array $values): void { @@ -105,7 +103,7 @@ public function testAssetNotSavingCausedByError(): void ->method('insertArray') ->willThrowException((new \Exception())); $this->expectException(CouldNotSaveException::class); - $this->logger->expects($this->once()) + $this->loggerMock->expects($this->once()) ->method('critical') ->willReturnSelf(); From 20a6a37db4baaeddc7dae246edcb5ecfb6de60e5 Mon Sep 17 00:00:00 2001 From: Alexander Shkurko <coderimus@gmail.com> Date: Sat, 16 Nov 2019 13:05:29 +0200 Subject: [PATCH 148/595] Adjustments according review --- .../Magento/MediaGallery/Plugin/Product/Gallery/Processor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/MediaGallery/Plugin/Product/Gallery/Processor.php b/app/code/Magento/MediaGallery/Plugin/Product/Gallery/Processor.php index 9144e77213179..3fbe4e3a91a2b 100644 --- a/app/code/Magento/MediaGallery/Plugin/Product/Gallery/Processor.php +++ b/app/code/Magento/MediaGallery/Plugin/Product/Gallery/Processor.php @@ -67,7 +67,7 @@ public function afterRemoveImage( try { $this->deleteMediaAssetByPath->execute($file); } catch (\Exception $exception) { - $this->logger->critical($$exception); + $this->logger->critical($exception); } return $result; From 094565fa335f20e3b77280c12090f5ad58dd0625 Mon Sep 17 00:00:00 2001 From: Dan Wallis <mrdanwallis@gmail.com> Date: Sat, 16 Nov 2019 14:55:14 +0000 Subject: [PATCH 149/595] Add right arrow to show some items have children --- .../Magento/backend/web/css/source/_actions.less | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/_actions.less b/app/design/adminhtml/Magento/backend/web/css/source/_actions.less index 886bbcc29a3b9..28912d873ae00 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/_actions.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/_actions.less @@ -444,6 +444,20 @@ button { > .action-menu-item { min-width: 100%; } + + &::after { + border-color: transparent transparent transparent #000; + border-style: solid; + border-width: 0.4rem 0 0.4rem 0.5rem; + content: ''; + height: 0; + margin-top: -0.2rem; + position: absolute; + right: 1rem; + top: 50%; + transition: all .2s linear; + width: 0; + } } } From 540b1340275b001aca44ce3d889a039614167a8e Mon Sep 17 00:00:00 2001 From: Mateusz Krzeszowiak <mateusz.krzeszowiak@creativestyle.pl> Date: Wed, 13 Nov 2019 18:10:05 +0100 Subject: [PATCH 150/595] Refactor JavaScript mixins module Fixes https://github.com/magento/magento2/issues/25586. --- lib/web/mage/requirejs/mixins.js | 152 ++++++++++++------------------- 1 file changed, 57 insertions(+), 95 deletions(-) diff --git a/lib/web/mage/requirejs/mixins.js b/lib/web/mage/requirejs/mixins.js index 77d98e0f81394..acda3ebf467d7 100644 --- a/lib/web/mage/requirejs/mixins.js +++ b/lib/web/mage/requirejs/mixins.js @@ -7,7 +7,25 @@ define('mixins', [ ], function (module) { 'use strict'; - var rjsMixins; + var contexts = require.s.contexts, + defContextName = '_', + defContext = contexts[defContextName], + unbundledContext = require.s.newContext('$'), + defaultConfig = defContext.config, + unbundledConfig = { + baseUrl: defaultConfig.baseUrl, + paths: defaultConfig.paths, + shim: defaultConfig.shim, + config: defaultConfig.config, + map: defaultConfig.map + }, + rjsMixins; + + /** + * Prepare a separate context where modules are not assigned to bundles + * so we are able to get their true path and corresponding mixins. + */ + unbundledContext.configure(unbundledConfig); /** * Checks if specified string contains @@ -50,14 +68,14 @@ define('mixins', [ /** * Extracts url (without baseUrl prefix) - * from a modules' name. + * from a module name ignoring the fact that it may be bundled. * * @param {String} name - Name, path or alias of a module. - * @param {Object} config - Contexts' configuartion. + * @param {Object} config - Context's configuartion. * @returns {String} */ function getPath(name, config) { - var url = require.toUrl(name); + var url = unbundledContext.require.toUrl(name); return removeBaseUrl(url, config); } @@ -73,11 +91,11 @@ define('mixins', [ } /** - * Iterativly calls mixins passing to them + * Iteratively calls mixins passing to them * current value of a 'target' parameter. * * @param {*} target - Value to be modified. - * @param {...Function} mixins + * @param {...Function} mixins - List of mixins to apply. * @returns {*} Modified 'target' value. */ function applyMixins(target) { @@ -94,8 +112,13 @@ define('mixins', [ /** * Loads specified module along with its' mixins. + * This method is called for each module defined with "mixins!" prefix + * in its name that was added by processNames method. * * @param {String} name - Module to be loaded. + * @param {Function} req - Local "require" function to use to load other modules. + * @param {Function} onLoad - A function to call with the value for name. + * @param {Object} config - RequireJS configuration object. */ load: function (name, req, onLoad, config) { var path = getPath(name, config), @@ -110,14 +133,14 @@ define('mixins', [ /** * Retrieves list of mixins associated with a specified module. * - * @param {String} path - Path to the module (without base url). + * @param {String} path - Path to the module (without base URL). * @returns {Array} An array of paths to mixins. */ getMixins: function (path) { var config = module.config() || {}, - mixins; + mixins; - // fix for when urlArgs is set + // Fix for when urlArgs is set. if (path.indexOf('?') !== -1) { path = path.substring(0, path.indexOf('?')); } @@ -131,7 +154,7 @@ define('mixins', [ /** * Checks if specified module has associated with it mixins. * - * @param {String} path - Path to the module (without base url). + * @param {String} path - Path to the module (without base URL). * @returns {Boolean} */ hasMixins: function (path) { @@ -139,11 +162,11 @@ define('mixins', [ }, /** - * Modifies provided names perpending to them + * Modifies provided names prepending to them * the 'mixins!' plugin prefix if it's necessary. * * @param {(Array|String)} names - Module names, paths or aliases. - * @param {Object} context - Current requirejs context. + * @param {Object} context - Current RequireJS context. * @returns {Array|String} */ processNames: function (names, context) { @@ -179,101 +202,40 @@ require([ ], function (mixins) { 'use strict'; - var originalRequire = window.require, - originalDefine = window.define, - contexts = originalRequire.s.contexts, - defContextName = '_', - hasOwn = Object.prototype.hasOwnProperty, - getLastInQueue; - - getLastInQueue = - '(function () {' + - 'var queue = globalDefQueue,' + - 'item = queue[queue.length - 1];' + - '' + - 'return item;' + - '})();'; - - /** - * Returns property of an object if - * it's not defined in it's prototype. - * - * @param {Object} obj - Object whose property should be retrieved. - * @param {String} prop - Name of the property. - * @returns {*} Value of the property or false. - */ - function getOwn(obj, prop) { - return hasOwn.call(obj, prop) && obj[prop]; - } - - /** - * Overrides global 'require' method adding to it dependencies modfication. - */ - window.require = function (deps, callback, errback, optional) { - var contextName = defContextName, - context, - config; - - if (!Array.isArray(deps) && typeof deps !== 'string') { - config = deps; - - if (Array.isArray(callback)) { - deps = callback; - callback = errback; - errback = optional; - } else { - deps = []; - } - } - - if (config && config.context) { - contextName = config.context; - } - - context = getOwn(contexts, contextName); - - if (!context) { - context = contexts[contextName] = require.s.newContext(contextName); - } - - if (config) { - context.configure(config); - } - - deps = mixins.processNames(deps, context); - - return context.require(deps, callback, errback); - }; + var contexts = require.s.contexts, + defContextName = '_', + defContext = contexts[defContextName], + originalContextRequire = defContext.require, + processNames = mixins.processNames; /** - * Overrides global 'define' method adding to it dependencies modfication. + * Wrap default context's require function which gets called every time + * module is requested using require call. The upside of this approach + * is that deps parameter is already normalized and guaranteed to be an array. */ - window.define = function (name, deps, callback) { // eslint-disable-line no-unused-vars - var context = getOwn(contexts, defContextName), - result = originalDefine.apply(this, arguments), - queueItem = require.exec(getLastInQueue), - lastDeps = queueItem && queueItem[1]; - - if (Array.isArray(lastDeps)) { - queueItem[1] = mixins.processNames(lastDeps, context); - } + defContext.require = function (deps, callback, errback) { + deps = processNames(deps, defContext); - return result; + return originalContextRequire(deps, callback, errback); }; /** * Copy properties of original 'require' method. */ - Object.keys(originalRequire).forEach(function (key) { - require[key] = originalRequire[key]; + Object.keys(originalContextRequire).forEach(function (key) { + defContext.require[key] = originalContextRequire[key]; }); /** - * Copy properties of original 'define' method. + * Wrap shift method from context's definitions queue. + * Items are added to the queue when a new module is defined and taken + * from it every time require call happens. */ - Object.keys(originalDefine).forEach(function (key) { - define[key] = originalDefine[key]; - }); + defContext.defQueue.shift = function () { + var queueItem = Array.prototype.shift.call(this); + + queueItem[1] = processNames(queueItem[1], defContext); - window.requirejs = window.require; + return queueItem; + }; }); From 3a7a953802482647e9030066c0f83e4b252f2127 Mon Sep 17 00:00:00 2001 From: Serhii Voloshkov <serhii.voloshkov@transoftgroup.com> Date: Mon, 18 Nov 2019 11:37:39 +0200 Subject: [PATCH 151/595] MC-19235: SalesRule improvement in TestFramework --- .../SalesRule/Model/GetSalesRuleByName.php | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 dev/tests/integration/framework/Magento/TestFramework/SalesRule/Model/GetSalesRuleByName.php diff --git a/dev/tests/integration/framework/Magento/TestFramework/SalesRule/Model/GetSalesRuleByName.php b/dev/tests/integration/framework/Magento/TestFramework/SalesRule/Model/GetSalesRuleByName.php new file mode 100644 index 0000000000000..db94d9ee97e04 --- /dev/null +++ b/dev/tests/integration/framework/Magento/TestFramework/SalesRule/Model/GetSalesRuleByName.php @@ -0,0 +1,48 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\TestFramework\SalesRule\Model; + +use Magento\Framework\Api\SearchCriteriaBuilder; +use Magento\SalesRule\Api\RuleRepositoryInterface; +use Magento\SalesRule\Api\Data\RuleInterface; + +/** + * Search and return Sales rule by name. + */ +class GetSalesRuleByName +{ + /** @var SearchCriteriaBuilder */ + private $searchCriteriaBuilder; + + /** @var RuleRepositoryInterface */ + private $ruleRepository; + + /** + * @param SearchCriteriaBuilder $searchCriteriaBuilder + * @param RuleRepositoryInterface $ruleRepository + */ + public function __construct(SearchCriteriaBuilder $searchCriteriaBuilder, RuleRepositoryInterface $ruleRepository) + { + $this->searchCriteriaBuilder = $searchCriteriaBuilder; + $this->ruleRepository = $ruleRepository; + } + + /** + * Return Sales Rule by name. + * + * @param string $name + * @return RuleInterface|null + */ + public function execute(string $name): ?RuleInterface + { + $searchCriteria = $this->searchCriteriaBuilder->addFilter('name', $name)->create(); + $salesRules = $this->ruleRepository->getList($searchCriteria)->getItems(); + + return array_shift($salesRules); + } +} From a7ffbd6842a0e4e243a014b8ceb8d197fca83f2e Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Mon, 18 Nov 2019 10:32:38 +0200 Subject: [PATCH 152/595] Move hide() method to if statement --- .../Ui/view/base/web/js/grid/columns/image-preview.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js index 57f16dc0c1a02..cf597f8d3a543 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js @@ -101,12 +101,13 @@ define([ show: function (record) { var img; - this.hide(); - if (record._rowIndex === this.visibleRecord()) { + this.hide(); + return; } + this.hide(); this.displayedRecord(record); this._selectRow(record.rowNumber || null); this.visibleRecord(record._rowIndex); From c9502a2995e0b3f475ebeca45f019d7597578daf Mon Sep 17 00:00:00 2001 From: Nikita Shcherbatykh <nikita.shcherbatykh@transoftgroup.com> Date: Mon, 18 Nov 2019 16:44:43 +0200 Subject: [PATCH 153/595] MC-22972: Credit memo without refunded shipment produces the negative Grand Total --- app/code/Magento/Sales/Model/Order/Creditmemo/Total/Tax.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Model/Order/Creditmemo/Total/Tax.php b/app/code/Magento/Sales/Model/Order/Creditmemo/Total/Tax.php index d4c2e7b2d6854..95dace13d832f 100644 --- a/app/code/Magento/Sales/Model/Order/Creditmemo/Total/Tax.php +++ b/app/code/Magento/Sales/Model/Order/Creditmemo/Total/Tax.php @@ -41,7 +41,7 @@ public function collect(\Magento\Sales\Model\Order\Creditmemo $creditmemo) $baseOrderItemTax = (double)$orderItem->getBaseTaxInvoiced(); $orderItemQty = (double)$orderItem->getQtyInvoiced(); - if ($orderItemTax && $orderItemQty) { + if ($orderItemQty) { /** * Check item tax amount */ From 21620c69868e3786148b3e8f5e0d0786a7f7540b Mon Sep 17 00:00:00 2001 From: Mateusz Krzeszowiak <mateusz.krzeszowiak@creativestyle.pl> Date: Mon, 18 Nov 2019 15:58:32 +0100 Subject: [PATCH 154/595] Add tests --- .../tests/lib/mage/requirejs/mixins.test.js | 148 ++++++++++++++++++ lib/web/mage/requirejs/mixins.js | 2 +- 2 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 dev/tests/js/jasmine/tests/lib/mage/requirejs/mixins.test.js diff --git a/dev/tests/js/jasmine/tests/lib/mage/requirejs/mixins.test.js b/dev/tests/js/jasmine/tests/lib/mage/requirejs/mixins.test.js new file mode 100644 index 0000000000000..3d85f77b87467 --- /dev/null +++ b/dev/tests/js/jasmine/tests/lib/mage/requirejs/mixins.test.js @@ -0,0 +1,148 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +/* eslint max-nested-callbacks: 0 */ +require.config({ + paths: { + 'mixins': 'mage/requirejs/mixins' + } +}); + +define(['rjsResolver', 'mixins'], function (resolver, mixins) { + 'use strict'; + + var context = { + config: {} + }; + + describe('mixins module', function () { + beforeEach(function (done) { + // Wait for all modules to be loaded so they don't interfere with testing. + resolver(function () { + done(); + }); + }); + + describe('processNames method', function () { + beforeEach(function () { + spyOn(mixins, 'processNames').and.callThrough(); + spyOn(mixins, 'hasMixins').and.callThrough(); + }); + + it('gets called when module is both required and defined', function (done) { + var name = 'tests/assets/mixins/defined-module', + dependencyName = 'tests/assets/mixins/defined-module-dependency'; + + define(dependencyName, [], function () {}); + define(name, [dependencyName], function () {}); + + require([name], function () { + expect(mixins.processNames.calls.argsFor(0)[0]).toEqual([]); + expect(mixins.processNames.calls.argsFor(1)[0]).toEqual([dependencyName]); + expect(mixins.processNames.calls.argsFor(2)[0]).toEqual([name]); + done(); + }); + }); + + it('keeps name intact when it already contains another plugin', function () { + mixins.hasMixins.and.returnValue(true); + + expect(mixins.processNames('plugin!module', context)).toBe('plugin!module'); + }); + + it('keeps name intact when it has no mixins', function () { + mixins.hasMixins.and.returnValue(false); + + expect(mixins.processNames('module', context)).toBe('module'); + }); + + it('keeps names intact when they have no mixins', function () { + mixins.hasMixins.and.returnValue(false); + + expect(mixins.processNames(['module'], context)).toEqual(['module']); + }); + + it('adds prefix to name when it has mixins', function () { + mixins.hasMixins.and.returnValue(true); + + expect(mixins.processNames('module', context)).toBe('mixins!module'); + }); + + it('adds prefix to name when it contains a relative path', function () { + mixins.hasMixins.and.returnValue(false); + + expect(mixins.processNames('./module', context)).toBe('mixins!./module'); + }); + + it('adds prefix to names when they contain a relative path', function () { + mixins.hasMixins.and.returnValue(false); + + expect(mixins.processNames(['./module'], context)).toEqual(['mixins!./module']); + }); + + it('adds prefix to names when they have mixins', function () { + mixins.hasMixins.and.returnValue(true); + + expect(mixins.processNames(['module'], context)).toEqual(['mixins!module']); + }); + }); + + describe('load method', function () { + it('is not called when module has mixins', function (done) { + var name = 'tests/assets/mixins/load-not-called'; + + spyOn(mixins, 'hasMixins').and.returnValue(false); + spyOn(mixins, 'load').and.callThrough(); + + define(name, [], function () {}); + + require([name], function () { + expect(mixins.load.calls.any()).toBe(false); + done(); + }); + }); + + it('is called when module has mixins', function (done) { + var name = 'tests/assets/mixins/load-called'; + + spyOn(mixins, 'hasMixins').and.returnValue(true); + spyOn(mixins, 'load').and.callThrough(); + + define(name, [], function () {}); + + require([name], function () { + expect(mixins.load.calls.mostRecent().args[0]).toEqual(name); + done(); + }); + }); + + it('applies mixins for loaded module', function (done) { + var name = 'tests/assets/mixins/mixins-applied', + mixinName = 'tests/assets/mixins/mixins-applied-ext'; + + spyOn(mixins, 'hasMixins').and.returnValue(true); + spyOn(mixins, 'load').and.callThrough(); + spyOn(mixins, 'getMixins').and.returnValue([mixinName]); + + define(name, [], function () { + return { value: 'original' }; + }); + + define(mixinName, [], function () { + return function(module) { + module.value = 'changed'; + + return module; + }; + }); + + require([name], function (module) { + expect(module.value).toBe('changed'); + done(); + }); + }); + }); + }); +}); diff --git a/lib/web/mage/requirejs/mixins.js b/lib/web/mage/requirejs/mixins.js index acda3ebf467d7..613605038f4b9 100644 --- a/lib/web/mage/requirejs/mixins.js +++ b/lib/web/mage/requirejs/mixins.js @@ -71,7 +71,7 @@ define('mixins', [ * from a module name ignoring the fact that it may be bundled. * * @param {String} name - Name, path or alias of a module. - * @param {Object} config - Context's configuartion. + * @param {Object} config - Context's configuration. * @returns {String} */ function getPath(name, config) { From 94f223bdac946f7a38342d42defb66ad1e23e5b1 Mon Sep 17 00:00:00 2001 From: Serhii Voloshkov <serhii.voloshkov@transoftgroup.com> Date: Mon, 18 Nov 2019 16:44:01 +0200 Subject: [PATCH 155/595] MC-19235: Quote improvement in TestFramework --- .../Quote/Model/GetQuoteByReservedOrderId.php | 48 ++++++++++++++++++ .../quote_for_customer_and_custom_store.php | 49 +++++++++++++++++++ ...for_customer_and_custom_store_rollback.php | 29 +++++++++++ 3 files changed, 126 insertions(+) create mode 100644 dev/tests/integration/framework/Magento/TestFramework/Quote/Model/GetQuoteByReservedOrderId.php create mode 100644 dev/tests/integration/testsuite/Magento/Quote/_files/quote_for_customer_and_custom_store.php create mode 100644 dev/tests/integration/testsuite/Magento/Quote/_files/quote_for_customer_and_custom_store_rollback.php diff --git a/dev/tests/integration/framework/Magento/TestFramework/Quote/Model/GetQuoteByReservedOrderId.php b/dev/tests/integration/framework/Magento/TestFramework/Quote/Model/GetQuoteByReservedOrderId.php new file mode 100644 index 0000000000000..1d2a1a92fc128 --- /dev/null +++ b/dev/tests/integration/framework/Magento/TestFramework/Quote/Model/GetQuoteByReservedOrderId.php @@ -0,0 +1,48 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\TestFramework\Quote\Model; + +use Magento\Framework\Api\SearchCriteriaBuilder; +use Magento\Quote\Api\CartRepositoryInterface; +use Magento\Quote\Api\Data\CartInterface; + +/** + * Search and return quote by reserved order id. + */ +class GetQuoteByReservedOrderId +{ + /** @var SearchCriteriaBuilder */ + private $searchCriteriaBuilder; + + /** @var CartRepositoryInterface */ + private $cartRepository; + + /** + * @param SearchCriteriaBuilder $searchCriteriaBuilder + * @param CartRepositoryInterface $cartRepository + */ + public function __construct(SearchCriteriaBuilder $searchCriteriaBuilder, CartRepositoryInterface $cartRepository) + { + $this->searchCriteriaBuilder = $searchCriteriaBuilder; + $this->cartRepository = $cartRepository; + } + + /** + * Return quote by reserved order id. + * + * @param string $reservedOrderId + * @return CartInterface|null + */ + public function execute(string $reservedOrderId): ?CartInterface + { + $searchCriteria = $this->searchCriteriaBuilder->addFilter('reserved_order_id', $reservedOrderId)->create(); + $quote = $this->cartRepository->getList($searchCriteria)->getItems(); + + return array_shift($quote); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Quote/_files/quote_for_customer_and_custom_store.php b/dev/tests/integration/testsuite/Magento/Quote/_files/quote_for_customer_and_custom_store.php new file mode 100644 index 0000000000000..6e1fba3db57cb --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Quote/_files/quote_for_customer_and_custom_store.php @@ -0,0 +1,49 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Quote\Api\CartRepositoryInterface; +use Magento\Quote\Model\Quote; +use Magento\Quote\Model\Quote\Address; +use Magento\Store\Api\StoreRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\ObjectManager; +use Magento\Customer\Api\CustomerRepositoryInterface; + +/** @var ObjectManager $objectManager */ +$objectManager = Bootstrap::getObjectManager(); + +$customer = $objectManager->get(CustomerRepositoryInterface::class)->get('customer@example.com'); +$store = $objectManager->get(StoreRepositoryInterface::class)->get('secondstore'); + +$addressData = include __DIR__ . '/../../Customer/Fixtures/address_data.php'; +/** @var Address $shippingAddress */ +$shippingAddress = $objectManager->create(Address::class, ['data' => $addressData[0]]); +$shippingAddress->setAddressType('shipping'); + +$billingAddress = clone $shippingAddress; +$billingAddress->setId(null) + ->setAddressType('billing'); + +/** @var Quote $quote */ +$quote = $objectManager->create( + Quote::class, + [ + 'data' => [ + 'customer_id' => $customer->getId(), + 'store_id' => $store->getId(), + 'reserved_order_id' => 'tsg-123456789', + 'is_active' => true, + 'is_multishipping' => false + ], + ] +); +$quote->setShippingAddress($shippingAddress) + ->setBillingAddress($billingAddress); + +/** @var CartRepositoryInterface $repository */ +$repository = $objectManager->get(CartRepositoryInterface::class); +$repository->save($quote); diff --git a/dev/tests/integration/testsuite/Magento/Quote/_files/quote_for_customer_and_custom_store_rollback.php b/dev/tests/integration/testsuite/Magento/Quote/_files/quote_for_customer_and_custom_store_rollback.php new file mode 100644 index 0000000000000..9d922b8bd0bd8 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Quote/_files/quote_for_customer_and_custom_store_rollback.php @@ -0,0 +1,29 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Framework\Registry; +use Magento\Quote\Api\CartRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Quote\Model\GetQuoteByReservedOrderId; + +/** @var ObjectManager $objectManager */ +$objectManager = Bootstrap::getObjectManager(); + +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +$quote = $objectManager->get(GetQuoteByReservedOrderId::class)->execute('tsg-123456789'); +if ($quote !== null) { + /** @var CartRepositoryInterface $cartRepository */ + $cartRepository = $objectManager->get(CartRepositoryInterface::class); + $cartRepository->delete($quote); +} + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); From 8eb66b564753fd3fab258189a368c05d771eb2a7 Mon Sep 17 00:00:00 2001 From: Mateusz Krzeszowiak <mateusz.krzeszowiak@creativestyle.pl> Date: Mon, 18 Nov 2019 15:59:36 +0100 Subject: [PATCH 156/595] Test more of a public api then internal behaviour --- .../tests/lib/mage/requirejs/mixins.test.js | 199 +++++++++++------- 1 file changed, 119 insertions(+), 80 deletions(-) diff --git a/dev/tests/js/jasmine/tests/lib/mage/requirejs/mixins.test.js b/dev/tests/js/jasmine/tests/lib/mage/requirejs/mixins.test.js index 3d85f77b87467..52374a24e8c68 100644 --- a/dev/tests/js/jasmine/tests/lib/mage/requirejs/mixins.test.js +++ b/dev/tests/js/jasmine/tests/lib/mage/requirejs/mixins.test.js @@ -4,6 +4,8 @@ */ /* eslint max-nested-callbacks: 0 */ +// jscs:disable jsDoc + require.config({ paths: { 'mixins': 'mage/requirejs/mixins' @@ -13,136 +15,173 @@ require.config({ define(['rjsResolver', 'mixins'], function (resolver, mixins) { 'use strict'; - var context = { - config: {} - }; - describe('mixins module', function () { beforeEach(function (done) { + spyOn(mixins, 'hasMixins').and.callThrough(); + spyOn(mixins, 'getMixins').and.callThrough(); + spyOn(mixins, 'load').and.callThrough(); + // Wait for all modules to be loaded so they don't interfere with testing. resolver(function () { done(); }); }); - describe('processNames method', function () { - beforeEach(function () { - spyOn(mixins, 'processNames').and.callThrough(); - spyOn(mixins, 'hasMixins').and.callThrough(); - }); + it('does not affect modules without mixins', function (done) { + var name = 'tests/assets/mixins/no-mixins', + mixinName = 'tests/assets/mixins/no-mixins-ext'; - it('gets called when module is both required and defined', function (done) { - var name = 'tests/assets/mixins/defined-module', - dependencyName = 'tests/assets/mixins/defined-module-dependency'; + mixins.hasMixins.and.returnValue(false); - define(dependencyName, [], function () {}); - define(name, [dependencyName], function () {}); + define(name, [], function () { + return { + value: 'original' + }; + }); + + define(mixinName, [], function () { + return function (module) { + module.value = 'changed'; - require([name], function () { - expect(mixins.processNames.calls.argsFor(0)[0]).toEqual([]); - expect(mixins.processNames.calls.argsFor(1)[0]).toEqual([dependencyName]); - expect(mixins.processNames.calls.argsFor(2)[0]).toEqual([name]); - done(); - }); + return module; + }; }); - it('keeps name intact when it already contains another plugin', function () { - mixins.hasMixins.and.returnValue(true); + require([name], function (module) { + expect(module.value).toBe('original'); - expect(mixins.processNames('plugin!module', context)).toBe('plugin!module'); + done(); }); + }); + + it('does not affect modules that are loaded with plugins', function (done) { + var name = 'plugin!tests/assets/mixins/no-mixins', + mixinName = 'tests/assets/mixins/no-mixins-ext'; - it('keeps name intact when it has no mixins', function () { - mixins.hasMixins.and.returnValue(false); + mixins.hasMixins.and.returnValue(true); + mixins.getMixins.and.returnValue([mixinName]); + + define('plugin', [], function () { + return { + load: function (module, req, onLoad) { + req(module, onLoad); + } + }; + }); - expect(mixins.processNames('module', context)).toBe('module'); + define(name, [], function () { + return { + value: 'original' + }; }); - it('keeps names intact when they have no mixins', function () { - mixins.hasMixins.and.returnValue(false); + define(mixinName, [], function () { + return function (module) { + module.value = 'changed'; - expect(mixins.processNames(['module'], context)).toEqual(['module']); + return module; + }; }); - it('adds prefix to name when it has mixins', function () { - mixins.hasMixins.and.returnValue(true); + require([name], function (module) { + expect(module.value).toBe('original'); - expect(mixins.processNames('module', context)).toBe('mixins!module'); + done(); }); + }); + + it('applies mixins for normal module with mixins', function (done) { + var name = 'tests/assets/mixins/mixins-applied', + mixinName = 'tests/assets/mixins/mixins-applied-ext'; - it('adds prefix to name when it contains a relative path', function () { - mixins.hasMixins.and.returnValue(false); + mixins.hasMixins.and.returnValue(true); + mixins.getMixins.and.returnValue([mixinName]); - expect(mixins.processNames('./module', context)).toBe('mixins!./module'); + define(name, [], function () { + return { + value: 'original' + }; }); - it('adds prefix to names when they contain a relative path', function () { - mixins.hasMixins.and.returnValue(false); + define(mixinName, [], function () { + return function (module) { + module.value = 'changed'; - expect(mixins.processNames(['./module'], context)).toEqual(['mixins!./module']); + return module; + }; }); - it('adds prefix to names when they have mixins', function () { - mixins.hasMixins.and.returnValue(true); + require([name], function (module) { + expect(module.value).toBe('changed'); - expect(mixins.processNames(['module'], context)).toEqual(['mixins!module']); + done(); }); }); - describe('load method', function () { - it('is not called when module has mixins', function (done) { - var name = 'tests/assets/mixins/load-not-called'; - - spyOn(mixins, 'hasMixins').and.returnValue(false); - spyOn(mixins, 'load').and.callThrough(); + it('applies mixins for module that is a dependency', function (done) { + var name = 'tests/assets/mixins/module-with-dependency', + dependencyName = 'tests/assets/mixins/dependency-module', + mixinName = 'tests/assets/mixins/dependency-module-ext'; - define(name, [], function () {}); + mixins.hasMixins.and.returnValue(true); + mixins.getMixins.and.returnValue([mixinName]); - require([name], function () { - expect(mixins.load.calls.any()).toBe(false); - done(); - }); + define(dependencyName, [], function () { + return { + value: 'original' + }; }); - it('is called when module has mixins', function (done) { - var name = 'tests/assets/mixins/load-called'; + define(name, [dependencyName], function (module) { + expect(module.value).toBe('changed'); - spyOn(mixins, 'hasMixins').and.returnValue(true); - spyOn(mixins, 'load').and.callThrough(); + done(); - define(name, [], function () {}); + return {}; + }); - require([name], function () { - expect(mixins.load.calls.mostRecent().args[0]).toEqual(name); - done(); - }); + define(mixinName, [], function () { + return function (module) { + module.value = 'changed'; + + return module; + }; }); - it('applies mixins for loaded module', function (done) { - var name = 'tests/assets/mixins/mixins-applied', - mixinName = 'tests/assets/mixins/mixins-applied-ext'; + require([name], function () {}); + }); - spyOn(mixins, 'hasMixins').and.returnValue(true); - spyOn(mixins, 'load').and.callThrough(); - spyOn(mixins, 'getMixins').and.returnValue([mixinName]); + it('applies mixins for module that is a relative dependency', function (done) { + var name = 'tests/assets/mixins/module-with-relative-dependency', + dependencyName = 'tests/assets/mixins/relative-module', + mixinName = 'tests/assets/mixins/relative-module-ext'; - define(name, [], function () { - return { value: 'original' }; - }); + mixins.hasMixins.and.returnValue(true); + mixins.getMixins.and.returnValue([mixinName]); - define(mixinName, [], function () { - return function(module) { - module.value = 'changed'; + define(dependencyName, [], function () { + return { + value: 'original' + }; + }); - return module; - }; - }); + define(name, ['./relative-module'], function (module) { + expect(module.value).toBe('changed'); - require([name], function (module) { - expect(module.value).toBe('changed'); - done(); - }); + done(); + + return {}; + }); + + define(mixinName, [], function () { + return function (module) { + module.value = 'changed'; + + return module; + }; }); + + require([name], function () {}); }); }); }); From 53515bdd1d06206f3f126254aaa719abbbc2e8b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Corr=C3=AAa=20Gomes?= <rafaelcgstz@gmail.com> Date: Mon, 18 Nov 2019 15:10:36 -0300 Subject: [PATCH 157/595] Telephone Widget > Template > Removing this and helper --- .../view/frontend/templates/widget/telephone.phtml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Customer/view/frontend/templates/widget/telephone.phtml b/app/code/Magento/Customer/view/frontend/templates/widget/telephone.phtml index c444a15705909..4c3432233189b 100644 --- a/app/code/Magento/Customer/view/frontend/templates/widget/telephone.phtml +++ b/app/code/Magento/Customer/view/frontend/templates/widget/telephone.phtml @@ -14,18 +14,14 @@ </span> </label> <div class="control"> - <?php - $_validationClass = $block->escapeHtmlAttr( - $this->helper(\Magento\Customer\Helper\Address::class) - ->getAttributeValidationClass('telephone') - ); - ?> <input type="text" name="telephone" id="telephone" value="<?= $block->escapeHtmlAttr($block->getTelephone()) ?>" title="<?= $block->escapeHtmlAttr(__('Phone Number')) ?>" - class="input-text <?= $_validationClass ?: '' ?>" + class="input-text <?= $block->escapeHtmlAttr( + $block->getAttributeValidationClass('telephone') + ) ?>" > </div> </div> From 944ebbeb0fd720be4223e9f4e4b4de5e80e160d4 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Mon, 18 Nov 2019 14:11:07 -0600 Subject: [PATCH 158/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- .../Catalog/Model/Indexer/Category/Product/Action/Rows.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php b/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php index 7f4b12e0d8235..de8dc350a3c4c 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php @@ -85,6 +85,7 @@ public function __construct( * @param int[] $entityIds * @param bool $useTempTable * @return $this + * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function execute(array $entityIds = [], $useTempTable = false) { From 6defcedcbf47d4c8f5ce11a6c97252856e306b4f Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Mon, 18 Nov 2019 14:46:54 -0600 Subject: [PATCH 159/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- .../Catalog/Observer/CategoryProductIndexer.php | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/app/code/Magento/Catalog/Observer/CategoryProductIndexer.php b/app/code/Magento/Catalog/Observer/CategoryProductIndexer.php index bdee84762cac2..ca87efaa87490 100644 --- a/app/code/Magento/Catalog/Observer/CategoryProductIndexer.php +++ b/app/code/Magento/Catalog/Observer/CategoryProductIndexer.php @@ -8,7 +8,6 @@ namespace Magento\Catalog\Observer; use Magento\Catalog\Model\Indexer\Category\Product\Processor; -use Magento\Catalog\Model\Indexer\Category\Flat\State as FlatState; use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; @@ -22,21 +21,12 @@ class CategoryProductIndexer implements ObserverInterface */ private $processor; - /** - * @var FlatState - */ - private $flatState; - /** * @param Processor $processor - * @param FlatState $flatState */ - public function __construct( - Processor $processor, - FlatState $flatState - ) { + public function __construct(Processor $processor) + { $this->processor = $processor; - $this->flatState = $flatState; } /** @@ -45,7 +35,7 @@ public function __construct( public function execute(Observer $observer): void { $productIds = $observer->getEvent()->getProductIds(); - if (!empty($productIds) && $this->processor->isIndexerScheduled() && $this->flatState->isFlatEnabled()) { + if (!empty($productIds) && $this->processor->isIndexerScheduled()) { $this->processor->markIndexerAsInvalid(); } } From 5be08d3345a79f5a6d8f62347c5da5ff4e20900a Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Mon, 18 Nov 2019 15:34:37 -0600 Subject: [PATCH 160/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- .../Elasticsearch/Controller/Adminhtml/Category/SaveTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dev/tests/integration/testsuite/Magento/Elasticsearch/Controller/Adminhtml/Category/SaveTest.php b/dev/tests/integration/testsuite/Magento/Elasticsearch/Controller/Adminhtml/Category/SaveTest.php index b505e311b9ed0..6e21dfcab6a89 100644 --- a/dev/tests/integration/testsuite/Magento/Elasticsearch/Controller/Adminhtml/Category/SaveTest.php +++ b/dev/tests/integration/testsuite/Magento/Elasticsearch/Controller/Adminhtml/Category/SaveTest.php @@ -78,6 +78,11 @@ public function testExecute() self::equalTo(['You saved the category.']), MessageInterface::TYPE_SUCCESS ); + + $fulltextIndexer = $this->getIndexer(FulltextIndexer::INDEXER_ID); + self::assertTrue($fulltextIndexer->isInvalid(), 'Fulltext indexer should be invalidated.'); + $categoryIndexer = $this->getIndexer(CategoryIndexer::INDEXER_ID); + self::assertTrue($categoryIndexer->isInvalid(), 'Category indexer should be invalidated.'); } /** From 919c8e4bddd06d174a18f7c9479b191939791e5a Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Mon, 18 Nov 2019 16:23:35 -0600 Subject: [PATCH 161/595] MC-21948: Products index data delete process fires before indexation instead of right before insert indexed data to index tables during partial reindex --- .../Catalog/Model/Indexer/Category/Product/Action/Rows.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php b/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php index de8dc350a3c4c..5d81c1405efe0 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Rows.php @@ -5,11 +5,6 @@ */ namespace Magento\Catalog\Model\Indexer\Category\Product\Action; -/** - * Reindex multiple rows action. - * - * @package Magento\Catalog\Model\Indexer\Category\Product\Action - */ use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\Indexer\CacheContext; use Magento\Framework\Event\ManagerInterface as EventManagerInterface; From 8a4be0dba34b7895147faf1f72520ca6c2f0ef4d Mon Sep 17 00:00:00 2001 From: Oleksandr Dubovyk <odubovyk@magento.com> Date: Mon, 18 Nov 2019 17:01:56 -0600 Subject: [PATCH 162/595] MC-23192: 'Preview template' functionality places the whole email template into GET parameter - fixed --- .../Newsletter/Controller/Adminhtml/Template/Preview.php | 6 +++--- .../Newsletter/view/adminhtml/templates/template/edit.phtml | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Newsletter/Controller/Adminhtml/Template/Preview.php b/app/code/Magento/Newsletter/Controller/Adminhtml/Template/Preview.php index 9fd9f4335b5c5..784a62f86b145 100644 --- a/app/code/Magento/Newsletter/Controller/Adminhtml/Template/Preview.php +++ b/app/code/Magento/Newsletter/Controller/Adminhtml/Template/Preview.php @@ -6,12 +6,12 @@ */ namespace Magento\Newsletter\Controller\Adminhtml\Template; -use Magento\Framework\App\Action\HttpGetActionInterface; +use Magento\Framework\App\Action\HttpPostActionInterface; /** * View a rendered template. */ -class Preview extends \Magento\Newsletter\Controller\Adminhtml\Template implements HttpGetActionInterface +class Preview extends \Magento\Newsletter\Controller\Adminhtml\Template implements HttpPostActionInterface { /** * Preview Newsletter template @@ -25,7 +25,7 @@ public function execute() $data = $this->getRequest()->getParams(); $isEmptyRequestData = empty($data) || !isset($data['id']); $isEmptyPreviewData = !$this->_getSession()->hasPreviewData() || empty($this->_getSession()->getPreviewData()); - + if ($isEmptyRequestData && $isEmptyPreviewData) { $this->_forward('noroute'); return $this; diff --git a/app/code/Magento/Newsletter/view/adminhtml/templates/template/edit.phtml b/app/code/Magento/Newsletter/view/adminhtml/templates/template/edit.phtml index c49a5c61a7172..abc56070b6892 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/templates/template/edit.phtml +++ b/app/code/Magento/Newsletter/view/adminhtml/templates/template/edit.phtml @@ -17,12 +17,13 @@ use Magento\Framework\App\TemplateTypesInterface; </div> <?= /* @noEscape */ $block->getForm() ?> </form> -<form action="<?= $block->escapeUrl($block->getPreviewUrl()) ?>" method="get" id="newsletter_template_preview_form" target="_blank"> +<form action="<?= $block->escapeUrl($block->getPreviewUrl()) ?>" method="post" id="newsletter_template_preview_form" target="_blank"> <div class="no-display"> <input type="hidden" id="preview_type" name="type" value="<?= /* @noEscape */ $block->isTextType() ? 1 : 2 ?>" /> <input type="hidden" id="preview_text" name="text" value="" /> <input type="hidden" id="preview_styles" name="styles" value="" /> <input type="hidden" id="preview_id" name="id" value="" /> + <input type="hidden" name="form_key" value="<?= $block->escapeHtmlAttr($block->getFormKey()) ?>" > </div> </form> <script> From d1aaf740493b4d57bcf6710e2433a0584d0164a2 Mon Sep 17 00:00:00 2001 From: Serhii Voloshkov <serhii.voloshkov@transoftgroup.com> Date: Tue, 19 Nov 2019 10:47:58 +0200 Subject: [PATCH 163/595] MC-19235: Quote improvement in TestFramework --- .../TestFramework/Quote/Model/GetQuoteByReservedOrderId.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/tests/integration/framework/Magento/TestFramework/Quote/Model/GetQuoteByReservedOrderId.php b/dev/tests/integration/framework/Magento/TestFramework/Quote/Model/GetQuoteByReservedOrderId.php index 1d2a1a92fc128..bd83bc595692f 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Quote/Model/GetQuoteByReservedOrderId.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Quote/Model/GetQuoteByReservedOrderId.php @@ -41,8 +41,8 @@ public function __construct(SearchCriteriaBuilder $searchCriteriaBuilder, CartRe public function execute(string $reservedOrderId): ?CartInterface { $searchCriteria = $this->searchCriteriaBuilder->addFilter('reserved_order_id', $reservedOrderId)->create(); - $quote = $this->cartRepository->getList($searchCriteria)->getItems(); + $quotes = $this->cartRepository->getList($searchCriteria)->getItems(); - return array_shift($quote); + return array_shift($quotes); } } From fa416396e8fa14426077bc0de5150d1ca8d9fc45 Mon Sep 17 00:00:00 2001 From: Serhiy Yelahin <serhiy.yelahin@transoftgroup.com> Date: Tue, 19 Nov 2019 10:53:47 +0200 Subject: [PATCH 164/595] MC-23193: Tier Prices error on product update --- .../Product/Attribute/Backend/TierPrice/UpdateHandler.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/UpdateHandler.php b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/UpdateHandler.php index f1943bc108878..0daa1dfb5c8eb 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/UpdateHandler.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/UpdateHandler.php @@ -96,12 +96,7 @@ public function execute($entity, $arguments = []) $productId = (int)$entity->getData($identifierField); // prepare original data to compare - $origPrices = []; - $originalId = $entity->getOrigData($identifierField); - if (empty($originalId) || $entity->getData($identifierField) == $originalId) { - $origPrices = $entity->getOrigData($attribute->getName()); - } - + $origPrices = $entity->getOrigData($attribute->getName()); $old = $this->prepareOldTierPriceToCompare($origPrices); // prepare data for save $new = $this->prepareNewDataForSave($priceRows, $isGlobal); From a9ca041d177e32745e24f0de4e68ed64985a17e3 Mon Sep 17 00:00:00 2001 From: Viktor Sevch <svitja@ukr.net> Date: Tue, 19 Nov 2019 12:42:18 +0200 Subject: [PATCH 165/595] MC-18057: Product doesn'y match by "Date" attribute condition --- .../product_simple_with_date_attribute.php | 40 +++++++++++++++++-- ...ct_simple_with_date_attribute_rollback.php | 12 ++++++ 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_date_attribute.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_date_attribute.php index 2c78d9b74f969..46745c213845a 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_date_attribute.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_date_attribute.php @@ -10,10 +10,11 @@ $attribute->setData('is_used_for_promo_rules', 1); -/** @var $product \Magento\Catalog\Model\Product */ -$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Catalog\Model\Product::class); +/** @var ProductFactory $productFactory */ +$productFactory = $objectManager->get(Magento\Catalog\Model\ProductFactory::class); +$product = $productFactory->create(); $product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE) - ->setAttributeSetId(4) + ->setAttributeSetId($installer->getAttributeSetId('catalog_product', 'Default')) ->setWebsiteIds([1]) ->setName('Simple Product with date') ->setSku('simple_with_date') @@ -24,4 +25,37 @@ ->setCategoryIds([2]) ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1]) ->setDateAttribute(date('Y-m-d')) + ->setUrlKey('simple_with_date') + ->save(); + +$product2 = $productFactory->create(); +$product2->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE) + ->setAttributeSetId($installer->getAttributeSetId('catalog_product', 'Default')) + ->setWebsiteIds([1]) + ->setName('Simple Product with date -1') + ->setSku('simple_with_date2') + ->setPrice(10) + ->setDescription('Description with <b>html tag</b>') + ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH) + ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED) + ->setCategoryIds([2]) + ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1]) + ->setDateAttribute(date('Y-m-d', strtotime(date('Y-m-d') . '-1 day'))) + ->setUrlKey('simple_with_date2') + ->save(); + +$product3 = $productFactory->create(); +$product3->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE) + ->setAttributeSetId($installer->getAttributeSetId('catalog_product', 'Default')) + ->setWebsiteIds([1]) + ->setName('Simple Product with date +1') + ->setSku('simple_with_date3') + ->setPrice(10) + ->setDescription('Description with <b>html tag</b>') + ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH) + ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED) + ->setCategoryIds([2]) + ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1]) + ->setDateAttribute(date('Y-m-d', strtotime(date('Y-m-d') . '+1 day'))) + ->setUrlKey('simple_with_date3') ->save(); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_date_attribute_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_date_attribute_rollback.php index 0f155926dd6db..da61eb1d2332b 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_date_attribute_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_date_attribute_rollback.php @@ -26,6 +26,18 @@ } catch (NoSuchEntityException $e) { } +try { + $product = $productRepository->get('simple_with_date2', false, null, true); + $productRepository->delete($product); +} catch (NoSuchEntityException $e) { +} + +try { + $product = $productRepository->get('simple_with_date3', false, null, true); + $productRepository->delete($product); +} catch (NoSuchEntityException $e) { +} + $registry->unregister('isSecureArea'); $registry->register('isSecureArea', false); From f2bfadee7b32e72800025f3f74e5ee7b97e7f6db Mon Sep 17 00:00:00 2001 From: Serhiy Yelahin <serhiy.yelahin@transoftgroup.com> Date: Tue, 19 Nov 2019 13:37:11 +0200 Subject: [PATCH 166/595] MC-23193: Tier Prices error on product update --- .../Model/Attribute/Backend/TierPrice/UpdateHandlerTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Backend/TierPrice/UpdateHandlerTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Backend/TierPrice/UpdateHandlerTest.php index cce00c50d37af..fde793d5c5f89 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Backend/TierPrice/UpdateHandlerTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Attribute/Backend/TierPrice/UpdateHandlerTest.php @@ -108,6 +108,7 @@ public function testExecute(): void ]; $linkField = 'entity_id'; $productId = 10; + $originalProductId = 11; /** @var \PHPUnit_Framework_MockObject_MockObject $product */ $product = $this->getMockBuilder(\Magento\Catalog\Api\Data\ProductInterface::class) @@ -124,7 +125,7 @@ public function testExecute(): void ->willReturnMap( [ ['tier_price', $originalTierPrices], - ['entity_id', $productId] + ['entity_id', $originalProductId] ] ); $product->expects($this->atLeastOnce())->method('getStoreId')->willReturn(0); From cb1b7749c0520cb45cd47ec1560c62a06dbb172c Mon Sep 17 00:00:00 2001 From: nathanm <nathanm@fisheyehq.com> Date: Tue, 19 Nov 2019 15:13:17 +0000 Subject: [PATCH 167/595] Add escaping on meta properties for open graph Fixes issue where double quotes can bleed though the html attribute --- .../frontend/templates/product/view/opengraph/general.phtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/view/opengraph/general.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/view/opengraph/general.phtml index eb2bde647f9b1..4d4a34c6239d4 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/view/opengraph/general.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/view/opengraph/general.phtml @@ -9,11 +9,11 @@ <meta property="og:type" content="product" /> <meta property="og:title" - content="<?= /* @noEscape */ $block->stripTags($block->getProduct()->getName()) ?>" /> + content="<?= $block->escapeHtmlAttr($block->stripTags($block->getProduct()->getName())) ?>" /> <meta property="og:image" content="<?= $block->escapeUrl($block->getImage($block->getProduct(), 'product_base_image')->getImageUrl()) ?>" /> <meta property="og:description" - content="<?= /* @noEscape */ $block->stripTags($block->getProduct()->getShortDescription()) ?>" /> + content="<?= $block->escapeHtmlAttr($block->stripTags($block->getProduct()->getShortDescription())) ?>" /> <meta property="og:url" content="<?= $block->escapeUrl($block->getProduct()->getProductUrl()) ?>" /> <?php if ($priceAmount = $block->getProduct()->getPriceInfo()->getPrice(\Magento\Catalog\Pricing\Price\FinalPrice::PRICE_CODE)->getAmount()) :?> <meta property="product:price:amount" content="<?= $block->escapeHtmlAttr($priceAmount) ?>"/> From 95cf76c4aa42b5125b563adb34af565f5b4ef42a Mon Sep 17 00:00:00 2001 From: Alastair Mucklow <amucklow@strangerpixel.com> Date: Tue, 19 Nov 2019 16:00:37 +0000 Subject: [PATCH 168/595] Uses > Used for Yes/No column --- .../Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Grid.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Grid.php b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Grid.php index bf92e21827a01..b021b3e539a9d 100644 --- a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Grid.php +++ b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Grid.php @@ -100,7 +100,7 @@ protected function _prepareColumns() $this->addColumn( 'used', [ - 'header' => __('Uses'), + 'header' => __('Used'), 'index' => 'times_used', 'width' => '100', 'type' => 'options', From 8d9e1991789089c04162d5367db929e06227f3ce Mon Sep 17 00:00:00 2001 From: Oleksandr Gorkun <ogorkun@magento.com> Date: Tue, 19 Nov 2019 12:49:51 -0600 Subject: [PATCH 169/595] MC-19926: Implement CSP --- .../Collector/Config/FetchPolicyReader.php | 3 +- .../Collector/CspWhitelistXmlCollector.php | 4 +- .../Csp/Model/Collector/FetchPolicyMerger.php | 47 +++++ .../Csp/Model/Collector/FlagPolicyMerger.php | 33 ++++ .../Csp/Model/Collector/MergerInterface.php | 34 ++++ .../Collector/PluginTypesPolicyMerger.php | 35 ++++ .../Model/Collector/SandboxPolicyMerger.php | 47 +++++ .../Csp/Model/CompositePolicyCollector.php | 42 ++++- .../Magento/Csp/Model/Policy/FetchPolicy.php | 23 ++- app/code/Magento/Csp/etc/config.xml | 21 +++ app/code/Magento/Csp/etc/di.xml | 6 + .../Model/Collector/ConfigCollectorTest.php | 3 +- .../Model/CompositePolicyCollectorTest.php | 177 ++++++++++++++++++ .../Csp/Model/Mode/ConfigManagerTest.php | 86 +++++++++ .../SimplePolicyHeaderRendererTest.php | 21 ++- .../HTTP/PhpEnvironment/Response.php | 36 +++- 16 files changed, 600 insertions(+), 18 deletions(-) create mode 100644 app/code/Magento/Csp/Model/Collector/FetchPolicyMerger.php create mode 100644 app/code/Magento/Csp/Model/Collector/FlagPolicyMerger.php create mode 100644 app/code/Magento/Csp/Model/Collector/MergerInterface.php create mode 100644 app/code/Magento/Csp/Model/Collector/PluginTypesPolicyMerger.php create mode 100644 app/code/Magento/Csp/Model/Collector/SandboxPolicyMerger.php create mode 100644 app/code/Magento/Csp/etc/config.xml create mode 100644 dev/tests/integration/testsuite/Magento/Csp/Model/CompositePolicyCollectorTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Csp/Model/Mode/ConfigManagerTest.php diff --git a/app/code/Magento/Csp/Model/Collector/Config/FetchPolicyReader.php b/app/code/Magento/Csp/Model/Collector/Config/FetchPolicyReader.php index 8728755c594e6..8699d9588b909 100644 --- a/app/code/Magento/Csp/Model/Collector/Config/FetchPolicyReader.php +++ b/app/code/Magento/Csp/Model/Collector/Config/FetchPolicyReader.php @@ -30,7 +30,8 @@ public function read(string $id, $value): PolicyInterface !empty($value['eval']), [], [], - !empty($value['dynamic']) + !empty($value['dynamic']), + !empty($value['event_handlers']) ); } diff --git a/app/code/Magento/Csp/Model/Collector/CspWhitelistXmlCollector.php b/app/code/Magento/Csp/Model/Collector/CspWhitelistXmlCollector.php index f4a75f120dab9..9f19a5299c063 100644 --- a/app/code/Magento/Csp/Model/Collector/CspWhitelistXmlCollector.php +++ b/app/code/Magento/Csp/Model/Collector/CspWhitelistXmlCollector.php @@ -47,7 +47,9 @@ public function collect(array $defaultPolicies = []): array false, false, [], - $values['hashes'] + $values['hashes'], + false, + false ); } diff --git a/app/code/Magento/Csp/Model/Collector/FetchPolicyMerger.php b/app/code/Magento/Csp/Model/Collector/FetchPolicyMerger.php new file mode 100644 index 0000000000000..2a8f6c278b078 --- /dev/null +++ b/app/code/Magento/Csp/Model/Collector/FetchPolicyMerger.php @@ -0,0 +1,47 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Collector; + +use Magento\Csp\Api\Data\PolicyInterface; +use Magento\Csp\Model\Policy\FetchPolicy; + +/** + * @inheritDoc + */ +class FetchPolicyMerger implements MergerInterface +{ + /** + * @inheritDoc + */ + public function merge(PolicyInterface $policy1, PolicyInterface $policy2): PolicyInterface + { + /** @var FetchPolicy $policy1 */ + /** @var FetchPolicy $policy2 */ + return new FetchPolicy( + $policy1->getId(), + $policy1->isNoneAllowed() || $policy2->isNoneAllowed(), + array_unique(array_merge($policy1->getHostSources(), $policy2->getHostSources())), + array_unique(array_merge($policy1->getSchemeSources(), $policy2->getSchemeSources())), + $policy1->isSelfAllowed() || $policy2->isSelfAllowed(), + $policy1->isInlineAllowed() || $policy2->isInlineAllowed(), + $policy1->isEvalAllowed() || $policy2->isEvalAllowed(), + array_unique(array_merge($policy1->getNonceValues(), $policy2->getNonceValues())), + array_merge($policy1->getHashes(), $policy2->getHashes()), + $policy1->isDynamicAllowed() || $policy2->isDynamicAllowed(), + $policy1->areEventHandlersAllowed() || $policy2->areEventHandlersAllowed() + ); + } + + /** + * @inheritDoc + */ + public function canMerge(PolicyInterface $policy1, PolicyInterface $policy2): bool + { + return ($policy1 instanceof FetchPolicy) && ($policy2 instanceof FetchPolicy); + } +} diff --git a/app/code/Magento/Csp/Model/Collector/FlagPolicyMerger.php b/app/code/Magento/Csp/Model/Collector/FlagPolicyMerger.php new file mode 100644 index 0000000000000..a734feeab1281 --- /dev/null +++ b/app/code/Magento/Csp/Model/Collector/FlagPolicyMerger.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Collector; + +use Magento\Csp\Api\Data\PolicyInterface; +use Magento\Csp\Model\Policy\FlagPolicy; + +/** + * @inheritDoc + */ +class FlagPolicyMerger implements MergerInterface +{ + /** + * @inheritDoc + */ + public function merge(PolicyInterface $policy1, PolicyInterface $policy2): PolicyInterface + { + return $policy1; + } + + /** + * @inheritDoc + */ + public function canMerge(PolicyInterface $policy1, PolicyInterface $policy2): bool + { + return ($policy1 instanceof FlagPolicy) && ($policy2 instanceof FlagPolicy); + } +} diff --git a/app/code/Magento/Csp/Model/Collector/MergerInterface.php b/app/code/Magento/Csp/Model/Collector/MergerInterface.php new file mode 100644 index 0000000000000..4a8d78e7b8f4b --- /dev/null +++ b/app/code/Magento/Csp/Model/Collector/MergerInterface.php @@ -0,0 +1,34 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Collector; + +use Magento\Csp\Api\Data\PolicyInterface; + +/** + * Merges policies with the same ID in order to have only 1 policy DTO-per-policy. + */ +interface MergerInterface +{ + /** + * Merges 2 found policies into 1. + * + * @param PolicyInterface $policy1 + * @param PolicyInterface $policy2 + * @return PolicyInterface + */ + public function merge(PolicyInterface $policy1, PolicyInterface $policy2): PolicyInterface; + + /** + * Whether current merger can merge given 2 policies. + * + * @param PolicyInterface $policy1 + * @param PolicyInterface $policy2 + * @return bool + */ + public function canMerge(PolicyInterface $policy1, PolicyInterface $policy2): bool; +} diff --git a/app/code/Magento/Csp/Model/Collector/PluginTypesPolicyMerger.php b/app/code/Magento/Csp/Model/Collector/PluginTypesPolicyMerger.php new file mode 100644 index 0000000000000..58f2128657788 --- /dev/null +++ b/app/code/Magento/Csp/Model/Collector/PluginTypesPolicyMerger.php @@ -0,0 +1,35 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Collector; + +use Magento\Csp\Api\Data\PolicyInterface; +use Magento\Csp\Model\Policy\PluginTypesPolicy; + +/** + * @inheritDoc + */ +class PluginTypesPolicyMerger implements MergerInterface +{ + /** + * @inheritDoc + */ + public function merge(PolicyInterface $policy1, PolicyInterface $policy2): PolicyInterface + { + /** @var PluginTypesPolicy $policy1 */ + /** @var PluginTypesPolicy $policy2 */ + return new PluginTypesPolicy(array_unique(array_merge($policy1->getTypes(), $policy2->getTypes()))); + } + + /** + * @inheritDoc + */ + public function canMerge(PolicyInterface $policy1, PolicyInterface $policy2): bool + { + return ($policy1 instanceof PluginTypesPolicy) && ($policy2 instanceof PluginTypesPolicy); + } +} diff --git a/app/code/Magento/Csp/Model/Collector/SandboxPolicyMerger.php b/app/code/Magento/Csp/Model/Collector/SandboxPolicyMerger.php new file mode 100644 index 0000000000000..1c398a4cfd477 --- /dev/null +++ b/app/code/Magento/Csp/Model/Collector/SandboxPolicyMerger.php @@ -0,0 +1,47 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Collector; + +use Magento\Csp\Api\Data\PolicyInterface; +use Magento\Csp\Model\Policy\SandboxPolicy; + +/** + * @inheritDoc + */ +class SandboxPolicyMerger implements MergerInterface +{ + /** + * @inheritDoc + */ + public function merge(PolicyInterface $policy1, PolicyInterface $policy2): PolicyInterface + { + /** @var SandboxPolicy $policy1 */ + /** @var SandboxPolicy $policy2 */ + return new SandboxPolicy( + $policy1->isFormAllowed() || $policy2->isFormAllowed(), + $policy1->isModalsAllowed() || $policy2->isModalsAllowed(), + $policy1->isOrientationLockAllowed() || $policy2->isOrientationLockAllowed(), + $policy1->isPointerLockAllowed() || $policy2->isPointerLockAllowed(), + $policy1->isPopupsAllowed() || $policy2->isPopupsAllowed(), + $policy1->isPopupsToEscapeSandboxAllowed() || $policy2->isPopupsToEscapeSandboxAllowed(), + $policy1->isPresentationAllowed() || $policy2->isPresentationAllowed(), + $policy1->isSameOriginAllowed() || $policy2->isSameOriginAllowed(), + $policy1->isScriptsAllowed() || $policy2->isScriptsAllowed(), + $policy1->isTopNavigationAllowed() || $policy2->isTopNavigationAllowed(), + $policy1->isTopNavigationByUserActivationAllowed() || $policy2->isTopNavigationByUserActivationAllowed() + ); + } + + /** + * @inheritDoc + */ + public function canMerge(PolicyInterface $policy1, PolicyInterface $policy2): bool + { + return ($policy1 instanceof SandboxPolicy) && ($policy2 instanceof SandboxPolicy); + } +} diff --git a/app/code/Magento/Csp/Model/CompositePolicyCollector.php b/app/code/Magento/Csp/Model/CompositePolicyCollector.php index 31da34960ea75..b775c91b4e1ef 100644 --- a/app/code/Magento/Csp/Model/CompositePolicyCollector.php +++ b/app/code/Magento/Csp/Model/CompositePolicyCollector.php @@ -7,7 +7,9 @@ namespace Magento\Csp\Model; +use Magento\Csp\Api\Data\PolicyInterface; use Magento\Csp\Api\PolicyCollectorInterface; +use Magento\Csp\Model\Collector\MergerInterface; /** * Delegates collecting to multiple collectors. @@ -19,12 +21,38 @@ class CompositePolicyCollector implements PolicyCollectorInterface */ private $collectors; + /** + * @var MergerInterface[] + */ + private $mergers; + /** * @param PolicyCollectorInterface[] $collectors + * @param MergerInterface[] $mergers */ - public function __construct(array $collectors) + public function __construct(array $collectors, array $mergers) { $this->collectors = $collectors; + $this->mergers = $mergers; + } + + /** + * Merge 2 policies with the same ID. + * + * @param PolicyInterface $policy1 + * @param PolicyInterface $policy2 + * @return PolicyInterface + * @throws \RuntimeException When failed to merge. + */ + private function merge(PolicyInterface $policy1, PolicyInterface $policy2): PolicyInterface + { + foreach ($this->mergers as $merger) { + if ($merger->canMerge($policy1, $policy2)) { + return $merger->merge($policy1, $policy2); + } + } + + throw new \RuntimeException(sprintf('Merge for policies #%s was not found', $policy1->getId())); } /** @@ -36,7 +64,17 @@ public function collect(array $defaultPolicies = []): array foreach ($this->collectors as $collector) { $collected = $collector->collect($collected); } + //Merging policies. + /** @var PolicyInterface[] $result */ + $result = []; + foreach ($collected as $policy) { + if (array_key_exists($policy->getId(), $result)) { + $result[$policy->getId()] = $this->merge($result[$policy->getId()], $policy); + } else { + $result[$policy->getId()] = $policy; + } + } - return $collected; + return array_values($result); } } diff --git a/app/code/Magento/Csp/Model/Policy/FetchPolicy.php b/app/code/Magento/Csp/Model/Policy/FetchPolicy.php index 76d17e3cb96c7..cb44c20ab2fd4 100644 --- a/app/code/Magento/Csp/Model/Policy/FetchPolicy.php +++ b/app/code/Magento/Csp/Model/Policy/FetchPolicy.php @@ -82,6 +82,11 @@ class FetchPolicy implements SimplePolicyInterface */ private $dynamicAllowed; + /** + * @var bool + */ + private $eventHandlersAllowed; + /** * @param string $id * @param bool $noneAllowed @@ -93,6 +98,7 @@ class FetchPolicy implements SimplePolicyInterface * @param string[] $nonceValues * @param string[] $hashValues * @param bool $dynamicAllowed + * @param bool $eventHandlersAllowed * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -105,7 +111,8 @@ public function __construct( bool $evalAllowed = false, array $nonceValues = [], array $hashValues = [], - bool $dynamicAllowed = false + bool $dynamicAllowed = false, + bool $eventHandlersAllowed = false ) { $this->id = $id; $this->noneAllowed = $noneAllowed; @@ -117,6 +124,7 @@ public function __construct( $this->nonceValues = array_unique($nonceValues); $this->hashes = $hashValues; $this->dynamicAllowed = $dynamicAllowed; + $this->eventHandlersAllowed = $eventHandlersAllowed; } /** @@ -213,6 +221,9 @@ public function getValue(): string if ($this->isDynamicAllowed()) { $sources[] = '\'strict-dynamic\''; } + if ($this->areEventHandlersAllowed()) { + $sources[] = '\'unsafe-hashes\''; + } foreach ($this->getNonceValues() as $nonce) { $sources[] = '\'nonce-' .base64_encode($nonce) .'\''; } @@ -257,4 +268,14 @@ public function isDynamicAllowed(): bool { return $this->dynamicAllowed; } + + /** + * Allows to whitelist event handlers (but not javascript: URLs) with hashes. + * + * @return bool + */ + public function areEventHandlersAllowed(): bool + { + return $this->eventHandlersAllowed; + } } diff --git a/app/code/Magento/Csp/etc/config.xml b/app/code/Magento/Csp/etc/config.xml new file mode 100644 index 0000000000000..e45f6b223ed22 --- /dev/null +++ b/app/code/Magento/Csp/etc/config.xml @@ -0,0 +1,21 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> + <default> + <csp> + <mode> + <storefront> + <report_only>1</report_only> + </storefront> + <admin> + <report_only>1</report_only> + </admin> + </mode> + </csp> + </default> +</config> diff --git a/app/code/Magento/Csp/etc/di.xml b/app/code/Magento/Csp/etc/di.xml index f18453c91791d..0804f6d579137 100644 --- a/app/code/Magento/Csp/etc/di.xml +++ b/app/code/Magento/Csp/etc/di.xml @@ -21,6 +21,12 @@ <item name="config" xsi:type="object">Magento\Csp\Model\Collector\ConfigCollector</item> <item name="csp_whitelist" xsi:type="object">Magento\Csp\Model\Collector\CspWhitelistXmlCollector</item> </argument> + <argument name="mergers" xsi:type="array"> + <item name="fetch" xsi:type="object">Magento\Csp\Model\Collector\FetchPolicyMerger</item> + <item name="flag" xsi:type="object">Magento\Csp\Model\Collector\FlagPolicyMerger</item> + <item name="plugins" xsi:type="object">Magento\Csp\Model\Collector\PluginTypesPolicyMerger</item> + <item name="sandbox" xsi:type="object">Magento\Csp\Model\Collector\SandboxPolicyMerger</item> + </argument> </arguments> </type> <type name="Magento\Csp\Model\Collector\Config\PolicyReaderPool"> diff --git a/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/ConfigCollectorTest.php b/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/ConfigCollectorTest.php index ae8013d065194..54f6a4d8fd33f 100644 --- a/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/ConfigCollectorTest.php +++ b/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/ConfigCollectorTest.php @@ -68,7 +68,7 @@ private function getExpectedPolicies(): array 'manifest-src' => new FetchPolicy('manifest-src', false, [], [], true), 'media-src' => new FetchPolicy('media-src', false, [], [], true), 'object-src' => new FetchPolicy('object-src', false, [], [], true), - 'script-src' => new FetchPolicy('script-src', false, [], [], true), + 'script-src' => new FetchPolicy('script-src', false, [], [], true, false, false, [], [], false, true), 'style-src' => new FetchPolicy('style-src', false, [], [], true), 'base-uri' => new FetchPolicy('base-uri', false, [], [], true), 'plugin-types' => new PluginTypesPolicy( @@ -126,6 +126,7 @@ private function getExpectedPolicies(): array * @magentoConfigFixture default_store csp/policies/storefront/script_src/policy_id script-src * @magentoConfigFixture default_store csp/policies/storefront/script_src/none 0 * @magentoConfigFixture default_store csp/policies/storefront/script_src/self 1 + * @magentoConfigFixture default_store csp/policies/storefront/script_src/event_handlers 1 * @magentoConfigFixture default_store csp/policies/storefront/base_uri/policy_id base-uri * @magentoConfigFixture default_store csp/policies/storefront/base_uri/none 0 * @magentoConfigFixture default_store csp/policies/storefront/base_uri/self 1 diff --git a/dev/tests/integration/testsuite/Magento/Csp/Model/CompositePolicyCollectorTest.php b/dev/tests/integration/testsuite/Magento/Csp/Model/CompositePolicyCollectorTest.php new file mode 100644 index 0000000000000..fd0c58235de1d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Csp/Model/CompositePolicyCollectorTest.php @@ -0,0 +1,177 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model; + +use Magento\Csp\Api\PolicyCollectorInterface; +use Magento\Csp\Model\Policy\FetchPolicy; +use Magento\Csp\Model\Policy\FlagPolicy; +use Magento\Csp\Model\Policy\PluginTypesPolicy; +use Magento\Csp\Model\Policy\SandboxPolicy; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Test that composite collector properly calls other collectors and merges results. + */ +class CompositePolicyCollectorTest extends TestCase +{ + /** + * Create mock collectors that will populate policies. + * + * @return PolicyCollectorInterface[] + */ + private function createMockCollectors(): array + { + $mockCollector1 = $this->getMockForAbstractClass(PolicyCollectorInterface::class); + $mockCollector1->method('collect') + ->willReturnCallback( + function (array $prevPolicies) { + return array_merge( + $prevPolicies, + [ + new FetchPolicy( + 'script-src', + false, + ['https://magento.com'], + ['https'], + true, + false, + true, + ['569403695046645'], + ['B2yPHKaXnvFWtRChIbabYmUBFZdVfKKXHbWtWidDVF8=' => 'sha256'], + false, + true + ), + new FetchPolicy('script-src', false, ['https://devdocs.magento.com']), + new FlagPolicy('upgrade-insecure-requests'), + new PluginTypesPolicy(['application/x-shockwave-flash']), + new SandboxPolicy(false, true, false, true, false, true, false, true, false, true, false) + ] + ); + } + ); + $mockCollector2 = $this->getMockForAbstractClass(PolicyCollectorInterface::class); + $mockCollector2->method('collect') + ->willReturnCallback( + function (array $prevPolicies) { + return array_merge( + $prevPolicies, + [ + new FetchPolicy( + 'script-src', + true, + ['http://magento.com'], + ['http'], + false, + false, + false, + ['5694036950466451'], + ['B2yPHKaXnvFWtRChIbabYmUBFZdVfKKXHbWtWidDVF7=' => 'sha256'], + true, + false + ), + new FetchPolicy('default-src', false, [], [], true), + new FlagPolicy('upgrade-insecure-requests'), + new PluginTypesPolicy(['application/x-java-applet']), + new SandboxPolicy(true, false, true, false, true, false, true, false, true, false, false) + ] + ); + } + ); + + return [$mockCollector1, $mockCollector2]; + } + + /** + * Test collect method. + * + * Supply fake collectors, check results. + * + * @return void + */ + public function testCollect(): void + { + /** @var CompositePolicyCollector $collector */ + $collector = Bootstrap::getObjectManager()->create( + CompositePolicyCollector::class, + ['collectors' => $this->createMockCollectors()] + ); + + $collected = $collector->collect([]); + /** @var FetchPolicy[]|FlagPolicy[]|PluginTypesPolicy[]|SandboxPolicy[] $policies */ + $policies = []; + /** @var \Magento\Csp\Api\Data\PolicyInterface $policy */ + foreach ($collected as $policy) { + $policies[$policy->getId()] = $policy; + } + //Comparing resulting policies + $this->assertArrayHasKey('script-src', $policies); + $this->assertTrue($policies['script-src']->isNoneAllowed()); + $this->assertTrue($policies['script-src']->isSelfAllowed()); + $this->assertFalse($policies['script-src']->isInlineAllowed()); + $this->assertTrue($policies['script-src']->isEvalAllowed()); + $this->assertTrue($policies['script-src']->isDynamicAllowed()); + $this->assertTrue($policies['script-src']->areEventHandlersAllowed()); + $foundHosts = $policies['script-src']->getHostSources(); + $hosts = ['http://magento.com', 'https://magento.com', 'https://devdocs.magento.com']; + sort($foundHosts); + sort($hosts); + $this->assertEquals($hosts, $foundHosts); + $foundSchemes = $policies['script-src']->getSchemeSources(); + $schemes = ['https', 'http']; + sort($foundSchemes); + sort($schemes); + $this->assertEquals($schemes, $foundSchemes); + $foundNonceValues = $policies['script-src']->getNonceValues(); + $nonceValues = ['5694036950466451', '569403695046645']; + sort($foundNonceValues); + sort($nonceValues); + $this->assertEquals($nonceValues, $foundNonceValues); + $foundHashes = $policies['script-src']->getHashes(); + $hashes = [ + 'B2yPHKaXnvFWtRChIbabYmUBFZdVfKKXHbWtWidDVF7=' => 'sha256', + 'B2yPHKaXnvFWtRChIbabYmUBFZdVfKKXHbWtWidDVF8=' => 'sha256' + ]; + $this->assertEquals($hashes, $foundHashes); + + $this->assertArrayHasKey('default-src', $policies); + $this->assertFalse($policies['default-src']->isNoneAllowed()); + $this->assertTrue($policies['default-src']->isSelfAllowed()); + $this->assertFalse($policies['default-src']->isInlineAllowed()); + $this->assertFalse($policies['default-src']->isEvalAllowed()); + $this->assertFalse($policies['default-src']->isDynamicAllowed()); + $this->assertFalse($policies['default-src']->areEventHandlersAllowed()); + $this->assertEmpty($policies['default-src']->getHashes()); + $this->assertEmpty($policies['default-src']->getNonceValues()); + $this->assertEmpty($policies['default-src']->getHostSources()); + $this->assertEmpty($policies['default-src']->getSchemeSources()); + + $this->assertArrayHasKey('upgrade-insecure-requests', $policies); + $this->assertInstanceOf(FlagPolicy::class, $policies['upgrade-insecure-requests']); + + $this->assertArrayHasKey('plugin-types', $policies); + $types = ['application/x-java-applet', 'application/x-shockwave-flash']; + $foundTypes = $policies['plugin-types']->getTypes(); + sort($types); + sort($foundTypes); + $this->assertEquals($types, $foundTypes); + + $this->assertArrayHasKey('sandbox', $policies); + $this->assertTrue($policies['sandbox']->isFormAllowed()); + $this->assertTrue($policies['sandbox']->isModalsAllowed()); + $this->assertTrue($policies['sandbox']->isOrientationLockAllowed()); + $this->assertTrue($policies['sandbox']->isPointerLockAllowed()); + $this->assertTrue($policies['sandbox']->isPopupsAllowed()); + $this->assertTrue($policies['sandbox']->isPopupsToEscapeSandboxAllowed()); + $this->assertTrue($policies['sandbox']->isScriptsAllowed()); + $this->assertFalse($policies['sandbox']->isTopNavigationByUserActivationAllowed()); + $this->assertTrue($policies['sandbox']->isTopNavigationAllowed()); + $this->assertTrue($policies['sandbox']->isSameOriginAllowed()); + $this->assertTrue($policies['sandbox']->isPresentationAllowed()); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Csp/Model/Mode/ConfigManagerTest.php b/dev/tests/integration/testsuite/Magento/Csp/Model/Mode/ConfigManagerTest.php new file mode 100644 index 0000000000000..44790ef9dbc94 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Csp/Model/Mode/ConfigManagerTest.php @@ -0,0 +1,86 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Csp\Model\Mode; + +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Test config manager. + */ +class ConfigManagerTest extends TestCase +{ + /** + * @var ConfigManager + */ + private $manager; + + /** + * @inheritDoc + */ + public function setUp() + { + $this->manager = Bootstrap::getObjectManager()->get(ConfigManager::class); + } + + /** + * Check the default configurations of CSP. + * + * @magentoAppArea frontend + * @return void + */ + public function testStorefrontDefault(): void + { + $config = $this->manager->getConfigured(); + $this->assertTrue($config->isReportOnly()); + $this->assertNull($config->getReportUri()); + } + + /** + * Check the default configurations of CSP. + * + * @magentoAppArea adminhtml + * @return void + */ + public function testAdminDefault(): void + { + $config = $this->manager->getConfigured(); + $this->assertTrue($config->isReportOnly()); + $this->assertNull($config->getReportUri()); + } + + /** + * Check that class returns correct configurations. + * + * @magentoAppArea frontend + * @magentoConfigFixture default_store csp/mode/storefront/report_only 0 + * @magentoConfigFixture default_store csp/mode/storefront/report_uri https://magento.com + * @return void + */ + public function testFrontendConfigured(): void + { + $config = $this->manager->getConfigured(); + $this->assertFalse($config->isReportOnly()); + $this->assertEquals('https://magento.com', $config->getReportUri()); + } + + /** + * Check that class returns correct configurations. + * + * @magentoAppArea adminhtml + * @magentoConfigFixture default_store csp/mode/admin/report_only 0 + * @magentoConfigFixture default_store csp/mode/admin/report_uri https://magento.com + * @return void + */ + public function testAdminConfigured(): void + { + $config = $this->manager->getConfigured(); + $this->assertFalse($config->isReportOnly()); + $this->assertEquals('https://magento.com', $config->getReportUri()); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Csp/Model/Policy/Renderer/SimplePolicyHeaderRendererTest.php b/dev/tests/integration/testsuite/Magento/Csp/Model/Policy/Renderer/SimplePolicyHeaderRendererTest.php index eed72ffef93b1..a67665c6d3c48 100644 --- a/dev/tests/integration/testsuite/Magento/Csp/Model/Policy/Renderer/SimplePolicyHeaderRendererTest.php +++ b/dev/tests/integration/testsuite/Magento/Csp/Model/Policy/Renderer/SimplePolicyHeaderRendererTest.php @@ -93,13 +93,30 @@ public function testRenderRestrictWithReportingMode(): void */ public function testRenderReportMode(): void { - $policy = new FetchPolicy('default-src', false, ['https://magento.com'], [], true); + $policy = new FetchPolicy( + 'default-src', + false, + ['https://magento.com'], + ['https'], + true, + true, + true, + ['5749837589457695'], + ['B2yPHKaXnvFWtRChIbabYmUBFZdVfKKXHbWtWidDVF8=' => 'sha256'], + true, + true + ); $this->renderer->render($policy, $this->response); $this->assertNotEmpty($header = $this->response->getHeader('Content-Security-Policy-Report-Only')); $this->assertEmpty($this->response->getHeader('Content-Security-Policy')); - $this->assertEquals('default-src https://magento.com \'self\';', $header->getFieldValue()); + $this->assertEquals( + 'default-src https://magento.com https: \'self\' \'unsafe-inline\' \'unsafe-eval\' \'strict-dynamic\'' + . ' \'unsafe-hashes\' \'nonce-'.base64_encode($policy->getNonceValues()[0]).'\'' + . ' \'sha256-B2yPHKaXnvFWtRChIbabYmUBFZdVfKKXHbWtWidDVF8=\';', + $header->getFieldValue() + ); } /** diff --git a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Response.php b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Response.php index db33b0feaf783..dc3e63fcc7df8 100644 --- a/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Response.php +++ b/lib/internal/Magento/Framework/HTTP/PhpEnvironment/Response.php @@ -3,9 +3,9 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ -namespace Magento\Framework\HTTP\PhpEnvironment; +declare(strict_types=1); -use Zend\Http\Header\GenericMultiHeader; +namespace Magento\Framework\HTTP\PhpEnvironment; /** * Base HTTP response object @@ -79,18 +79,11 @@ public function setHeader($name, $value, $replace = false) { $value = (string)$value; - $headers = $this->getHeaders(); if ($replace) { - $headers->addHeaderLine($name, $value); $this->clearHeader($name); - } else { - //Zend framework will only force multiple headers for header objects - //extending MultiHeader interface. - $pluginKey = str_replace('-', '', mb_strtolower($name)); - $headers->getPluginClassLoader()->registerPlugin($pluginKey, GenericMultiHeader::class); - $headers->addHeader(new GenericMultiHeader($name, $value)); } + $this->getHeaders()->addHeaderLine($name, $value); return $this; } @@ -190,4 +183,27 @@ public function __sleep() { return ['content', 'isRedirect', 'statusCode']; } + + /** + * Sending provided headers. + * + * Had to be overridden because the original did not work correctly with multi-headers. + */ + public function sendHeaders() + { + if ($this->headersSent()) { + return $this; + } + + $status = $this->renderStatusLine(); + header($status); + + /** @var \Zend\Http\Header\HeaderInterface $header */ + foreach ($this->getHeaders() as $header) { + header($header->toString(), false); + } + + $this->headersSent = true; + return $this; + } } From 83d62dc78cf1152945f2b5d0a8c7221d79b584d1 Mon Sep 17 00:00:00 2001 From: Oleksandr Gorkun <ogorkun@magento.com> Date: Tue, 19 Nov 2019 13:05:31 -0600 Subject: [PATCH 170/595] MC-19926: Implement CSP --- .../Csp/Model/Collector/ConfigCollector.php | 14 +++++++------- app/code/Magento/Csp/etc/csp_whitelist.xsd | 2 +- .../Csp/Model/Collector/ConfigCollectorTest.php | 8 +++++++- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Csp/Model/Collector/ConfigCollector.php b/app/code/Magento/Csp/Model/Collector/ConfigCollector.php index f7b63e7549133..34711fe5d8a22 100644 --- a/app/code/Magento/Csp/Model/Collector/ConfigCollector.php +++ b/app/code/Magento/Csp/Model/Collector/ConfigCollector.php @@ -12,8 +12,8 @@ use Magento\Framework\App\Area; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\State; +use Magento\Store\Model\StoreManagerInterface; use Magento\Store\Model\ScopeInterface; -use Magento\Store\Model\Store; /** * Reads Magento config. @@ -36,26 +36,26 @@ class ConfigCollector implements PolicyCollectorInterface private $state; /** - * @var Store + * @var StoreManagerInterface */ - private $storeModel; + private $storeManager; /** * @param ScopeConfigInterface $config * @param PolicyReaderPool $readersPool * @param State $state - * @param Store $storeModel + * @param StoreManagerInterface $storeManager */ public function __construct( ScopeConfigInterface $config, PolicyReaderPool $readersPool, State $state, - Store $storeModel + StoreManagerInterface $storeManager ) { $this->config = $config; $this->readersPool = $readersPool; $this->state = $state; - $this->storeModel = $storeModel; + $this->storeManager = $storeManager; } /** @@ -77,7 +77,7 @@ public function collect(array $defaultPolicies = []): array $policiesConfig = $this->config->getValue( 'csp/policies/' . $configArea, ScopeInterface::SCOPE_STORE, - $this->storeModel->getStore() + $this->storeManager->getStore() ); if (is_array($policiesConfig) && $policiesConfig) { foreach ($policiesConfig as $policyConfig) { diff --git a/app/code/Magento/Csp/etc/csp_whitelist.xsd b/app/code/Magento/Csp/etc/csp_whitelist.xsd index 8b4b78008fe99..e68e596e21c79 100644 --- a/app/code/Magento/Csp/etc/csp_whitelist.xsd +++ b/app/code/Magento/Csp/etc/csp_whitelist.xsd @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- /** - * Structure description for webapi.xml configuration files. + * Structure description for csp_whitelist.xml configuration files. * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. diff --git a/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/ConfigCollectorTest.php b/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/ConfigCollectorTest.php index 54f6a4d8fd33f..6d8876012df1e 100644 --- a/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/ConfigCollectorTest.php +++ b/dev/tests/integration/testsuite/Magento/Csp/Model/Collector/ConfigCollectorTest.php @@ -160,11 +160,17 @@ private function getExpectedPolicies(): array */ public function testCollecting(): void { - $policies = $this->collector->collect([]); + $policies = $this->collector->collect([new FlagPolicy('upgrade-insecure-requests')]); $checked = []; $expectedPolicies = $this->getExpectedPolicies(); + //Policies were collected $this->assertNotEmpty($policies); + //Default policies are being kept + /** @var PolicyInterface $defaultPolicy */ + $defaultPolicy = array_shift($policies); + $this->assertEquals('upgrade-insecure-requests', $defaultPolicy->getId()); + //Comparing collected with configured /** @var PolicyInterface $policy */ foreach ($policies as $policy) { $id = $policy->getId(); From 471eff436ddb7c4b792a28309e268b889a865ba2 Mon Sep 17 00:00:00 2001 From: Oleksandr Gorkun <ogorkun@magento.com> Date: Tue, 19 Nov 2019 14:31:05 -0600 Subject: [PATCH 171/595] MC-19926: Implement CSP --- app/code/Magento/Csp/Model/Collector/SandboxPolicyMerger.php | 1 + app/code/Magento/Csp/Model/Policy/FetchPolicy.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/code/Magento/Csp/Model/Collector/SandboxPolicyMerger.php b/app/code/Magento/Csp/Model/Collector/SandboxPolicyMerger.php index 1c398a4cfd477..3e3f05b1bc845 100644 --- a/app/code/Magento/Csp/Model/Collector/SandboxPolicyMerger.php +++ b/app/code/Magento/Csp/Model/Collector/SandboxPolicyMerger.php @@ -17,6 +17,7 @@ class SandboxPolicyMerger implements MergerInterface { /** * @inheritDoc + * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function merge(PolicyInterface $policy1, PolicyInterface $policy2): PolicyInterface { diff --git a/app/code/Magento/Csp/Model/Policy/FetchPolicy.php b/app/code/Magento/Csp/Model/Policy/FetchPolicy.php index cb44c20ab2fd4..7350cbe80aecb 100644 --- a/app/code/Magento/Csp/Model/Policy/FetchPolicy.php +++ b/app/code/Magento/Csp/Model/Policy/FetchPolicy.php @@ -199,6 +199,8 @@ public function isNoneAllowed(): bool /** * @inheritDoc + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) */ public function getValue(): string { From 3020ac7ed08cdc07562fdede078e1ff27b779de0 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Wed, 20 Nov 2019 14:32:25 +0700 Subject: [PATCH 172/595] Resolve Wrong message in confirmation popup when delete customer group issue25661 --- .../Mftf/ActionGroup/AdminDeleteCustomerGroupActionGroup.xml | 4 +++- .../Magento/Customer/Test/Mftf/Data/CustomerGroupData.xml | 2 +- .../Customer/Ui/Component/Listing/Column/GroupActions.php | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminDeleteCustomerGroupActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminDeleteCustomerGroupActionGroup.xml index ab5ae53fd4caa..8171b97258157 100644 --- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminDeleteCustomerGroupActionGroup.xml +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminDeleteCustomerGroupActionGroup.xml @@ -15,7 +15,7 @@ <arguments> <argument name="customerGroupName" type="string"/> </arguments> - + <amOnPage url="{{AdminCustomerGroupsIndexPage.url}}" stepKey="goToAdminCustomerGroupIndexPage"/> <waitForPageLoad time="30" stepKey="waitForCustomerGroupIndexPageLoad"/> <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openFiltersSectionOnCustomerGroupIndexPage"/> @@ -24,6 +24,8 @@ <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> <click selector="{{AdminCustomerGroupGridActionsSection.selectButton(customerGroupName)}}" stepKey="clickSelectButton"/> <click selector="{{AdminCustomerGroupGridActionsSection.deleteAction(customerGroupName)}}" stepKey="clickOnDeleteItem"/> + <waitForElementVisible selector="{{AdminGridConfirmActionSection.message}}" stepKey="waitForConfirmModal"/> + <see selector="{{AdminGridConfirmActionSection.message}}" userInput="Are you sure you want to delete a {{customerGroupName}} record?" stepKey="seeRemoveMessage"/> <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDeleteCustomerGroup"/> <seeElement selector="{{AdminMessagesSection.success}}" stepKey="seeSuccessMessage"/> </actionGroup> diff --git a/app/code/Magento/Customer/Test/Mftf/Data/CustomerGroupData.xml b/app/code/Magento/Customer/Test/Mftf/Data/CustomerGroupData.xml index 28305d37cf77b..68e4090d64910 100644 --- a/app/code/Magento/Customer/Test/Mftf/Data/CustomerGroupData.xml +++ b/app/code/Magento/Customer/Test/Mftf/Data/CustomerGroupData.xml @@ -30,7 +30,7 @@ </array> </entity> <entity name="CustomCustomerGroup" type="customerGroup"> - <data key="code" unique="suffix">Group </data> + <data key="code" unique="suffix">Group-</data> <data key="tax_class_id">3</data> <data key="tax_class_name">Retail Customer</data> </entity> diff --git a/app/code/Magento/Customer/Ui/Component/Listing/Column/GroupActions.php b/app/code/Magento/Customer/Ui/Component/Listing/Column/GroupActions.php index 12f6f2705125b..5d974088b0d54 100644 --- a/app/code/Magento/Customer/Ui/Component/Listing/Column/GroupActions.php +++ b/app/code/Magento/Customer/Ui/Component/Listing/Column/GroupActions.php @@ -97,10 +97,10 @@ public function prepareDataSource(array $dataSource) ), 'label' => __('Delete'), 'confirm' => [ - 'title' => __('Delete %1', $this->escaper->escapeJs($title)), + 'title' => __('Delete %1', $this->escaper->escapeHtml($title)), 'message' => __( 'Are you sure you want to delete a %1 record?', - $this->escaper->escapeJs($title) + $this->escaper->escapeHtml($title) ) ], 'post' => true, From f97f68d88009eae7aef52c3404df84635e1a659b Mon Sep 17 00:00:00 2001 From: Alexey Rakitin <alexey.rakitin@babenkocommerce.com> Date: Wed, 20 Nov 2019 12:42:16 +0200 Subject: [PATCH 173/595] magento/magento2#25652: Arrows (.fotorama__thumb__arr) don't work in product gallery - Fotorama disabled arrows are hidden by opacity:0 - Internal ticket: MC-28947 --- lib/web/mage/gallery/gallery.less | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/web/mage/gallery/gallery.less b/lib/web/mage/gallery/gallery.less index 1608ef4ba83e9..10fba50fe239b 100644 --- a/lib/web/mage/gallery/gallery.less +++ b/lib/web/mage/gallery/gallery.less @@ -418,9 +418,8 @@ } .fotorama__arr--disabled { - *display: none; cursor: default; - opacity: 0.1; + opacity: 0; pointer-events: none; } From 14468af3f91c0b91d4ad202f67ccdce459aecc44 Mon Sep 17 00:00:00 2001 From: Alastair Mucklow <amucklow@strangerpixel.com> Date: Wed, 20 Nov 2019 10:48:45 +0000 Subject: [PATCH 174/595] Update translation file --- app/code/Magento/SalesRule/i18n/en_US.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/SalesRule/i18n/en_US.csv b/app/code/Magento/SalesRule/i18n/en_US.csv index 7511d147ae224..cd1e471516ac9 100644 --- a/app/code/Magento/SalesRule/i18n/en_US.csv +++ b/app/code/Magento/SalesRule/i18n/en_US.csv @@ -22,7 +22,7 @@ Conditions,Conditions Generate,Generate "Coupon Code","Coupon Code" Created,Created -Uses,Uses +Used,Used No,No Yes,Yes "Times Used","Times Used" From 377b013c4f91c31586032147bf7722d832362536 Mon Sep 17 00:00:00 2001 From: Viktor Sevch <svitja@ukr.net> Date: Wed, 20 Nov 2019 12:49:57 +0200 Subject: [PATCH 175/595] MC-18057: Product doesn'y match by "Date" attribute condition --- .../Catalog/_files/product_simple_with_date_attribute.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_date_attribute.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_date_attribute.php index 46745c213845a..28a89ff883c4f 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_date_attribute.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_date_attribute.php @@ -10,11 +10,11 @@ $attribute->setData('is_used_for_promo_rules', 1); -/** @var ProductFactory $productFactory */ +/** @var \Magento\Catalog\Model\ProductFactory $productFactory */ $productFactory = $objectManager->get(Magento\Catalog\Model\ProductFactory::class); $product = $productFactory->create(); $product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE) - ->setAttributeSetId($installer->getAttributeSetId('catalog_product', 'Default')) + ->setAttributeSetId($product->getDefaultAttributeSetId()) ->setWebsiteIds([1]) ->setName('Simple Product with date') ->setSku('simple_with_date') @@ -30,7 +30,7 @@ $product2 = $productFactory->create(); $product2->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE) - ->setAttributeSetId($installer->getAttributeSetId('catalog_product', 'Default')) + ->setAttributeSetId($product->getDefaultAttributeSetId()) ->setWebsiteIds([1]) ->setName('Simple Product with date -1') ->setSku('simple_with_date2') @@ -46,7 +46,7 @@ $product3 = $productFactory->create(); $product3->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE) - ->setAttributeSetId($installer->getAttributeSetId('catalog_product', 'Default')) + ->setAttributeSetId($product->getDefaultAttributeSetId()) ->setWebsiteIds([1]) ->setName('Simple Product with date +1') ->setSku('simple_with_date3') From dc1ab99136f06a550a12580832bca6cd726b0440 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Wed, 20 Nov 2019 17:13:21 +0200 Subject: [PATCH 176/595] Remove duplicated fireEcent, that prevents to duble initialization --- lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js index df691601eccb9..6cc53e3d40d92 100644 --- a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js +++ b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js @@ -293,7 +293,6 @@ define([ }; varienGlobalEvents.fireEvent('open_browser_callback', payload); - this.eventBus.fireEvent('open_browser_callback', payload); }.bind(this); } From b5fde42dacbca4239e9276f871fc6b48840a28a7 Mon Sep 17 00:00:00 2001 From: Oleksandr Gorkun <ogorkun@magento.com> Date: Wed, 20 Nov 2019 10:08:58 -0600 Subject: [PATCH 177/595] MAGETWO-55858: Output escaping methods shouldn't be part of AbstractBlock --- .../frontend/templates/product/list.phtml | 32 +++++----- .../Framework/View/TemplateEngine/PhpTest.php | 58 +++++++++++++++++++ .../Framework/View/_files/test_template.phtml | 18 ++++++ .../Framework/View/Element/AbstractBlock.php | 6 ++ .../Framework/View/TemplateEngine/Php.php | 20 ++++++- 5 files changed, 117 insertions(+), 17 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/Framework/View/TemplateEngine/PhpTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Framework/View/_files/test_template.phtml diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/list.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/list.phtml index 8c32302cf7c29..554caf6026001 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/list.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/list.phtml @@ -13,14 +13,16 @@ use Magento\Framework\App\Action\Action; * Product list template * * @var $block \Magento\Catalog\Block\Product\ListProduct + * @var \Magento\Framework\Escaper $escaper */ ?> <?php $_productCollection = $block->getLoadedProductCollection(); +/** @var \Magento\Catalog\Helper\Output $_helper */ $_helper = $this->helper(Magento\Catalog\Helper\Output::class); ?> <?php if (!$_productCollection->count()) :?> - <div class="message info empty"><div><?= $block->escapeHtml(__('We can\'t find products matching the selection.')) ?></div></div> + <div class="message info empty"><div><?= $escaper->escapeHtml(__('We can\'t find products matching the selection.')) ?></div></div> <?php else :?> <?= $block->getToolbarHtml() ?> <?= $block->getAdditionalHtml() ?> @@ -55,7 +57,7 @@ $_helper = $this->helper(Magento\Catalog\Helper\Output::class); } ?> <?php // Product Image ?> - <a href="<?= $block->escapeUrl($_product->getProductUrl()) ?>" + <a href="<?= $escaper->escapeUrl($_product->getProductUrl()) ?>" class="product photo product-item-photo" tabindex="-1"> <?= $productImage->toHtml() ?> @@ -66,7 +68,7 @@ $_helper = $this->helper(Magento\Catalog\Helper\Output::class); ?> <strong class="product name product-item-name"> <a class="product-item-link" - href="<?= $block->escapeUrl($_product->getProductUrl()) ?>"> + href="<?= $escaper->escapeUrl($_product->getProductUrl()) ?>"> <?= /* @noEscape */ $_helper->productAttribute($_product, $_product->getName(), 'name') ?> </a> </strong> @@ -77,13 +79,13 @@ $_helper = $this->helper(Magento\Catalog\Helper\Output::class); <?php endif; ?> <div class="product-item-inner"> - <div class="product actions product-item-actions"<?= strpos($pos, $viewMode . '-actions') ? $block->escapeHtmlAttr($position) : '' ?>> - <div class="actions-primary"<?= strpos($pos, $viewMode . '-primary') ? $block->escapeHtmlAttr($position) : '' ?>> + <div class="product actions product-item-actions"<?= strpos($pos, $viewMode . '-actions') ? $escaper->escapeHtmlAttr($position) : '' ?>> + <div class="actions-primary"<?= strpos($pos, $viewMode . '-primary') ? $escaper->escapeHtmlAttr($position) : '' ?>> <?php if ($_product->isSaleable()) :?> <?php $postParams = $block->getAddToCartPostParams($_product); ?> <form data-role="tocart-form" - data-product-sku="<?= $block->escapeHtml($_product->getSku()) ?>" - action="<?= $block->escapeUrl($postParams['action']) ?>" + data-product-sku="<?= $escaper->escapeHtml($_product->getSku()) ?>" + action="<?= $escaper->escapeUrl($postParams['action']) ?>" method="post"> <input type="hidden" name="product" @@ -92,20 +94,20 @@ $_helper = $this->helper(Magento\Catalog\Helper\Output::class); value="<?= /* @noEscape */ $postParams['data'][Action::PARAM_NAME_URL_ENCODED] ?>"> <?= $block->getBlockHtml('formkey') ?> <button type="submit" - title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>" + title="<?= $escaper->escapeHtmlAttr(__('Add to Cart')) ?>" class="action tocart primary"> - <span><?= $block->escapeHtml(__('Add to Cart')) ?></span> + <span><?= $escaper->escapeHtml(__('Add to Cart')) ?></span> </button> </form> <?php else :?> <?php if ($_product->isAvailable()) :?> - <div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div> + <div class="stock available"><span><?= $escaper->escapeHtml(__('In stock')) ?></span></div> <?php else :?> - <div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div> + <div class="stock unavailable"><span><?= $escaper->escapeHtml(__('Out of stock')) ?></span></div> <?php endif; ?> <?php endif; ?> </div> - <div data-role="add-to-links" class="actions-secondary"<?= strpos($pos, $viewMode . '-secondary') ? $block->escapeHtmlAttr($position) : '' ?>> + <div data-role="add-to-links" class="actions-secondary"<?= strpos($pos, $viewMode . '-secondary') ? $escaper->escapeHtmlAttr($position) : '' ?>> <?php if ($addToBlock = $block->getChildBlock('addto')) :?> <?= $addToBlock->setProduct($_product)->getChildHtml() ?> <?php endif; ?> @@ -114,9 +116,9 @@ $_helper = $this->helper(Magento\Catalog\Helper\Output::class); <?php if ($showDescription) :?> <div class="product description product-item-description"> <?= /* @noEscape */ $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?> - <a href="<?= $block->escapeUrl($_product->getProductUrl()) ?>" + <a href="<?= $escaper->escapeUrl($_product->getProductUrl()) ?>" title="<?= /* @noEscape */ $_productNameStripped ?>" - class="action more"><?= $block->escapeHtml(__('Learn More')) ?></a> + class="action more"><?= $escaper->escapeHtml(__('Learn More')) ?></a> </div> <?php endif; ?> </div> @@ -132,7 +134,7 @@ $_helper = $this->helper(Magento\Catalog\Helper\Output::class); { "[data-role=tocart-form], .form.map.checkout": { "catalogAddToCart": { - "product_sku": "<?= $block->escapeJs($_product->getSku()) ?>" + "product_sku": "<?= $escaper->escapeJs($_product->getSku()) ?>" } } } diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/TemplateEngine/PhpTest.php b/dev/tests/integration/testsuite/Magento/Framework/View/TemplateEngine/PhpTest.php new file mode 100644 index 0000000000000..f4227ee41b53d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/View/TemplateEngine/PhpTest.php @@ -0,0 +1,58 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Framework\View\TemplateEngine; + +use Magento\Framework\View\Element\BlockInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Testing .phtml templating. + */ +class PhpTest extends TestCase +{ + /** + * @var Php + */ + private $templateEngine; + + /** + * @inheritdoc + */ + protected function setUp() + { + $objectManager = Bootstrap::getObjectManager(); + $this->templateEngine = $objectManager->get(Php::class); + } + + /** + * See that templates get access to certain variables. + * + * @return void + */ + public function testVariablesAvailable(): void + { + $block = new class implements BlockInterface { + /** + * @inheritDoc + */ + public function toHtml() + { + return '<b>BLOCK</b>'; + } + }; + + $rendered = $this->templateEngine->render($block, __DIR__ .'/../_files/test_template.phtml'); + $this->assertEquals( + '<p>This template has access to <b>$escaper</b> and $block "<b>BLOCK</b>"</p>' + .PHP_EOL, + $rendered + ); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Framework/View/_files/test_template.phtml b/dev/tests/integration/testsuite/Magento/Framework/View/_files/test_template.phtml new file mode 100644 index 0000000000000..e41d495327a5d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/View/_files/test_template.phtml @@ -0,0 +1,18 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +?> +<?php +// phpcs:disable +?> +<?php +/** + * Template meant for testing. + * + * @var \Magento\Framework\View\Element\BlockInterface $block + * @var \Magento\Framework\Escaper $escaper + */ +?> +<p>This template has access to <?= $escaper->escapeHtml('<b>$escaper</b>') ?> and $block "<?= $block->toHtml() ?>"</p> diff --git a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php index 4df1ac515a87b..628e595229137 100644 --- a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php +++ b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); namespace Magento\Framework\View\Element; @@ -887,6 +888,7 @@ public static function extractModuleName($className) * @param string|array $data * @param array|null $allowedTags * @return string + * @deprecated Use $escaper directly in templates and in blocks. */ public function escapeHtml($data, $allowedTags = null) { @@ -899,6 +901,7 @@ public function escapeHtml($data, $allowedTags = null) * @param string $string * @return string * @since 100.2.0 + * @deprecated Use $escaper directly in templates and in blocks. */ public function escapeJs($string) { @@ -912,6 +915,7 @@ public function escapeJs($string) * @param boolean $escapeSingleQuote * @return string * @since 100.2.0 + * @deprecated Use $escaper directly in templates and in blocks. */ public function escapeHtmlAttr($string, $escapeSingleQuote = true) { @@ -924,6 +928,7 @@ public function escapeHtmlAttr($string, $escapeSingleQuote = true) * @param string $string * @return string * @since 100.2.0 + * @deprecated Use $escaper directly in templates and in blocks. */ public function escapeCss($string) { @@ -951,6 +956,7 @@ public function stripTags($data, $allowableTags = null, $allowHtmlEntities = fal * * @param string $string * @return string + * @deprecated Use $escaper directly in templates and in blocks. */ public function escapeUrl($string) { diff --git a/lib/internal/Magento/Framework/View/TemplateEngine/Php.php b/lib/internal/Magento/Framework/View/TemplateEngine/Php.php index 8c51433779424..0437386e4fc2b 100644 --- a/lib/internal/Magento/Framework/View/TemplateEngine/Php.php +++ b/lib/internal/Magento/Framework/View/TemplateEngine/Php.php @@ -3,8 +3,11 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Framework\View\TemplateEngine; +use Magento\Framework\Escaper; use Magento\Framework\View\Element\BlockInterface; use Magento\Framework\View\TemplateEngineInterface; @@ -27,14 +30,23 @@ class Php implements TemplateEngineInterface */ protected $_helperFactory; + /** + * @var Escaper + */ + private $escaper; + /** * Constructor * * @param \Magento\Framework\ObjectManagerInterface $helperFactory + * @param Escaper|null $escaper */ - public function __construct(\Magento\Framework\ObjectManagerInterface $helperFactory) - { + public function __construct( + \Magento\Framework\ObjectManagerInterface $helperFactory, + ?Escaper $escaper = null + ) { $this->_helperFactory = $helperFactory; + $this->escaper = $escaper ?? $helperFactory->get(Escaper::class); } /** @@ -48,6 +60,7 @@ public function __construct(\Magento\Framework\ObjectManagerInterface $helperFac * @param array $dictionary * @return string * @throws \Exception + * @SuppressWarnings(PHPMD.UnusedLocalVariable) */ public function render(BlockInterface $block, $fileName, array $dictionary = []) { @@ -56,6 +69,9 @@ public function render(BlockInterface $block, $fileName, array $dictionary = []) $tmpBlock = $this->_currentBlock; $this->_currentBlock = $block; extract($dictionary, EXTR_SKIP); + //So it can be used in the template. + $escaper = $this->escaper; + // phpcs:ignore include $fileName; $this->_currentBlock = $tmpBlock; } catch (\Exception $exception) { From ca0e7094e3fb16065b566fd623e06301f52ac0b8 Mon Sep 17 00:00:00 2001 From: Alex Taranovsky <firster@atwix.com> Date: Wed, 20 Nov 2019 18:19:29 +0200 Subject: [PATCH 178/595] =?UTF-8?q?magento/magento2#:=20Remove=20redundant?= =?UTF-8?q?=20use=3D=E2=80=9Coptional=E2=80=9D=20from=20INDEXER=20XSD=20sc?= =?UTF-8?q?hema?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Magento/Framework/Indexer/etc/indexer.xsd | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/lib/internal/Magento/Framework/Indexer/etc/indexer.xsd b/lib/internal/Magento/Framework/Indexer/etc/indexer.xsd index fc38a5206e855..ca14e5d56fb76 100644 --- a/lib/internal/Magento/Framework/Indexer/etc/indexer.xsd +++ b/lib/internal/Magento/Framework/Indexer/etc/indexer.xsd @@ -14,19 +14,19 @@ </xs:annotation> <xs:sequence> <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="title" type="translatableType" /> - <xs:element name="description" type="translatableType" /> - <xs:element name="saveHandler" type="saveHandlerType" /> - <xs:element name="structure" type="structureType" /> + <xs:element name="title" type="translatableType"/> + <xs:element name="description" type="translatableType"/> + <xs:element name="saveHandler" type="saveHandlerType"/> + <xs:element name="structure" type="structureType"/> <xs:group ref="fieldset"/> </xs:choice> <xs:group ref="dependencies"/> </xs:sequence> - <xs:attribute name="id" type="xs:string" use="required" /> - <xs:attribute name="primary" type="nameType" use="optional" /> - <xs:attribute name="view_id" type="viewIdType" use="optional" /> - <xs:attribute name="class" type="classType" use="optional" /> - <xs:attribute name="shared_index" type="xs:string" use="optional" /> + <xs:attribute name="id" type="xs:string" use="required"/> + <xs:attribute name="primary" type="nameType"/> + <xs:attribute name="view_id" type="viewIdType"/> + <xs:attribute name="class" type="classType"/> + <xs:attribute name="shared_index" type="xs:string"/> </xs:complexType> <xs:group name="fieldset"> @@ -48,7 +48,7 @@ <xs:complexType name="translatableType"> <xs:simpleContent> <xs:extension base="xs:string"> - <xs:attribute name="translate" use="optional" fixed="true" type="xs:boolean"/> + <xs:attribute name="translate" fixed="true" type="xs:boolean"/> </xs:extension> </xs:simpleContent> </xs:complexType> @@ -60,7 +60,7 @@ </xs:documentation> </xs:annotation> <xs:restriction base="xs:string"> - <xs:pattern value="[a-zA-Z0-9_]+" /> + <xs:pattern value="[a-zA-Z0-9_]+"/> </xs:restriction> </xs:simpleType> @@ -71,7 +71,7 @@ </xs:documentation> </xs:annotation> <xs:restriction base="xs:string"> - <xs:pattern value="[a-zA-Z|\\]+[a-zA-Z0-9\\]+" /> + <xs:pattern value="[a-zA-Z|\\]+[a-zA-Z0-9\\]+"/> </xs:restriction> </xs:simpleType> @@ -82,7 +82,7 @@ </xs:documentation> </xs:annotation> <xs:restriction base="xs:string"> - <xs:pattern value="[a-zA-Z0-9_]+" /> + <xs:pattern value="[a-zA-Z0-9_]+"/> </xs:restriction> </xs:simpleType> @@ -93,7 +93,7 @@ </xs:documentation> </xs:annotation> <xs:restriction base="xs:string"> - <xs:pattern value="[a-zA-Z0-9_]+" /> + <xs:pattern value="[a-zA-Z0-9_]+"/> </xs:restriction> </xs:simpleType> @@ -104,7 +104,7 @@ </xs:documentation> </xs:annotation> <xs:restriction base="xs:string"> - <xs:pattern value="[a-zA-Z0-9_]+" /> + <xs:pattern value="[a-zA-Z0-9_]+"/> </xs:restriction> </xs:simpleType> @@ -115,7 +115,7 @@ </xs:documentation> </xs:annotation> <xs:restriction base="xs:string"> - <xs:pattern value="[a-zA-Z0-9_]+" /> + <xs:pattern value="[a-zA-Z0-9_]+"/> </xs:restriction> </xs:simpleType> @@ -126,8 +126,8 @@ </xs:documentation> </xs:annotation> <xs:attribute name="name" type="nameType" use="required"/> - <xs:attribute name="handler" type="classType" use="optional"/> - <xs:attribute name="origin" type="originType" use="optional"/> + <xs:attribute name="handler" type="classType"/> + <xs:attribute name="origin" type="originType"/> </xs:complexType> <xs:complexType name="fieldsetType" mixed="true"> @@ -137,11 +137,11 @@ </xs:documentation> </xs:annotation> <xs:sequence> - <xs:element type="referenceType" name="reference" minOccurs="0" maxOccurs="unbounded" /> + <xs:element type="referenceType" name="reference" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="field" type="fieldType" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> - <xs:attribute name="source" type="classType" use="optional"/> - <xs:attribute name="provider" type="classType" use="optional"/> + <xs:attribute name="source" type="classType"/> + <xs:attribute name="provider" type="classType"/> <xs:attribute name="name" type="nameType" use="required"/> </xs:complexType> @@ -149,9 +149,9 @@ <xs:complexContent> <xs:extension base="fieldTypeAbstract"> <xs:choice> - <xs:element type="filterType" name="filter" minOccurs="0" maxOccurs="1" /> + <xs:element type="filterType" name="filter" minOccurs="0" maxOccurs="1"/> </xs:choice> - <xs:attribute type="dataType" name="dataType" use="optional" /> + <xs:attribute type="dataType" name="dataType"/> </xs:extension> </xs:complexContent> </xs:complexType> @@ -190,20 +190,20 @@ </xs:documentation> </xs:annotation> <xs:attribute name="fieldset" type="nameType" use="required"/> - <xs:attribute name="from" type="fromType" use="optional"/> - <xs:attribute name="to" type="toType" use="optional"/> + <xs:attribute name="from" type="fromType"/> + <xs:attribute name="to" type="toType"/> </xs:complexType> <xs:simpleType name="dataType"> <xs:restriction base="xs:string"> - <xs:enumeration value="int" /> - <xs:enumeration value="float" /> - <xs:enumeration value="varchar" /> - <xs:enumeration value="text" /> - <xs:enumeration value="mediumtext" /> - <xs:enumeration value="timestamp" /> - <xs:enumeration value="datetime" /> - <xs:enumeration value="date" /> + <xs:enumeration value="int"/> + <xs:enumeration value="float"/> + <xs:enumeration value="varchar"/> + <xs:enumeration value="text"/> + <xs:enumeration value="mediumtext"/> + <xs:enumeration value="timestamp"/> + <xs:enumeration value="datetime"/> + <xs:enumeration value="date"/> </xs:restriction> </xs:simpleType> @@ -226,8 +226,8 @@ Indexer Id must be unique. </xs:documentation> </xs:annotation> - <xs:selector xpath="indexer" /> - <xs:field xpath="@id" /> + <xs:selector xpath="indexer"/> + <xs:field xpath="@id"/> </xs:unique> <xs:unique name="uniqueViewId"> <xs:annotation> @@ -235,8 +235,8 @@ Indexer Id must be unique. </xs:documentation> </xs:annotation> - <xs:selector xpath="indexer" /> - <xs:field xpath="@view_id" /> + <xs:selector xpath="indexer"/> + <xs:field xpath="@view_id"/> </xs:unique> </xs:element> <xs:complexType name="configType"> @@ -266,8 +266,8 @@ Related indexer id must be unique. </xs:documentation> </xs:annotation> - <xs:selector xpath="indexer" /> - <xs:field xpath="@id" /> + <xs:selector xpath="indexer"/> + <xs:field xpath="@id"/> </xs:unique> </xs:element> </xs:choice> @@ -287,7 +287,7 @@ Indexer dependency that represents another indexer. </xs:documentation> </xs:annotation> - <xs:attribute name="id" type="xs:string" use="required" /> + <xs:attribute name="id" type="xs:string" use="required"/> </xs:complexType> </xs:element> </xs:sequence> From 1cf65ed2d45481e07651687899f58d20f44a1cc4 Mon Sep 17 00:00:00 2001 From: Arnob Saha <arnobsh@gmail.com> Date: Mon, 18 Nov 2019 11:26:48 -0600 Subject: [PATCH 179/595] MC-22931: VAT calculation issue with shipping rate selection - static fixing --- app/code/Magento/Tax/Model/Config.php | 86 +++++++++++++++++++++++++-- 1 file changed, 80 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Tax/Model/Config.php b/app/code/Magento/Tax/Model/Config.php index 09212ce90bf58..201158eae25dd 100644 --- a/app/code/Magento/Tax/Model/Config.php +++ b/app/code/Magento/Tax/Model/Config.php @@ -14,11 +14,15 @@ use Magento\Store\Model\Store; /** + * Class to set flags for tax display setting + * * @SuppressWarnings(PHPMD.ExcessivePublicCount) */ class Config { - // tax notifications + /** + * Tax notifications + */ const XML_PATH_TAX_NOTIFICATION_IGNORE_DISCOUNT = 'tax/notification/ignore_discount'; const XML_PATH_TAX_NOTIFICATION_IGNORE_PRICE_DISPLAY = 'tax/notification/ignore_price_display'; @@ -70,7 +74,11 @@ class Config const XML_PATH_DISPLAY_CART_SHIPPING = 'tax/cart_display/shipping'; - /** @deprecated */ + /** + * Tax cart display discount + * + * @deprecated + */ const XML_PATH_DISPLAY_CART_DISCOUNT = 'tax/cart_display/discount'; const XML_PATH_DISPLAY_CART_GRANDTOTAL = 'tax/cart_display/grandtotal'; @@ -88,7 +96,11 @@ class Config const XML_PATH_DISPLAY_SALES_SHIPPING = 'tax/sales_display/shipping'; - /** @deprecated */ + /** + * Tax sales display discount + * + * @deprecated + */ const XML_PATH_DISPLAY_SALES_DISCOUNT = 'tax/sales_display/discount'; const XML_PATH_DISPLAY_SALES_GRANDTOTAL = 'tax/sales_display/grandtotal'; @@ -231,6 +243,7 @@ public function discountTax($store = null) /** * Get taxes/discounts calculation sequence. + * * This sequence depends on "Apply Customer Tax" and "Apply Discount On Prices" configuration options. * * @param null|int|string|Store $store @@ -353,6 +366,8 @@ public function setShippingPriceIncludeTax($flag) } /** + * Return the flag for display sales for cart prices including tax + * * @param null|string|bool|int|Store $store * @return bool */ @@ -366,6 +381,8 @@ public function displayCartPricesInclTax($store = null) } /** + * Return the flag for display sales for cart prices excluding tax + * * @param null|string|bool|int|Store $store * @return bool */ @@ -379,6 +396,8 @@ public function displayCartPricesExclTax($store = null) } /** + * Return the flag for display sales for cart prices both including and excluding tax + * * @param null|string|bool|int|Store $store * @return bool */ @@ -392,6 +411,8 @@ public function displayCartPricesBoth($store = null) } /** + * Return the flag for display sales for cart subtotal including tax + * * @param null|string|bool|int|Store $store * @return bool */ @@ -405,6 +426,8 @@ public function displayCartSubtotalInclTax($store = null) } /** + * Return the flag for display sales for cart subtotal excluding tax + * * @param null|string|bool|int|Store $store * @return bool */ @@ -418,6 +441,8 @@ public function displayCartSubtotalExclTax($store = null) } /** + * Return the flag for display sales for cart subtotal both including and excluding tax + * * @param null|string|bool|int|Store $store * @return bool */ @@ -431,6 +456,8 @@ public function displayCartSubtotalBoth($store = null) } /** + * Return the flag for display sales for cart shipping including tax + * * @param null|string|bool|int|Store $store * @return bool */ @@ -444,6 +471,8 @@ public function displayCartShippingInclTax($store = null) } /** + * Return the flag for display sales for cart shipping excluding tax + * * @param null|string|bool|int|Store $store * @return bool */ @@ -457,6 +486,8 @@ public function displayCartShippingExclTax($store = null) } /** + * Return the flag for display sales for shipping both including and excluding tax + * * @param null|string|bool|int|Store $store * @return bool */ @@ -470,6 +501,8 @@ public function displayCartShippingBoth($store = null) } /** + * Return the flag for display cart discount for including tax + * * @param null|string|bool|int|Store $store * @return bool * @deprecated 100.1.3 @@ -484,6 +517,8 @@ public function displayCartDiscountInclTax($store = null) } /** + * Return the flag for display cart discount for excluding tax + * * @param null|string|bool|int|Store $store * @return bool * @deprecated 100.1.3 @@ -498,6 +533,8 @@ public function displayCartDiscountExclTax($store = null) } /** + * Return the flag for display cart discount for both including and excluding tax + * * @param null|string|bool|int|Store $store * @return bool * @deprecated 100.1.3 @@ -512,6 +549,8 @@ public function displayCartDiscountBoth($store = null) } /** + * Return the flag for display cart tax with grand total for both including and excluding tax + * * @param null|string|bool|int|Store $store * @return bool */ @@ -525,6 +564,8 @@ public function displayCartTaxWithGrandTotal($store = null) } /** + * Return the flag for display cart full summary + * * @param null|string|bool|int|Store $store * @return bool */ @@ -538,6 +579,8 @@ public function displayCartFullSummary($store = null) } /** + * Return the flag for display cart zero tax + * * @param null|string|bool|int|Store $store * @return bool */ @@ -551,6 +594,8 @@ public function displayCartZeroTax($store = null) } /** + * Return the flag for display sales prices for including tax + * * @param null|string|bool|int|Store $store * @return bool */ @@ -564,6 +609,8 @@ public function displaySalesPricesInclTax($store = null) } /** + * Return the flag for display sales prices for excluding tax + * * @param null|string|bool|int|Store $store * @return bool */ @@ -577,6 +624,8 @@ public function displaySalesPricesExclTax($store = null) } /** + * Return the flag for display sales prices for both including and excluding tax + * * @param null|string|bool|int|Store $store * @return bool */ @@ -590,6 +639,8 @@ public function displaySalesPricesBoth($store = null) } /** + * Return the flag for display sales subtotal for including tax + * * @param null|string|bool|int|Store $store * @return bool */ @@ -603,6 +654,8 @@ public function displaySalesSubtotalInclTax($store = null) } /** + * Return the flag for display sales subtotal for excluding tax + * * @param null|string|bool|int|Store $store * @return bool */ @@ -616,6 +669,8 @@ public function displaySalesSubtotalExclTax($store = null) } /** + * Return the flag for display sales subtotal for both including and excluding tax + * * @param null|string|bool|int|Store $store * @return bool */ @@ -629,6 +684,8 @@ public function displaySalesSubtotalBoth($store = null) } /** + * Return the flag for display sales for shipping including tax + * * @param null|string|bool|int|Store $store * @return bool */ @@ -642,6 +699,8 @@ public function displaySalesShippingInclTax($store = null) } /** + * Return the flag for display sales for shipping excluding tax + * * @param null|string|bool|int|Store $store * @return bool */ @@ -655,6 +714,8 @@ public function displaySalesShippingExclTax($store = null) } /** + * Return the flag for display sales for shipping both including and excluding tax + * * @param null|string|bool|int|Store $store * @return bool */ @@ -668,6 +729,8 @@ public function displaySalesShippingBoth($store = null) } /** + * Return the flag for display sales discount for including tax + * * @param null|string|bool|int|Store $store * @return bool * @deprecated 100.1.3 @@ -682,6 +745,8 @@ public function displaySalesDiscountInclTax($store = null) } /** + * Return the flag for display sales discount for excluding tax + * * @param null|string|bool|int|Store $store * @return bool * @deprecated 100.1.3 @@ -696,6 +761,8 @@ public function displaySalesDiscountExclTax($store = null) } /** + * Return the flag for display sales discount for both including and excluding tax + * * @param null|string|bool|int|Store $store * @return bool * @deprecated 100.1.3 @@ -710,6 +777,8 @@ public function displaySalesDiscountBoth($store = null) } /** + * Return the flag for display sales tax with grand total + * * @param null|string|bool|int|Store $store * @return bool */ @@ -723,6 +792,8 @@ public function displaySalesTaxWithGrandTotal($store = null) } /** + * Return the flag for display sales full summary + * * @param null|string|bool|int|Store $store * @return bool */ @@ -736,6 +807,8 @@ public function displaySalesFullSummary($store = null) } /** + * Return the flag for display sales zero tax + * * @param null|string|bool|int|Store $store * @return bool */ @@ -829,15 +902,16 @@ public function getInfoUrl($store = null) /** * Check if necessary do product price conversion + * * If it necessary will be returned conversion type (minus or plus) * * @param null|int|string|Store $store - * @return bool|int + * @return bool * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function needPriceConversion($store = null) { - $res = 0; + $res = false; $priceIncludesTax = $this->priceIncludesTax($store) || $this->getNeedUseShippingExcludeTax(); if ($priceIncludesTax) { switch ($this->getPriceDisplayType($store)) { @@ -845,7 +919,7 @@ public function needPriceConversion($store = null) case self::DISPLAY_TYPE_BOTH: return self::PRICE_CONVERSION_MINUS; case self::DISPLAY_TYPE_INCLUDING_TAX: - $res = false; + $res = $this->displayCartPricesInclTax($store); break; default: break; From 242aae9f6250bdb3704d8e4e369510e090628405 Mon Sep 17 00:00:00 2001 From: Oleksandr Gorkun <ogorkun@magento.com> Date: Wed, 20 Nov 2019 12:49:20 -0600 Subject: [PATCH 180/595] MAGETWO-55858: Output escaping methods shouldn't be part of AbstractBlock --- lib/internal/Magento/Framework/View/Element/AbstractBlock.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php index 628e595229137..6a098ab5a155d 100644 --- a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php +++ b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php @@ -877,7 +877,7 @@ public static function extractModuleName($className) $namespace = substr( $className, 0, - strpos($className, '\\' . 'Block' . '\\') + (int)strpos($className, '\\' . 'Block' . '\\') ); return str_replace('\\', '_', $namespace); } From 65272509dcb4d948f72a6299b9ca52cc28f21841 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Wed, 20 Nov 2019 16:43:20 +0200 Subject: [PATCH 181/595] magento/magento2#25658: MFTF coverage added. --- .../Test/Mftf/Section/AdminCartPriceRulesFormSection.xml | 1 + .../Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml | 3 +++ app/code/Magento/SalesRule/i18n/en_US.csv | 1 + 3 files changed, 5 insertions(+) diff --git a/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml b/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml index 3849d153be465..39399152f5fab 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml @@ -98,5 +98,6 @@ <element name="couponQty" type="input" selector="#coupons_qty"/> <element name="generateCouponsButton" type="button" selector="#coupons_generate_button" timeout="30"/> <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']"/> </section> </sections> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml index 9d807de409a0c..d719bb90efd59 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml @@ -62,6 +62,9 @@ <waitForPageLoad stepKey="waitFormToReload1"/> <click selector="{{AdminCartPriceRulesFormSection.manageCouponCodesHeader}}" stepKey="expandCouponSection2"/> + <!-- Assert coupon codes grid header is correct --> + <see selector="{{AdminCartPriceRulesFormSection.couponGridUsedHeader}}" userInput="Used" stepKey="seeCorrectUsedHeader"/> + <!-- Grab a coupon code and hold on to it for later --> <grabTextFrom selector="{{AdminCartPriceRulesFormSection.generatedCouponByIndex('1')}}" stepKey="grabCouponCode"/> diff --git a/app/code/Magento/SalesRule/i18n/en_US.csv b/app/code/Magento/SalesRule/i18n/en_US.csv index cd1e471516ac9..83a5aa76ba0c8 100644 --- a/app/code/Magento/SalesRule/i18n/en_US.csv +++ b/app/code/Magento/SalesRule/i18n/en_US.csv @@ -23,6 +23,7 @@ Generate,Generate "Coupon Code","Coupon Code" Created,Created Used,Used +Uses,Uses No,No Yes,Yes "Times Used","Times Used" From 1c17498d35e066ad509d92394e84224f1afa26ea Mon Sep 17 00:00:00 2001 From: Oleksandr Dubovyk <odubovyk@magento.com> Date: Wed, 20 Nov 2019 15:37:35 -0600 Subject: [PATCH 182/595] MC-23192: 'Preview template' functionality places the whole email template into GET parameter - fixed func test --- .../Newsletter/Controller/Adminhtml/Template/Preview.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Newsletter/Controller/Adminhtml/Template/Preview.php b/app/code/Magento/Newsletter/Controller/Adminhtml/Template/Preview.php index 784a62f86b145..c5ed6fb55c48b 100644 --- a/app/code/Magento/Newsletter/Controller/Adminhtml/Template/Preview.php +++ b/app/code/Magento/Newsletter/Controller/Adminhtml/Template/Preview.php @@ -7,11 +7,13 @@ namespace Magento\Newsletter\Controller\Adminhtml\Template; use Magento\Framework\App\Action\HttpPostActionInterface; +use Magento\Framework\App\Action\HttpGetActionInterface; +use Magento\Newsletter\Controller\Adminhtml\Template; /** * View a rendered template. */ -class Preview extends \Magento\Newsletter\Controller\Adminhtml\Template implements HttpPostActionInterface +class Preview extends Template implements HttpPostActionInterface, HttpGetActionInterface { /** * Preview Newsletter template From 59ff70d0473f55fbb6169f6a8c4d9300135def2d Mon Sep 17 00:00:00 2001 From: Oleksandr Gorkun <ogorkun@magento.com> Date: Wed, 20 Nov 2019 15:42:48 -0600 Subject: [PATCH 183/595] MAGETWO-55858: Output escaping methods shouldn't be part of AbstractBlock --- lib/internal/Magento/Framework/View/Element/AbstractBlock.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php index 6a098ab5a155d..802574110d080 100644 --- a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php +++ b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php @@ -822,7 +822,7 @@ public function formatDate( $showTime = false, $timezone = null ) { - $date = $date instanceof \DateTimeInterface ? $date : new \DateTime($date); + $date = $date instanceof \DateTimeInterface ? $date : new \DateTime($date ?? 'now'); return $this->_localeDate->formatDateTime( $date, $format, @@ -845,7 +845,7 @@ public function formatTime( $format = \IntlDateFormatter::SHORT, $showDate = false ) { - $time = $time instanceof \DateTimeInterface ? $time : new \DateTime($time); + $time = $time instanceof \DateTimeInterface ? $time : new \DateTime($time ?? 'now'); return $this->_localeDate->formatDateTime( $time, $showDate ? $format : \IntlDateFormatter::NONE, From d56adbb6e91bb014feafa6febfde65a53b7d3cf3 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Thu, 21 Nov 2019 09:23:14 +0200 Subject: [PATCH 184/595] Revert event add checks that method not fires two times at the time --- lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js index 6cc53e3d40d92..94e931f3349d7 100644 --- a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js +++ b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js @@ -293,6 +293,7 @@ define([ }; varienGlobalEvents.fireEvent('open_browser_callback', payload); + this.eventBus.fireEvent('open_browser_callback', payload); }.bind(this); } @@ -372,7 +373,7 @@ define([ /** * @param {Object} o */ - openFileBrowser: function (o) { + openFileBrowser: _.debounce(function (o) { var typeTitle = this.translate('Select Images'), storeId = this.config['store_id'] ? this.config['store_id'] : 0, frameDialog = jQuery('div.mce-container[role="dialog"]'), @@ -405,7 +406,7 @@ define([ } ); }); - }, + }, 250), /** * @param {String} string From 644ffcd1c5e836c3131de288175880449f63f964 Mon Sep 17 00:00:00 2001 From: Viktor Sevch <svitja@ukr.net> Date: Thu, 21 Nov 2019 10:08:14 +0200 Subject: [PATCH 185/595] MC-18057: Product doesn'y match by "Date" attribute condition --- app/code/Magento/Rule/Model/Condition/AbstractCondition.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Rule/Model/Condition/AbstractCondition.php b/app/code/Magento/Rule/Model/Condition/AbstractCondition.php index f60817cce608b..67fc3590ac501 100644 --- a/app/code/Magento/Rule/Model/Condition/AbstractCondition.php +++ b/app/code/Magento/Rule/Model/Condition/AbstractCondition.php @@ -885,10 +885,8 @@ public function validateAttribute($validatedValue) */ protected function _compareValues($validatedValue, $value, $strict = true) { - if (null === $value || null === $validatedValue) { - return $value == $validatedValue; - } - if ($strict && is_numeric($validatedValue) && is_numeric($value)) { + if (null === $value || null === $validatedValue || + $strict && is_numeric($validatedValue) && is_numeric($value)) { return $validatedValue == $value; } From 748de99356d5fcec2839f860484311255aac7d32 Mon Sep 17 00:00:00 2001 From: Tristan Hofman <tristan@baldwin.be> Date: Thu, 21 Nov 2019 10:56:02 +0100 Subject: [PATCH 186/595] ISSUE 25680 Removed the theme.active.editor block from the layout for swagger index page --- .../Magento/Swagger/view/frontend/layout/swagger_index_index.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Swagger/view/frontend/layout/swagger_index_index.xml b/app/code/Magento/Swagger/view/frontend/layout/swagger_index_index.xml index 5a592b9b7c987..059b9ad445806 100644 --- a/app/code/Magento/Swagger/view/frontend/layout/swagger_index_index.xml +++ b/app/code/Magento/Swagger/view/frontend/layout/swagger_index_index.xml @@ -30,6 +30,7 @@ <!--Remove Magento page content--> <referenceContainer name="page.wrapper" remove="true"/> <referenceBlock name="translate" remove="true"/> + <referenceBlock name="theme.active.editor" remove="true" /> <referenceBlock name="requirejs-config" remove="true"/> <referenceContainer name="root"> <block name="swaggerUiContent" class="Magento\Swagger\Block\Index" template="Magento_Swagger::swagger-ui/index.phtml" /> From 3872f5f63fcb26e13565694392b9feb88c4df9c9 Mon Sep 17 00:00:00 2001 From: Nikita Shcherbatykh <nikita.shcherbatykh@transoftgroup.com> Date: Thu, 21 Nov 2019 13:14:39 +0200 Subject: [PATCH 187/595] MC-22972: Credit memo without refunded shipment produces the negative Grand Total --- .../Model/Order/Creditmemo/Total/TaxTest.php | 137 ++++++++++++++++++ 1 file changed, 137 insertions(+) diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/TaxTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/TaxTest.php index 565d51ff515a2..7d1096b4c9ea1 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/TaxTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/TaxTest.php @@ -610,6 +610,143 @@ public function collectDataProvider() ], ]; + // scenario 6: 2 items, 2 invoiced, price includes tax, full discount, free shipping + // partial credit memo, make sure that discount tax compensation (with 100 % discount) is calculated correctly + $result['collect_with_full_discount_product_price'] = [ + 'order_data' => [ + 'data_fields' => [ + 'discount_amount' => -200.00, + 'discount_invoiced' => -200.00, + 'subtotal' => 181.82, + 'subtotal_incl_tax' => 200, + 'base_subtotal' => 181.82, + 'base_subtotal_incl_tax' => 200, + 'subtotal_invoiced' => 181.82, + 'discount_tax_compensation_amount' => 18.18, + 'discount_tax_compensation_invoiced' => 18.18, + 'base_discount_tax_compensation_amount' => 18.18, + 'base_discount_tax_compensation_invoiced' => 18.18, + 'grand_total' => 0, + 'base_grand_total' => 0, + 'shipping_tax_amount' => 0, + 'base_shipping_tax_amount' => 0, + 'shipping_discount_tax_compensation_amount' => 0, + 'base_shipping_discount_tax_compensation_amount' => 0, + 'tax_amount' => 0, + 'base_tax_amount' => 0, + 'tax_invoiced' => 0, + 'base_tax_invoiced' => 0, + 'tax_refunded' => 0, + 'base_tax_refunded' => 0, + 'base_shipping_amount' => 0, + ], + ], + 'creditmemo_data' => [ + 'items' => [ + 'item_1' => [ + 'order_item' => [ + 'qty_invoiced' => 1, + 'tax_amount' => 0, + 'tax_invoiced' => 0, + 'tax_refunded' => null, + 'base_tax_amount' => 0, + 'base_tax_invoiced' => 0, + 'base_tax_refunded' => 0, + 'tax_percent' => 10, + 'qty_refunded' => 0, + 'discount_percent' => 100, + 'discount_amount' => 100, + 'base_discount_amount' => 100, + 'discount_invoiced' => 100, + 'base_discount_invoiced' => 100, + 'row_total' => 90.91, + 'base_row_total' => 90.91, + 'row_invoiced' => 90.91, + 'base_row_invoiced' => 90.91, + 'price_incl_tax' => 100, + 'base_price_incl_tax' => 100, + 'row_total_incl_tax' => 100, + 'base_row_total_incl_tax' => 100, + 'discount_tax_compensation_amount' => 9.09, + 'base_discount_tax_compensation_amount' => 9.09, + 'discount_tax_compensation_invoiced' => 9.09, + 'base_discount_tax_compensation_invoiced' => 9.09, + ], + 'is_last' => true, + 'qty' => 1, + ], + 'item_2' => [ + 'order_item' => [ + 'qty_invoiced' => 1, + 'tax_amount' => 0, + 'tax_invoiced' => 0, + 'tax_refunded' => null, + 'base_tax_amount' => 0, + 'base_tax_invoiced' => 0, + 'base_tax_refunded' => null, + 'tax_percent' => 10, + 'qty_refunded' => 0, + 'discount_percent' => 100, + 'discount_amount' => 100, + 'base_discount_amount' => 100, + 'discount_invoiced' => 100, + 'base_discount_invoiced' => 100, + 'row_total' => 90.91, + 'base_row_total' => 90.91, + 'row_invoiced' => 90.91, + 'base_row_invoiced' => 90.91, + 'price_incl_tax' => 100, + 'base_price_incl_tax' => 100, + 'row_total_incl_tax' => 100, + 'base_row_total_incl_tax' => 100, + 'discount_tax_compensation_amount' => 9.09, + 'base_discount_tax_compensation_amount' => 9.09, + 'discount_tax_compensation_invoiced' => 9.09, + 'base_discount_tax_compensation_invoiced' => 9.09, + ], + 'is_last' => false, + 'qty' => 0, + ], + ], + 'is_last' => false, + 'data_fields' => [ + 'grand_total' => -9.09, + 'base_grand_total' => -9.09, + 'base_shipping_amount' => 0, + 'tax_amount' => 0, + 'base_tax_amount' => 0, + 'invoice' => new MagentoObject( + [ + 'shipping_tax_amount' => 0, + 'base_shipping_tax_amount' => 0, + 'shipping_discount_tax_compensation_amount' => 0, + 'base_shipping_discount_tax_compensation_amount' => 0, + ] + ), + ], + ], + 'expected_results' => [ + 'creditmemo_items' => [ + 'item_1' => [ + 'tax_amount' => 0, + 'base_tax_amount' => 0, + ], + 'item_2' => [ + 'tax_amount' => 0, + 'base_tax_amount' => 0, + ], + ], + 'creditmemo_data' => [ + 'grand_total' => 0, + 'base_grand_total' => 0, + 'tax_amount' => 0, + 'base_tax_amount' => 0, + 'shipping_tax_amount' => 0, + 'base_shipping_tax_amount' => 0, + ], + ], + ]; + return $result; } From 277bde305a1637f488fc867a47efe8bb247b0962 Mon Sep 17 00:00:00 2001 From: Nikita Shcherbatykh <nikita.shcherbatykh@transoftgroup.com> Date: Thu, 21 Nov 2019 15:35:42 +0200 Subject: [PATCH 188/595] MC-22972: Credit memo without refunded shipment produces the negative Grand Total --- .../Model/Order/Creditmemo/Total/TaxTest.php | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/TaxTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/TaxTest.php index 7d1096b4c9ea1..f32ce7aa4715b 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/TaxTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/TaxTest.php @@ -100,16 +100,18 @@ public function testCollect($orderData, $creditmemoData, $expectedResults) } $this->creditmemo->expects($this->any()) ->method('roundPrice') - ->will($this->returnCallback( - function ($price, $type) use (&$roundingDelta) { - if (!isset($roundingDelta[$type])) { - $roundingDelta[$type] = 0; + ->will( + $this->returnCallback( + function ($price, $type) use (&$roundingDelta) { + if (!isset($roundingDelta[$type])) { + $roundingDelta[$type] = 0; + } + $roundedPrice = round($price + $roundingDelta[$type], 2); + $roundingDelta[$type] = $price - $roundedPrice; + return $roundedPrice; } - $roundedPrice = round($price + $roundingDelta[$type], 2); - $roundingDelta[$type] = $price - $roundedPrice; - return $roundedPrice; - } - )); + ) + ); $this->model->collect($this->creditmemo); From 129771e606bcadca1b7cc7e5e698b8de9e37e35e Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Thu, 21 Nov 2019 21:30:34 +0700 Subject: [PATCH 189/595] Unit Test to cover class \Magento\Captcha\CustomerData\Captcha --- .../Test/Unit/CustomerData/CaptchaTest.php | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 app/code/Magento/Captcha/Test/Unit/CustomerData/CaptchaTest.php diff --git a/app/code/Magento/Captcha/Test/Unit/CustomerData/CaptchaTest.php b/app/code/Magento/Captcha/Test/Unit/CustomerData/CaptchaTest.php new file mode 100644 index 0000000000000..0c2b1975e6cf4 --- /dev/null +++ b/app/code/Magento/Captcha/Test/Unit/CustomerData/CaptchaTest.php @@ -0,0 +1,107 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Captcha\Test\Unit\CustomerData; + +use Magento\Captcha\Helper\Data as CaptchaHelper; +use Magento\Customer\Model\Session as CustomerSession; +use Magento\Captcha\CustomerData\Captcha; +use Magento\Captcha\Model\DefaultModel; +use Magento\Customer\Api\Data\CustomerInterface as CustomerData; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; + +/** + * Test class to cover \Magento\Captcha\CustomerData\Captcha + * + * Class \Magento\Captcha\Test\Unit\CustomerData\CaptchaTest + */ +class CaptchaTest extends \PHPUnit\Framework\TestCase +{ + /** + * @var CaptchaHelper | \PHPUnit_Framework_MockObject_MockObject + */ + private $helper; + + /** + * @var CustomerSession | \PHPUnit_Framework_MockObject_MockObject + */ + private $customerSession; + + /** + * @var CustomerData | \PHPUnit_Framework_MockObject_MockObject + */ + private $customerData; + + /** + * @var Captcha + */ + private $model; + + /** + * @var array + */ + private $formIds; + + /** + * @var ObjectManagerHelper + */ + protected $objectManagerHelper; + + /** + * Create mocks and model + */ + protected function setUp() + { + $this->helper = $this->createMock(CaptchaHelper::class); + $this->customerSession = $this->createMock(CustomerSession::class); + $this->formIds = [ + 'user_login' + ]; + $this->objectManagerHelper = new ObjectManagerHelper($this); + $this->model = $this->objectManagerHelper->getObject( + Captcha::class, + [ + 'helper' => $this->helper, + 'formIds' => $this->formIds, + 'customerSession' => $this->customerSession + ] + ); + } + + /** + * Test getSectionData() when user is login and require captcha + */ + public function testGetSectionData() + { + $emailLogin = 'test@localhost.com'; + + $userLoginModel = $this->createMock(DefaultModel::class); + $userLoginModel->expects($this->any())->method('isRequired')->with($emailLogin) + ->willReturn(true); + $this->helper->expects($this->any())->method('getCaptcha')->with('user_login')->willReturn($userLoginModel); + + $this->customerSession->expects($this->any())->method('isLoggedIn') + ->willReturn(true); + + $this->customerData = $this->createMock(CustomerData::class); + $this->customerData->expects($this->any())->method('getEmail')->willReturn($emailLogin); + $this->customerSession->expects($this->any())->method('getCustomerData') + ->willReturn($this->customerData); + + /* Assert to test */ + $this->assertEquals( + [ + "user_login" => [ + "isRequired" => true, + "timestamp" => time() + ] + ], + $this->model->getSectionData() + ); + } +} From 8d44a36e0bfcb39cd5c9ff79b0a2e03aedd31fd9 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Thu, 21 Nov 2019 22:10:38 +0700 Subject: [PATCH 190/595] [Downloadable Product] Cover Sample DataProvider by Unit Test --- .../Form/Modifier/Data/SamplesTest.php | 158 ++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 app/code/Magento/Downloadable/Test/Unit/Ui/DataProvider/Product/Form/Modifier/Data/SamplesTest.php diff --git a/app/code/Magento/Downloadable/Test/Unit/Ui/DataProvider/Product/Form/Modifier/Data/SamplesTest.php b/app/code/Magento/Downloadable/Test/Unit/Ui/DataProvider/Product/Form/Modifier/Data/SamplesTest.php new file mode 100644 index 0000000000000..2f5b47a1d86b5 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Unit/Ui/DataProvider/Product/Form/Modifier/Data/SamplesTest.php @@ -0,0 +1,158 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Downloadable\Test\Unit\Ui\DataProvider\Product\Form\Modifier\Data; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Downloadable\Ui\DataProvider\Product\Form\Modifier\Data\Samples; +use \Magento\Framework\Escaper; +use Magento\Downloadable\Model\Product\Type; +use Magento\Catalog\Model\Locator\LocatorInterface; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Downloadable\Helper\File as DownloadableFile; +use Magento\Framework\UrlInterface; +use Magento\Catalog\Api\Data\ProductInterface; + +/** + * Test class to cover Sample Modifier + * + * Class \Magento\Downloadable\Test\Unit\Ui\DataProvider\Product\Form\Modifier\Data\SampleTest + */ +class SamplesTest extends \PHPUnit\Framework\TestCase +{ + /** + * @var ObjectManagerHelper + */ + private $objectManagerHelper; + + /** + * @var LocatorInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $locatorMock; + + /** + * @var ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $scopeConfigMock; + + /** + * @var Escaper|\PHPUnit_Framework_MockObject_MockObject + */ + private $escaperMock; + + /** + * @var DownloadableFile|\PHPUnit_Framework_MockObject_MockObject + */ + private $downloadableFileMock; + + /** + * @var UrlInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $urlBuilderMock; + + /** + * @var ProductInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $productMock; + + /** + * @var Samples + */ + private $samples; + + /** + * @return void + */ + protected function setUp() + { + $this->objectManagerHelper = new ObjectManagerHelper($this); + $this->productMock = $this->getMockBuilder(ProductInterface::class) + ->setMethods(['getSamplesTitle', 'getId', 'getTypeId']) + ->getMockForAbstractClass(); + $this->locatorMock = $this->createMock(LocatorInterface::class); + $this->scopeConfigMock = $this->createMock(ScopeConfigInterface::class); + $this->escaperMock = $this->createMock(Escaper::class); + $this->downloadableFileMock = $this->createMock(DownloadableFile::class); + $this->urlBuilderMock = $this->createMock(UrlInterface::class); + $this->samples = $this->objectManagerHelper->getObject( + Samples::class, + [ + 'escaper' => $this->escaperMock, + 'locator' => $this->locatorMock, + 'scopeConfig' => $this->scopeConfigMock, + 'downloadableFile' => $this->downloadableFileMock, + 'urlBuilder' => $this->urlBuilderMock + ] + ); + } + + /** + * Test getSamplesTitle() + * + * @param int|null $id + * @param string $typeId + * @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectedGetTitle + * @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectedGetValue + * @return void + * @dataProvider getSamplesTitleDataProvider + */ + public function testGetSamplesTitle($id, $typeId, $expectedGetTitle, $expectedGetValue) + { + $title = 'My Title'; + $this->locatorMock->expects($this->any()) + ->method('getProduct') + ->willReturn($this->productMock); + $this->productMock->expects($this->once()) + ->method('getId') + ->willReturn($id); + $this->productMock->expects($this->any()) + ->method('getTypeId') + ->willReturn($typeId); + $this->productMock->expects($expectedGetTitle) + ->method('getSamplesTitle') + ->willReturn($title); + $this->scopeConfigMock->expects($expectedGetValue) + ->method('getValue') + ->willReturn($title); + + /* Assert Result */ + $this->assertEquals($title, $this->samples->getSamplesTitle()); + } + + /** + * @return array + */ + public function getSamplesTitleDataProvider() + { + return [ + [ + 'id' => 1, + 'typeId' => Type::TYPE_DOWNLOADABLE, + 'expectedGetTitle' => $this->once(), + 'expectedGetValue' => $this->never(), + ], + [ + 'id' => null, + 'typeId' => Type::TYPE_DOWNLOADABLE, + 'expectedGetTitle' => $this->never(), + 'expectedGetValue' => $this->once(), + ], + [ + 'id' => 1, + 'typeId' => 'someType', + 'expectedGetTitle' => $this->never(), + 'expectedGetValue' => $this->once(), + ], + [ + 'id' => null, + 'typeId' => 'someType', + 'expectedGetTitle' => $this->never(), + 'expectedGetValue' => $this->once(), + ], + ]; + } +} From cef605f171d616d33976ebfcc53874aaf40a2339 Mon Sep 17 00:00:00 2001 From: Oleksandr Gorkun <ogorkun@magento.com> Date: Thu, 21 Nov 2019 10:13:52 -0600 Subject: [PATCH 191/595] MAGETWO-55858: Output escaping methods shouldn't be part of AbstractBlock --- lib/internal/Magento/Framework/View/Element/AbstractBlock.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php index 802574110d080..a70b87b8099f6 100644 --- a/lib/internal/Magento/Framework/View/Element/AbstractBlock.php +++ b/lib/internal/Magento/Framework/View/Element/AbstractBlock.php @@ -874,6 +874,10 @@ public function getModuleName() */ public static function extractModuleName($className) { + if (!$className) { + return ''; + } + $namespace = substr( $className, 0, From cbca71ed3aa091c7144b1c4633ac7155b6becb09 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Thu, 21 Nov 2019 11:38:53 -0600 Subject: [PATCH 192/595] MC-29026: GraphQL returns filters with some data if you making request to not existing or empty category --- .../Resolver/Layer/DataProvider/Filters.php | 21 ++++++++++++++-- .../Model/Resolver/LayerFilters.php | 25 ++++++++++++++++++- .../Plugin/Filters/DataProviderPlugin.php | 11 +++++--- 3 files changed, 51 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Layer/DataProvider/Filters.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Layer/DataProvider/Filters.php index 786d4f1ab867c..9ce7af8b9012d 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Layer/DataProvider/Filters.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Layer/DataProvider/Filters.php @@ -34,14 +34,16 @@ public function __construct( * Get layered navigation filters data * * @param string $layerType + * @param array|null $attributesToFilter * @return array + * @throws \Magento\Framework\Exception\LocalizedException */ - public function getData(string $layerType) : array + public function getData(string $layerType, array $attributesToFilter = null) : array { $filtersData = []; /** @var AbstractFilter $filter */ foreach ($this->filtersProvider->getFilters($layerType) as $filter) { - if ($filter->getItemsCount()) { + if ($this->isNeedToAddFilter($filter, $attributesToFilter)) { $filterGroup = [ 'name' => (string)$filter->getName(), 'filter_items_count' => $filter->getItemsCount(), @@ -60,4 +62,19 @@ public function getData(string $layerType) : array } return $filtersData; } + + private function isNeedToAddFilter(AbstractFilter $filter, array $attributesToFilter): bool + { + if ($attributesToFilter === null) { + $result = (bool)$filter->getItemsCount(); + } else { + try { + $filterAttribute = $filter->getAttributeModel(); + $result = in_array($filterAttribute->getAttributeCode(), $attributesToFilter); + } catch (\Magento\Framework\Exception\LocalizedException $e) { + $result = false; + } + } + return $result; + } } diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/LayerFilters.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/LayerFilters.php index 0ec7e12e42d55..78ac45a1ad001 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/LayerFilters.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/LayerFilters.php @@ -44,6 +44,29 @@ public function resolve( return null; } - return $this->filtersDataProvider->getData($value['layer_type']); + $attributes = $this->prepareAttributesResults($value); + return $this->filtersDataProvider->getData($value['layer_type'], $attributes); + } + + /** + * Get attributes available to filtering from the search result + * + * @param array $value + * @return array|null + */ + private function prepareAttributesResults(array $value): ?array + { + $attributes = []; + if (!empty($value['search_result'])) { + $buckets = $value['search_result']->getSearchAggregation()->getBuckets(); + foreach ($buckets as $bucket) { + if (!empty($bucket->getValues())) { + $attributes[] = str_replace('_bucket', '', $bucket->getName()); + } + } + } else { + $attributes = null; + } + return $attributes; } } diff --git a/app/code/Magento/SwatchesGraphQl/Plugin/Filters/DataProviderPlugin.php b/app/code/Magento/SwatchesGraphQl/Plugin/Filters/DataProviderPlugin.php index 14c4ba62c8a47..f40d893cd30b0 100644 --- a/app/code/Magento/SwatchesGraphQl/Plugin/Filters/DataProviderPlugin.php +++ b/app/code/Magento/SwatchesGraphQl/Plugin/Filters/DataProviderPlugin.php @@ -53,12 +53,17 @@ public function __construct( * @param Filters $subject * @param \Closure $proceed * @param string $layerType + * @param array $attributesToFilter * @return array * @SuppressWarnings(PHPMD.UnusedFormalParameter) * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ - public function aroundGetData(Filters $subject, \Closure $proceed, string $layerType) : array - { + public function aroundGetData( + Filters $subject, + \Closure $proceed, + string $layerType, + array $attributesToFilter = null + ) : array { $swatchFilters = []; /** @var AbstractFilter $filter */ foreach ($this->filtersProvider->getFilters($layerType) as $filter) { @@ -69,7 +74,7 @@ public function aroundGetData(Filters $subject, \Closure $proceed, string $layer } } - $filtersData = $proceed($layerType); + $filtersData = $proceed($layerType, $attributesToFilter); foreach ($filtersData as $groupKey => $filterGroup) { /** @var AbstractFilter $swatchFilter */ From 33b33e97c55bc099b99740fe180603360d04bc79 Mon Sep 17 00:00:00 2001 From: Lyzun Oleksandr <alex.nuzil@gmail.com> Date: Thu, 21 Nov 2019 18:40:30 +0100 Subject: [PATCH 193/595] Add Tests for operation statuses endpoint --- .../Api/BulkStatusInterfaceTest.php | 39 +++++++++++++++++++ .../Api/OperationRepositoryInterfaceTest.php | 4 +- .../_files/operation_searchable.php | 17 +++++++- 3 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/BulkStatusInterfaceTest.php diff --git a/dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/BulkStatusInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/BulkStatusInterfaceTest.php new file mode 100644 index 0000000000000..771e0d3079b7f --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/BulkStatusInterfaceTest.php @@ -0,0 +1,39 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\AsynchronousOperations\Api; + +use Magento\TestFramework\TestCase\WebapiAbstract; +use Magento\Framework\Bulk\OperationInterface; + +class BulkStatusInterfaceTest extends WebapiAbstract +{ + const RESOURCE_PATH = '/V1/bulk/'; + const SERVICE_NAME = 'asynchronousOperationsBulkStatusV1'; + const TEST_UUID = "bulk-uuid-searchable-6"; + + /** + * @magentoApiDataFixture Magento/AsynchronousOperations/_files/operation_searchable.php + */ + public function testGetListByBulkStartTime() + { + + $serviceInfo = [ + 'rest' => [ + 'resourcePath' => self::RESOURCE_PATH . self::TEST_UUID . "/operation-status/" . OperationInterface::STATUS_TYPE_OPEN, + 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_GET + ], + 'soap' => [ + 'service' => self::SERVICE_NAME, + 'operation' => self::SERVICE_NAME . 'Get', + ], + ]; + $qty = $this->_webApiCall($serviceInfo); + $this->assertEquals(2, $qty); + } +} diff --git a/dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/OperationRepositoryInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/OperationRepositoryInterfaceTest.php index 8eab6c9fd8676..81ed561a9803e 100644 --- a/dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/OperationRepositoryInterfaceTest.php +++ b/dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/OperationRepositoryInterfaceTest.php @@ -57,8 +57,8 @@ public function testGetListByBulkStartTime() $this->assertArrayHasKey('items', $response); $this->assertEquals($searchCriteria['searchCriteria'], $response['search_criteria']); - $this->assertEquals(3, $response['total_count']); - $this->assertEquals(3, count($response['items'])); + $this->assertEquals(5, $response['total_count']); + $this->assertEquals(5, count($response['items'])); foreach ($response['items'] as $item) { $this->assertEquals('bulk-uuid-searchable-6', $item['bulk_uuid']); diff --git a/dev/tests/integration/testsuite/Magento/AsynchronousOperations/_files/operation_searchable.php b/dev/tests/integration/testsuite/Magento/AsynchronousOperations/_files/operation_searchable.php index e74f995f8b57b..7e0d7594c3510 100644 --- a/dev/tests/integration/testsuite/Magento/AsynchronousOperations/_files/operation_searchable.php +++ b/dev/tests/integration/testsuite/Magento/AsynchronousOperations/_files/operation_searchable.php @@ -52,7 +52,22 @@ 'error_code' => 2222, 'result_message' => 'Entity with ID=4 does not exist', ], - + [ + 'bulk_uuid' => 'bulk-uuid-searchable-6', + 'topic_name' => 'topic-5', + 'serialized_data' => json_encode(['entity_id' => 5]), + 'status' => OperationInterface::STATUS_TYPE_OPEN, + 'error_code' => null, + 'result_message' => '', + ], + [ + 'bulk_uuid' => 'bulk-uuid-searchable-6', + 'topic_name' => 'topic-5', + 'serialized_data' => json_encode(['entity_id' => 5]), + 'status' => OperationInterface::STATUS_TYPE_OPEN, + 'error_code' => null, + 'result_message' => '', + ] ]; $bulkQuery = "INSERT INTO {$bulkTable} (`uuid`, `user_id`, `description`, `operation_count`, `start_time`)" From 871321f7e8eea79982c8d0f7de06d6ad67df1f67 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Thu, 21 Nov 2019 12:47:18 -0600 Subject: [PATCH 194/595] MC-29026: GraphQL returns filters with some data if you making request to not existing or empty category --- .../Model/Resolver/Layer/DataProvider/Filters.php | 14 +++++++++++--- .../Plugin/Filters/DataProviderPlugin.php | 5 ++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Layer/DataProvider/Filters.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Layer/DataProvider/Filters.php index 9ce7af8b9012d..fa1807b5709a8 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Layer/DataProvider/Filters.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Layer/DataProvider/Filters.php @@ -9,6 +9,7 @@ use Magento\Catalog\Model\Layer\Filter\AbstractFilter; use Magento\CatalogGraphQl\Model\Resolver\Layer\FiltersProvider; +use Magento\Catalog\Model\Layer\Filter\Item; /** * Layered navigation filters data provider. @@ -49,7 +50,7 @@ public function getData(string $layerType, array $attributesToFilter = null) : a 'filter_items_count' => $filter->getItemsCount(), 'request_var' => $filter->getRequestVar(), ]; - /** @var \Magento\Catalog\Model\Layer\Filter\Item $filterItem */ + /** @var Item $filterItem */ foreach ($filter->getItems() as $filterItem) { $filterGroup['filter_items'][] = [ 'label' => (string)$filterItem->getLabel(), @@ -63,15 +64,22 @@ public function getData(string $layerType, array $attributesToFilter = null) : a return $filtersData; } + /** + * Check for adding filter to the list + * + * @param AbstractFilter $filter + * @param array $attributesToFilter + * @return bool + */ private function isNeedToAddFilter(AbstractFilter $filter, array $attributesToFilter): bool { if ($attributesToFilter === null) { $result = (bool)$filter->getItemsCount(); } else { - try { + if ($filter->hasAttributeModel()) { $filterAttribute = $filter->getAttributeModel(); $result = in_array($filterAttribute->getAttributeCode(), $attributesToFilter); - } catch (\Magento\Framework\Exception\LocalizedException $e) { + } else { $result = false; } } diff --git a/app/code/Magento/SwatchesGraphQl/Plugin/Filters/DataProviderPlugin.php b/app/code/Magento/SwatchesGraphQl/Plugin/Filters/DataProviderPlugin.php index f40d893cd30b0..947018ce1bdf4 100644 --- a/app/code/Magento/SwatchesGraphQl/Plugin/Filters/DataProviderPlugin.php +++ b/app/code/Magento/SwatchesGraphQl/Plugin/Filters/DataProviderPlugin.php @@ -53,10 +53,12 @@ public function __construct( * @param Filters $subject * @param \Closure $proceed * @param string $layerType - * @param array $attributesToFilter + * @param array|null $attributesToFilter * @return array + * @throws \Magento\Framework\Exception\LocalizedException * @SuppressWarnings(PHPMD.UnusedFormalParameter) * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * phpcs:disable Generic.Metrics.NestingLevel */ public function aroundGetData( Filters $subject, @@ -97,4 +99,5 @@ public function aroundGetData( return $filtersData; } + //phpcs:enable } From 669e717c9b6a6860aba67db7650031e0e80af3c7 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Thu, 21 Nov 2019 13:37:59 -0600 Subject: [PATCH 195/595] MC-29026: GraphQL returns filters with some data if you making request to not existing or empty category --- .../Model/Resolver/Layer/DataProvider/Filters.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Layer/DataProvider/Filters.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Layer/DataProvider/Filters.php index fa1807b5709a8..c16a174f7787c 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Layer/DataProvider/Filters.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Layer/DataProvider/Filters.php @@ -21,6 +21,11 @@ class Filters */ private $filtersProvider; + /** + * @var array + */ + private $mappings; + /** * Filters constructor. * @param FiltersProvider $filtersProvider @@ -29,6 +34,9 @@ public function __construct( FiltersProvider $filtersProvider ) { $this->filtersProvider = $filtersProvider; + $this->mappings = [ + 'Category' => 'category' + ]; } /** @@ -70,6 +78,7 @@ public function getData(string $layerType, array $attributesToFilter = null) : a * @param AbstractFilter $filter * @param array $attributesToFilter * @return bool + * @throws \Magento\Framework\Exception\LocalizedException */ private function isNeedToAddFilter(AbstractFilter $filter, array $attributesToFilter): bool { @@ -79,6 +88,8 @@ private function isNeedToAddFilter(AbstractFilter $filter, array $attributesToFi if ($filter->hasAttributeModel()) { $filterAttribute = $filter->getAttributeModel(); $result = in_array($filterAttribute->getAttributeCode(), $attributesToFilter); + } elseif (!empty($this->mappings[$filter->getName()])) { + $result = in_array($this->mappings[$filter->getName()], $attributesToFilter); } else { $result = false; } From 4f7497c84b4aafff5777a5d21f8e0a7ed93303df Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Thu, 21 Nov 2019 14:28:24 -0600 Subject: [PATCH 196/595] MC-29026: GraphQL returns filters with some data if you making request to not existing or empty category --- .../SwatchesGraphQl/Plugin/Filters/DataProviderPlugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/SwatchesGraphQl/Plugin/Filters/DataProviderPlugin.php b/app/code/Magento/SwatchesGraphQl/Plugin/Filters/DataProviderPlugin.php index 947018ce1bdf4..22178b65203af 100644 --- a/app/code/Magento/SwatchesGraphQl/Plugin/Filters/DataProviderPlugin.php +++ b/app/code/Magento/SwatchesGraphQl/Plugin/Filters/DataProviderPlugin.php @@ -61,10 +61,10 @@ public function __construct( * phpcs:disable Generic.Metrics.NestingLevel */ public function aroundGetData( - Filters $subject, + Flters $subject, \Closure $proceed, string $layerType, - array $attributesToFilter = null + $attributesToFilter = null ) : array { $swatchFilters = []; /** @var AbstractFilter $filter */ From fb108a7efec2916c50c123db50e72a48ea883e21 Mon Sep 17 00:00:00 2001 From: Oleksandr Gorkun <ogorkun@magento.com> Date: Thu, 21 Nov 2019 14:38:58 -0600 Subject: [PATCH 197/595] MAGETWO-55858: Output escaping methods shouldn't be part of AbstractBlock --- .../Test/Unit/Block/Widget/DobTest.php | 10 ++- .../Encryption/Test/Unit/EncryptorTest.php | 17 ++-- .../Locale/Test/Unit/TranslatedListsTest.php | 88 +++++++++++++++---- 3 files changed, 91 insertions(+), 24 deletions(-) diff --git a/app/code/Magento/Customer/Test/Unit/Block/Widget/DobTest.php b/app/code/Magento/Customer/Test/Unit/Block/Widget/DobTest.php index b1d7c455324b3..1fd7fc340e542 100644 --- a/app/code/Magento/Customer/Test/Unit/Block/Widget/DobTest.php +++ b/app/code/Magento/Customer/Test/Unit/Block/Widget/DobTest.php @@ -354,7 +354,15 @@ public function testGetDateFormat(string $locale, string $expectedFormat) public function getDateFormatDataProvider(): array { return [ - ['ar_SA', 'd/M/y'], + [ + 'ar_SA', + preg_replace( + '/[^MmDdYy\/\.\-]/', + '', + (new \IntlDateFormatter('ar_SA', \IntlDateFormatter::SHORT, \IntlDateFormatter::NONE)) + ->getPattern() + ) + ], [Resolver::DEFAULT_LOCALE, self::DATE_FORMAT], ]; } diff --git a/lib/internal/Magento/Framework/Encryption/Test/Unit/EncryptorTest.php b/lib/internal/Magento/Framework/Encryption/Test/Unit/EncryptorTest.php index 6478b74ac05cd..c87982ff5e3e6 100644 --- a/lib/internal/Magento/Framework/Encryption/Test/Unit/EncryptorTest.php +++ b/lib/internal/Magento/Framework/Encryption/Test/Unit/EncryptorTest.php @@ -135,8 +135,11 @@ public function testGetHashRandomSaltSpecifiedLength(): void * * @dataProvider validateHashDataProvider */ - public function testValidateHash($password, $hash, $expected): void + public function testValidateHash($password, $hash, $expected, int $requiresVersion): void { + if ($requiresVersion > $this->encryptor->getLatestHashVersion()) { + $this->markTestSkipped('On current installation encryptor does not support algo #' .$requiresVersion); + } $actual = $this->encryptor->validateHash($password, $hash); $this->assertEquals($expected, $actual); } @@ -149,10 +152,14 @@ public function testValidateHash($password, $hash, $expected): void public function validateHashDataProvider(): array { return [ - ['password', 'hash:salt:1', false], - ['password', '67a1e09bb1f83f5007dc119c14d663aa:salt:0', true], - ['password', '13601bda4ea78e55a07b98866d2be6be0744e3866f13c00c811cab608a28f322:salt:1', true], - ['password', 'c6aad9e058f6c4b06187c06d2b69bf506a786af030f81fb6d83778422a68205e:salt:1:2', true], + ['password', 'hash:salt:1', false, 1], + ['password', '67a1e09bb1f83f5007dc119c14d663aa:salt:0', true, 0], + ['password', '13601bda4ea78e55a07b98866d2be6be0744e3866f13c00c811cab608a28f322:salt:1', true, 1], + //Hashes after customer:hash:upgrade command issued + //Upgraded from version #1 to #2 + ['password', 'c6aad9e058f6c4b06187c06d2b69bf506a786af030f81fb6d83778422a68205e:salt:1:2', true, 2], + //From #0 to #1 + ['password', '3b68ca4706cbae291455e4340478076c1e1618e742b6144cfcc3e50f648903e4:salt:0:1', true, 1] ]; } diff --git a/lib/internal/Magento/Framework/Locale/Test/Unit/TranslatedListsTest.php b/lib/internal/Magento/Framework/Locale/Test/Unit/TranslatedListsTest.php index 0d51d6fbda305..1d15d2de9f161 100644 --- a/lib/internal/Magento/Framework/Locale/Test/Unit/TranslatedListsTest.php +++ b/lib/internal/Magento/Framework/Locale/Test/Unit/TranslatedListsTest.php @@ -44,24 +44,36 @@ class TranslatedListsTest extends TestCase * @var array */ private $expectedLocales = [ - 'en_US' => 'English (United States)', - 'en_GB' => 'English (United Kingdom)', - 'uk_UA' => 'Ukrainian (Ukraine)', - 'de_DE' => 'German (Germany)', - 'sr_Cyrl_RS' => 'Serbian (Cyrillic, Serbia)', - 'sr_Latn_RS' => 'Serbian (Latin, Serbia)' + 'en_US', + 'en_GB', + 'uk_UA', + 'de_DE', + 'sr_Cyrl_RS', + 'sr_Latn_RS' ]; /** - * @var array + * @var string[] + */ + private $languages = [ + 'en_US' => 'English', + 'en_GB' => 'English', + 'uk_UA' => 'Ukrainian', + 'de_DE' => 'German', + 'sr_Cyrl_RS' => 'Serbian', + 'sr_Latn_RS' => 'Serbian' + ]; + + /** + * @var string[] */ - private $expectedTranslatedLocales = [ - 'en_US' => 'English (United States) / English (United States)', - 'en_GB' => 'English (United Kingdom) / English (United Kingdom)', - 'uk_UA' => 'українська (Україна) / Ukrainian (Ukraine)', - 'de_DE' => 'Deutsch (Deutschland) / German (Germany)', - 'sr_Cyrl_RS' => 'српски (ћирилица, Србија) / Serbian (Cyrillic, Serbia)', - 'sr_Latn_RS' => 'Srpski (latinica, Srbija) / Serbian (Latin, Serbia)' + private $countries = [ + 'en_US' => 'United States', + 'en_GB' => 'United Kingdom', + 'uk_UA' => 'Ukraine', + 'de_DE' => 'Germany', + 'sr_Cyrl_RS' => 'Serbia', + 'sr_Latn_RS' => 'Serbia' ]; protected function setUp() @@ -168,20 +180,22 @@ public function testGetOptionTimezones() public function testGetOptionLocales() { + $expected = $this->getExpectedLocales(); $locales = array_intersect( - $this->expectedLocales, + $expected, $this->convertOptionLocales($this->listsModel->getOptionLocales()) ); - $this->assertEquals($this->expectedLocales, $locales); + $this->assertEquals($expected, $locales); } public function testGetTranslatedOptionLocales() { + $expected = $this->getExpectedTranslatedLocales(); $locales = array_intersect( - $this->expectedTranslatedLocales, + $expected, $this->convertOptionLocales($this->listsModel->getTranslatedOptionLocales()) ); - $this->assertEquals($this->expectedTranslatedLocales, $locales); + $this->assertEquals($expected, $locales); } /** @@ -198,4 +212,42 @@ private function convertOptionLocales($optionLocales): array return $result; } + + /** + * Expected translated locales list. + * + * @return string[] + */ + private function getExpectedTranslatedLocales(): array + { + $expected = []; + foreach ($this->expectedLocales as $locale) { + $script = \Locale::getDisplayScript($locale); + $scriptTranslated = $script ? \Locale::getDisplayScript($locale, $locale) .', ' : ''; + $expected[$locale] = ucwords(\Locale::getDisplayLanguage($locale, $locale)) + . ' (' . $scriptTranslated + . \Locale::getDisplayRegion($locale, $locale) . ') / ' + . $this->languages[$locale] + . ' (' . ($script ? $script .', ' : '') . $this->countries[$locale] . ')'; + } + + return $expected; + } + + /** + * Expected locales list. + * + * @return string[] + */ + private function getExpectedLocales(): array + { + $expected = []; + foreach ($this->expectedLocales as $locale) { + $script = \Locale::getScript($locale); + $scriptDisplayed = $script ? \Locale::getDisplayScript($locale) . ', ' : ''; + $expected[$locale] = $this->languages[$locale] .' (' .$scriptDisplayed .$this->countries[$locale] .')'; + } + + return $expected; + } } From 76b782005c1913981244f1547d74af5ef80c7433 Mon Sep 17 00:00:00 2001 From: Iryna Lagno <ilagno@adobe.com> Date: Thu, 21 Nov 2019 15:08:52 -0600 Subject: [PATCH 198/595] MC-17545: Remove deprecation annotations from the PatchVersionInterface --- .../Magento/Framework/Setup/Patch/PatchVersionInterface.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/Setup/Patch/PatchVersionInterface.php b/lib/internal/Magento/Framework/Setup/Patch/PatchVersionInterface.php index fb2b0e2c379f4..1638d67041a11 100644 --- a/lib/internal/Magento/Framework/Setup/Patch/PatchVersionInterface.php +++ b/lib/internal/Magento/Framework/Setup/Patch/PatchVersionInterface.php @@ -6,9 +6,8 @@ namespace Magento\Framework\Setup\Patch; /** - * For backward compatibility with versioned style module installation. Deprecated since creation. + * For backward compatibility with versioned style module installation. * - * @deprecated */ interface PatchVersionInterface { @@ -19,7 +18,6 @@ interface PatchVersionInterface * by old mechanism of UpgradeData.php script * * @return string - * @deprecated since appearance, required for backward compatibility */ public static function getVersion(); } From bb2d0f8cf6c3f701a086a58caf425943b97a15b6 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Thu, 21 Nov 2019 15:16:12 -0600 Subject: [PATCH 199/595] MC-29026: GraphQL returns filters with some data if you making request to not existing or empty category --- .../Model/Resolver/Layer/DataProvider/Filters.php | 9 ++++++--- .../Plugin/Filters/DataProviderPlugin.php | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Layer/DataProvider/Filters.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Layer/DataProvider/Filters.php index c16a174f7787c..75186ac58384f 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Layer/DataProvider/Filters.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Layer/DataProvider/Filters.php @@ -88,10 +88,13 @@ private function isNeedToAddFilter(AbstractFilter $filter, array $attributesToFi if ($filter->hasAttributeModel()) { $filterAttribute = $filter->getAttributeModel(); $result = in_array($filterAttribute->getAttributeCode(), $attributesToFilter); - } elseif (!empty($this->mappings[$filter->getName()])) { - $result = in_array($this->mappings[$filter->getName()], $attributesToFilter); } else { - $result = false; + $name = (string)$filter->getName(); + if (array_key_exists($name, $this->mappings)) { + $result = in_array($this->mappings[$name], $attributesToFilter); + } else { + $result = false; + } } } return $result; diff --git a/app/code/Magento/SwatchesGraphQl/Plugin/Filters/DataProviderPlugin.php b/app/code/Magento/SwatchesGraphQl/Plugin/Filters/DataProviderPlugin.php index 22178b65203af..9b3c96cabbab9 100644 --- a/app/code/Magento/SwatchesGraphQl/Plugin/Filters/DataProviderPlugin.php +++ b/app/code/Magento/SwatchesGraphQl/Plugin/Filters/DataProviderPlugin.php @@ -61,7 +61,7 @@ public function __construct( * phpcs:disable Generic.Metrics.NestingLevel */ public function aroundGetData( - Flters $subject, + Filters $subject, \Closure $proceed, string $layerType, $attributesToFilter = null From 37106029ec063d5e9710ee70ee4a0ed9239536f0 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Thu, 21 Nov 2019 15:47:38 -0600 Subject: [PATCH 200/595] MC-29026: GraphQL returns filters with some data if you making request to not existing or empty category --- .../SwatchesGraphQl/Plugin/Filters/DataProviderPlugin.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/SwatchesGraphQl/Plugin/Filters/DataProviderPlugin.php b/app/code/Magento/SwatchesGraphQl/Plugin/Filters/DataProviderPlugin.php index 9b3c96cabbab9..c14ec68b9ab38 100644 --- a/app/code/Magento/SwatchesGraphQl/Plugin/Filters/DataProviderPlugin.php +++ b/app/code/Magento/SwatchesGraphQl/Plugin/Filters/DataProviderPlugin.php @@ -36,6 +36,7 @@ class DataProviderPlugin * * @param FiltersProvider $filtersProvider * @param \Magento\Swatches\Helper\Data $swatchHelper + * @param \Magento\Swatches\Block\LayeredNavigation\RenderLayered $renderLayered */ public function __construct( FiltersProvider $filtersProvider, From be319e9114ecbeee75e1c65473f80f68dfb3d1af Mon Sep 17 00:00:00 2001 From: Alex Ghiban <drew7721@gmail.com> Date: Thu, 21 Nov 2019 16:58:56 -0500 Subject: [PATCH 201/595] Remove UserLockedException catch. `UserLockedException` extends `AuthenticationException` and provides the same message. These lines were useless. --- app/code/Magento/Customer/Controller/Account/LoginPost.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/code/Magento/Customer/Controller/Account/LoginPost.php b/app/code/Magento/Customer/Controller/Account/LoginPost.php index 4091a068e3094..011d8f5c944d6 100644 --- a/app/code/Magento/Customer/Controller/Account/LoginPost.php +++ b/app/code/Magento/Customer/Controller/Account/LoginPost.php @@ -204,11 +204,6 @@ public function execute() 'This account is not confirmed. <a href="%1">Click here</a> to resend confirmation email.', $value ); - } catch (UserLockedException $e) { - $message = __( - 'The account sign-in was incorrect or your account is disabled temporarily. ' - . 'Please wait and try again later.' - ); } catch (AuthenticationException $e) { $message = __( 'The account sign-in was incorrect or your account is disabled temporarily. ' From 1030ac0bfa0941126d389a6a10eafa253b6dec8a Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Thu, 21 Nov 2019 16:54:23 -0600 Subject: [PATCH 202/595] MC-29026: GraphQL returns filters with some data if you making request to not existing or empty category --- .../Model/Resolver/Layer/DataProvider/Filters.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Layer/DataProvider/Filters.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Layer/DataProvider/Filters.php index 75186ac58384f..f6d8edf1fe9b5 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Layer/DataProvider/Filters.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Layer/DataProvider/Filters.php @@ -93,7 +93,7 @@ private function isNeedToAddFilter(AbstractFilter $filter, array $attributesToFi if (array_key_exists($name, $this->mappings)) { $result = in_array($this->mappings[$name], $attributesToFilter); } else { - $result = false; + $result = true; } } } From ddb9acb6aab086844306e637c38e01b1433de583 Mon Sep 17 00:00:00 2001 From: Mateusz Krzeszowiak <mateusz.krzeszowiak@creativestyle.pl> Date: Fri, 22 Nov 2019 00:01:10 +0100 Subject: [PATCH 203/595] Fix document elements check to prevent WYSIWYG error on IE When creating a document using DomParser's parseFromString method from an empty string, IE 11 returns a document which both head and body elements are null, which caused the errors. Fixes https://github.com/magento/magento2/issues/13209 --- .../tiny_mce/plugins/magentovariable/editor_plugin.js | 6 ++---- .../wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js index 92c13fca63920..e54aaa1006d4b 100644 --- a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js +++ b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js @@ -196,10 +196,8 @@ define([ } }); - returnval += doc.head.innerHTML ? - doc.head.innerHTML.replace(/&quot;/g, '"') : ''; - returnval += doc.body.innerHTML ? - doc.body.innerHTML.replace(/&quot;/g, '"') : ''; + returnval += doc.head ? doc.head.innerHTML.replace(/&quot;/g, '"') : ''; + returnval += doc.body ? doc.body.innerHTML.replace(/&quot;/g, '"') : ''; return returnval ? returnval : content; }, diff --git a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js index e6669d77a3889..f163206a13656 100644 --- a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js +++ b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js @@ -212,10 +212,8 @@ define([ widgetEl.parentNode.removeChild(widgetEl); }); - returnval += doc.head.innerHTML ? - doc.head.innerHTML.replace(/&quot;/g, '"') : ''; - returnval += doc.body.innerHTML ? - doc.body.innerHTML.replace(/&quot;/g, '"') : ''; + returnval += doc.head ? doc.head.innerHTML.replace(/&quot;/g, '"') : ''; + returnval += doc.body ? doc.body.innerHTML.replace(/&quot;/g, '"') : ''; return returnval ? returnval : content; }, From 982d64a1aaf43843b07c3b05b2e13d70a06ce080 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Thu, 21 Nov 2019 17:25:25 -0600 Subject: [PATCH 204/595] MC-29026: GraphQL returns filters with some data if you making request to not existing or empty category --- .../GraphQl/Catalog/ProductSearchTest.php | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php index e1615eb9a667e..6e732d68fe7d3 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php @@ -31,6 +31,37 @@ */ class ProductSearchTest extends GraphQlAbstract { + /** + * Verify that filters for non-existing category are empty + * + * @throws \Exception + */ + public function testFilterForNonExistingCategory() + { + $query = <<<QUERY +{ + products(filter: {category_id: {eq: "99999999"}}) { + filters { + name + } + } +} +QUERY; + + $response = $this->graphQlQuery($query); + + $this->assertArrayHasKey( + 'filters', + $response['products'], + 'Filters are missing in product query result.' + ); + + $this->assertEmpty( + $response['products']['filters'], + 'Returned filters data set does not empty' + ); + } + /** * Verify that layered navigation filters and aggregations are correct for product query * From 7534f33b2bbed6d1bb86e6b3fb22218d45c97158 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Fri, 22 Nov 2019 13:01:32 +0700 Subject: [PATCH 205/595] Refactor to pass review --- .../Captcha/Test/Unit/CustomerData/CaptchaTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Captcha/Test/Unit/CustomerData/CaptchaTest.php b/app/code/Magento/Captcha/Test/Unit/CustomerData/CaptchaTest.php index 0c2b1975e6cf4..b34de7778e176 100644 --- a/app/code/Magento/Captcha/Test/Unit/CustomerData/CaptchaTest.php +++ b/app/code/Magento/Captcha/Test/Unit/CustomerData/CaptchaTest.php @@ -23,17 +23,17 @@ class CaptchaTest extends \PHPUnit\Framework\TestCase { /** - * @var CaptchaHelper | \PHPUnit_Framework_MockObject_MockObject + * @var CaptchaHelper|\PHPUnit_Framework_MockObject_MockObject */ private $helper; /** - * @var CustomerSession | \PHPUnit_Framework_MockObject_MockObject + * @var CustomerSession|\PHPUnit_Framework_MockObject_MockObject */ private $customerSession; /** - * @var CustomerData | \PHPUnit_Framework_MockObject_MockObject + * @var CustomerData|\PHPUnit_Framework_MockObject_MockObject */ private $customerData; @@ -76,7 +76,7 @@ protected function setUp() /** * Test getSectionData() when user is login and require captcha */ - public function testGetSectionData() + public function testGetSectionDataWhenLoginAndRequireCaptcha() { $emailLogin = 'test@localhost.com'; From 822364927cfda079506ab0400734f7acbc372418 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Fri, 22 Nov 2019 11:10:42 +0200 Subject: [PATCH 206/595] Adding dependency for New Relic system configs --- .../etc/adminhtml/system.xml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/app/code/Magento/NewRelicReporting/etc/adminhtml/system.xml b/app/code/Magento/NewRelicReporting/etc/adminhtml/system.xml index 98f9c55adbdf0..60c52164021d9 100644 --- a/app/code/Magento/NewRelicReporting/etc/adminhtml/system.xml +++ b/app/code/Magento/NewRelicReporting/etc/adminhtml/system.xml @@ -19,37 +19,61 @@ </field> <field id="api_url" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> <label>New Relic API URL</label> + <depends> + <field id="enable">1</field> + </depends> </field> <field id="insights_api_url" translate="label comment" type="text" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> <label>Insights API URL</label> <comment>Use %s to replace the account ID in the URL</comment> + <depends> + <field id="enable">1</field> + </depends> </field> <field id="account_id" translate="label comment" type="text" sortOrder="4" showInDefault="1" showInWebsite="1" showInStore="1"> <label>New Relic Account ID</label> <comment><![CDATA["Need a New Relic account? <a href="http://www.newrelic.com/magento" target="_blank">Click here to get one]]></comment> + <depends> + <field id="enable">1</field> + </depends> </field> <field id="app_id" translate="label comment" type="text" sortOrder="5" showInDefault="1" showInWebsite="1" showInStore="1"> <label>New Relic Application ID</label> <comment>This can commonly be found at the end of the URL when viewing the APM after "/applications/"</comment> + <depends> + <field id="enable">1</field> + </depends> </field> <field id="api" translate="label comment" type="obscure" sortOrder="6" showInDefault="1" showInWebsite="1" showInStore="1"> <label>New Relic API Key</label> <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model> <comment>This is located by navigating to Events -> Deployments from the New Relic APM website</comment> + <depends> + <field id="enable">1</field> + </depends> </field> <field id="insights_insert_key" translate="label comment" type="obscure" sortOrder="7" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Insights API Key</label> <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model> <comment>Generated under Insights in Manage data -> API Keys -> Insert Keys</comment> + <depends> + <field id="enable">1</field> + </depends> </field> <field id="app_name" translate="label comment" type="text" sortOrder="8" showInDefault="1" showInWebsite="1" showInStore="1"> <label>New Relic Application Name</label> <comment>This is located by navigating to Settings from the New Relic APM website</comment> + <depends> + <field id="enable">1</field> + </depends> </field> <field id="separate_apps" translate="label comment" type="select" sortOrder="9" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Send Adminhtml and Frontend as Separate Apps</label> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> <comment>In addition to the main app (which includes all PHP execution), separate apps for adminhtml and frontend will be created. Requires New Relic Application Name to be set.</comment> + <depends> + <field id="enable">1</field> + </depends> </field> </group> <group id="cron" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1"> From 9ce49c47861dd1ca058d516f02b2da7441ce203b Mon Sep 17 00:00:00 2001 From: Lyzun Oleksandr <alex.nuzil@gmail.com> Date: Fri, 22 Nov 2019 11:01:54 +0100 Subject: [PATCH 207/595] Fix tests --- .../Api/BulkStatusInterfaceTest.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/BulkStatusInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/BulkStatusInterfaceTest.php index 771e0d3079b7f..de4ec207653a3 100644 --- a/dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/BulkStatusInterfaceTest.php +++ b/dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/BulkStatusInterfaceTest.php @@ -15,6 +15,7 @@ class BulkStatusInterfaceTest extends WebapiAbstract { const RESOURCE_PATH = '/V1/bulk/'; const SERVICE_NAME = 'asynchronousOperationsBulkStatusV1'; + const GET_COUNT_OPERATION_NAME = "GetOperationsCountByBulkIdAndStatus"; const TEST_UUID = "bulk-uuid-searchable-6"; /** @@ -22,18 +23,22 @@ class BulkStatusInterfaceTest extends WebapiAbstract */ public function testGetListByBulkStartTime() { - + $resourcePath = self::RESOURCE_PATH . self::TEST_UUID . "/operation-status/" . OperationInterface::STATUS_TYPE_OPEN; $serviceInfo = [ 'rest' => [ - 'resourcePath' => self::RESOURCE_PATH . self::TEST_UUID . "/operation-status/" . OperationInterface::STATUS_TYPE_OPEN, + 'resourcePath' => $resourcePath, 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_GET ], 'soap' => [ 'service' => self::SERVICE_NAME, - 'operation' => self::SERVICE_NAME . 'Get', + 'serviceVersion' => 'V1', + 'operation' => self::SERVICE_NAME . self::GET_COUNT_OPERATION_NAME ], ]; - $qty = $this->_webApiCall($serviceInfo); + $qty = $this->_webApiCall( + $serviceInfo, + ['bulkUuid' => self::TEST_UUID, 'status' => OperationInterface::STATUS_TYPE_OPEN] + ); $this->assertEquals(2, $qty); } } From a880a833582e76446ca12e23850805da0357299c Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Fri, 22 Nov 2019 14:38:47 +0200 Subject: [PATCH 208/595] remove duplicated events on wisiwyg initialization --- lib/internal/Magento/Framework/Data/Form/Element/Editor.php | 4 ---- lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/internal/Magento/Framework/Data/Form/Element/Editor.php b/lib/internal/Magento/Framework/Data/Form/Element/Editor.php index b5f2017501c01..92dc2e6c97ecd 100644 --- a/lib/internal/Magento/Framework/Data/Form/Element/Editor.php +++ b/lib/internal/Magento/Framework/Data/Form/Element/Editor.php @@ -533,10 +533,6 @@ protected function getInlineJs($jsSetupObject, $forceLoad) $jsSetupObject . ')); varienGlobalEvents.attachEventHandler("formSubmit", editorFormValidationHandler); - varienGlobalEvents.clearEventHandlers("open_browser_callback"); - varienGlobalEvents.attachEventHandler("open_browser_callback", ' . - $jsSetupObject . - '.openFileBrowser); //]]> }); </script>'; diff --git a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js index 94e931f3349d7..df691601eccb9 100644 --- a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js +++ b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js @@ -373,7 +373,7 @@ define([ /** * @param {Object} o */ - openFileBrowser: _.debounce(function (o) { + openFileBrowser: function (o) { var typeTitle = this.translate('Select Images'), storeId = this.config['store_id'] ? this.config['store_id'] : 0, frameDialog = jQuery('div.mce-container[role="dialog"]'), @@ -406,7 +406,7 @@ define([ } ); }); - }, 250), + }, /** * @param {String} string From 07fc246f5db339b9a79cc9ebe841df28eb1a239e Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Fri, 22 Nov 2019 15:03:06 +0200 Subject: [PATCH 209/595] Static test fix --- lib/internal/Magento/Framework/Data/Form/Element/Editor.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Data/Form/Element/Editor.php b/lib/internal/Magento/Framework/Data/Form/Element/Editor.php index 92dc2e6c97ecd..0c9a3ee5b9495 100644 --- a/lib/internal/Magento/Framework/Data/Form/Element/Editor.php +++ b/lib/internal/Magento/Framework/Data/Form/Element/Editor.php @@ -309,9 +309,11 @@ protected function _getPluginButtonsHtml($visible = true) $configStyle = ''; if (isset($buttonOptions['style'])) { $configStyle = $buttonOptions['style']; - } + } + // phpcs:disable Magento2.Performance.ForeachArrayMerge $buttonOptions = array_merge($buttonOptions, ['style' => 'display:none;' . $configStyle]); - } + // phpcs:enable + } $buttonsHtml .= $this->_getButtonHtml($buttonOptions); } } From ae2416b3b537ce27b7696673505dad5c7e6e78c9 Mon Sep 17 00:00:00 2001 From: Yurii Sapiha <yurasapiga93@gmail.com> Date: Fri, 22 Nov 2019 15:34:51 +0200 Subject: [PATCH 210/595] MC-23203: Admin: Simple product with all custom attributes --- .../Attribute/Save/AbstractAttributeTest.php | 183 ++++++++++++++++++ .../Attribute/Save/AttributeDateTest.php | 79 ++++++++ .../Attribute/Save/AttributeDropdownTest.php | 70 +++++++ .../Save/AttributeMultiSelectTest.php | 79 ++++++++ .../Attribute/Save/AttributePriceTest.php | 93 +++++++++ .../Attribute/Save/AttributeTextAreaTest.php | 70 +++++++ .../Save/AttributeTextSwatchTest.php | 70 +++++++ .../Attribute/Save/AttributeTextTest.php | 70 +++++++ .../Save/AttributeVisualSwatchTest.php | 70 +++++++ .../Attribute/Save/AttributeYesNoTest.php | 70 +++++++ .../Product/Gallery/CreateHandlerTest.php | 26 +++ .../Save/AttributeFixedProductTaxTest.php | 134 +++++++++++++ 12 files changed, 1014 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AbstractAttributeTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeDateTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeDropdownTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeMultiSelectTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributePriceTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeTextAreaTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeTextSwatchTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeTextTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeVisualSwatchTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeYesNoTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Weee/Model/Product/Attribute/Save/AttributeFixedProductTaxTest.php diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AbstractAttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AbstractAttributeTest.php new file mode 100644 index 0000000000000..88ca9e589ebfb --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AbstractAttributeTest.php @@ -0,0 +1,183 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\Product\Attribute\Save; + +use Magento\Catalog\Api\Data\ProductAttributeInterface; +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\ResourceModel\Eav\Attribute; +use Magento\Eav\Api\AttributeRepositoryInterface; +use Magento\Eav\Model\Entity\Attribute\Exception; +use Magento\Framework\ObjectManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Base class for text product attributes + */ +abstract class AbstractAttributeTest extends TestCase +{ + /** @var ObjectManagerInterface */ + protected $objectManager; + + /** @var AttributeRepositoryInterface */ + protected $attributeRepository; + + /** @var ProductRepositoryInterface */ + protected $productRepository; + + /** @var Attribute */ + protected $attribute; + + /** + * @inheritdoc + */ + protected function setUp() + { + parent::setUp(); + + $this->objectManager = Bootstrap::getObjectManager(); + $this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class); + $this->attributeRepository = $this->objectManager->create(AttributeRepositoryInterface::class); + $this->attribute = $this->attributeRepository->get( + ProductAttributeInterface::ENTITY_TYPE_CODE, + $this->getAttributeCode() + ); + } + + /** + * @dataProvider productProvider + * @param $productSku + * @return void + */ + public function testSaveText(string $productSku): void + { + $product = $this->setAttributeValueAndValidate($productSku, $this->getDefaultAttributeValue()); + $product = $this->productRepository->save($product); + $this->assertEquals($this->getDefaultAttributeValue(), $product->getData($this->getAttributeCode())); + } + + /** + * @dataProvider productProvider + * @param string $productSku + * @return void + */ + public function testRequiredAttribute(string $productSku): void + { + $this->expectException(Exception::class); + $messageFormat = 'The "%s" attribute value is empty. Set the attribute and try again.'; + $this->expectExceptionMessage((string)__(sprintf($messageFormat, $this->attribute->getDefaultFrontendLabel()))); + $this->prepareAttribute(['is_required' => true]); + $this->unsetAttributeValueAndValidate($productSku); + } + + /** + * @dataProvider productProvider + * @param string $productSku + * @return void + */ + public function testDefaultValue(string $productSku): void + { + $this->prepareAttribute(['default_value' => $this->getDefaultAttributeValue()]); + $product = $this->unsetAttributeValueAndValidate($productSku); + $product = $this->productRepository->save($product); + $this->assertEquals($this->getDefaultAttributeValue(), $product->getData($this->getAttributeCode())); + } + + /** + * @dataProvider uniqueTestProvider + * @param string $firstSku + * @param string $secondSku + * @return void + */ + public function testUniqueAttribute(string $firstSku, string $secondSku): void + { + $this->expectException(Exception::class); + $messageFormat = 'The value of the "%s" attribute isn\'t unique. Set a unique value and try again.'; + $this->expectExceptionMessage((string)__(sprintf($messageFormat, $this->attribute->getDefaultFrontendLabel()))); + $this->prepareAttribute(['is_unique' => 1]); + $product = $this->setAttributeValueAndValidate($firstSku, $this->getDefaultAttributeValue()); + $this->productRepository->save($product); + $this->setAttributeValueAndValidate($secondSku, $this->getDefaultAttributeValue()); + } + + /** + * Set attribute value to product and validate the product + * + * @param string $attributeValue + * @param string $productSku + * @return ProductInterface + */ + protected function setAttributeValueAndValidate(string $productSku, string $attributeValue): ProductInterface + { + $product = $this->productRepository->get($productSku); + $product->addData([$this->getAttributeCode() => $attributeValue]); + $product->validate(); + + return $product; + } + + /** + * Unset attribute value of the product and validate the product + * + * @param string $productSku + * @return ProductInterface + */ + private function unsetAttributeValueAndValidate(string $productSku): ProductInterface + { + $product = $this->productRepository->get($productSku); + $product->unsetData($this->getAttributeCode()); + $product->validate(); + + return $product; + } + + /** + * Prepare attribute to test + * + * @param array $data + * @return void + */ + private function prepareAttribute(array $data): void + { + $attribute = $this->attributeRepository->get( + ProductAttributeInterface::ENTITY_TYPE_CODE, + $this->getAttributeCode() + ); + $attribute->addData($data); + $this->attributeRepository->save($attribute); + } + + /** + * Returns attribute code for current test + * + * @return string + */ + abstract protected function getAttributeCode(): string; + + /** + * Get default value for current attribute + * + * @return string + */ + abstract protected function getDefaultAttributeValue(): string; + + /** + * Products provider for tests + * + * @return array + */ + abstract public function productProvider(): array; + + /** + * Provider for unique attribute tests + * + * @return array + */ + abstract public function uniqueTestProvider(): array; +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeDateTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeDateTest.php new file mode 100644 index 0000000000000..625418592d4e2 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeDateTest.php @@ -0,0 +1,79 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\Product\Attribute\Save; + +/** + * @magentoDbIsolation enabled + * @magentoDataFixture Magento/Catalog/_files/product_date_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + */ +class AttributeDateTest extends AbstractAttributeTest +{ + /** + * @dataProvider productProvider + * @param string $productSku + */ + public function testDefaultValue(string $productSku): void + { + $this->markTestSkipped('Test is blocked by issue MC-28950'); + } + + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return 'date_attribute'; + } + + /** + * @inheritdoc + */ + protected function getDefaultAttributeValue(): string + { + return $this->attribute->getBackend()->formatDate('11/20/19'); + } + + /** + * @magentoDataFixture Magento/Catalog/_files/product_date_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * @magentoDataFixture Magento/Catalog/_files/product_simple_out_of_stock.php + * @dataProvider uniqueTestProvider + * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod + * @inheritdoc + */ + public function testUniqueAttribute(string $firstSku, string $secondSku): void + { + parent::testUniqueAttribute($firstSku, $secondSku); + } + + /** + * @inheritdoc + */ + public function productProvider(): array + { + return [ + [ + 'product_sku' => 'simple2', + ], + ]; + } + + /** + * @inheritdoc + */ + public function uniqueTestProvider(): array + { + return [ + [ + 'first_product_sku' => 'simple2', + 'second_product_sku' => 'simple-out-of-stock', + ], + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeDropdownTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeDropdownTest.php new file mode 100644 index 0000000000000..b724279a55f42 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeDropdownTest.php @@ -0,0 +1,70 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\Product\Attribute\Save; + +/** + * @magentoDbIsolation enabled + * @magentoDataFixture Magento/Catalog/_files/dropdown_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + */ +class AttributeDropdownTest extends AbstractAttributeTest +{ + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return 'dropdown_attribute'; + } + + /** + * @inheritdoc + */ + protected function getDefaultAttributeValue(): string + { + return $this->attribute->getSource()->getOptionId('Option 1'); + } + + /** + * @magentoDataFixture Magento/Catalog/_files/dropdown_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * @magentoDataFixture Magento/Catalog/_files/product_simple_out_of_stock.php + * @dataProvider uniqueTestProvider + * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod + * @inheritdoc + */ + public function testUniqueAttribute(string $firstSku, string $secondSku): void + { + parent::testUniqueAttribute($firstSku, $secondSku); + } + + /** + * @inheritdoc + */ + public function productProvider(): array + { + return [ + [ + 'product_sku' => 'simple2', + ], + ]; + } + + /** + * @inheritdoc + */ + public function uniqueTestProvider(): array + { + return [ + [ + 'first_product_sku' => 'simple2', + 'second_product_sku' => 'simple-out-of-stock', + ], + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeMultiSelectTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeMultiSelectTest.php new file mode 100644 index 0000000000000..50280060daad1 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeMultiSelectTest.php @@ -0,0 +1,79 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\Product\Attribute\Save; + +/** + * @magentoDbIsolation enabled + * @magentoDataFixture Magento/Catalog/_files/multiselect_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + */ +class AttributeMultiSelectTest extends AbstractAttributeTest +{ + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return 'multiselect_attribute'; + } + + /** + * @inheritdoc + */ + protected function getDefaultAttributeValue(): string + { + return $this->attribute->getSource()->getOptionId('Option 1'); + } + + /** + * @inheritdoc + * @dataProvider productProvider + */ + public function testDefaultValue(string $productSku): void + { + $this->markTestSkipped('Test is blocked by issue MC-29019'); + } + + /** + * @magentoDataFixture Magento/Catalog/_files/multiselect_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * @magentoDataFixture Magento/Catalog/_files/product_simple_out_of_stock.php + * @dataProvider uniqueTestProvider + * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod + * @inheritdoc + */ + public function testUniqueAttribute(string $firstSku, string $secondSku): void + { + parent::testUniqueAttribute($firstSku, $secondSku); + } + + /** + * @inheritdoc + */ + public function productProvider(): array + { + return [ + [ + 'product_sku' => 'simple2', + ], + ]; + } + + /** + * @inheritdoc + */ + public function uniqueTestProvider(): array + { + return [ + [ + 'first_product_sku' => 'simple2', + 'second_product_sku' => 'simple-out-of-stock', + ], + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributePriceTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributePriceTest.php new file mode 100644 index 0000000000000..a56058ae5007a --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributePriceTest.php @@ -0,0 +1,93 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\Product\Attribute\Save; + +use Magento\Eav\Model\Entity\Attribute\Exception; + +/** + * @magentoDbIsolation enabled + * @magentoDataFixture Magento/Catalog/_files/product_decimal_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + */ +class AttributePriceTest extends AbstractAttributeTest +{ + /** + * @magentoDataFixture Magento/Catalog/_files/product_decimal_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * @magentoDataFixture Magento/Catalog/_files/product_simple_out_of_stock.php + * @dataProvider uniqueTestProvider + * @inheritdoc + */ + public function testUniqueAttribute(string $firstSku, string $secondSku): void + { + $this->markTestSkipped('Test is blocked by issue MC-29019'); + parent::testUniqueAttribute($firstSku, $secondSku); + } + + /** + * @magentoDataFixture Magento/Catalog/_files/product_decimal_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * @return void + */ + public function testNegativeValue(): void + { + $this->expectException(Exception::class); + $this->expectExceptionMessage((string)__('Please enter a number 0 or greater in this field.')); + $this->setAttributeValueAndValidate('simple2', '-1'); + } + + /** + * @dataProvider productProvider + * @param string $productSku + */ + public function testDefaultValue(string $productSku): void + { + // product price attribute does not support default value + } + + /** + * @inheritdoc + */ + public function productProvider(): array + { + return [ + [ + 'product_sku' => 'simple2', + ], + ]; + } + + /** + * @inheritdoc + */ + public function uniqueTestProvider(): array + { + return [ + [ + 'first_product_sku' => 'simple2', + 'second_product_sku' => 'simple-out-of-stock', + ], + ]; + } + + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return 'decimal_attribute'; + } + + /** + * @inheritdoc + */ + protected function getDefaultAttributeValue(): string + { + return '100'; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeTextAreaTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeTextAreaTest.php new file mode 100644 index 0000000000000..6f9b26e6680b1 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeTextAreaTest.php @@ -0,0 +1,70 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\Product\Attribute\Save; + +/** + * @magentoDbIsolation enabled + * @magentoDataFixture Magento/Catalog/_files/product_text_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + */ +class AttributeTextAreaTest extends AbstractAttributeTest +{ + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return 'text_attribute'; + } + + /** + * @inheritdoc + */ + protected function getDefaultAttributeValue(): string + { + return 'default text area value'; + } + + /** + * @magentoDataFixture Magento/Catalog/_files/product_text_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * @magentoDataFixture Magento/Catalog/_files/product_simple_out_of_stock.php + * @dataProvider uniqueTestProvider + * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod + * @inheritdoc + */ + public function testUniqueAttribute(string $firstSku, string $secondSku): void + { + parent::testUniqueAttribute($firstSku, $secondSku); + } + + /** + * @inheritdoc + */ + public function productProvider(): array + { + return [ + [ + 'product_sku' => 'simple2', + ] + ]; + } + + /** + * @inheritdoc + */ + public function uniqueTestProvider(): array + { + return [ + [ + 'first_product_sku' => 'simple2', + 'second_product_sku' => 'simple-out-of-stock', + ], + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeTextSwatchTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeTextSwatchTest.php new file mode 100644 index 0000000000000..0650155ba3e47 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeTextSwatchTest.php @@ -0,0 +1,70 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\Product\Attribute\Save; + +/** + * @magentoDbIsolation enabled + * @magentoDataFixture Magento/Swatches/_files/product_text_swatch_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + */ +class AttributeTextSwatchTest extends AbstractAttributeTest +{ + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return 'text_swatch_attribute'; + } + + /** + * @inheritdoc + */ + protected function getDefaultAttributeValue(): string + { + return $this->attribute->getSource()->getOptionId('Option 2'); + } + + /** + * @magentoDataFixture Magento/Swatches/_files/product_text_swatch_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * @magentoDataFixture Magento/Catalog/_files/product_simple_out_of_stock.php + * @dataProvider uniqueTestProvider + * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod + * @inheritdoc + */ + public function testUniqueAttribute(string $firstSku, string $secondSku): void + { + parent::testUniqueAttribute($firstSku, $secondSku); + } + + /** + * @inheritdoc + */ + public function productProvider(): array + { + return [ + [ + 'product_sku' => 'simple2', + ], + ]; + } + + /** + * @inheritdoc + */ + public function uniqueTestProvider(): array + { + return [ + [ + 'first_product_sku' => 'simple2', + 'second_product_sku' => 'simple-out-of-stock', + ], + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeTextTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeTextTest.php new file mode 100644 index 0000000000000..e1fa9f6229f0d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeTextTest.php @@ -0,0 +1,70 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\Product\Attribute\Save; + +/** + * @magentoDbIsolation enabled + * @magentoDataFixture Magento/Catalog/_files/product_varchar_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + */ +class AttributeTextTest extends AbstractAttributeTest +{ + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return 'varchar_attribute'; + } + + /** + * @inheritdoc + */ + protected function getDefaultAttributeValue(): string + { + return 'default text value'; + } + + /** + * @magentoDataFixture Magento/Catalog/_files/product_varchar_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * @magentoDataFixture Magento/Catalog/_files/product_simple_out_of_stock.php + * @dataProvider uniqueTestProvider + * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod + * @inheritdoc + */ + public function testUniqueAttribute(string $firstSku, string $secondSku): void + { + parent::testUniqueAttribute($firstSku, $secondSku); + } + + /** + * @inheritdoc + */ + public function productProvider(): array + { + return [ + [ + 'product_sku' => 'simple2', + ], + ]; + } + + /** + * @inheritdoc + */ + public function uniqueTestProvider(): array + { + return [ + [ + 'first_product_sku' => 'simple2', + 'second_product_sku' => 'simple-out-of-stock', + ], + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeVisualSwatchTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeVisualSwatchTest.php new file mode 100644 index 0000000000000..5666d4223505d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeVisualSwatchTest.php @@ -0,0 +1,70 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\Product\Attribute\Save; + +/** + * @magentoDbIsolation enabled + * @magentoDataFixture Magento/Swatches/_files/product_visual_swatch_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + */ +class AttributeVisualSwatchTest extends AbstractAttributeTest +{ + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return 'visual_swatch_attribute'; + } + + /** + * @inheritdoc + */ + protected function getDefaultAttributeValue(): string + { + return $this->attribute->getSource()->getOptionId('option 2'); + } + + /** + * @magentoDataFixture Magento/Swatches/_files/product_visual_swatch_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * @magentoDataFixture Magento/Catalog/_files/product_simple_out_of_stock.php + * @dataProvider uniqueTestProvider + * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod + * @inheritdoc + */ + public function testUniqueAttribute(string $firstSku, string $secondSku): void + { + parent::testUniqueAttribute($firstSku, $secondSku); + } + + /** + * @inheritdoc + */ + public function productProvider(): array + { + return [ + [ + 'product_sku' => 'simple2', + ], + ]; + } + + /** + * @inheritdoc + */ + public function uniqueTestProvider(): array + { + return [ + [ + 'first_product_sku' => 'simple2', + 'second_product_sku' => 'simple-out-of-stock', + ], + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeYesNoTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeYesNoTest.php new file mode 100644 index 0000000000000..71d2855fdb3bf --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeYesNoTest.php @@ -0,0 +1,70 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\Product\Attribute\Save; + +/** + * @magentoDbIsolation enabled + * @magentoDataFixture Magento/Catalog/_files/product_boolean_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + */ +class AttributeYesNoTest extends AbstractAttributeTest +{ + /** + * @inheritdoc + */ + protected function getAttributeCode(): string + { + return 'boolean_attribute'; + } + + /** + * @inheritdoc + */ + protected function getDefaultAttributeValue(): string + { + return '1'; + } + + /** + * @magentoDataFixture Magento/Catalog/_files/product_boolean_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + * @magentoDataFixture Magento/Catalog/_files/product_simple_out_of_stock.php + * @dataProvider uniqueTestProvider + * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod + * @inheritdoc + */ + public function testUniqueAttribute(string $firstSku, string $secondSku): void + { + parent::testUniqueAttribute($firstSku, $secondSku); + } + + /** + * @inheritdoc + */ + public function productProvider(): array + { + return [ + [ + 'product_sku' => 'simple2', + ], + ]; + } + + /** + * @inheritdoc + */ + public function uniqueTestProvider(): array + { + return [ + [ + 'first_product_sku' => 'simple2', + 'second_product_sku' => 'simple-out-of-stock', + ], + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/CreateHandlerTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/CreateHandlerTest.php index 03455bb341cae..2277470e33b12 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/CreateHandlerTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Gallery/CreateHandlerTest.php @@ -251,6 +251,32 @@ public function additionalGalleryFieldsProvider(): array ]; } + /** + * @magentoDataFixture Magento/Catalog/_files/product_image_attribute.php + * @magentoDataFixture Magento/Catalog/_files/product_simple.php + * @magentoDataFixture Magento/Catalog/_files/product_image.php + * @return void + */ + public function testExecuteWithCustomMediaAttribute(): void + { + $data = [ + 'media_gallery' => ['images' => ['image' => ['file' => $this->fileName, 'label' => '']]], + 'image' => 'no_selection', + 'small_image' => 'no_selection', + 'swatch_image' => 'no_selection', + 'thumbnail' => 'no_selection', + 'image_attribute' => $this->fileName + ]; + $product = $this->initProduct($data); + $this->createHandler->execute($product); + $mediaAttributeValue = $this->productResource->getAttributeRawValue( + $product->getId(), + ['image_attribute'], + $product->getStoreId() + ); + $this->assertEquals($this->fileName, $mediaAttributeValue); + } + /** * Returns product for testing. * diff --git a/dev/tests/integration/testsuite/Magento/Weee/Model/Product/Attribute/Save/AttributeFixedProductTaxTest.php b/dev/tests/integration/testsuite/Magento/Weee/Model/Product/Attribute/Save/AttributeFixedProductTaxTest.php new file mode 100644 index 0000000000000..af474d8f8954f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Weee/Model/Product/Attribute/Save/AttributeFixedProductTaxTest.php @@ -0,0 +1,134 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Weee\Model\Product\Attribute\Save; + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Eav\Model\Entity\Attribute\Exception; +use Magento\Framework\ObjectManagerInterface; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * @magentoDbIsolation enabled + * @magentoDataFixture Magento/Weee/_files/fixed_product_attribute.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + */ +class AttributeFixedProductTaxTest extends TestCase +{ + /** @var ObjectManagerInterface */ + protected $objectManager; + + /** @var ProductRepositoryInterface */ + protected $productRepository; + + /** @var string */ + private $attributeCode; + + /** + * @inheritdoc + */ + protected function setUp() + { + parent::setUp(); + + $this->objectManager = Bootstrap::getObjectManager(); + $this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class); + $this->attributeCode = 'fixed_product_attribute'; + } + + /** + * @dataProvider FPTProvider + * @param array $data + * @param array $expectedData + * @return void + */ + public function testSaveProductWithFPTAttribute(array $data, array $expectedData): void + { + $product = $this->productRepository->get('simple2'); + $product->addData([$this->attributeCode => $data]); + $product = $this->productRepository->save($product); + $this->assertEquals($expectedData, $product->getData($this->attributeCode)); + } + + /** + * @return array + */ + public function FPTProvider(): array + { + return [ + [ + 'data' => [ + [ + 'region_id' => '0', + 'country' => 'GB', + 'val' => '', + 'value' => '15', + 'website_id' => '0', + 'state' => '', + ], + [ + 'region_id' => '1', + 'country' => 'US', + 'val' => '', + 'value' => '35', + 'website_id' => '0', + 'state' => '', + ], + ], + 'expected_data' => [ + [ + 'website_id' => '0', + 'country' => 'GB', + 'state' => '0', + 'value' => '15.000', + 'website_value' => 15.0, + ], + [ + 'website_id' => '0', + 'country' => 'US', + 'state' => '0', + 'value' => '35.000', + 'website_value' => 35.0 + ], + ], + ], + ]; + } + + /** + * @return void + */ + public function testSaveProductWithFPTAttributeWithDuplicates(): void + { + $attributeValues = [ + [ + 'region_id' => '0', + 'country' => 'GB', + 'val' => '', + 'value' => '15', + 'website_id' => '0', + 'state' => '', + ], + [ + 'region_id' => '0', + 'country' => 'GB', + 'val' => '', + 'value' => '15', + 'website_id' => '0', + 'state' => '', + ], + ]; + $this->expectException(Exception::class); + $message = 'Set unique country-state combinations within the same fixed product tax. ' + . 'Verify the combinations and try again.'; + $this->expectExceptionMessage((string)__($message)); + $product = $this->productRepository->get('simple2'); + $product->addData([$this->attributeCode => $attributeValues]); + $this->productRepository->save($product); + } +} From a6ba5850045eb2276fb91ce6b12bf0e12b90b383 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Fri, 22 Nov 2019 15:24:42 +0200 Subject: [PATCH 211/595] Remove duplicated event --- .../Magento/Framework/Data/Form/Element/Editor.php | 8 ++++---- .../mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/internal/Magento/Framework/Data/Form/Element/Editor.php b/lib/internal/Magento/Framework/Data/Form/Element/Editor.php index 0c9a3ee5b9495..5059fb38f29ca 100644 --- a/lib/internal/Magento/Framework/Data/Form/Element/Editor.php +++ b/lib/internal/Magento/Framework/Data/Form/Element/Editor.php @@ -309,11 +309,11 @@ protected function _getPluginButtonsHtml($visible = true) $configStyle = ''; if (isset($buttonOptions['style'])) { $configStyle = $buttonOptions['style']; - } + } // phpcs:disable Magento2.Performance.ForeachArrayMerge $buttonOptions = array_merge($buttonOptions, ['style' => 'display:none;' . $configStyle]); - // phpcs:enable - } + // phpcs:enable + } $buttonsHtml .= $this->_getButtonHtml($buttonOptions); } } @@ -411,7 +411,7 @@ protected function _getButtonHtml($data) protected function _wrapIntoContainer($html) { if (!$this->getConfig('use_container')) { - return '<div class="admin__control-wysiwig">' .$html . '</div>'; + return '<div class="admin__control-wysiwig">' . $html . '</div>'; } $html = '<div id="editor' . $this->getHtmlId() . '"' diff --git a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js index df691601eccb9..aea636066be61 100644 --- a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js +++ b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter.js @@ -118,6 +118,7 @@ define([ tinyMCE4.init(settings); this.getPluginButtons().hide(); varienGlobalEvents.clearEventHandlers('open_browser_callback'); + this.eventBus.clearEventHandlers('open_browser_callback'); this.eventBus.attachEventHandler('open_browser_callback', tinyMceEditors.get(self.id).openFileBrowser); }.bind(this)); }, From 871bef6380cfc16daffe973b3e69a618c20ebc4e Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <51681487+engcom-Foxtrot@users.noreply.github.com> Date: Fri, 22 Nov 2019 16:33:04 +0200 Subject: [PATCH 212/595] magento/magento2#25569: Static tests fix. --- .../AsynchronousOperations/Api/BulkStatusInterfaceTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/BulkStatusInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/BulkStatusInterfaceTest.php index de4ec207653a3..135af2b556734 100644 --- a/dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/BulkStatusInterfaceTest.php +++ b/dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/BulkStatusInterfaceTest.php @@ -23,7 +23,10 @@ class BulkStatusInterfaceTest extends WebapiAbstract */ public function testGetListByBulkStartTime() { - $resourcePath = self::RESOURCE_PATH . self::TEST_UUID . "/operation-status/" . OperationInterface::STATUS_TYPE_OPEN; + $resourcePath = self::RESOURCE_PATH + . self::TEST_UUID + . "/operation-status/" + . OperationInterface::STATUS_TYPE_OPEN; $serviceInfo = [ 'rest' => [ 'resourcePath' => $resourcePath, From b423aaa869641e51b439b882b214f895b9996c9a Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Fri, 22 Nov 2019 21:48:49 +0700 Subject: [PATCH 213/595] [ImportExport] Cover Helper Data by Unit Test --- .../Test/Unit/Helper/DataTest.php | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 app/code/Magento/ImportExport/Test/Unit/Helper/DataTest.php diff --git a/app/code/Magento/ImportExport/Test/Unit/Helper/DataTest.php b/app/code/Magento/ImportExport/Test/Unit/Helper/DataTest.php new file mode 100644 index 0000000000000..85630d2106b45 --- /dev/null +++ b/app/code/Magento/ImportExport/Test/Unit/Helper/DataTest.php @@ -0,0 +1,139 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ImportExport\Test\Unit\Helper; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Framework\App\Helper\Context; +use Magento\Framework\File\Size as FileSize; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\ImportExport\Helper\Data as HelperData; +use PHPUnit\Framework\TestCase; + +/** + * Test class to cover Data Helper + * + * Class \Magento\ImportExport\Test\Unit\Helper\DataTest + */ +class DataTest extends TestCase +{ + /** + * @var ObjectManagerHelper + */ + private $objectManagerHelper; + + /** + * @var FileSize|PHPUnit_Framework_MockObject_MockObject + */ + private $fileSizeMock; + + /** + * @var Context|PHPUnit_Framework_MockObject_MockObject + */ + private $contextMock; + + /** + * @var ScopeConfigInterface|PHPUnit_Framework_MockObject_MockObject + */ + private $scopeConfigMock; + + /** + * @var HelperData|PHPUnit_Framework_MockObject_MockObject + */ + private $helperData; + + /** + * Set up environment + */ + protected function setUp() + { + $this->contextMock = $this->createMock(Context::class); + $this->fileSizeMock = $this->createMock(FileSize::class); + $this->scopeConfigMock = $this->createMock(ScopeConfigInterface::class); + $this->contextMock->expects($this->any())->method('getScopeConfig')->willReturn($this->scopeConfigMock); + + $this->objectManagerHelper = new ObjectManagerHelper($this); + $this->helperData = $this->objectManagerHelper->getObject( + HelperData::class, + [ + 'context' => $this->contextMock, + 'fileSize' => $this->fileSizeMock + ] + ); + } + + /** + * Test getMaxUploadSizeMessage() with data provider below + * + * @param float $maxImageSize + * @param string $expected + * @return void + * @dataProvider getMaxUploadSizeMessageDataProvider + */ + public function testGetMaxUploadSizeMessage($maxImageSize, $expected) + { + $this->fileSizeMock->expects($this->any())->method('getMaxFileSizeInMb')->willReturn($maxImageSize); + $this->assertEquals($expected, $this->helperData->getMaxUploadSizeMessage()); + } + + /** + * DataProvider for testGetMaxUploadSizeMessage() function + * + * @return array + */ + public function getMaxUploadSizeMessageDataProvider() + { + return [ + 'Test with max image size = 10Mb' => [ + 'maxImageSize' => 10, + 'expected' => 'Make sure your file isn\'t more than 10M.', + ], + 'Test with max image size = 0' => [ + 'maxImageSize' => 0, + 'expected' => 'We can\'t provide the upload settings right now.', + ] + ]; + } + + /** + * Test getLocalValidPaths() + * + * @return void + */ + public function testGetLocalValidPaths() + { + $paths = [ + 'available' => [ + 'export_xml' => 'var/export/*/*.xml', + 'export_csv' => 'var/export/*/*.csv', + 'import_xml' => 'var/import/*/*.xml', + 'import_csv' => 'var/import/*/*.csv', + ] + ]; + $this->scopeConfigMock->expects($this->any())->method('getValue') + ->with(HelperData::XML_PATH_EXPORT_LOCAL_VALID_PATH) + ->willReturn($paths); + + $this->assertEquals($paths, $this->helperData->getLocalValidPaths()); + } + + /** + * Test getBunchSize() + * + * @return void + */ + public function testGetBunchSize() + { + $bunchSize = '100'; + + $this->scopeConfigMock->expects($this->any())->method('getValue') + ->with(HelperData::XML_PATH_BUNCH_SIZE) + ->willReturn($bunchSize); + + $this->assertEquals(100, $this->helperData->getBunchSize()); + } +} From 6d19852ac3af89bd36e0a3527d010c629ffa3a97 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <51681487+engcom-Foxtrot@users.noreply.github.com> Date: Fri, 22 Nov 2019 16:59:41 +0200 Subject: [PATCH 214/595] magento/magento2#25569: Static tests fix. --- .../AsynchronousOperations/Api/BulkStatusInterfaceTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/BulkStatusInterfaceTest.php b/dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/BulkStatusInterfaceTest.php index 135af2b556734..46ffb39878c0d 100644 --- a/dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/BulkStatusInterfaceTest.php +++ b/dev/tests/api-functional/testsuite/Magento/AsynchronousOperations/Api/BulkStatusInterfaceTest.php @@ -23,7 +23,7 @@ class BulkStatusInterfaceTest extends WebapiAbstract */ public function testGetListByBulkStartTime() { - $resourcePath = self::RESOURCE_PATH + $resourcePath = self::RESOURCE_PATH . self::TEST_UUID . "/operation-status/" . OperationInterface::STATUS_TYPE_OPEN; From 7ac931df6589b9c8069c4f2d97062d38510c7e03 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Fri, 22 Nov 2019 09:06:04 -0600 Subject: [PATCH 215/595] MC-29026: GraphQL returns filters with some data if you making request to not existing or empty category --- .../Magento/GraphQl/Catalog/ProductSearchTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php index 6e732d68fe7d3..73baa59b92bf9 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php @@ -123,10 +123,15 @@ public function testFilterLn() usort($expectedFilters, [$this, 'compareFilterNames']); usort($actualFilters, [$this, 'compareFilterNames']); + $errMsg = print_r($expectedFilters, true); + $errMsg .= '---'; + $errMsg .= print_r($actualFilters, true); + $this->assertFilters( ['products' => ['filters' => $actualFilters]], $expectedFilters, - 'Returned filters data set does not match the expected value' + //'Returned filters data set does not match the expected value' + $errMsg ); } From 1be4e03189b9461ebff420596f0bc6a44a60a9ec Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Fri, 22 Nov 2019 17:07:53 +0200 Subject: [PATCH 216/595] Fix for tinymce3 editor --- app/code/Magento/Tinymce3/view/base/web/tinymce3Adapter.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Tinymce3/view/base/web/tinymce3Adapter.js b/app/code/Magento/Tinymce3/view/base/web/tinymce3Adapter.js index bb3300baf988a..86602b2017c15 100644 --- a/app/code/Magento/Tinymce3/view/base/web/tinymce3Adapter.js +++ b/app/code/Magento/Tinymce3/view/base/web/tinymce3Adapter.js @@ -78,6 +78,8 @@ define([ } tinyMCE3.init(this.getSettings(mode)); + varienGlobalEvents.clearEventHandlers("open_browser_callback"); + varienGlobalEvents.attachEventHandler("open_browser_callback", tinyMceEditors.get(this.id).openFileBrowser); }, /** From 806576a72355803e7bb768ccbeda35b82bf29faf Mon Sep 17 00:00:00 2001 From: Yurii Sapiha <yurasapiga93@gmail.com> Date: Fri, 22 Nov 2019 17:26:59 +0200 Subject: [PATCH 217/595] MC-23203: Admin: Simple product with all custom attributes --- .../Model/Product/Attribute/Save/AbstractAttributeTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AbstractAttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AbstractAttributeTest.php index 88ca9e589ebfb..7a49475fd5107 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AbstractAttributeTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AbstractAttributeTest.php @@ -55,7 +55,7 @@ protected function setUp() * @param $productSku * @return void */ - public function testSaveText(string $productSku): void + public function testSaveAttribute(string $productSku): void { $product = $this->setAttributeValueAndValidate($productSku, $this->getDefaultAttributeValue()); $product = $this->productRepository->save($product); From 6976aabdfdab91a9d06e412c2ed619538ed034b6 Mon Sep 17 00:00:00 2001 From: Dmytro Yushkin <dyushkin@adobe.com> Date: Thu, 21 Nov 2019 16:05:04 -0600 Subject: [PATCH 218/595] MC-21868: Magento 2.3.3 notifications converted to attachments in MS Exchange - Disposition Header --- lib/internal/Magento/Framework/Mail/Message.php | 1 - lib/internal/Magento/Framework/Mail/MimePart.php | 5 ++++- .../Magento/Framework/Mail/Test/Unit/MessageTest.php | 2 -- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/internal/Magento/Framework/Mail/Message.php b/lib/internal/Magento/Framework/Mail/Message.php index 1f423e8010870..0e4d79aac9331 100644 --- a/lib/internal/Magento/Framework/Mail/Message.php +++ b/lib/internal/Magento/Framework/Mail/Message.php @@ -171,7 +171,6 @@ private function createMimeFromString($body, $messageType) $part = new Part($body); $part->setCharset($this->zendMessage->getEncoding()); $part->setEncoding(Mime::ENCODING_QUOTEDPRINTABLE); - $part->setDisposition(Mime::DISPOSITION_INLINE); $part->setType($messageType); $mimeMessage = new \Zend\Mime\Message(); $mimeMessage->addPart($part); diff --git a/lib/internal/Magento/Framework/Mail/MimePart.php b/lib/internal/Magento/Framework/Mail/MimePart.php index 9b9bb6eadbec3..a43ed4b36e072 100644 --- a/lib/internal/Magento/Framework/Mail/MimePart.php +++ b/lib/internal/Magento/Framework/Mail/MimePart.php @@ -15,6 +15,9 @@ */ class MimePart implements MimePartInterface { + /** + * UTF-8 charset + */ public const CHARSET_UTF8 = 'utf-8'; /** @@ -47,7 +50,7 @@ public function __construct( $content, ?string $type = MimeInterface::TYPE_HTML, ?string $fileName = null, - ?string $disposition = MimeInterface::DISPOSITION_INLINE, + ?string $disposition = null, ?string $encoding = MimeInterface::ENCODING_QUOTED_PRINTABLE, ?string $description = null, ?array $filters = [], diff --git a/lib/internal/Magento/Framework/Mail/Test/Unit/MessageTest.php b/lib/internal/Magento/Framework/Mail/Test/Unit/MessageTest.php index c29ca4d261cc4..6e5763714b88a 100644 --- a/lib/internal/Magento/Framework/Mail/Test/Unit/MessageTest.php +++ b/lib/internal/Magento/Framework/Mail/Test/Unit/MessageTest.php @@ -29,7 +29,6 @@ public function testSetBodyHtml() $this->assertEquals('quoted-printable', $part->getEncoding()); $this->assertEquals('utf-8', $part->getCharset()); $this->assertEquals('body', $part->getContent()); - $this->assertEquals('inline', $part->getDisposition()); } public function testSetBodyText() @@ -41,6 +40,5 @@ public function testSetBodyText() $this->assertEquals('quoted-printable', $part->getEncoding()); $this->assertEquals('utf-8', $part->getCharset()); $this->assertEquals('body', $part->getContent()); - $this->assertEquals('inline', $part->getDisposition()); } } From 29335aa1fb7f3418125e7140aede0430de336bf6 Mon Sep 17 00:00:00 2001 From: Lena Orobei <oorobei@magento.com> Date: Fri, 22 Nov 2019 12:33:04 -0600 Subject: [PATCH 219/595] ENGCOM-6317: Bump coding standard version --- .../Magento/BundleGraphQl/etc/schema.graphqls | 1 + composer.json | 2 +- composer.lock | 36 ++++++++++++------- .../static/framework/Magento/ruleset.xml | 21 ----------- 4 files changed, 25 insertions(+), 35 deletions(-) diff --git a/app/code/Magento/BundleGraphQl/etc/schema.graphqls b/app/code/Magento/BundleGraphQl/etc/schema.graphqls index 0eff0e086180e..4544c07d59997 100644 --- a/app/code/Magento/BundleGraphQl/etc/schema.graphqls +++ b/app/code/Magento/BundleGraphQl/etc/schema.graphqls @@ -3,6 +3,7 @@ type Mutation { addBundleProductsToCart(input: AddBundleProductsToCartInput): AddBundleProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart") + testStatic(invalid_argument): invalid_output } input AddBundleProductsToCartInput { diff --git a/composer.json b/composer.json index 1a73e551168b0..e95bce2314e7f 100644 --- a/composer.json +++ b/composer.json @@ -87,7 +87,7 @@ "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", "friendsofphp/php-cs-fixer": "~2.14.0", "lusitanian/oauth": "~0.8.10", - "magento/magento-coding-standard": "~4.0.0", + "magento/magento-coding-standard": "*", "magento/magento2-functional-testing-framework": "2.5.3", "pdepend/pdepend": "2.5.2", "phpcompatibility/php-compatibility": "^9.3", diff --git a/composer.lock b/composer.lock index 65e5fd8e5a42c..d6cd5368fd72a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e75fa994f056960e832018efd6af5a40", + "content-hash": "0e6d1fc607befd753c33181c6bcfd1b4", "packages": [ { "name": "braintree/braintree_php", @@ -530,6 +530,7 @@ ], "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", "homepage": "https://github.com/container-interop/container-interop", + "abandoned": "psr/container", "time": "2017-02-14T19:40:03+00:00" }, { @@ -7178,33 +7179,42 @@ }, { "name": "magento/magento-coding-standard", - "version": "4", + "version": "5", "source": { "type": "git", "url": "https://github.com/magento/magento-coding-standard.git", - "reference": "d24e0230a532e19941ed264f57db38fad5b1008a" + "reference": "da46c5d57a43c950dfa364edc7f1f0436d5353a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/magento-coding-standard/zipball/d24e0230a532e19941ed264f57db38fad5b1008a", - "reference": "d24e0230a532e19941ed264f57db38fad5b1008a", + "url": "https://api.github.com/repos/magento/magento-coding-standard/zipball/da46c5d57a43c950dfa364edc7f1f0436d5353a5", + "reference": "da46c5d57a43c950dfa364edc7f1f0436d5353a5", "shasum": "" }, "require": { "php": ">=5.6.0", - "squizlabs/php_codesniffer": "^3.4" + "squizlabs/php_codesniffer": "^3.4", + "webonyx/graphql-php": ">=0.12.6 <1.0" }, "require-dev": { "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "type": "phpcodesniffer-standard", + "autoload": { + "classmap": [ + "PHP_CodeSniffer/Tokenizers/" + ], + "psr-4": { + "Magento2\\": "Magento2/" + } + }, "notification-url": "https://packagist.org/downloads/", "license": [ "OSL-3.0", "AFL-3.0" ], "description": "A set of Magento specific PHP CodeSniffer rules.", - "time": "2019-08-06T15:58:37+00:00" + "time": "2019-11-04T22:08:27+00:00" }, { "name": "magento/magento2-functional-testing-framework", @@ -7914,20 +7924,20 @@ "authors": [ { "name": "Manuel Pichler", + "role": "Project Founder", "email": "github@manuel-pichler.de", - "homepage": "https://github.com/manuelpichler", - "role": "Project Founder" + "homepage": "https://github.com/manuelpichler" }, { "name": "Marc Würth", + "role": "Project Maintainer", "email": "ravage@bluewin.ch", - "homepage": "https://github.com/ravage84", - "role": "Project Maintainer" + "homepage": "https://github.com/ravage84" }, { "name": "Other contributors", - "homepage": "https://github.com/phpmd/phpmd/graphs/contributors", - "role": "Contributors" + "role": "Contributors", + "homepage": "https://github.com/phpmd/phpmd/graphs/contributors" } ], "description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.", diff --git a/dev/tests/static/framework/Magento/ruleset.xml b/dev/tests/static/framework/Magento/ruleset.xml index 89020150035bb..70d1810d1eb2f 100644 --- a/dev/tests/static/framework/Magento/ruleset.xml +++ b/dev/tests/static/framework/Magento/ruleset.xml @@ -15,25 +15,4 @@ <exclude-pattern>*/Test/*</exclude-pattern> <exclude-pattern>*Test.php</exclude-pattern> </rule> - <rule ref="Magento2.Files.LineLength.MaxExceeded"> - <exclude-pattern>*.phtml</exclude-pattern> - </rule> - <rule ref="Squiz.Operators.IncrementDecrementUsage"> - <exclude-pattern>*.phtml</exclude-pattern> - </rule> - <rule ref="PEAR.ControlStructures.ControlSignature"> - <exclude-pattern>*.phtml</exclude-pattern> - </rule> - <rule ref="Squiz.WhiteSpace.ScopeClosingBrace"> - <exclude-pattern>*.phtml</exclude-pattern> - </rule> - <rule ref="PEAR.Functions.FunctionCallSignature"> - <exclude-pattern>*.phtml</exclude-pattern> - </rule> - <rule ref="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace"> - <exclude-pattern>*.phtml</exclude-pattern> - </rule> - <rule ref="Magento2.Security.LanguageConstruct.DirectOutput"> - <exclude-pattern>*.phtml</exclude-pattern> - </rule> </ruleset> From 7150c78d37af31583f3e2467aab2272497f0964d Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Fri, 22 Nov 2019 13:24:23 -0600 Subject: [PATCH 220/595] MC-29026: GraphQL returns filters with some data if you making request to not existing or empty category --- .../Magento/GraphQl/Catalog/ProductSearchTest.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php index 73baa59b92bf9..6e732d68fe7d3 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php @@ -123,15 +123,10 @@ public function testFilterLn() usort($expectedFilters, [$this, 'compareFilterNames']); usort($actualFilters, [$this, 'compareFilterNames']); - $errMsg = print_r($expectedFilters, true); - $errMsg .= '---'; - $errMsg .= print_r($actualFilters, true); - $this->assertFilters( ['products' => ['filters' => $actualFilters]], $expectedFilters, - //'Returned filters data set does not match the expected value' - $errMsg + 'Returned filters data set does not match the expected value' ); } From 4f6042f63074e53082e50ca675021506122bedac Mon Sep 17 00:00:00 2001 From: Lena Orobei <oorobei@magento.com> Date: Fri, 22 Nov 2019 13:38:43 -0600 Subject: [PATCH 221/595] ENGCOM-6317: Bump coding standard version --- dev/tests/static/phpunit.xml.dist | 3 ++ .../Magento/Test/GraphQl/LiveCodeTest.php | 51 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 dev/tests/static/testsuite/Magento/Test/GraphQl/LiveCodeTest.php diff --git a/dev/tests/static/phpunit.xml.dist b/dev/tests/static/phpunit.xml.dist index d6db407fb5264..f82086a2c8bb2 100644 --- a/dev/tests/static/phpunit.xml.dist +++ b/dev/tests/static/phpunit.xml.dist @@ -24,6 +24,9 @@ <testsuite name="PHP Coding Standard Verification"> <file>testsuite/Magento/Test/Php/LiveCodeTest.php</file> </testsuite> + <testsuite name="GraphQL Static Code Analysis"> + <file>testsuite/Magento/Test/GraphQl/LiveCodeTest.php</file> + </testsuite> <testsuite name="Code Integrity Tests"> <directory>testsuite/Magento/Test/Integrity</directory> </testsuite> diff --git a/dev/tests/static/testsuite/Magento/Test/GraphQl/LiveCodeTest.php b/dev/tests/static/testsuite/Magento/Test/GraphQl/LiveCodeTest.php new file mode 100644 index 0000000000000..32bd666b3d7cd --- /dev/null +++ b/dev/tests/static/testsuite/Magento/Test/GraphQl/LiveCodeTest.php @@ -0,0 +1,51 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Test\GraphQl; + +use Magento\TestFramework\CodingStandard\Tool\CodeSniffer; +use Magento\TestFramework\CodingStandard\Tool\CodeSniffer\Wrapper; +use Magento\Test\Php\LiveCodeTest as PHPCodeTest; +use PHPUnit\Framework\TestCase; + +/** + * Set of tests for static code style + */ +class LiveCodeTest extends TestCase +{ + /** + * @var string + */ + private static $reportDir = ''; + + /** + * Setup basics for all tests + */ + public static function setUpBeforeClass(): void + { + self::$reportDir = BP . '/dev/tests/static/report'; + if (!is_dir(self::$reportDir)) { + mkdir(self::$reportDir, 0770); + } + } + + /** + * Test GraphQL schema files code style using phpcs + */ + public function testCodeStyle(): void + { + $reportFile = self::$reportDir . '/graphql_phpcs_report.txt'; + $codeSniffer = new CodeSniffer('Magento', $reportFile, new Wrapper()); + $result = $codeSniffer->run(PHPCodeTest::getWhitelist(['graphqls'])); + $report = file_exists($reportFile) ? file_get_contents($reportFile) : ''; + $this->assertEquals( + 0, + $result, + "PHP Code Sniffer detected {$result} violation(s): " . PHP_EOL . $report + ); + } +} From 004d61a7055ef5a4abd1ce8a8ac0c557f496a7f9 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Fri, 22 Nov 2019 13:41:46 -0600 Subject: [PATCH 222/595] MC-29026: GraphQL returns filters with some data if you making request to not existing or empty category --- .../testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php index 6e732d68fe7d3..9ee3b3baa5fc2 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductSearchTest.php @@ -72,6 +72,7 @@ public function testFilterForNonExistingCategory() */ public function testFilterLn() { + $this->reIndexAndCleanCache(); $query = <<<QUERY { products ( From 491b373ea13c8ba66f9207bc671fab0e613dda82 Mon Sep 17 00:00:00 2001 From: Lena Orobei <oorobei@magento.com> Date: Fri, 22 Nov 2019 14:10:27 -0600 Subject: [PATCH 223/595] ENGCOM-6317: Bump coding standard version --- .../static/testsuite/Magento/Test/GraphQl/LiveCodeTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/static/testsuite/Magento/Test/GraphQl/LiveCodeTest.php b/dev/tests/static/testsuite/Magento/Test/GraphQl/LiveCodeTest.php index 32bd666b3d7cd..2805d7d897097 100644 --- a/dev/tests/static/testsuite/Magento/Test/GraphQl/LiveCodeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/GraphQl/LiveCodeTest.php @@ -38,7 +38,7 @@ public static function setUpBeforeClass(): void */ public function testCodeStyle(): void { - $reportFile = self::$reportDir . '/graphql_phpcs_report.txt'; + $reportFile = self::$reportDir . '/graphql_phpcs_report.txt'; $codeSniffer = new CodeSniffer('Magento', $reportFile, new Wrapper()); $result = $codeSniffer->run(PHPCodeTest::getWhitelist(['graphqls'])); $report = file_exists($reportFile) ? file_get_contents($reportFile) : ''; From 9b55f0ee31b3b1d68ce7112251d6c12b0f73119f Mon Sep 17 00:00:00 2001 From: Fabricio Sobral <fabricio.sobral@webjump.com.br> Date: Fri, 22 Nov 2019 19:03:34 -0300 Subject: [PATCH 224/595] 25703 change margin bottom value to fix issue --- .../luma/Magento_Checkout/web/css/source/module/_cart.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less index 460a961830b43..7d3e9f5dbf01b 100644 --- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less +++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less @@ -113,7 +113,7 @@ .page-main & { .block { - margin-bottom: 0; + margin-bottom: 20px; } } From f61f1d9878a3bf4becb19e90b2e1332cdccec163 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sat, 23 Nov 2019 11:37:49 +0700 Subject: [PATCH 225/595] [Tax] Cover Tax CustomerData by Unit Test --- ...CheckoutTotalsJsLayoutDataProviderTest.php | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 app/code/Magento/Tax/Test/Unit/CustomerData/CheckoutTotalsJsLayoutDataProviderTest.php diff --git a/app/code/Magento/Tax/Test/Unit/CustomerData/CheckoutTotalsJsLayoutDataProviderTest.php b/app/code/Magento/Tax/Test/Unit/CustomerData/CheckoutTotalsJsLayoutDataProviderTest.php new file mode 100644 index 0000000000000..d624a42c1e134 --- /dev/null +++ b/app/code/Magento/Tax/Test/Unit/CustomerData/CheckoutTotalsJsLayoutDataProviderTest.php @@ -0,0 +1,129 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Tax\Test\Unit\CustomerData; + +use PHPUnit\Framework\TestCase; +use Magento\Tax\CustomerData\CheckoutTotalsJsLayoutDataProvider; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Tax\Model\Config as TaxConfig; + +/** + * Test class to cover CheckoutTotalsJsLayoutDataProvider + * + * Class \Magento\Tax\Test\Unit\CustomerData\CheckoutTotalsJsLayoutDataProviderTest + */ +class CheckoutTotalsJsLayoutDataProviderTest extends TestCase +{ + /** + * @var CheckoutTotalsJsLayoutDataProvider + */ + private $dataProvider; + + /** + * @var TaxConfig|PHPUnit_Framework_MockObject_MockObject + */ + private $taxConfigMock; + + /** + * Setup environment for test + */ + protected function setUp() + { + $this->taxConfigMock = $this->createMock(TaxConfig::class); + $objectManager = new ObjectManagerHelper($this); + + $this->dataProvider = $objectManager->getObject( + CheckoutTotalsJsLayoutDataProvider::class, + [ + 'taxConfig' => $this->taxConfigMock + ] + ); + } + + /** + * Test getData() with dataset getDataDataProvider + * + * @param int $displayCartSubtotalInclTax + * @param int $displayCartSubtotalExclTax + * @param array $expected + * @return void + * @dataProvider getDataDataProvider + */ + public function testGetData($displayCartSubtotalInclTax, $displayCartSubtotalExclTax, $expected) + { + $this->taxConfigMock->expects($this->any())->method('displayCartSubtotalInclTax') + ->willReturn($displayCartSubtotalInclTax); + $this->taxConfigMock->expects($this->any())->method('displayCartSubtotalExclTax') + ->willReturn($displayCartSubtotalExclTax); + + $this->assertEquals($expected, $this->dataProvider->getData()); + } + + /** + * Dataset for test getData() + * + * @return array + */ + public function getDataDataProvider() + { + return [ + 'Test with settings display cart incl and excl is Yes' => [ + '1' , + '1', + [ + 'components' => [ + 'minicart_content' => [ + 'children' => [ + 'subtotal.container' => [ + 'children' => [ + 'subtotal' => [ + 'children' => [ + 'subtotal.totals' => [ + 'config' => [ + 'display_cart_subtotal_incl_tax' => 1, + 'display_cart_subtotal_excl_tax' => 1 + ] + ], + ], + ], + ], + ], + ], + ], + ] + ] + ], + 'Test with settings display cart incl and excl is No' => [ + '0' , + '0', + [ + 'components' => [ + 'minicart_content' => [ + 'children' => [ + 'subtotal.container' => [ + 'children' => [ + 'subtotal' => [ + 'children' => [ + 'subtotal.totals' => [ + 'config' => [ + 'display_cart_subtotal_incl_tax' => 0, + 'display_cart_subtotal_excl_tax' => 0 + ] + ], + ], + ], + ], + ], + ], + ], + ] + ] + ] + ]; + } +} From 02c01c0ff028e2dc79e59829e4aeeefd0b4e64a1 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sat, 23 Nov 2019 21:46:44 +0700 Subject: [PATCH 226/595] [Shipping] Cover Helper Data by Unit Test --- .../Shipping/Test/Unit/Helper/DataTest.php | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 app/code/Magento/Shipping/Test/Unit/Helper/DataTest.php diff --git a/app/code/Magento/Shipping/Test/Unit/Helper/DataTest.php b/app/code/Magento/Shipping/Test/Unit/Helper/DataTest.php new file mode 100644 index 0000000000000..b82e3537d26e2 --- /dev/null +++ b/app/code/Magento/Shipping/Test/Unit/Helper/DataTest.php @@ -0,0 +1,102 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Shipping\Test\Unit\Helper; + +use PHPUnit\Framework\TestCase; +use Magento\Shipping\Helper\Data as HelperData; +use Magento\Framework\Url\DecoderInterface; +use Magento\Framework\App\Helper\Context; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; + +/** + * Data helper test + * + * Class \Magento\Shipping\Test\Unit\Helper\DataTest + */ +class DataTest extends TestCase +{ + /** + * @var HelperData + */ + private $helper; + + /** + * @var DecoderInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $urlDecoderMock; + + /** + * @var Context|\PHPUnit_Framework_MockObject_MockObject + */ + private $contextMock; + + /** + * @var ObjectManagerHelper + */ + private $objectManagerHelper; + + /** + * Setup environment to test + */ + protected function setUp() + { + $this->contextMock = $this->createMock(Context::class); + $this->urlDecoderMock = $this->createMock(DecoderInterface::class); + $this->contextMock->expects($this->any())->method('getUrlDecoder') + ->willReturn($this->urlDecoderMock); + $this->objectManagerHelper = new ObjectManagerHelper($this); + + $this->helper = $this->objectManagerHelper->getObject( + HelperData::class, + [ + 'context' => $this->contextMock + ] + ); + } + + /** + * test decodeTrackingHash() with data provider below + * + * @param string $hash + * @param string $urlDecodeResult + * @param array $expected + * @dataProvider decodeTrackingHashDataProvider + */ + public function testDecodeTrackingHash($hash, $urlDecodeResult, $expected) + { + $this->urlDecoderMock->expects($this->any())->method('decode') + ->with($hash) + ->willReturn($urlDecodeResult); + $this->assertEquals($expected, $this->helper->decodeTrackingHash($hash)); + } + + /** + * Dataset to test getData() + * + * @return array + */ + public function decodeTrackingHashDataProvider() + { + return [ + 'Test with hash key is allowed' => [ + strtr(base64_encode('order_id:1:protected_code'), '+/=', '-_,'), + 'order_id:1:protected_code', + [ + 'key' => 'order_id', + 'id' => 1, + 'hash' => 'protected_code' + ] + ], + 'Test with hash key is not allowed' => [ + strtr(base64_encode('invoice_id:1:protected_code'), '+/=', '-_,'), + 'invoice_id:1:protected_code', + [] + ] + ]; + } +} From 9992c0e30b4e368ca978be334c541996c66207cc Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sat, 23 Nov 2019 22:41:29 +0700 Subject: [PATCH 227/595] refactor code to pass review --- .../Test/Unit/CustomerData/CaptchaTest.php | 37 +++++++------------ 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/app/code/Magento/Captcha/Test/Unit/CustomerData/CaptchaTest.php b/app/code/Magento/Captcha/Test/Unit/CustomerData/CaptchaTest.php index b34de7778e176..a791039fe27f9 100644 --- a/app/code/Magento/Captcha/Test/Unit/CustomerData/CaptchaTest.php +++ b/app/code/Magento/Captcha/Test/Unit/CustomerData/CaptchaTest.php @@ -14,28 +14,19 @@ use Magento\Captcha\Model\DefaultModel; use Magento\Customer\Api\Data\CustomerInterface as CustomerData; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use PHPUnit\Framework\TestCase; -/** - * Test class to cover \Magento\Captcha\CustomerData\Captcha - * - * Class \Magento\Captcha\Test\Unit\CustomerData\CaptchaTest - */ -class CaptchaTest extends \PHPUnit\Framework\TestCase +class CaptchaTest extends TestCase { /** * @var CaptchaHelper|\PHPUnit_Framework_MockObject_MockObject */ - private $helper; + private $helperMock; /** * @var CustomerSession|\PHPUnit_Framework_MockObject_MockObject */ - private $customerSession; - - /** - * @var CustomerData|\PHPUnit_Framework_MockObject_MockObject - */ - private $customerData; + private $customerSessionMock; /** * @var Captcha @@ -57,8 +48,8 @@ class CaptchaTest extends \PHPUnit\Framework\TestCase */ protected function setUp() { - $this->helper = $this->createMock(CaptchaHelper::class); - $this->customerSession = $this->createMock(CustomerSession::class); + $this->helperMock = $this->createMock(CaptchaHelper::class); + $this->customerSessionMock = $this->createMock(CustomerSession::class); $this->formIds = [ 'user_login' ]; @@ -66,9 +57,9 @@ protected function setUp() $this->model = $this->objectManagerHelper->getObject( Captcha::class, [ - 'helper' => $this->helper, + 'helper' => $this->helperMock, 'formIds' => $this->formIds, - 'customerSession' => $this->customerSession + 'customerSession' => $this->customerSessionMock ] ); } @@ -83,15 +74,15 @@ public function testGetSectionDataWhenLoginAndRequireCaptcha() $userLoginModel = $this->createMock(DefaultModel::class); $userLoginModel->expects($this->any())->method('isRequired')->with($emailLogin) ->willReturn(true); - $this->helper->expects($this->any())->method('getCaptcha')->with('user_login')->willReturn($userLoginModel); + $this->helperMock->expects($this->any())->method('getCaptcha')->with('user_login')->willReturn($userLoginModel); - $this->customerSession->expects($this->any())->method('isLoggedIn') + $this->customerSessionMock->expects($this->any())->method('isLoggedIn') ->willReturn(true); - $this->customerData = $this->createMock(CustomerData::class); - $this->customerData->expects($this->any())->method('getEmail')->willReturn($emailLogin); - $this->customerSession->expects($this->any())->method('getCustomerData') - ->willReturn($this->customerData); + $customerDataMock = $this->createMock(CustomerData::class); + $customerDataMock->expects($this->any())->method('getEmail')->willReturn($emailLogin); + $this->customerSessionMock->expects($this->any())->method('getCustomerData') + ->willReturn($customerDataMock); /* Assert to test */ $this->assertEquals( From 34998b6ee11084d047aeca7c137d4fd65818e821 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sat, 23 Nov 2019 23:10:37 +0700 Subject: [PATCH 228/595] Resolve Wrong Css at "Minimum Qty Allowed in Shopping Cart" on Google Chrome issue25647 --- .../Block/Adminhtml/Form/Field/Minsaleqty.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Minsaleqty.php b/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Minsaleqty.php index 6c4f6a0f46a59..ffcb758dcbd66 100644 --- a/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Minsaleqty.php +++ b/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Minsaleqty.php @@ -37,7 +37,7 @@ protected function _getGroupRenderer() '', ['data' => ['is_render_to_js_template' => true]] ); - $this->_groupRenderer->setClass('customer_group_select'); + $this->_groupRenderer->setClass('customer_group_select admin__control-select'); } return $this->_groupRenderer; } @@ -57,7 +57,7 @@ protected function _prepareToRender() 'min_sale_qty', [ 'label' => __('Minimum Qty'), - 'class' => 'required-entry validate-number validate-greater-than-zero' + 'class' => 'required-entry validate-number validate-greater-than-zero admin__control-text' ] ); $this->_addAfter = false; From 20fd591f056285e1d906fd64fe18919f83e5963e Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sat, 23 Nov 2019 23:12:03 +0700 Subject: [PATCH 229/595] Resolve Wrong Css at "Minimum Qty Allowed in Shopping Cart" on Google Chrome issue25647 --- .../Block/Adminhtml/Form/Field/CustomergroupTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Block/Adminhtml/Form/Field/CustomergroupTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Block/Adminhtml/Form/Field/CustomergroupTest.php index 527828a92dea8..f552f10d50304 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Block/Adminhtml/Form/Field/CustomergroupTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Block/Adminhtml/Form/Field/CustomergroupTest.php @@ -22,11 +22,11 @@ protected function setUp() public function testToHtml() { - $this->_block->setClass('customer_group_select'); + $this->_block->setClass('customer_group_select admin__control-select'); $this->_block->setId('123'); $this->_block->setTitle('Customer Group'); $this->_block->setInputName('groups[item_options]'); - $expectedResult = '<select name="groups[item_options]" id="123" class="customer_group_select" ' + $expectedResult = '<select name="groups[item_options]" id="123" class="customer_group_select admin__control-select" ' . 'title="Customer Group" ><option value="32000" >ALL GROUPS</option><option value="0" >NOT LOGGED IN' . '</option><option value="1" >General</option><option value="2" >Wholesale</option><option value="3" >' . 'Retailer</option></select>'; From 0a4393ccce5760c8551a315ac774b160c0b6e19a Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sat, 23 Nov 2019 23:51:12 +0700 Subject: [PATCH 230/595] Fix static test --- .../Block/Adminhtml/Form/Field/CustomergroupTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/CatalogInventory/Block/Adminhtml/Form/Field/CustomergroupTest.php b/dev/tests/integration/testsuite/Magento/CatalogInventory/Block/Adminhtml/Form/Field/CustomergroupTest.php index f552f10d50304..b7be72e9ff827 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogInventory/Block/Adminhtml/Form/Field/CustomergroupTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogInventory/Block/Adminhtml/Form/Field/CustomergroupTest.php @@ -26,7 +26,8 @@ public function testToHtml() $this->_block->setId('123'); $this->_block->setTitle('Customer Group'); $this->_block->setInputName('groups[item_options]'); - $expectedResult = '<select name="groups[item_options]" id="123" class="customer_group_select admin__control-select" ' + $expectedResult = '<select name="groups[item_options]" id="123" ' + . 'class="customer_group_select admin__control-select" ' . 'title="Customer Group" ><option value="32000" >ALL GROUPS</option><option value="0" >NOT LOGGED IN' . '</option><option value="1" >General</option><option value="2" >Wholesale</option><option value="3" >' . 'Retailer</option></select>'; From 7b16d76207684bc5422058d323d5e35d36ac58bc Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Sun, 24 Nov 2019 01:13:15 +0200 Subject: [PATCH 231/595] Cover with js unit test, static test fix --- .../Tinymce3/view/base/web/tinymce3Adapter.js | 4 +- .../tests/lib/mage/tinymce4Adapter.test.js | 41 +++++++++++++++++++ .../Framework/Data/Form/Element/Editor.php | 4 +- 3 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 dev/tests/js/jasmine/tests/lib/mage/tinymce4Adapter.test.js diff --git a/app/code/Magento/Tinymce3/view/base/web/tinymce3Adapter.js b/app/code/Magento/Tinymce3/view/base/web/tinymce3Adapter.js index 86602b2017c15..15bc5465e5d04 100644 --- a/app/code/Magento/Tinymce3/view/base/web/tinymce3Adapter.js +++ b/app/code/Magento/Tinymce3/view/base/web/tinymce3Adapter.js @@ -78,8 +78,8 @@ define([ } tinyMCE3.init(this.getSettings(mode)); - varienGlobalEvents.clearEventHandlers("open_browser_callback"); - varienGlobalEvents.attachEventHandler("open_browser_callback", tinyMceEditors.get(this.id).openFileBrowser); + varienGlobalEvents.clearEventHandlers('open_browser_callback'); + varienGlobalEvents.attachEventHandler('open_browser_callback', tinyMceEditors.get(this.id).openFileBrowser); }, /** diff --git a/dev/tests/js/jasmine/tests/lib/mage/tinymce4Adapter.test.js b/dev/tests/js/jasmine/tests/lib/mage/tinymce4Adapter.test.js new file mode 100644 index 0000000000000..7af1a19e4b4c1 --- /dev/null +++ b/dev/tests/js/jasmine/tests/lib/mage/tinymce4Adapter.test.js @@ -0,0 +1,41 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'wysiwygAdapter', + 'underscore' +], function (wysiwygAdapter, _) { + 'use strict'; + + var obj; + + beforeEach(function () { + + /** + * Dummy constructor to use for instantiation + * @constructor + */ + var Constr = function () {}; + + Constr.prototype = wysiwygAdapter; + + obj = new Constr(); + obj.eventBus = new window.varienEvents(); + obj.initialize(1, { + 'store_id': 0, + 'tinymce4': { + 'content_css': '' + }, + 'files_browser_window_url': 'url' + }); + obj.setup(); + }); + + describe('"openFileBrowser" method', function () { + it('Opens file browser to given instance', function () { + expect(_.size(obj.eventBus.arrEvents['open_browser_callback'])).toBe(1); + }); + }); +}); diff --git a/lib/internal/Magento/Framework/Data/Form/Element/Editor.php b/lib/internal/Magento/Framework/Data/Form/Element/Editor.php index 5059fb38f29ca..08a5edd09bf35 100644 --- a/lib/internal/Magento/Framework/Data/Form/Element/Editor.php +++ b/lib/internal/Magento/Framework/Data/Form/Element/Editor.php @@ -310,9 +310,7 @@ protected function _getPluginButtonsHtml($visible = true) if (isset($buttonOptions['style'])) { $configStyle = $buttonOptions['style']; } - // phpcs:disable Magento2.Performance.ForeachArrayMerge - $buttonOptions = array_merge($buttonOptions, ['style' => 'display:none;' . $configStyle]); - // phpcs:enable + $buttonOptions['style'] = 'display:none; ' . $configStyle; } $buttonsHtml .= $this->_getButtonHtml($buttonOptions); } From ad17bd912b73c3afc6ad4192bc6cfdd1ad594a6b Mon Sep 17 00:00:00 2001 From: Benjamin Rosenberger <rosenberger@e-conomix.at> Date: Sun, 24 Nov 2019 11:40:27 +0100 Subject: [PATCH 232/595] add the id of the category to the category tree names --- app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php index 9a4a9fa768006..929c181bf820c 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php @@ -407,6 +407,7 @@ protected function _getNodeJson($node, $level = 0) public function buildNodeName($node) { $result = $this->escapeHtml($node->getName()); + $result .= ' (ID: ' . $node->getId() . ')'; if ($this->_withProductCount) { $result .= ' (' . $node->getProductCount() . ')'; } From f307e2edce1d04e6e4cff145505d64dcc98047be Mon Sep 17 00:00:00 2001 From: Sergiy Zhovnir <s.zhovnir@atwix.com> Date: Sun, 24 Nov 2019 14:18:45 +0200 Subject: [PATCH 233/595] #issue-723 Fixed the issue Image preview should be closed when the page is changed --- .../Magento/Ui/view/base/web/js/grid/columns/image-preview.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js index 4f632df025ac8..bc21e9e21ff3b 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js @@ -30,7 +30,8 @@ define([ }, listens: { '${ $.provider }:params.filters': 'hide', - '${ $.provider }:params.search': 'hide' + '${ $.provider }:params.search': 'hide', + '${ $.provider }:params.paging': 'hide' }, exports: { height: '${ $.parentName }.thumbnail_url:previewHeight' From 353eaa884b9cb14fbd74978666a5a29c2881c3bd Mon Sep 17 00:00:00 2001 From: Benjamin Rosenberger <rosenberger@e-conomix.at> Date: Sun, 24 Nov 2019 13:25:43 +0100 Subject: [PATCH 234/595] add correct test category output to wait for --- .../AdminFilteringCategoryProductsUsingScopeSelectorTest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml index 5c434ecabf80d..41b446b474078 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml @@ -131,7 +131,7 @@ userInput="$$createProduct1.name$$" stepKey="seeProductName4"/> <see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct12.name$$)}}" userInput="$$createProduct12.name$$" stepKey="seeProductName5"/> - <waitForText userInput="$$createCategory.name$$ (2)" stepKey="seeCorrectProductCount"/> + <waitForText userInput="$$createCategory.name$$ (ID: 6) (2)" stepKey="seeCorrectProductCount"/> <dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct0.name$$)}}" userInput="$$createProduct0.name$$" stepKey="dontSeeProductName"/> <dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct2.name$$)}}" @@ -151,7 +151,7 @@ userInput="$$createProduct2.name$$" stepKey="seeProductName6"/> <see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct12.name$$)}}" userInput="$$createProduct12.name$$" stepKey="seeProductName7"/> - <waitForText userInput="$$createCategory.name$$ (2)" stepKey="seeCorrectProductCount2"/> + <waitForText userInput="$$createCategory.name$$ (ID: 6) (2)" stepKey="seeCorrectProductCount2"/> <dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct0.name$$)}}" userInput="$$createProduct0.name$$" stepKey="dontSeeProductName2"/> <dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct2.name$$)}}" From 539e4c620a75aa294050025d02d48f313e6dd2c7 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sun, 24 Nov 2019 23:09:54 +0700 Subject: [PATCH 235/595] [Customer] Cover Customer Navigation Block by Unit Test --- .../Unit/Block/Account/NavigationTest.php | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 app/code/Magento/Customer/Test/Unit/Block/Account/NavigationTest.php diff --git a/app/code/Magento/Customer/Test/Unit/Block/Account/NavigationTest.php b/app/code/Magento/Customer/Test/Unit/Block/Account/NavigationTest.php new file mode 100644 index 0000000000000..ac439d1c7973f --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Block/Account/NavigationTest.php @@ -0,0 +1,106 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Test\Unit\Block\Account; + +use PHPUnit\Framework\TestCase; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Customer\Block\Account\Navigation; +use Magento\Framework\View\Element\Template\Context; +use Magento\Framework\View\LayoutInterface; +use Magento\Wishlist\Block\Link as WishListLink; +use Magento\Customer\Block\Account\Link as CustomerAccountLink; + +class NavigationTest extends TestCase +{ + /** + * @var ObjectManagerHelper + */ + private $objectManagerHelper; + + /** + * @var Navigation + */ + private $navigation; + + /** + * @var Context|\PHPUnit_Framework_MockObject_MockObject + */ + private $contextMock; + + /** + * @var LayoutInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $layoutMock; + + /** + * Setup environment for test + */ + protected function setUp() + { + $this->contextMock = $this->createMock(Context::class); + $this->layoutMock = $this->createMock(LayoutInterface::class); + $this->contextMock->expects($this->any()) + ->method('getLayout') + ->willReturn($this->layoutMock); + $this->objectManagerHelper = new ObjectManagerHelper($this); + $this->navigation = $this->objectManagerHelper->getObject( + Navigation::class, + [ + 'context' => $this->contextMock + ] + ); + } + + /** + * Test get links with block customer account link and wish list link + * + * @return void + */ + public function testGetLinksWithCustomerAndWishList() + { + $wishListLink = $this->getMockBuilder(WishListLink::class) + ->disableOriginalConstructor() + ->setMethods(['getSortOrder']) + ->getMock(); + + $customerAccountLink = $this->getMockBuilder(CustomerAccountLink::class) + ->disableOriginalConstructor() + ->setMethods(['getSortOrder']) + ->getMock(); + + $wishListLink->expects($this->any()) + ->method('getSortOrder') + ->willReturn(100); + + $customerAccountLink->expects($this->any()) + ->method('getSortOrder') + ->willReturn(20); + + $nameInLayout = 'top.links'; + + $blockChildren = [ + 'wishListLink' => $wishListLink, + 'customerAccountLink' => $customerAccountLink + ]; + + $this->navigation->setNameInLayout($nameInLayout); + $this->layoutMock->expects($this->any()) + ->method('getChildBlocks') + ->with($nameInLayout) + ->willReturn($blockChildren); + + /* Assertion */ + $this->assertEquals( + [ + 0 => $wishListLink, + 1 => $customerAccountLink + ], + $this->navigation->getLinks() + ); + } +} From 49b0c16a24a0bc8b77f2066f4f2bd8a1856f21bc Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sun, 24 Nov 2019 23:10:51 +0700 Subject: [PATCH 236/595] [Customer] Cover Customer Navigation Block by Unit Test --- .../Test/Unit/Block/Account/NavigationTest.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Customer/Test/Unit/Block/Account/NavigationTest.php b/app/code/Magento/Customer/Test/Unit/Block/Account/NavigationTest.php index ac439d1c7973f..e8c7bd886ab01 100644 --- a/app/code/Magento/Customer/Test/Unit/Block/Account/NavigationTest.php +++ b/app/code/Magento/Customer/Test/Unit/Block/Account/NavigationTest.php @@ -63,29 +63,29 @@ protected function setUp() */ public function testGetLinksWithCustomerAndWishList() { - $wishListLink = $this->getMockBuilder(WishListLink::class) + $wishListLinkMock = $this->getMockBuilder(WishListLink::class) ->disableOriginalConstructor() ->setMethods(['getSortOrder']) ->getMock(); - $customerAccountLink = $this->getMockBuilder(CustomerAccountLink::class) + $customerAccountLinkMock = $this->getMockBuilder(CustomerAccountLink::class) ->disableOriginalConstructor() ->setMethods(['getSortOrder']) ->getMock(); - $wishListLink->expects($this->any()) + $wishListLinkMock->expects($this->any()) ->method('getSortOrder') ->willReturn(100); - $customerAccountLink->expects($this->any()) + $customerAccountLinkMock->expects($this->any()) ->method('getSortOrder') ->willReturn(20); $nameInLayout = 'top.links'; $blockChildren = [ - 'wishListLink' => $wishListLink, - 'customerAccountLink' => $customerAccountLink + 'wishListLink' => $wishListLinkMock, + 'customerAccountLink' => $customerAccountLinkMock ]; $this->navigation->setNameInLayout($nameInLayout); @@ -97,8 +97,8 @@ public function testGetLinksWithCustomerAndWishList() /* Assertion */ $this->assertEquals( [ - 0 => $wishListLink, - 1 => $customerAccountLink + 0 => $wishListLinkMock, + 1 => $customerAccountLinkMock ], $this->navigation->getLinks() ); From e5d143d8d968bf5a71429677015be4ae36196a74 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Sun, 24 Nov 2019 18:59:53 +0200 Subject: [PATCH 237/595] Cover changes with jasmnine test --- .../js/grid/columns/image-preview.test.js | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/columns/image-preview.test.js diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/columns/image-preview.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/columns/image-preview.test.js new file mode 100644 index 0000000000000..b5c6e75248bfa --- /dev/null +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/columns/image-preview.test.js @@ -0,0 +1,50 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +/* eslint-disable max-nested-callbacks, no-undef */ + +define([ + 'Magento_Ui/js/grid/columns/image-preview', + 'ko', + 'jquery' +], function (Preview, ko, $) { + 'use strict'; + + describe('Ui/js/grid/columns/image-preview', function () { + var record = { + _rowIndex: 1, + rowNumber: 1 + }, + imagePreview; + + beforeEach(function () { + imagePreview = new Preview(); + + /** + * @return {Object} + */ + function getThumbnail() { + return { + previewRowId: ko.observable() + }; + } + + imagePreview.thumbnailComponent = getThumbnail; + + imagePreview.visibleRecord = ko.observable(1); + }); + + describe('show method', function () { + it('show image', function () { + var mockImg = document.createElement('img'), + hide = spyOn(imagePreview, 'hide'); + + spyOn($.fn, 'get').and.returnValue(mockImg); + imagePreview.show(record); + expect(hide).toHaveBeenCalledTimes(1); + }); + + }); + }); +}); From 9348fb818ae587d87e71d485a95592d105117e97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Szubert?= <bartlomiejszubert@gmail.com> Date: Sun, 24 Nov 2019 22:22:17 +0100 Subject: [PATCH 238/595] Fix #24713 - Symbol of the Belarusian currency BYR is outdated --- .../Dhl/Test/Unit/Model/_files/countries.xml | 2 +- app/code/Magento/Dhl/etc/countries.xml | 2 +- app/code/Magento/Directory/etc/config.xml | 2 +- app/code/Magento/GraphQl/etc/schema.graphqls | 2 +- .../Magento/Framework/Locale/Config.php | 2 +- .../Framework/Locale/Test/Unit/ConfigTest.php | 35 +++++++++++-------- 6 files changed, 25 insertions(+), 20 deletions(-) diff --git a/app/code/Magento/Dhl/Test/Unit/Model/_files/countries.xml b/app/code/Magento/Dhl/Test/Unit/Model/_files/countries.xml index 792465ce45942..d71bb69c99c9b 100644 --- a/app/code/Magento/Dhl/Test/Unit/Model/_files/countries.xml +++ b/app/code/Magento/Dhl/Test/Unit/Model/_files/countries.xml @@ -216,7 +216,7 @@ <name>Botswana</name> </BW> <BY> - <currency>BYR</currency> + <currency>BYN</currency> <weight_unit>KG</weight_unit> <measure_unit>CM</measure_unit> <region>AP</region> diff --git a/app/code/Magento/Dhl/etc/countries.xml b/app/code/Magento/Dhl/etc/countries.xml index 792465ce45942..d71bb69c99c9b 100644 --- a/app/code/Magento/Dhl/etc/countries.xml +++ b/app/code/Magento/Dhl/etc/countries.xml @@ -216,7 +216,7 @@ <name>Botswana</name> </BW> <BY> - <currency>BYR</currency> + <currency>BYN</currency> <weight_unit>KG</weight_unit> <measure_unit>CM</measure_unit> <region>AP</region> diff --git a/app/code/Magento/Directory/etc/config.xml b/app/code/Magento/Directory/etc/config.xml index 2ff0b484fe979..32099ff9d8af5 100644 --- a/app/code/Magento/Directory/etc/config.xml +++ b/app/code/Magento/Directory/etc/config.xml @@ -9,7 +9,7 @@ <default> <system> <currency> - <installed>AZN,AZM,AFN,ALL,DZD,AOA,ARS,AMD,AWG,AUD,BSD,BHD,BDT,BBD,BYR,BZD,BMD,BTN,BOB,BAM,BWP,BRL,GBP,BND,BGN,BUK,BIF,KHR,CAD,CVE,CZK,KYD,CLP,CNY,COP,KMF,CDF,CRC,HRK,CUP,DKK,DJF,DOP,XCD,EGP,SVC,GQE,ERN,EEK,ETB,EUR,FKP,FJD,GMD,GEK,GEL,GHS,GIP,GTQ,GNF,GYD,HTG,HNL,HKD,HUF,ISK,INR,IDR,IRR,IQD,ILS,JMD,JPY,JOD,KZT,KES,KWD,KGS,LAK,LVL,LBP,LSL,LRD,LYD,LTL,MOP,MKD,MGA,MWK,MYR,MVR,LSM,MRO,MUR,MXN,MDL,MNT,MAD,MZN,MMK,NAD,NPR,ANG,TRL,TRY,NZD,NIC,NGN,KPW,NOK,OMR,PKR,PAB,PGK,PYG,PEN,PHP,PLN,QAR,RHD,RON,ROL,RUB,RWF,SHP,STD,SAR,RSD,SCR,SLL,SGD,SKK,SBD,SOS,ZAR,KRW,LKR,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TMM,USD,UGX,UAH,AED,UYU,UZS,VUV,VEB,VEF,VND,CHE,CHW,XOF,XPF,WST,YER,ZMK,ZWD</installed> + <installed>AZN,AZM,AFN,ALL,DZD,AOA,ARS,AMD,AWG,AUD,BSD,BHD,BDT,BBD,BYN,BZD,BMD,BTN,BOB,BAM,BWP,BRL,GBP,BND,BGN,BUK,BIF,KHR,CAD,CVE,CZK,KYD,CLP,CNY,COP,KMF,CDF,CRC,HRK,CUP,DKK,DJF,DOP,XCD,EGP,SVC,GQE,ERN,EEK,ETB,EUR,FKP,FJD,GMD,GEK,GEL,GHS,GIP,GTQ,GNF,GYD,HTG,HNL,HKD,HUF,ISK,INR,IDR,IRR,IQD,ILS,JMD,JPY,JOD,KZT,KES,KWD,KGS,LAK,LVL,LBP,LSL,LRD,LYD,LTL,MOP,MKD,MGA,MWK,MYR,MVR,LSM,MRO,MUR,MXN,MDL,MNT,MAD,MZN,MMK,NAD,NPR,ANG,TRL,TRY,NZD,NIC,NGN,KPW,NOK,OMR,PKR,PAB,PGK,PYG,PEN,PHP,PLN,QAR,RHD,RON,ROL,RUB,RWF,SHP,STD,SAR,RSD,SCR,SLL,SGD,SKK,SBD,SOS,ZAR,KRW,LKR,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TMM,USD,UGX,UAH,AED,UYU,UZS,VUV,VEB,VEF,VND,CHE,CHW,XOF,XPF,WST,YER,ZMK,ZWD</installed> </currency> </system> <currency> diff --git a/app/code/Magento/GraphQl/etc/schema.graphqls b/app/code/Magento/GraphQl/etc/schema.graphqls index 559ccf9428929..fccde015c3388 100644 --- a/app/code/Magento/GraphQl/etc/schema.graphqls +++ b/app/code/Magento/GraphQl/etc/schema.graphqls @@ -113,7 +113,7 @@ enum CurrencyEnum @doc(description: "The list of available currency codes") { BHD BDT BBD - BYR + BYN BZD BMD BTN diff --git a/lib/internal/Magento/Framework/Locale/Config.php b/lib/internal/Magento/Framework/Locale/Config.php index f02ba78ccc3e0..c2d0147c7fdc8 100644 --- a/lib/internal/Magento/Framework/Locale/Config.php +++ b/lib/internal/Magento/Framework/Locale/Config.php @@ -129,7 +129,7 @@ class Config implements \Magento\Framework\Locale\ConfigInterface 'BHD', /*Bahraini Dinar*/ 'BDT', /*Bangladesh Taka*/ 'BBD', /*Barbados Dollar*/ - 'BYR', /*Belarussian Ruble*/ + 'BYN', /*Belarussian Ruble*/ 'BZD', /*Belize Dollar*/ 'BMD', /*Bermudan Dollar*/ 'BTN', /*Bhutan Ngultrum*/ diff --git a/lib/internal/Magento/Framework/Locale/Test/Unit/ConfigTest.php b/lib/internal/Magento/Framework/Locale/Test/Unit/ConfigTest.php index 149f6b5e33b6e..20731ee34558e 100644 --- a/lib/internal/Magento/Framework/Locale/Test/Unit/ConfigTest.php +++ b/lib/internal/Magento/Framework/Locale/Test/Unit/ConfigTest.php @@ -6,7 +6,11 @@ namespace Magento\Framework\Locale\Test\Unit; -class ConfigTest extends \PHPUnit\Framework\TestCase +use Magento\Framework\Locale\Config; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\TestCase; + +class ConfigTest extends TestCase { private static $allAllowedLocales = [ 'af_ZA', 'ar_DZ', 'ar_EG', 'ar_KW', 'ar_MA', 'ar_SA', 'az_Latn_AZ', 'be_BY', 'bg_BG', 'bn_BD', @@ -22,7 +26,7 @@ class ConfigTest extends \PHPUnit\Framework\TestCase private static $allAllowedCurrencies = [ 'AFN', 'ALL', 'AZN', 'DZD', 'AOA', 'ARS', 'AMD', 'AWG', 'AUD', 'BSD', - 'BHD', 'BDT', 'BBD', 'BYR', 'BZD', 'BMD', 'BTN', 'BOB', 'BAM', 'BWP', + 'BHD', 'BDT', 'BBD', 'BYN', 'BZD', 'BMD', 'BTN', 'BOB', 'BAM', 'BWP', 'BRL', 'GBP', 'BND', 'BGN', 'BUK', 'BIF', 'KHR', 'CAD', 'CVE', 'CZK', 'KYD', 'GQE', 'CLP', 'CNY', 'COP', 'KMF', 'CDF', 'CRC', 'HRK', 'CUP', 'DKK', 'DJF', 'DOP', 'XCD', 'EGP', 'SVC', 'ERN', 'EEK', 'ETB', 'EUR', @@ -67,13 +71,14 @@ class ConfigTest extends \PHPUnit\Framework\TestCase 'QED', 'PNP', 'EJN', 'MTO', 'EBY', ]; - /** @var \Magento\Framework\Locale\Config */ + /** + * @var Config + */ private $configObject; public function testGetAllowedLocalesNoDataArray() { - $this->configObject = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this)) - ->getObject(\Magento\Framework\Locale\Config::class); + $this->configObject = (new ObjectManager($this))->getObject(Config::class); $retrievedLocales = $this->configObject->getAllowedLocales(); @@ -88,9 +93,9 @@ public function testGetAllowedLocalesNoDataArray() public function testGetAllowedLocalesGivenDataArray() { - $this->configObject = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this)) + $this->configObject = (new ObjectManager($this)) ->getObject( - \Magento\Framework\Locale\Config::class, + Config::class, [ 'data' => [ 'allowedLocales' => $this::$sampleAdditionalLocales, @@ -114,9 +119,9 @@ public function testGetAllowedLocalesGivenDataArray() public function testGetAllowedLocalesGivenRedundantDataArray() { - $this->configObject = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this)) + $this->configObject = (new ObjectManager($this)) ->getObject( - \Magento\Framework\Locale\Config::class, + Config::class, [ 'data' => [ 'allowedLocales' => $this::$samplePresentLocales, @@ -140,8 +145,8 @@ public function testGetAllowedLocalesGivenRedundantDataArray() public function testGetAllowedCurrenciesNoDataArray() { - $this->configObject = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this)) - ->getObject(\Magento\Framework\Locale\Config::class); + $this->configObject = (new ObjectManager($this)) + ->getObject(Config::class); $retrievedCurrencies = $this->configObject->getAllowedCurrencies(); @@ -156,9 +161,9 @@ public function testGetAllowedCurrenciesNoDataArray() public function testGetAllowedCurrenciesGivenDataArray() { - $this->configObject = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this)) + $this->configObject = (new ObjectManager($this)) ->getObject( - \Magento\Framework\Locale\Config::class, + Config::class, [ 'data' => [ 'allowedCurrencies' => $this::$sampleAdditionalCurrencies, @@ -182,9 +187,9 @@ public function testGetAllowedCurrenciesGivenDataArray() public function testGetAllowedCurrenciesGivenRedundantDataArray() { - $this->configObject = (new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this)) + $this->configObject = (new ObjectManager($this)) ->getObject( - \Magento\Framework\Locale\Config::class, + Config::class, [ 'data' => [ 'allowedCurrencies' => $this::$samplePresentCurrencies, From 95eea5245b97a8c6f62d435dbfe32c2f3ddcb4c8 Mon Sep 17 00:00:00 2001 From: Alexey Rakitin <alexey.rakitin@babenkocommerce.com> Date: Fri, 22 Nov 2019 13:00:25 +0200 Subject: [PATCH 239/595] magento/magento2#23481: Billing/Shipping Address edit form design update from order backend - Messages container added to correctly apply margin between message and form - Form wrapper html tag changed from 'fieldset' to 'div' - Added 'admin__fieldset' class to form for standard admin styles to work properly --- .../Sales/Block/Adminhtml/Order/Address/Form.php | 1 + .../adminhtml/templates/order/address/form.phtml | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Address/Form.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Address/Form.php index 1efa149b390ef..06f2edba878ae 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Address/Form.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Address/Form.php @@ -108,6 +108,7 @@ protected function _prepareForm() { parent::_prepareForm(); $this->_form->setId('edit_form'); + $this->_form->setClass('admin__fieldset'); $this->_form->setMethod('post'); $this->_form->setAction( $this->getUrl('sales/*/addressSave', ['address_id' => $this->_getAddress()->getId()]) diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/address/form.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/address/form.phtml index a7f3b3c1cc8f5..b794c418de8d9 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/address/form.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/address/form.phtml @@ -4,13 +4,15 @@ * See COPYING.txt for license details. */ ?> -<div class="message message-notice"> - <div class="message-inner"> - <div class="message-content"><?= $block->escapeHtml(__('Changing address information will not recalculate shipping, tax or other order amount.')) ?></div> +<div class="messages"> + <div class="message message-notice"> + <div class="message-inner"> + <div class="message-content"><?= $block->escapeHtml(__('Changing address information will not recalculate shipping, tax or other order amount.')) ?></div> + </div> </div> </div> -<fieldset class="fieldset admin__fieldset-wrapper"> +<div class="fieldset admin__fieldset-wrapper"> <legend class="legend admin__legend"> <span><?= $block->escapeHtml($block->getHeaderText()) ?></span> </legend> @@ -18,4 +20,4 @@ <div class="form-inline" data-mage-init='{"Magento_Sales/order/edit/address/form":{}}'> <?= $block->getForm()->toHtml() ?> </div> -</fieldset> +</div> From feac134662923a95ff8633a3f99a6adf0bf7d6d2 Mon Sep 17 00:00:00 2001 From: Yurii Sapiha <yurasapiga93@gmail.com> Date: Mon, 25 Nov 2019 10:47:16 +0200 Subject: [PATCH 240/595] MC-23203: Admin: Simple product with all custom attributes --- .../Attribute/Save/AbstractAttributeTest.php | 41 ++++++++++++------- .../Attribute/Save/AttributeDateTest.php | 6 +-- .../Attribute/Save/AttributeDropdownTest.php | 6 +-- .../Save/AttributeMultiSelectTest.php | 6 +-- .../Attribute/Save/AttributePriceTest.php | 6 +-- .../Attribute/Save/AttributeTextAreaTest.php | 4 +- .../Attribute/Save/AttributeTextTest.php | 4 +- .../Attribute/Save/AttributeYesNoTest.php | 4 +- .../Model}/AttributeTextSwatchTest.php | 10 +++-- .../Model}/AttributeVisualSwatchTest.php | 10 +++-- .../Save/AttributeFixedProductTaxTest.php | 8 ++-- 11 files changed, 61 insertions(+), 44 deletions(-) rename dev/tests/integration/testsuite/Magento/{Catalog/Model/Product/Attribute/Save => Swatches/Model}/AttributeTextSwatchTest.php (84%) rename dev/tests/integration/testsuite/Magento/{Catalog/Model/Product/Attribute/Save => Swatches/Model}/AttributeVisualSwatchTest.php (84%) diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AbstractAttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AbstractAttributeTest.php index 7a49475fd5107..d2ab4d69dc45c 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AbstractAttributeTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AbstractAttributeTest.php @@ -10,7 +10,6 @@ use Magento\Catalog\Api\Data\ProductAttributeInterface; use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Api\ProductRepositoryInterface; -use Magento\Catalog\Model\ResourceModel\Eav\Attribute; use Magento\Eav\Api\AttributeRepositoryInterface; use Magento\Eav\Model\Entity\Attribute\Exception; use Magento\Framework\ObjectManagerInterface; @@ -31,7 +30,7 @@ abstract class AbstractAttributeTest extends TestCase /** @var ProductRepositoryInterface */ protected $productRepository; - /** @var Attribute */ + /** @var ProductAttributeInterface */ protected $attribute; /** @@ -44,10 +43,6 @@ protected function setUp() $this->objectManager = Bootstrap::getObjectManager(); $this->productRepository = $this->objectManager->create(ProductRepositoryInterface::class); $this->attributeRepository = $this->objectManager->create(AttributeRepositoryInterface::class); - $this->attribute = $this->attributeRepository->get( - ProductAttributeInterface::ENTITY_TYPE_CODE, - $this->getAttributeCode() - ); } /** @@ -71,7 +66,9 @@ public function testRequiredAttribute(string $productSku): void { $this->expectException(Exception::class); $messageFormat = 'The "%s" attribute value is empty. Set the attribute and try again.'; - $this->expectExceptionMessage((string)__(sprintf($messageFormat, $this->attribute->getDefaultFrontendLabel()))); + $this->expectExceptionMessage( + (string)__(sprintf($messageFormat, $this->getAttribute()->getDefaultFrontendLabel())) + ); $this->prepareAttribute(['is_required' => true]); $this->unsetAttributeValueAndValidate($productSku); } @@ -90,7 +87,7 @@ public function testDefaultValue(string $productSku): void } /** - * @dataProvider uniqueTestProvider + * @dataProvider uniqueAttributeValueProvider * @param string $firstSku * @param string $secondSku * @return void @@ -99,13 +96,32 @@ public function testUniqueAttribute(string $firstSku, string $secondSku): void { $this->expectException(Exception::class); $messageFormat = 'The value of the "%s" attribute isn\'t unique. Set a unique value and try again.'; - $this->expectExceptionMessage((string)__(sprintf($messageFormat, $this->attribute->getDefaultFrontendLabel()))); + $this->expectExceptionMessage( + (string)__(sprintf($messageFormat, $this->getAttribute()->getDefaultFrontendLabel())) + ); $this->prepareAttribute(['is_unique' => 1]); $product = $this->setAttributeValueAndValidate($firstSku, $this->getDefaultAttributeValue()); $this->productRepository->save($product); $this->setAttributeValueAndValidate($secondSku, $this->getDefaultAttributeValue()); } + /** + * Get attribute + * + * @return ProductAttributeInterface + */ + protected function getAttribute(): ProductAttributeInterface + { + if ($this->attribute === null) { + $this->attribute = $this->attributeRepository->get( + ProductAttributeInterface::ENTITY_TYPE_CODE, + $this->getAttributeCode() + ); + } + + return $this->attribute; + } + /** * Set attribute value to product and validate the product * @@ -145,10 +161,7 @@ private function unsetAttributeValueAndValidate(string $productSku): ProductInte */ private function prepareAttribute(array $data): void { - $attribute = $this->attributeRepository->get( - ProductAttributeInterface::ENTITY_TYPE_CODE, - $this->getAttributeCode() - ); + $attribute = $this->getAttribute(); $attribute->addData($data); $this->attributeRepository->save($attribute); } @@ -179,5 +192,5 @@ abstract public function productProvider(): array; * * @return array */ - abstract public function uniqueTestProvider(): array; + abstract public function uniqueAttributeValueProvider(): array; } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeDateTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeDateTest.php index 625418592d4e2..d30f32087c815 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeDateTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeDateTest.php @@ -36,14 +36,14 @@ protected function getAttributeCode(): string */ protected function getDefaultAttributeValue(): string { - return $this->attribute->getBackend()->formatDate('11/20/19'); + return $this->getAttribute()->getBackend()->formatDate('11/20/19'); } /** * @magentoDataFixture Magento/Catalog/_files/product_date_attribute.php * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php * @magentoDataFixture Magento/Catalog/_files/product_simple_out_of_stock.php - * @dataProvider uniqueTestProvider + * @dataProvider uniqueAttributeValueProvider * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod * @inheritdoc */ @@ -67,7 +67,7 @@ public function productProvider(): array /** * @inheritdoc */ - public function uniqueTestProvider(): array + public function uniqueAttributeValueProvider(): array { return [ [ diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeDropdownTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeDropdownTest.php index b724279a55f42..c1cdd0bab28aa 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeDropdownTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeDropdownTest.php @@ -27,14 +27,14 @@ protected function getAttributeCode(): string */ protected function getDefaultAttributeValue(): string { - return $this->attribute->getSource()->getOptionId('Option 1'); + return $this->getAttribute()->getSource()->getOptionId('Option 1'); } /** * @magentoDataFixture Magento/Catalog/_files/dropdown_attribute.php * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php * @magentoDataFixture Magento/Catalog/_files/product_simple_out_of_stock.php - * @dataProvider uniqueTestProvider + * @dataProvider uniqueAttributeValueProvider * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod * @inheritdoc */ @@ -58,7 +58,7 @@ public function productProvider(): array /** * @inheritdoc */ - public function uniqueTestProvider(): array + public function uniqueAttributeValueProvider(): array { return [ [ diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeMultiSelectTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeMultiSelectTest.php index 50280060daad1..4ee2b83010bdc 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeMultiSelectTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeMultiSelectTest.php @@ -27,7 +27,7 @@ protected function getAttributeCode(): string */ protected function getDefaultAttributeValue(): string { - return $this->attribute->getSource()->getOptionId('Option 1'); + return $this->getAttribute()->getSource()->getOptionId('Option 1'); } /** @@ -43,7 +43,7 @@ public function testDefaultValue(string $productSku): void * @magentoDataFixture Magento/Catalog/_files/multiselect_attribute.php * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php * @magentoDataFixture Magento/Catalog/_files/product_simple_out_of_stock.php - * @dataProvider uniqueTestProvider + * @dataProvider uniqueAttributeValueProvider * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod * @inheritdoc */ @@ -67,7 +67,7 @@ public function productProvider(): array /** * @inheritdoc */ - public function uniqueTestProvider(): array + public function uniqueAttributeValueProvider(): array { return [ [ diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributePriceTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributePriceTest.php index a56058ae5007a..5de9d30f71638 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributePriceTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributePriceTest.php @@ -20,12 +20,12 @@ class AttributePriceTest extends AbstractAttributeTest * @magentoDataFixture Magento/Catalog/_files/product_decimal_attribute.php * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php * @magentoDataFixture Magento/Catalog/_files/product_simple_out_of_stock.php - * @dataProvider uniqueTestProvider + * @dataProvider uniqueAttributeValueProvider * @inheritdoc */ public function testUniqueAttribute(string $firstSku, string $secondSku): void { - $this->markTestSkipped('Test is blocked by issue MC-29019'); + $this->markTestSkipped('Test is blocked by issue MC-29018'); parent::testUniqueAttribute($firstSku, $secondSku); } @@ -65,7 +65,7 @@ public function productProvider(): array /** * @inheritdoc */ - public function uniqueTestProvider(): array + public function uniqueAttributeValueProvider(): array { return [ [ diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeTextAreaTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeTextAreaTest.php index 6f9b26e6680b1..61dbf78962c9e 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeTextAreaTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeTextAreaTest.php @@ -34,7 +34,7 @@ protected function getDefaultAttributeValue(): string * @magentoDataFixture Magento/Catalog/_files/product_text_attribute.php * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php * @magentoDataFixture Magento/Catalog/_files/product_simple_out_of_stock.php - * @dataProvider uniqueTestProvider + * @dataProvider uniqueAttributeValueProvider * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod * @inheritdoc */ @@ -58,7 +58,7 @@ public function productProvider(): array /** * @inheritdoc */ - public function uniqueTestProvider(): array + public function uniqueAttributeValueProvider(): array { return [ [ diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeTextTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeTextTest.php index e1fa9f6229f0d..4da09bc1eca5a 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeTextTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeTextTest.php @@ -34,7 +34,7 @@ protected function getDefaultAttributeValue(): string * @magentoDataFixture Magento/Catalog/_files/product_varchar_attribute.php * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php * @magentoDataFixture Magento/Catalog/_files/product_simple_out_of_stock.php - * @dataProvider uniqueTestProvider + * @dataProvider uniqueAttributeValueProvider * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod * @inheritdoc */ @@ -58,7 +58,7 @@ public function productProvider(): array /** * @inheritdoc */ - public function uniqueTestProvider(): array + public function uniqueAttributeValueProvider(): array { return [ [ diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeYesNoTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeYesNoTest.php index 71d2855fdb3bf..7b966791c7b6e 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeYesNoTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeYesNoTest.php @@ -34,7 +34,7 @@ protected function getDefaultAttributeValue(): string * @magentoDataFixture Magento/Catalog/_files/product_boolean_attribute.php * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php * @magentoDataFixture Magento/Catalog/_files/product_simple_out_of_stock.php - * @dataProvider uniqueTestProvider + * @dataProvider uniqueAttributeValueProvider * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod * @inheritdoc */ @@ -58,7 +58,7 @@ public function productProvider(): array /** * @inheritdoc */ - public function uniqueTestProvider(): array + public function uniqueAttributeValueProvider(): array { return [ [ diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeTextSwatchTest.php b/dev/tests/integration/testsuite/Magento/Swatches/Model/AttributeTextSwatchTest.php similarity index 84% rename from dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeTextSwatchTest.php rename to dev/tests/integration/testsuite/Magento/Swatches/Model/AttributeTextSwatchTest.php index 0650155ba3e47..067ca94e02371 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeTextSwatchTest.php +++ b/dev/tests/integration/testsuite/Magento/Swatches/Model/AttributeTextSwatchTest.php @@ -5,7 +5,9 @@ */ declare(strict_types=1); -namespace Magento\Catalog\Model\Product\Attribute\Save; +namespace Magento\Swatches\Model; + +use Magento\Catalog\Model\Product\Attribute\Save\AbstractAttributeTest; /** * @magentoDbIsolation enabled @@ -27,14 +29,14 @@ protected function getAttributeCode(): string */ protected function getDefaultAttributeValue(): string { - return $this->attribute->getSource()->getOptionId('Option 2'); + return $this->getAttribute()->getSource()->getOptionId('Option 2'); } /** * @magentoDataFixture Magento/Swatches/_files/product_text_swatch_attribute.php * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php * @magentoDataFixture Magento/Catalog/_files/product_simple_out_of_stock.php - * @dataProvider uniqueTestProvider + * @dataProvider uniqueAttributeValueProvider * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod * @inheritdoc */ @@ -58,7 +60,7 @@ public function productProvider(): array /** * @inheritdoc */ - public function uniqueTestProvider(): array + public function uniqueAttributeValueProvider(): array { return [ [ diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeVisualSwatchTest.php b/dev/tests/integration/testsuite/Magento/Swatches/Model/AttributeVisualSwatchTest.php similarity index 84% rename from dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeVisualSwatchTest.php rename to dev/tests/integration/testsuite/Magento/Swatches/Model/AttributeVisualSwatchTest.php index 5666d4223505d..ab9030f5ed8d9 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Save/AttributeVisualSwatchTest.php +++ b/dev/tests/integration/testsuite/Magento/Swatches/Model/AttributeVisualSwatchTest.php @@ -5,7 +5,9 @@ */ declare(strict_types=1); -namespace Magento\Catalog\Model\Product\Attribute\Save; +namespace Magento\Swatches\Model; + +use Magento\Catalog\Model\Product\Attribute\Save\AbstractAttributeTest; /** * @magentoDbIsolation enabled @@ -27,14 +29,14 @@ protected function getAttributeCode(): string */ protected function getDefaultAttributeValue(): string { - return $this->attribute->getSource()->getOptionId('option 2'); + return $this->getAttribute()->getSource()->getOptionId('option 2'); } /** * @magentoDataFixture Magento/Swatches/_files/product_visual_swatch_attribute.php * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php * @magentoDataFixture Magento/Catalog/_files/product_simple_out_of_stock.php - * @dataProvider uniqueTestProvider + * @dataProvider uniqueAttributeValueProvider * phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod * @inheritdoc */ @@ -58,7 +60,7 @@ public function productProvider(): array /** * @inheritdoc */ - public function uniqueTestProvider(): array + public function uniqueAttributeValueProvider(): array { return [ [ diff --git a/dev/tests/integration/testsuite/Magento/Weee/Model/Product/Attribute/Save/AttributeFixedProductTaxTest.php b/dev/tests/integration/testsuite/Magento/Weee/Model/Product/Attribute/Save/AttributeFixedProductTaxTest.php index af474d8f8954f..c83a694b4fc1d 100644 --- a/dev/tests/integration/testsuite/Magento/Weee/Model/Product/Attribute/Save/AttributeFixedProductTaxTest.php +++ b/dev/tests/integration/testsuite/Magento/Weee/Model/Product/Attribute/Save/AttributeFixedProductTaxTest.php @@ -21,10 +21,10 @@ class AttributeFixedProductTaxTest extends TestCase { /** @var ObjectManagerInterface */ - protected $objectManager; + private $objectManager; /** @var ProductRepositoryInterface */ - protected $productRepository; + private $productRepository; /** @var string */ private $attributeCode; @@ -42,7 +42,7 @@ protected function setUp() } /** - * @dataProvider FPTProvider + * @dataProvider fPTProvider * @param array $data * @param array $expectedData * @return void @@ -58,7 +58,7 @@ public function testSaveProductWithFPTAttribute(array $data, array $expectedData /** * @return array */ - public function FPTProvider(): array + public function fPTProvider(): array { return [ [ From 3f80642207a39a012cd1267586af752868a8f607 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <p.bystritsky@yandex.ru> Date: Fri, 22 Nov 2019 17:51:32 +0200 Subject: [PATCH 241/595] Tests for: magento/magento2#25600, magento/magento2#25528, magento/magento2#25613, magento/magento2#25606. --- .../Test/StorefrontForthLevelCategoryTest.xml | 52 +++++++ .../Model/Product/Image/ParamsBuilderTest.php | 134 ++++++++++++++++++ .../Section/StorefrontMiniCartSection.xml | 1 + .../Test/NoErrorForMiniCartItemEditTest.xml | 69 +++++++++ .../App/Test/Unit/FrontControllerTest.php | 85 ++++++++++- 5 files changed, 339 insertions(+), 2 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/StorefrontForthLevelCategoryTest.xml create mode 100644 app/code/Magento/Catalog/Test/Unit/Model/Product/Image/ParamsBuilderTest.php create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontForthLevelCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontForthLevelCategoryTest.xml new file mode 100644 index 0000000000000..bb46f8010eaa8 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontForthLevelCategoryTest.xml @@ -0,0 +1,52 @@ +<?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="StorefrontForthLevelCategoryTest"> + <annotations> + <features value="Catalog"/> + <stories value="Category"/> + <title value="Storefront forth level category test"/> + <description value="When the submenu was created in the third stage follow, the submenu works"/> + <severity value="MAJOR"/> + <group value="Catalog"/> + </annotations> + <before> + <createData entity="SimpleSubCategory" stepKey="category1"/> + <createData entity="SubCategoryWithParent" stepKey="category2"> + <requiredEntity createDataKey="category1"/> + </createData> + <createData entity="SubCategoryWithParent" stepKey="category3"> + <requiredEntity createDataKey="category2"/> + </createData> + <createData entity="SubCategoryWithParent" stepKey="category4"> + <requiredEntity createDataKey="category3"/> + </createData> + </before> + <after> + <deleteData createDataKey="category4" stepKey="deleteCategory4"/> + <deleteData createDataKey="category3" stepKey="deleteCategory3"/> + <deleteData createDataKey="category2" stepKey="deleteCategory2"/> + <deleteData createDataKey="category1" stepKey="deleteCategory1"/> + </after> + <amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnStorefrontPage"/> + <moveMouseOver + selector="{{StorefrontHeaderSection.NavigationCategoryByName($$category1.name$$)}}" + stepKey="hoverCategoryLevelOne"/> + <moveMouseOver + selector="{{StorefrontHeaderSection.NavigationCategoryByName($$category2.name$$)}}" + stepKey="hoverCategoryLevelTwo"/> + <moveMouseOver + selector="{{StorefrontHeaderSection.NavigationCategoryByName($$category3.name$$)}}" + stepKey="hoverCategoryLevelThree"/> + <moveMouseOver + selector="{{StorefrontHeaderSection.NavigationCategoryByName($$category4.name$$)}}" + stepKey="hoverCategoryLevelFour"/> + </test> +</tests> diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Image/ParamsBuilderTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Image/ParamsBuilderTest.php new file mode 100644 index 0000000000000..22e3a88574e03 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Image/ParamsBuilderTest.php @@ -0,0 +1,134 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Catalog\Test\Unit\Model\Product\Image; + +use Magento\Catalog\Model\Product\Image; +use Magento\Catalog\Model\Product\Image\ParamsBuilder; +use Magento\Framework\App\Area; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\Config\View; +use Magento\Framework\View\ConfigInterface; +use Magento\Store\Model\ScopeInterface; + +class ParamsBuilderTest extends \PHPUnit\Framework\TestCase +{ + /** + * @var ScopeConfigInterface + */ + private $scopeConfig; + + /** + * @var ConfigInterface + */ + private $viewConfig; + + /** + * @var ParamsBuilder + */ + private $model; + + protected function setUp() + { + $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $this->scopeConfig = $this->createMock(ScopeConfigInterface::class); + $this->viewConfig = $this->createMock(ConfigInterface::class); + $this->model = $objectManager->getObject( + ParamsBuilder::class, + [ + 'scopeConfig' => $this->scopeConfig, + 'viewConfig' => $this->viewConfig, + ] + ); + } + + /** + * Test watermark location. + */ + public function testWatermarkLocation() + { + $imageArguments = [ + 'type' => 'type', + 'height' => 'image_height', + 'width' => 'image_width', + 'angle' => 'angle', + 'background' => [1, 2, 3] + ]; + $scopeId = 1; + $quality = 100; + $file = 'file'; + $width = 'width'; + $height = 'height'; + $size = "{$width}x{$height}"; + $opacity = 'opacity'; + $position = 'position'; + + $viewMock = $this->createMock(View::class); + $viewMock->expects($this->once()) + ->method('getVarValue') + ->with('Magento_Catalog', 'product_image_white_borders') + ->willReturn(true); + + $this->viewConfig->expects($this->once()) + ->method('getViewConfig') + ->with(['area' => Area::AREA_FRONTEND]) + ->willReturn($viewMock); + + $this->scopeConfig->expects($this->exactly(5))->method('getValue')->withConsecutive( + [ + Image::XML_PATH_JPEG_QUALITY + ], + [ + "design/watermark/{$imageArguments['type']}_image", + ScopeInterface::SCOPE_STORE, + $scopeId, + ], + [ + "design/watermark/{$imageArguments['type']}_size", + ScopeInterface::SCOPE_STORE], + [ + "design/watermark/{$imageArguments['type']}_imageOpacity", + ScopeInterface::SCOPE_STORE, + $scopeId + ], + [ + "design/watermark/{$imageArguments['type']}_position", + ScopeInterface::SCOPE_STORE, + $scopeId + ] + )->willReturnOnConsecutiveCalls( + $quality, + $file, + $size, + $opacity, + $position + ); + + $actual = $this->model->build($imageArguments, $scopeId); + $expected = [ + 'image_type' => $imageArguments['type'], + 'background' => $imageArguments['background'], + 'angle' => $imageArguments['angle'], + 'quality' => $quality, + 'keep_aspect_ratio' => true, + 'keep_frame' => true, + 'keep_transparency' => true, + 'constrain_only' => true, + 'watermark_file' => $file, + 'watermark_image_opacity' => $opacity, + 'watermark_position' => $position, + 'watermark_width' => $width, + 'watermark_height' => $height, + 'image_height' => $imageArguments['height'], + 'image_width' => $imageArguments['width'], + ]; + + $this->assertEquals( + $expected, + $actual + ); + } +} diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontMiniCartSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontMiniCartSection.xml index e00906386e46b..80ed4f90c2cd0 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontMiniCartSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontMiniCartSection.xml @@ -25,6 +25,7 @@ <element name="goToCheckout" type="button" selector="#top-cart-btn-checkout" timeout="30"/> <element name="viewAndEditCart" type="button" selector=".action.viewcart" timeout="30"/> <element name="miniCartItemsText" type="text" selector=".minicart-items"/> + <element name="editMiniCartItem" type="button" selector=".action.edit" timeout="30"/> <element name="deleteMiniCartItem" type="button" selector=".action.delete" timeout="30"/> <element name="deleteMiniCartItemByName" type="button" selector="//ol[@id='mini-cart']//div[contains(., '{{var}}')]//a[contains(@class, 'delete')]" parameterized="true"/> <element name="miniCartSubtotalField" type="text" selector=".block-minicart .amount span.price"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml new file mode 100644 index 0000000000000..2d0c4a05c1dec --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml @@ -0,0 +1,69 @@ +<?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="NoErrorForMiniCartItemEditTest"> + <annotations> + <features value="ConfigurableProduct"/> + <title value="No error for minicart item edit test"/> + <description value="Already selected configurable option should be selected when configurable product is edited from minicart"/> + <severity value="MAJOR"/> + <group value="ConfigurableProduct"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <createData entity="ApiCategory" stepKey="createCategory"/> + <!-- Create Configurable product --> + <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <argument name="product" value="_defaultProduct"/> + <argument name="category" value="$$createCategory$$"/> + </actionGroup> + </before> + <after> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <!-- Delete the first simple product --> + <actionGroup stepKey="deleteProduct1" ref="deleteProductBySku"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" + dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" + stepKey="clickClearFilters"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!-- Go To Created Product Page --> + <amOnPage stepKey="goToCreatedProductPage" url="{{_defaultProduct.urlKey}}.html"/> + <waitForPageLoad stepKey="waitForProductPageLoad2"/> + + <!-- Add Product to Cart --> + <seeElement selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" + stepKey="checkDropDownProductOption"/> + <selectOption userInput="{{colorProductAttribute1.name}}" + selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" + stepKey="selectOption1"/> + <selectOption userInput="{{colorProductAttribute2.name}}" + selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" + stepKey="selectOption2"/> + <click selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" + stepKey="clickDropDownProductOption"/> + <selectOption userInput="{{colorProductAttribute1.name}}" + selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" + stepKey="selectOptionForAddingToCart"/> + <click selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="clickAddToCart"/> + <waitForPageLoad stepKey="waitForMiniCart"/> + + <!-- Edit Item in Cart --> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="openMiniCart"/> + <click selector="{{StorefrontMinicartSection.editMiniCartItem}}" stepKey="clickEditCartItem"/> + + <!-- Check if Product Configuration is still selected --> + <see selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" + userInput="{{colorProductAttribute1.name}}" stepKey="seeConfigurationSelected"/> + </test> +</tests> diff --git a/lib/internal/Magento/Framework/App/Test/Unit/FrontControllerTest.php b/lib/internal/Magento/Framework/App/Test/Unit/FrontControllerTest.php index e7500e78f7b97..e088bb92c8782 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/FrontControllerTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/FrontControllerTest.php @@ -3,10 +3,18 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Framework\App\Test\Unit; +use Magento\Framework\App\Request\InvalidRequestException; +use Magento\Framework\App\Request\ValidatorInterface; use Magento\Framework\Exception\NotFoundException; +use Magento\Framework\Message\ManagerInterface as MessageManager; +use Psr\Log\LoggerInterface; +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ class FrontControllerTest extends \PHPUnit\Framework\TestCase { /** @@ -34,6 +42,21 @@ class FrontControllerTest extends \PHPUnit\Framework\TestCase */ protected $response; + /** + * @var \PHPUnit\Framework\MockObject\MockObject|ValidatorInterface + */ + private $requestValidator; + + /** + * @var \PHPUnit\Framework\MockObject\MockObject|\MessageManager + */ + private $messages; + + /** + * @var \PHPUnit\Framework\MockObject\MockObject|\LoggerInterface + */ + private $logger; + protected function setUp() { $this->request = $this->getMockBuilder(\Magento\Framework\App\Request\Http::class) @@ -44,7 +67,16 @@ protected function setUp() $this->router = $this->createMock(\Magento\Framework\App\RouterInterface::class); $this->routerList = $this->createMock(\Magento\Framework\App\RouterList::class); $this->response = $this->createMock(\Magento\Framework\App\Response\Http::class); - $this->model = new \Magento\Framework\App\FrontController($this->routerList, $this->response); + $this->requestValidator = $this->createMock(ValidatorInterface::class); + $this->messages = $this->createMock(MessageManager::class); + $this->logger = $this->createMock(LoggerInterface::class); + $this->model = new \Magento\Framework\App\FrontController( + $this->routerList, + $this->response, + $this->requestValidator, + $this->messages, + $this->logger + ); } /** @@ -55,7 +87,8 @@ public function testDispatchThrowException() { $validCounter = 0; $callbackValid = function () use (&$validCounter) { - return $validCounter++%10 ? false : true; + $validCounter++; + return $validCounter % 10 ? false : true; }; $this->routerList->expects($this->any())->method('valid')->will($this->returnCallback($callbackValid)); @@ -73,6 +106,54 @@ public function testDispatchThrowException() $this->model->dispatch($this->request); } + /** + * Check adding validation failure message to debug log. + */ + public function testAddingValidationFailureMessageToDebugLog() + { + $exceptionMessage = 'exception_message'; + $exception = new InvalidRequestException($exceptionMessage); + + $this->routerList->expects($this->any()) + ->method('valid') + ->will($this->returnValue(true)); + + $response = $this->createMock(\Magento\Framework\App\Response\Http::class); + $controllerInstance = $this->getMockBuilder(\Magento\Framework\App\Action\Action::class) + ->disableOriginalConstructor() + ->getMock(); + $controllerInstance->expects($this->any()) + ->method('dispatch') + ->with($this->request) + ->will($this->returnValue($response)); + $this->router->expects($this->at(0)) + ->method('match') + ->with($this->request) + ->will($this->returnValue(false)); + $this->router->expects($this->at(1)) + ->method('match') + ->with($this->request) + ->will($this->returnValue($controllerInstance)); + + $this->routerList->expects($this->any()) + ->method('current') + ->will($this->returnValue($this->router)); + + $this->request->expects($this->at(0))->method('isDispatched')->will($this->returnValue(false)); + $this->request->expects($this->at(1))->method('setDispatched')->with(true); + $this->request->expects($this->at(2))->method('isDispatched')->will($this->returnValue(true)); + + $this->requestValidator->expects($this->once()) + ->method('validate')->with($this->request, $controllerInstance)->willThrowException($exception); + $this->logger->expects($this->once())->method('debug')->with( + 'Request validation failed for action "' + . get_class($controllerInstance) . '"', + ["exception" => $exception] + ); + + $this->assertEquals($exceptionMessage, $this->model->dispatch($this->request)); + } + public function testDispatched() { $this->routerList->expects($this->any()) From 4e3e5bd5d387cdb4ba6358c7d9e3a49a2cd8a3d8 Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Mon, 25 Nov 2019 12:52:23 +0200 Subject: [PATCH 242/595] MC-21860: Partial sitemaps have wrong urls in sitemap index --- app/code/Magento/Sitemap/Model/Sitemap.php | 20 ++++-- .../Magento/Sitemap/Model/SitemapTest.php | 69 +++++++++++++++++++ 2 files changed, 85 insertions(+), 4 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/Sitemap/Model/SitemapTest.php diff --git a/app/code/Magento/Sitemap/Model/Sitemap.php b/app/code/Magento/Sitemap/Model/Sitemap.php index 0d69634ccfa5e..2baa6ff2c71a7 100644 --- a/app/code/Magento/Sitemap/Model/Sitemap.php +++ b/app/code/Magento/Sitemap/Model/Sitemap.php @@ -10,6 +10,7 @@ use Magento\Framework\App\ObjectManager; use Magento\Framework\DataObject; use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Filesystem; use Magento\Framework\UrlInterface; use Magento\Robots\Model\Config\Value; use Magento\Sitemap\Model\ItemProvider\ItemProviderInterface; @@ -191,6 +192,16 @@ class Sitemap extends \Magento\Framework\Model\AbstractModel implements \Magento */ private $lastModMinTsVal; + /** + * @var Filesystem + */ + private $filesystem; + + /** + * @var DocumentRoot + */ + private $documentRoot; + /** * Initialize dependencies. * @@ -238,8 +249,9 @@ public function __construct( ) { $this->_escaper = $escaper; $this->_sitemapData = $sitemapData; - $documentRoot = $documentRoot ?: ObjectManager::getInstance()->get(DocumentRoot::class); - $this->_directory = $filesystem->getDirectoryWrite($documentRoot->getPath()); + $this->documentRoot = $documentRoot ?: ObjectManager::getInstance()->get(DocumentRoot::class); + $this->filesystem = $filesystem; + $this->_directory = $filesystem->getDirectoryWrite($this->documentRoot->getPath()); $this->_categoryFactory = $categoryFactory; $this->_productFactory = $productFactory; $this->_cmsFactory = $cmsFactory; @@ -727,8 +739,8 @@ protected function _getFormattedLastmodDate($date) */ protected function _getDocumentRoot() { - // phpcs:ignore Magento2.Functions.DiscouragedFunction - return realpath($this->_request->getServer('DOCUMENT_ROOT')); + return $this->filesystem->getDirectoryRead($this->documentRoot->getPath()) + ->getAbsolutePath(); } /** diff --git a/dev/tests/integration/testsuite/Magento/Sitemap/Model/SitemapTest.php b/dev/tests/integration/testsuite/Magento/Sitemap/Model/SitemapTest.php new file mode 100644 index 0000000000000..8b9c4229d2b28 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sitemap/Model/SitemapTest.php @@ -0,0 +1,69 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Sitemap\Model; + +use Magento\Framework\App\Config\Value; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Filesystem; +use Magento\Framework\ObjectManagerInterface; +use Magento\Sitemap\Model\Sitemap; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Request; +use Zend\Stdlib\Parameters; +use PHPUnit\Framework\TestCase; + +class SitemapTest extends TestCase +{ + /** + * @var Sitemap + */ + private $model; + + /** + * @var ObjectManagerInterface + */ + private $objectManager; + + /** + * @inheritdoc + */ + protected function setUp() + { + $this->objectManager = Bootstrap::getObjectManager(); + $this->model = $this->objectManager->get(Sitemap::class); + } + + /** + * Test get sitemap URL from parent root directory path + * + * @return void + */ + public function testGetSitemapUrlFromParentRootDirectoryPath(): void + { + /** @var Value $configValue */ + $configValue = $this->objectManager->get(Value::class); + $configValue->load('web/unsecure/base_url', 'path'); + $baseUrl = $configValue->getValue() ?: 'http://localhost/'; + + /** @var Filesystem $filesystem */ + $filesystem = $this->objectManager->create(Filesystem::class); + $rootDir = $filesystem->getDirectoryRead(DirectoryList::ROOT) + ->getAbsolutePath(); + $requestPath = dirname($rootDir); + + /** @var Request $request */ + $request = $this->objectManager->get(Request::class); + //imitation run script from parent root directory + $request->setServer(new Parameters(['DOCUMENT_ROOT' => $requestPath])); + + $sitemapUrl = $this->model->getSitemapUrl('/', 'sitemap.xml'); + + $this->assertEquals($baseUrl.'sitemap.xml', $sitemapUrl); + } +} From 071b47b38d08fe8c092625a19dca09bb6059e211 Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Mon, 25 Nov 2019 15:33:23 +0200 Subject: [PATCH 243/595] MC-21860: Partial sitemaps have wrong urls in sitemap index --- .../Magento/Sitemap/Model/SitemapTest.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Sitemap/Model/SitemapTest.php b/dev/tests/integration/testsuite/Magento/Sitemap/Model/SitemapTest.php index 8b9c4229d2b28..a051bfc4dad45 100644 --- a/dev/tests/integration/testsuite/Magento/Sitemap/Model/SitemapTest.php +++ b/dev/tests/integration/testsuite/Magento/Sitemap/Model/SitemapTest.php @@ -8,7 +8,6 @@ namespace Magento\Sitemap\Model; -use Magento\Framework\App\Config\Value; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Filesystem; use Magento\Framework\ObjectManagerInterface; @@ -18,6 +17,9 @@ use Zend\Stdlib\Parameters; use PHPUnit\Framework\TestCase; +/** + * Test for Sitemap + */ class SitemapTest extends TestCase { /** @@ -30,6 +32,11 @@ class SitemapTest extends TestCase */ private $objectManager; + /** + * @var Filesystem + */ + private $filesystem; + /** * @inheritdoc */ @@ -37,6 +44,7 @@ protected function setUp() { $this->objectManager = Bootstrap::getObjectManager(); $this->model = $this->objectManager->get(Sitemap::class); + $this->filesystem = $this->objectManager->get(Filesystem::class); } /** @@ -46,14 +54,9 @@ protected function setUp() */ public function testGetSitemapUrlFromParentRootDirectoryPath(): void { - /** @var Value $configValue */ - $configValue = $this->objectManager->get(Value::class); - $configValue->load('web/unsecure/base_url', 'path'); - $baseUrl = $configValue->getValue() ?: 'http://localhost/'; + $baseUrl = 'http://localhost/'; - /** @var Filesystem $filesystem */ - $filesystem = $this->objectManager->create(Filesystem::class); - $rootDir = $filesystem->getDirectoryRead(DirectoryList::ROOT) + $rootDir = $this->filesystem->getDirectoryRead(DirectoryList::ROOT) ->getAbsolutePath(); $requestPath = dirname($rootDir); From 8036f49046955af249dbae8037495a42c78c05a9 Mon Sep 17 00:00:00 2001 From: Mastiuhin Olexandr <mastiuhin.olexandr@transoftgroup.com> Date: Mon, 25 Nov 2019 15:43:33 +0200 Subject: [PATCH 244/595] MC-28956: Discounted shipping price is incorrectly displayed on multishipping review order page --- .../Magento/Multishipping/Model/Checkout/Type/Multishipping.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Multishipping/Model/Checkout/Type/Multishipping.php b/app/code/Magento/Multishipping/Model/Checkout/Type/Multishipping.php index 4c5f666805570..7fa674505461e 100644 --- a/app/code/Magento/Multishipping/Model/Checkout/Type/Multishipping.php +++ b/app/code/Magento/Multishipping/Model/Checkout/Type/Multishipping.php @@ -625,6 +625,7 @@ public function setShippingMethods($methods) $addressId = $address->getId(); if (isset($methods[$addressId])) { $address->setShippingMethod($methods[$addressId]); + $address->setCollectShippingRates(true); } elseif (!$address->getShippingMethod()) { throw new \Magento\Framework\Exception\LocalizedException( __('Set shipping methods for all addresses. Verify the shipping methods and try again.') From 41565f0f7b702136668189eb5a2ecfa1d6b82d69 Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Fri, 22 Nov 2019 08:53:45 -0600 Subject: [PATCH 245/595] MC-22856: Disable product issue with Cart Item bundle product - Fix issue with checkout button not showing if bundle product was disabled --- .../Model/ResourceModel/Quote/Item/Collection.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Quote/Model/ResourceModel/Quote/Item/Collection.php b/app/code/Magento/Quote/Model/ResourceModel/Quote/Item/Collection.php index 79fd2b1495c49..443e4fda1bd8c 100644 --- a/app/code/Magento/Quote/Model/ResourceModel/Quote/Item/Collection.php +++ b/app/code/Magento/Quote/Model/ResourceModel/Quote/Item/Collection.php @@ -10,6 +10,7 @@ use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Model\ResourceModel\Product\Collection as ProductCollection; use Magento\Catalog\Model\Product\Attribute\Source\Status as ProductStatus; +use Magento\Framework\Exception\NoSuchEntityException; use Magento\Quote\Model\Quote; use Magento\Quote\Model\Quote\Item as QuoteItem; use Magento\Quote\Model\ResourceModel\Quote\Item as ResourceQuoteItem; @@ -256,8 +257,17 @@ protected function _assignProducts(): self foreach ($this as $item) { /** @var ProductInterface $product */ $product = $productCollection->getItemById($item->getProductId()); + try { + /** @var QuoteItem $item */ + $parentItem = $item->getParentItem(); + $parentProduct = $parentItem ? $parentItem->getProduct() : null; + } catch (NoSuchEntityException $exception) { + $parentItem = null; + $parentProduct = null; + $this->_logger->error($exception); + } $qtyOptions = []; - if ($product && $this->isValidProduct($product)) { + if ($this->isValidProduct($product) && (!$parentItem || $this->isValidProduct($parentProduct))) { $product->setCustomOptions([]); $optionProductIds = $this->getOptionProductIds($item, $product, $productCollection); foreach ($optionProductIds as $optionProductId) { @@ -327,7 +337,7 @@ private function getOptionProductIds( * @param ProductInterface $product * @return bool */ - private function isValidProduct(ProductInterface $product): bool + private function isValidProduct(?ProductInterface $product): bool { $result = ($product && (int)$product->getStatus() !== ProductStatus::STATUS_DISABLED); From 9fc40860a813211d1a86e70edd8b01c7dd1bfed5 Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Fri, 22 Nov 2019 17:55:53 -0600 Subject: [PATCH 246/595] MC-29105: Disable product issue with Cart Item bundle product - Add MFTF test --- ...frontCheckoutDisabledBundleProductTest.xml | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml new file mode 100644 index 0000000000000..97eceae962bfb --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml @@ -0,0 +1,80 @@ +<?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="StorefrontCheckoutDisabledBundleProductTest"> + <annotations> + <features value="Checkout"/> + <stories value="Disabled bundle product is preventing customer to checkout for the first attempt"/> + <title value="Customer should be able to checkout if there is at least one available product in the cart"/> + <description value="Customer should be able to checkout if there is at least one available product in the cart"/> + <severity value="MINOR"/> + <testCaseId value="MC-29105"/> + <group value="checkout"/> + </annotations> + + <before> + <!-- Create category and simple product --> + <createData entity="SimpleSubCategory" stepKey="createCategory"/> + <createData entity="_defaultProduct" stepKey="createSimpleProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <!-- Create bundle product --> + <createData entity="ApiBundleProductPriceViewRange" stepKey="createBundleDynamicProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="DropDownBundleOption" stepKey="bundleOption"> + <requiredEntity createDataKey="createBundleDynamicProduct"/> + </createData> + <createData entity="ApiBundleLink" stepKey="createNewBundleLink"> + <requiredEntity createDataKey="createBundleDynamicProduct"/> + <requiredEntity createDataKey="bundleOption"/> + <requiredEntity createDataKey="createSimpleProduct"/> + </createData> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" stepKey="cacheFlush"/> + </before> + <after> + <!-- Delete category --> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <!-- Delete bundle product data --> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> + <deleteData createDataKey="createBundleDynamicProduct" stepKey="deleteBundleProduct"/> + </after> + <!-- Add simple product to the cart --> + <actionGroup ref="AddSimpleProductToCart" stepKey="cartAddSimpleProductToCart"> + <argument name="product" value="$$createSimpleProduct$$"/> + <argument name="productCount" value="1"/> + </actionGroup> + <!-- Go to bundle product page --> + <amOnPage url="{{StorefrontProductPage.url($$createBundleDynamicProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToProductPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <!-- Add bundle product to the cart --> + <click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickCustomizeAndAddToCart"/> + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToCart"> + <argument name="productName" value="$$createBundleDynamicProduct.name$$"/> + </actionGroup> + <!-- Login to admin panel --> + <openNewTab stepKey="openNewTab"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <!-- Find the first simple product that we just created using the product grid and go to its page--> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <!-- Disabled bundle product from grid --> + <actionGroup ref="ChangeStatusProductUsingProductGridActionGroup" stepKey="disabledProductFromGrid"> + <argument name="product" value="$$createBundleDynamicProduct$$"/> + <argument name="status" value="Disable"/> + </actionGroup> + <closeTab stepKey="closeTab"/> + <!-- Go to cart page--> + <actionGroup ref="StorefrontOpenCartPageActionGroup" stepKey="openCartPage"/> + <!-- Assert checkout button exists on the page--> + <seeElement selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="seeCheckoutButton"/> + <!-- Assert no error message is not shown on the page--> + <dontSee userInput="Some of the products are out of stock." stepKey="seeNoItemsInShoppingCart"/> + </test> +</tests> From 46b4e37bac99457c1cecd2c04fe740419a9042fe Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Mon, 25 Nov 2019 20:14:28 +0200 Subject: [PATCH 247/595] Covering the system dependency by MFTF --- .../AdminTogglesEnabledConfigActionGroup.xml | 17 +++++++++ ...AdminUnchecksUseSystemValueActionGroup.xml | 14 +++++++ ...rtAdminDoesntSeeConfigFieldActionGroup.xml | 17 +++++++++ .../AssertAdminSeesConfigFieldActionGroup.xml | 17 +++++++++ .../Mftf/Page/AdminNewRelicConfigPage.xml | 12 ++++++ .../AdminNewRelicConfigSystemSection.xml | 16 ++++++++ .../AdminChecksSystemConfigDependencyTest.xml | 38 +++++++++++++++++++ 7 files changed, 131 insertions(+) create mode 100644 app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminTogglesEnabledConfigActionGroup.xml create mode 100644 app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUnchecksUseSystemValueActionGroup.xml create mode 100644 app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminDoesntSeeConfigFieldActionGroup.xml create mode 100644 app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminSeesConfigFieldActionGroup.xml create mode 100644 app/code/Magento/NewRelicReporting/Test/Mftf/Page/AdminNewRelicConfigPage.xml create mode 100644 app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml create mode 100644 app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminTogglesEnabledConfigActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminTogglesEnabledConfigActionGroup.xml new file mode 100644 index 0000000000000..f9632784f4a92 --- /dev/null +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminTogglesEnabledConfigActionGroup.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="AdminTogglesEnabledConfigActionGroup"> + <arguments> + <argument name="state" type="string"/> + </arguments> + <selectOption selector="{{AdminNewRelicConfigSystemSection.status}}" userInput="{{state}}" stepKey="switchActiveState"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUnchecksUseSystemValueActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUnchecksUseSystemValueActionGroup.xml new file mode 100644 index 0000000000000..7d90c1d8dd478 --- /dev/null +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUnchecksUseSystemValueActionGroup.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="AdminUnchecksUseSystemValueActionGroup"> + <uncheckOption selector="{{AdminNewRelicConfigSystemSection.useSystemValueForEnabled}}" stepKey="uncheckCheckbox"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminDoesntSeeConfigFieldActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminDoesntSeeConfigFieldActionGroup.xml new file mode 100644 index 0000000000000..6e87dbbfbbf4b --- /dev/null +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminDoesntSeeConfigFieldActionGroup.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="AssertAdminDoesntSeeConfigFieldActionGroup"> + <arguments> + <argument name="config" type="string"/> + </arguments> + <dontSeeElement selector="{{config}}" stepKey="dontSeeConfigField"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminSeesConfigFieldActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminSeesConfigFieldActionGroup.xml new file mode 100644 index 0000000000000..4df7099e50b28 --- /dev/null +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminSeesConfigFieldActionGroup.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="AssertAdminSeesConfigFieldActionGroup"> + <arguments> + <argument name="config" type="string"/> + </arguments> + <seeElement selector="{{config}}" stepKey="seeConfigField"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/Page/AdminNewRelicConfigPage.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/Page/AdminNewRelicConfigPage.xml new file mode 100644 index 0000000000000..fda7d0ef336b1 --- /dev/null +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/Page/AdminNewRelicConfigPage.xml @@ -0,0 +1,12 @@ +<?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="AdminNewRelicConfigPage" url="admin/system_config/edit/section/newrelicreporting/" area="admin" module="Magento_Config"> + <section name="AdminNewRelicConfigSystemSection"/> + </page> +</pages> \ No newline at end of file diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml new file mode 100644 index 0000000000000..7c8baccca52fe --- /dev/null +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.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="AdminNewRelicConfigSystemSection"> + <element name="status" type="select" selector="#row_newrelicreporting_general_enable [data-ui-id='select-groups-general-fields-enable-value']"/> + <element name="useSystemValueForEnabled" type="checkbox" selector="#newrelicreporting_general_enable_inherit"/> + <element name="apiUrl" type="select" selector="input#newrelicreporting_general_api_url"/> + </section> +</sections> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml new file mode 100644 index 0000000000000..12aacbc964d2f --- /dev/null +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml @@ -0,0 +1,38 @@ +<?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="AdminChecksSystemConfigDependencyTest"> + <annotations> + <features value="NewRelicReporting"/> + <stories value="Admin is able to see the configuration fields only after enabling the feature"/> + <title value="Admin can see the configuration fields only after enabling the feature"/> + <description value="The system configs should be available only after enabling the New Relic feature."/> + <severity value="CRITICAL"/> + <group value="NewRelicReporting"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <amOnPage url="{{AdminNewRelicConfigPage.url}}" stepKey="navigateToNewRelicConfigurationPage"/> + </before> + <after> + <actionGroup ref="logout" stepKey="logoutOfAdmin"/> + </after> + <actionGroup ref="AssertAdminDoesntSeeConfigFieldActionGroup" stepKey="checkIfApiUrlIsNotVisible"> + <argument name="config" value="{{AdminNewRelicConfigSystemSection.apiUrl}}"/> + </actionGroup> + <actionGroup ref="AdminUnchecksUseSystemValueActionGroup" stepKey="uncheckUseSystemValue"/> + <actionGroup ref="AdminTogglesEnabledConfigActionGroup" stepKey="enableNewRelic"> + <argument name="state" value="Yes"/> + </actionGroup> + <actionGroup ref="AssertAdminSeesConfigFieldActionGroup" stepKey="checkIfApiUrlIsVisible"> + <argument name="config" value="{{AdminNewRelicConfigSystemSection.apiUrl}}"/> + </actionGroup> + </test> +</tests> From 2c20f71758c8dcf11d85c81de935ef59c6237b01 Mon Sep 17 00:00:00 2001 From: Lena Orobei <oorobei@magento.com> Date: Mon, 25 Nov 2019 13:27:40 -0600 Subject: [PATCH 248/595] ENGCOM-6317: Bump coding standard version --- .../Magento/BundleGraphQl/etc/schema.graphqls | 3 +- .../Tool/CodeSniffer/GraphQlWrapper.php | 28 +++++++++++++++++++ dev/tests/static/phpunit.xml.dist | 6 ++-- .../Magento/Test/GraphQl/LiveCodeTest.php | 8 ++++-- 4 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CodeSniffer/GraphQlWrapper.php diff --git a/app/code/Magento/BundleGraphQl/etc/schema.graphqls b/app/code/Magento/BundleGraphQl/etc/schema.graphqls index 4544c07d59997..46906e958bde5 100644 --- a/app/code/Magento/BundleGraphQl/etc/schema.graphqls +++ b/app/code/Magento/BundleGraphQl/etc/schema.graphqls @@ -3,7 +3,6 @@ type Mutation { addBundleProductsToCart(input: AddBundleProductsToCartInput): AddBundleProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart") - testStatic(invalid_argument): invalid_output } input AddBundleProductsToCartInput { @@ -87,3 +86,5 @@ enum ShipBundleItemsEnum @doc(description: "This enumeration defines whether bun TOGETHER SEPARATELY } + +type invalidCamelCaseType {} diff --git a/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CodeSniffer/GraphQlWrapper.php b/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CodeSniffer/GraphQlWrapper.php new file mode 100644 index 0000000000000..311b2b8f72164 --- /dev/null +++ b/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/CodeSniffer/GraphQlWrapper.php @@ -0,0 +1,28 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\TestFramework\CodingStandard\Tool\CodeSniffer; + +/** + * Add GraphQl files extension to config. + */ +class GraphQlWrapper extends Wrapper +{ + const FILE_EXTENSION = 'graphqls'; + + private const TOKENIZER = 'GraphQL'; + + /** + * @inheritDoc + */ + public function init() + { + parent::init(); + + $this->config->extensions += [self::FILE_EXTENSION => self::TOKENIZER]; + } +} diff --git a/dev/tests/static/phpunit.xml.dist b/dev/tests/static/phpunit.xml.dist index f82086a2c8bb2..c85b2d2a0bdfb 100644 --- a/dev/tests/static/phpunit.xml.dist +++ b/dev/tests/static/phpunit.xml.dist @@ -21,12 +21,12 @@ <testsuite name="HTML Static Code Analysis"> <file>testsuite/Magento/Test/Html/LiveCodeTest.php</file> </testsuite> - <testsuite name="PHP Coding Standard Verification"> - <file>testsuite/Magento/Test/Php/LiveCodeTest.php</file> - </testsuite> <testsuite name="GraphQL Static Code Analysis"> <file>testsuite/Magento/Test/GraphQl/LiveCodeTest.php</file> </testsuite> + <testsuite name="PHP Coding Standard Verification"> + <file>testsuite/Magento/Test/Php/LiveCodeTest.php</file> + </testsuite> <testsuite name="Code Integrity Tests"> <directory>testsuite/Magento/Test/Integrity</directory> </testsuite> diff --git a/dev/tests/static/testsuite/Magento/Test/GraphQl/LiveCodeTest.php b/dev/tests/static/testsuite/Magento/Test/GraphQl/LiveCodeTest.php index 2805d7d897097..db429dd6f3ceb 100644 --- a/dev/tests/static/testsuite/Magento/Test/GraphQl/LiveCodeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/GraphQl/LiveCodeTest.php @@ -38,9 +38,11 @@ public static function setUpBeforeClass(): void */ public function testCodeStyle(): void { - $reportFile = self::$reportDir . '/graphql_phpcs_report.txt'; - $codeSniffer = new CodeSniffer('Magento', $reportFile, new Wrapper()); - $result = $codeSniffer->run(PHPCodeTest::getWhitelist(['graphqls'])); + $reportFile = self::$reportDir . '/graphql_phpcs_report.txt'; + $codeSniffer = new CodeSniffer('Magento', + $reportFile, new Wrapper()); + $codeSniffer->setExtensions([CodeSniffer\GraphQlWrapper::FILE_EXTENSION]); + $result = $codeSniffer->run(PHPCodeTest::getWhitelist([CodeSniffer\GraphQlWrapper::FILE_EXTENSION])); $report = file_exists($reportFile) ? file_get_contents($reportFile) : ''; $this->assertEquals( 0, From 91a59726aa966e99c5ec52b7cb0dc71ec3c83b32 Mon Sep 17 00:00:00 2001 From: Lena Orobei <oorobei@magento.com> Date: Mon, 25 Nov 2019 14:38:52 -0600 Subject: [PATCH 249/595] ENGCOM-6317: Bump coding standard version --- app/code/Magento/BundleGraphQl/etc/schema.graphqls | 2 +- .../static/testsuite/Magento/Test/GraphQl/LiveCodeTest.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/BundleGraphQl/etc/schema.graphqls b/app/code/Magento/BundleGraphQl/etc/schema.graphqls index 46906e958bde5..914e405ba2695 100644 --- a/app/code/Magento/BundleGraphQl/etc/schema.graphqls +++ b/app/code/Magento/BundleGraphQl/etc/schema.graphqls @@ -87,4 +87,4 @@ enum ShipBundleItemsEnum @doc(description: "This enumeration defines whether bun SEPARATELY } -type invalidCamelCaseType {} +type invalidCamelCaseType {} #test static check diff --git a/dev/tests/static/testsuite/Magento/Test/GraphQl/LiveCodeTest.php b/dev/tests/static/testsuite/Magento/Test/GraphQl/LiveCodeTest.php index db429dd6f3ceb..97d134517a5a6 100644 --- a/dev/tests/static/testsuite/Magento/Test/GraphQl/LiveCodeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/GraphQl/LiveCodeTest.php @@ -39,8 +39,7 @@ public static function setUpBeforeClass(): void public function testCodeStyle(): void { $reportFile = self::$reportDir . '/graphql_phpcs_report.txt'; - $codeSniffer = new CodeSniffer('Magento', - $reportFile, new Wrapper()); + $codeSniffer = new CodeSniffer('Magento', $reportFile, new Wrapper()); $codeSniffer->setExtensions([CodeSniffer\GraphQlWrapper::FILE_EXTENSION]); $result = $codeSniffer->run(PHPCodeTest::getWhitelist([CodeSniffer\GraphQlWrapper::FILE_EXTENSION])); $report = file_exists($reportFile) ? file_get_contents($reportFile) : ''; From 66fddf2e77580582c5c3f0ce957b73dfa3fd6f50 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Tue, 26 Nov 2019 07:02:39 +0200 Subject: [PATCH 250/595] Adding expanding config tab step --- .../AdminExpandNewRelicConfigTabActionGroup.xml | 17 +++++++++++++++++ .../AdminNewRelicConfigSystemSection.xml | 1 + .../AdminChecksSystemConfigDependencyTest.xml | 7 +++++-- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminExpandNewRelicConfigTabActionGroup.xml diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminExpandNewRelicConfigTabActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminExpandNewRelicConfigTabActionGroup.xml new file mode 100644 index 0000000000000..4dc3d2ea8ea34 --- /dev/null +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminExpandNewRelicConfigTabActionGroup.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="AdminExpandNewRelicConfigTabActionGroup"> + <arguments> + <argument name="tabName" type="string"/> + </arguments> + <conditionalClick selector="{{AdminNewRelicConfigSystemSection.tab(tabName)}}" dependentSelector="{{AdminNewRelicConfigSystemSection.status}}" visible="false" stepKey="expandTab"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml index 7c8baccca52fe..79625273b988e 100644 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml @@ -9,6 +9,7 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminNewRelicConfigSystemSection"> + <element name="tab" type="button" selector="#newrelicreporting_{{tab}}-head" parameterized="true"/> <element name="status" type="select" selector="#row_newrelicreporting_general_enable [data-ui-id='select-groups-general-fields-enable-value']"/> <element name="useSystemValueForEnabled" type="checkbox" selector="#newrelicreporting_general_enable_inherit"/> <element name="apiUrl" type="select" selector="input#newrelicreporting_general_api_url"/> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml index 12aacbc964d2f..eabacffe9b181 100644 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml @@ -19,12 +19,15 @@ </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <amOnPage url="{{AdminNewRelicConfigPage.url}}" stepKey="navigateToNewRelicConfigurationPage"/> + <actionGroup ref="AdminNavigateToNewRelicConfigurationActionGroup" stepKey="goToConfigPage"/> + <actionGroup ref="AdminExpandNewRelicConfigTabActionGroup" stepKey="expandGeneralTab"> + <argument name="tabName" value="general"/> + </actionGroup> </before> <after> <actionGroup ref="logout" stepKey="logoutOfAdmin"/> </after> - <actionGroup ref="AssertAdminDoesntSeeConfigFieldActionGroup" stepKey="checkIfApiUrlIsNotVisible"> + <actionGroup ref="AssertAdminDontSeeConfigFieldActionGroup" stepKey="checkIfApiUrlIsNotVisible"> <argument name="config" value="{{AdminNewRelicConfigSystemSection.apiUrl}}"/> </actionGroup> <actionGroup ref="AdminUnchecksUseSystemValueActionGroup" stepKey="uncheckUseSystemValue"/> From 1298766deffe2c992b3f29aeb85454cc7bc6e44c Mon Sep 17 00:00:00 2001 From: Adarsh Manickam <amanickam@ztech.io> Date: Tue, 19 Nov 2019 20:01:53 +0530 Subject: [PATCH 251/595] Refactored action click --- .../base/web/js/grid/columns/image-preview.js | 51 +++++++++---------- 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js index 7cbbfdab28ba1..98bb5770dca5d 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js @@ -40,7 +40,7 @@ define([ */ initialize: function () { this._super(); - this.setNavigationListener(); + $(document).on('keydown', this.handleKeyDown.bind(this)); return this; }, @@ -67,8 +67,13 @@ define([ * @param {Object} record */ next: function (record) { - var recordToShow = this.getRecord(record._rowIndex + 1); + var recordToShow; + if (record._rowIndex + 1 === this.masonry().rows().length) { + return; + } + + recordToShow = this.getRecord(record._rowIndex + 1); recordToShow.rowNumber = record.lastInRow ? record.rowNumber + 1 : record.rowNumber; this.show(recordToShow); }, @@ -79,6 +84,9 @@ define([ * @param {Object} record */ prev: function (record) { + if (record._rowIndex === 0) { + return; + } var recordToShow = this.getRecord(record._rowIndex - 1); recordToShow.rowNumber = record.firstInRow ? record.rowNumber - 1 : record.rowNumber; @@ -190,33 +198,20 @@ define([ }, /** - * Set image preview keyboard navigation listener + * Handle keyboard navigation for image preview + * + * @param {Object} e */ - setNavigationListener: function () { - var imageIndex, endIndex, key, - startIndex = 0, - imageColumnSelector = '.masonry-image-column', - adobeModalSelector = '.adobe-stock-modal', - imageGridSelector = '.masonry-image-grid'; - - $(document).on('keydown', function(e) { - key = keyCodes[e.keyCode]; - endIndex = $(imageGridSelector)[0].children.length - 1; - - if($(this.previewImageSelector).length > 0) { - imageIndex = $(this.previewImageSelector) - .parents(imageColumnSelector) - .data('repeatIndex'); + handleKeyDown: function (e) { + var key = keyCodes[e.keyCode]; + + if (this.visibleRecord() !== null) { + if (key === 'pageLeftKey') { + this.prev(this.displayedRecord()); + } else if (key === 'pageRightKey') { + this.next(this.displayedRecord()); } - - if($(adobeModalSelector).hasClass('_show')) { - if(key === 'pageLeftKey' && imageIndex !== startIndex) { - $(this.previewImageSelector + ' .action-previous').click(); - } else if (key === 'pageRightKey' && imageIndex !== endIndex) { - $(this.previewImageSelector + ' .action-next').click(); - } - } - }); - }, + } + } }); }); From a70f50cf096765815c766465aca000e08c102825 Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Mon, 25 Nov 2019 22:28:12 -0800 Subject: [PATCH 252/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- .../Model/Indexer/IndexBuilder.php | 19 ++----------------- .../Model/Rule/ConfigurableProductHandler.php | 9 ++++++--- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index ae76a20cdf762..0ca9c544b74c9 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -292,23 +292,8 @@ protected function doReindexByIds($ids) /** @var Rule[] $activeRules */ $activeRules = $this->getActiveRules()->getItems(); - foreach ($activeRules as $activeRule) { - $rule = clone $activeRule; - $rule->setProductsFilter($ids); - $matchedProductIds = $rule->getMatchingProductIds(); - if (empty($matchedProductIds)) { - continue; - } - - $matchedProductIds = array_intersect_key($matchedProductIds, array_flip($ids)); - foreach ($matchedProductIds as $matchedProductId => $validationByWebsite) { - $websiteIds = array_keys(array_filter($validationByWebsite)); - if (empty($websiteIds)) { - continue; - } - - $this->assignProductToRule($rule, $matchedProductId, $websiteIds); - } + foreach ($activeRules as $rule) { + $this->reindexRuleProduct->execute($rule, $this->batchCount); } foreach ($ids as $productId) { diff --git a/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Rule/ConfigurableProductHandler.php b/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Rule/ConfigurableProductHandler.php index e846c10bf49ef..d57ce702f70b8 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Rule/ConfigurableProductHandler.php +++ b/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Rule/ConfigurableProductHandler.php @@ -1,16 +1,14 @@ <?php /** - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\CatalogRuleConfigurable\Plugin\CatalogRule\Model\Rule; -use Magento\ConfigurableProduct\Model\Product\Type\Configurable; use Magento\CatalogRuleConfigurable\Plugin\CatalogRule\Model\ConfigurableProductsProvider; /** - * Add configurable sub products to catalog rule indexer on full reindex + * Add configurable sub products to catalog rule indexer on reindex */ class ConfigurableProductHandler { @@ -42,9 +40,12 @@ public function __construct( } /** + * Add configurable products during setting product ids for filtering + * * @param \Magento\CatalogRule\Model\Rule $rule * @param int|array $productIds * @return array + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function beforeSetProductsFilter(\Magento\CatalogRule\Model\Rule $rule, $productIds) { @@ -62,6 +63,8 @@ public function beforeSetProductsFilter(\Magento\CatalogRule\Model\Rule $rule, $ } /** + * Add configurable products for matched products + * * @param \Magento\CatalogRule\Model\Rule $rule * @param array $productIds * @return array From 61303b69a2ea96d20db1f5b728af7ca5e714510d Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Tue, 26 Nov 2019 10:56:53 +0200 Subject: [PATCH 253/595] MC-21860: Partial sitemaps have wrong urls in sitemap index --- .../testsuite/Magento/Sitemap/Model/SitemapTest.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Sitemap/Model/SitemapTest.php b/dev/tests/integration/testsuite/Magento/Sitemap/Model/SitemapTest.php index a051bfc4dad45..73863e0915c66 100644 --- a/dev/tests/integration/testsuite/Magento/Sitemap/Model/SitemapTest.php +++ b/dev/tests/integration/testsuite/Magento/Sitemap/Model/SitemapTest.php @@ -18,7 +18,7 @@ use PHPUnit\Framework\TestCase; /** - * Test for Sitemap + * Tests \Magento\Sitemap\Model\Sitemap functionality. */ class SitemapTest extends TestCase { @@ -54,8 +54,6 @@ protected function setUp() */ public function testGetSitemapUrlFromParentRootDirectoryPath(): void { - $baseUrl = 'http://localhost/'; - $rootDir = $this->filesystem->getDirectoryRead(DirectoryList::ROOT) ->getAbsolutePath(); $requestPath = dirname($rootDir); @@ -67,6 +65,6 @@ public function testGetSitemapUrlFromParentRootDirectoryPath(): void $sitemapUrl = $this->model->getSitemapUrl('/', 'sitemap.xml'); - $this->assertEquals($baseUrl.'sitemap.xml', $sitemapUrl); + $this->assertEquals('http://localhost/sitemap.xml', $sitemapUrl); } } From b7d1359371841ddf9fd8f2494567f56ccb5da027 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <51681487+engcom-Foxtrot@users.noreply.github.com> Date: Tue, 26 Nov 2019 11:30:29 +0200 Subject: [PATCH 254/595] magento/magento2#5328: Static test fix. --- .../Magento/Sales/Model/ResourceModel/Status/Collection.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/Sales/Model/ResourceModel/Status/Collection.php b/app/code/Magento/Sales/Model/ResourceModel/Status/Collection.php index f9dc4a7d83ae2..83346d4528c22 100644 --- a/app/code/Magento/Sales/Model/ResourceModel/Status/Collection.php +++ b/app/code/Magento/Sales/Model/ResourceModel/Status/Collection.php @@ -6,8 +6,7 @@ namespace Magento\Sales\Model\ResourceModel\Status; /** - * Class Collection - * Oder statuses grid collection + * Order statuses grid collection. */ class Collection extends \Magento\Sales\Model\ResourceModel\Order\Status\Collection { From 41c95a21ff19503b3870748f0c5a8bbb5b6d3bdb Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <51681487+engcom-Foxtrot@users.noreply.github.com> Date: Tue, 26 Nov 2019 11:34:50 +0200 Subject: [PATCH 255/595] magento/magento2#25611: Static test fix. --- .../Magento/Ui/view/base/web/js/grid/columns/image-preview.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js index 98bb5770dca5d..fec9fd969d61e 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js @@ -84,10 +84,12 @@ define([ * @param {Object} record */ prev: function (record) { + var recordToShow; + if (record._rowIndex === 0) { return; } - var recordToShow = this.getRecord(record._rowIndex - 1); + recordToShow = this.getRecord(record._rowIndex - 1); recordToShow.rowNumber = record.firstInRow ? record.rowNumber - 1 : record.rowNumber; this.show(recordToShow); From e4b09b462d15786cfb69e530e54ddd1b7fc2ccde Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Tue, 26 Nov 2019 16:53:58 +0700 Subject: [PATCH 256/595] Resolve wrong Cursor icon when hover in "Images And Videos" thumbnail, small ... options --- .../backend/web/css/source/components/_media-gallery.less | 1 + 1 file changed, 1 insertion(+) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/components/_media-gallery.less b/app/design/adminhtml/Magento/backend/web/css/source/components/_media-gallery.less index 9a5f35e4ede90..2490ac4cee625 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/components/_media-gallery.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/components/_media-gallery.less @@ -284,6 +284,7 @@ line-height: 1; margin: 0 .4rem .4rem 0; padding: .6rem; + cursor: pointer; } } From a05fa051b3bf2c03ba29addc98d8079b7928e42c Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Tue, 26 Nov 2019 17:22:09 +0700 Subject: [PATCH 257/595] Fix static test --- .../backend/web/css/source/components/_media-gallery.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/components/_media-gallery.less b/app/design/adminhtml/Magento/backend/web/css/source/components/_media-gallery.less index 2490ac4cee625..6de25c424656d 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/components/_media-gallery.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/components/_media-gallery.less @@ -280,11 +280,11 @@ .item-role { background: @color-gray89; color: @color-brownie; + cursor: pointer; font-size: @font-size__s; line-height: 1; margin: 0 .4rem .4rem 0; padding: .6rem; - cursor: pointer; } } From 5a8e81589c82b478f95454151e35977a73b260fb Mon Sep 17 00:00:00 2001 From: Fabricio Sobral <fabricio.sobral@webjump.com.br> Date: Tue, 26 Nov 2019 07:52:27 -0300 Subject: [PATCH 258/595] change by request --- .../luma/Magento_Checkout/web/css/source/module/_cart.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less index 7d3e9f5dbf01b..6c0c7a4fb66e1 100644 --- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less +++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less @@ -113,7 +113,7 @@ .page-main & { .block { - margin-bottom: 20px; + margin-bottom: @indent__base; } } From 8bf48fb0cfa69ac1b377d90503bbb2b20e5247ee Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <p.bystritsky@yandex.ru> Date: Tue, 26 Nov 2019 14:10:30 +0200 Subject: [PATCH 259/595] Tests for: magento/magento2#25102, magento/magento2#25251, magento/magento2#25584. --- .../Test/Mftf/Page/AdminThreeDSecurePage.xml | 14 ++++++++ .../Section/AdminCardinalCommerceSection.xml | 16 +++++++++ ...dminCardinalCommerceSettingsHiddenTest.xml | 33 +++++++++++++++++++ .../Test/Mftf/Page/AdminCurrencySetupPage.xml | 14 ++++++++ .../AdminScheduledImportSettingsSection.xml | 16 +++++++++ ...AdminScheduledImportSettingsHiddenTest.xml | 33 +++++++++++++++++++ .../Mftf/Page/AdminFraudProtectionPage.xml | 14 ++++++++ .../AdminSignifydConfigurationSection.xml | 16 +++++++++ ...gnifydConfigDependentOnActiveFieldTest.xml | 33 +++++++++++++++++++ 9 files changed, 189 insertions(+) create mode 100644 app/code/Magento/CardinalCommerce/Test/Mftf/Page/AdminThreeDSecurePage.xml create mode 100644 app/code/Magento/CardinalCommerce/Test/Mftf/Section/AdminCardinalCommerceSection.xml create mode 100644 app/code/Magento/CardinalCommerce/Test/Mftf/Test/AdminCardinalCommerceSettingsHiddenTest.xml create mode 100644 app/code/Magento/Directory/Test/Mftf/Page/AdminCurrencySetupPage.xml create mode 100644 app/code/Magento/Directory/Test/Mftf/Section/AdminScheduledImportSettingsSection.xml create mode 100644 app/code/Magento/Directory/Test/Mftf/Test/AdminScheduledImportSettingsHiddenTest.xml create mode 100644 app/code/Magento/Signifyd/Test/Mftf/Page/AdminFraudProtectionPage.xml create mode 100644 app/code/Magento/Signifyd/Test/Mftf/Section/AdminSignifydConfigurationSection.xml create mode 100644 app/code/Magento/Signifyd/Test/Mftf/Test/AdminSignifydConfigDependentOnActiveFieldTest.xml diff --git a/app/code/Magento/CardinalCommerce/Test/Mftf/Page/AdminThreeDSecurePage.xml b/app/code/Magento/CardinalCommerce/Test/Mftf/Page/AdminThreeDSecurePage.xml new file mode 100644 index 0000000000000..dae6869dbfe79 --- /dev/null +++ b/app/code/Magento/CardinalCommerce/Test/Mftf/Page/AdminThreeDSecurePage.xml @@ -0,0 +1,14 @@ +<?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="AdminThreeDSecurePage" url="admin/system_config/edit/section/three_d_secure/" area="admin" module="Magento_CardinalCommerce"> + <section name="AdminCardinalCommerceSection"/> + </page> +</pages> diff --git a/app/code/Magento/CardinalCommerce/Test/Mftf/Section/AdminCardinalCommerceSection.xml b/app/code/Magento/CardinalCommerce/Test/Mftf/Section/AdminCardinalCommerceSection.xml new file mode 100644 index 0000000000000..1016fbaefb0ab --- /dev/null +++ b/app/code/Magento/CardinalCommerce/Test/Mftf/Section/AdminCardinalCommerceSection.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="AdminCardinalCommerceSection"> + <element name="head" type="button" selector="#three_d_secure_cardinal_config-link"/> + <element name="enabled" type="input" selector="#three_d_secure_cardinal_config_enabled_authorize"/> + <element name="environment" type="input" selector="#three_d_secure_cardinal_config_environment"/> + </section> +</sections> diff --git a/app/code/Magento/CardinalCommerce/Test/Mftf/Test/AdminCardinalCommerceSettingsHiddenTest.xml b/app/code/Magento/CardinalCommerce/Test/Mftf/Test/AdminCardinalCommerceSettingsHiddenTest.xml new file mode 100644 index 0000000000000..a41b96f0db6e4 --- /dev/null +++ b/app/code/Magento/CardinalCommerce/Test/Mftf/Test/AdminCardinalCommerceSettingsHiddenTest.xml @@ -0,0 +1,33 @@ +<?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="AdminCardinalCommerceSettingsHiddenTest"> + <annotations> + <features value="CardinalCommerce"/> + <title value="CardinalCommerce settings hidden" /> + <description value="CardinalCommerce config shouldn't be visible if the 3D secure is disabled for Authorize.Net."/> + <severity value="MINOR"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <magentoCLI command="config:set three_d_secure/cardinal/enabled_authorizenet 1" stepKey="enableCardinalCommerce"/> + </before> + + <after> + <actionGroup ref="logout" stepKey="logout"/> + <magentoCLI command="config:set three_d_secure/cardinal/enabled_authorizenet 0" stepKey="disableCardinalCommerce"/> + </after> + + <amOnPage url="{{AdminThreeDSecurePage.url}}" stepKey="openCurrencyOptionsPage" /> + <conditionalClick dependentSelector="{{AdminCardinalCommerceSection.enabled}}" visible="false" selector="{{AdminCardinalCommerceSection.head}}" stepKey="openCollapsibleBlock"/> + <see selector="{{AdminCardinalCommerceSection.environment}}" userInput="Production" stepKey="seeEnvironmentProduction"/> + <selectOption selector="{{AdminCardinalCommerceSection.enabled}}" userInput="0" stepKey="disableCardinalCommerceOption"/> + <dontSeeElement selector="{{AdminCardinalCommerceSection.environment}}" stepKey="dontSeeEnvironmentProduction"/> + </test> +</tests> diff --git a/app/code/Magento/Directory/Test/Mftf/Page/AdminCurrencySetupPage.xml b/app/code/Magento/Directory/Test/Mftf/Page/AdminCurrencySetupPage.xml new file mode 100644 index 0000000000000..03c2b0f856d19 --- /dev/null +++ b/app/code/Magento/Directory/Test/Mftf/Page/AdminCurrencySetupPage.xml @@ -0,0 +1,14 @@ +<?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="AdminCurrencySetupPage" url="admin/system_config/edit/section/currency/" area="admin" module="Magento_Directory"> + <section name="AdminScheduledImportSettingsSection"/> + </page> +</pages> diff --git a/app/code/Magento/Directory/Test/Mftf/Section/AdminScheduledImportSettingsSection.xml b/app/code/Magento/Directory/Test/Mftf/Section/AdminScheduledImportSettingsSection.xml new file mode 100644 index 0000000000000..4c4b0d6c9541e --- /dev/null +++ b/app/code/Magento/Directory/Test/Mftf/Section/AdminScheduledImportSettingsSection.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="AdminScheduledImportSettingsSection"> + <element name="head" type="button" selector="#currency_import-head"/> + <element name="enabled" type="input" selector="#currency_import_enabled"/> + <element name="service" type="input" selector="#currency_import_service"/> + </section> +</sections> diff --git a/app/code/Magento/Directory/Test/Mftf/Test/AdminScheduledImportSettingsHiddenTest.xml b/app/code/Magento/Directory/Test/Mftf/Test/AdminScheduledImportSettingsHiddenTest.xml new file mode 100644 index 0000000000000..0320b6f422cd6 --- /dev/null +++ b/app/code/Magento/Directory/Test/Mftf/Test/AdminScheduledImportSettingsHiddenTest.xml @@ -0,0 +1,33 @@ +<?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="AdminScheduledImportSettingsHiddenTest"> + <annotations> + <features value="Directory"/> + <title value="Scheduled import settings hidden" /> + <description value="Scheduled Import Settings' should hide fields when 'Enabled' is 'No'"/> + <severity value="MINOR"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <magentoCLI command="config:set currency/import/enabled 1" stepKey="enableCurrencyImport"/> + </before> + + <after> + <actionGroup ref="logout" stepKey="logout"/> + <magentoCLI command="config:set currency/import/enabled 0" stepKey="disableCurrencyImport"/> + </after> + + <amOnPage url="{{AdminCurrencySetupPage.url}}" stepKey="openCurrencyOptionsPage" /> + <conditionalClick dependentSelector="{{AdminScheduledImportSettingsSection.enabled}}" visible="false" selector="{{AdminScheduledImportSettingsSection.head}}" stepKey="openCollapsibleBlock"/> + <see selector="{{AdminScheduledImportSettingsSection.service}}" userInput="Fixer.io" stepKey="seeServiceFixerIo"/> + <selectOption selector="{{AdminScheduledImportSettingsSection.enabled}}" userInput="0" stepKey="disableCurrencyImportOption"/> + <dontSeeElement selector="{{AdminScheduledImportSettingsSection.service}}" stepKey="dontSeeServiceFixerIo"/> + </test> +</tests> diff --git a/app/code/Magento/Signifyd/Test/Mftf/Page/AdminFraudProtectionPage.xml b/app/code/Magento/Signifyd/Test/Mftf/Page/AdminFraudProtectionPage.xml new file mode 100644 index 0000000000000..07b58b8594843 --- /dev/null +++ b/app/code/Magento/Signifyd/Test/Mftf/Page/AdminFraudProtectionPage.xml @@ -0,0 +1,14 @@ +<?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="AdminFraudProtectionPage" url="admin/system_config/edit/section/fraud_protection/" area="admin" module="Magento_Signifyd"> + <section name="AdminSignifydConfigurationSection"/> + </page> +</pages> diff --git a/app/code/Magento/Signifyd/Test/Mftf/Section/AdminSignifydConfigurationSection.xml b/app/code/Magento/Signifyd/Test/Mftf/Section/AdminSignifydConfigurationSection.xml new file mode 100644 index 0000000000000..618e9d520dd87 --- /dev/null +++ b/app/code/Magento/Signifyd/Test/Mftf/Section/AdminSignifydConfigurationSection.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="AdminSignifydConfigurationSection"> + <element name="head" type="button" selector="#fraud_protection_signifyd_config-head"/> + <element name="enabled" type="input" selector="#fraud_protection_signifyd_config_active"/> + <element name="url" type="text" selector="#fraud_protection_signifyd_config_api_url"/> + </section> +</sections> diff --git a/app/code/Magento/Signifyd/Test/Mftf/Test/AdminSignifydConfigDependentOnActiveFieldTest.xml b/app/code/Magento/Signifyd/Test/Mftf/Test/AdminSignifydConfigDependentOnActiveFieldTest.xml new file mode 100644 index 0000000000000..dcae0c4091ba6 --- /dev/null +++ b/app/code/Magento/Signifyd/Test/Mftf/Test/AdminSignifydConfigDependentOnActiveFieldTest.xml @@ -0,0 +1,33 @@ +<?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="AdminSignifydConfigDependentOnActiveFieldTest"> + <annotations> + <features value="Signifyd"/> + <title value="Signifyd config dependent on active field" /> + <description value="Signifyd system configs dependent by Enable this Solution field."/> + <severity value="MINOR"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <magentoCLI command="config:set fraud_protection/signifyd/active 1" stepKey="enableSignifyd"/> + </before> + + <after> + <actionGroup ref="logout" stepKey="logout"/> + <magentoCLI command="config:set fraud_protection/signifyd/active 0" stepKey="disableSignifyd"/> + </after> + + <amOnPage url="{{AdminFraudProtectionPage.url}}" stepKey="openFraudProtectionPagePage" /> + <conditionalClick dependentSelector="{{AdminSignifydConfigurationSection.enabled}}" visible="false" selector="{{AdminSignifydConfigurationSection.head}}" stepKey="openCollapsibleBlock"/> + <seeInField selector="{{AdminSignifydConfigurationSection.url}}" userInput="https://api.signifyd.com/v2/" stepKey="seeApiUrlField"/> + <selectOption selector="{{AdminSignifydConfigurationSection.enabled}}" userInput="0" stepKey="disableSignifydOption"/> + <dontSeeElement selector="{{AdminSignifydConfigurationSection.url}}" stepKey="dontSeeApiUrlField"/> + </test> +</tests> From 1ab336b33d26713f660ae4aade5aae35332a13f5 Mon Sep 17 00:00:00 2001 From: Fabricio Sobral <fabricio.sobral@webjump.com.br> Date: Tue, 26 Nov 2019 10:52:50 -0300 Subject: [PATCH 260/595] change by request to improve --- .../luma/Magento_Checkout/web/css/source/module/_cart.less | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less index 6c0c7a4fb66e1..ac0ab760ead62 100644 --- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less +++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less @@ -113,7 +113,7 @@ .page-main & { .block { - margin-bottom: @indent__base; + margin-bottom: 0; } } @@ -563,6 +563,9 @@ .widget { float: left; + &.block { + margin-bottom: @indent__base; + } } } From 841bb75dfbb59a8971b0897b55a234923a2c30e5 Mon Sep 17 00:00:00 2001 From: ashna-jahan <ashna@jivainfotech.com> Date: Tue, 26 Nov 2019 19:35:25 +0530 Subject: [PATCH 261/595] fixed issue 25433 --- .../web/css/source/forms/fields/_control-table.less | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less index 697d11fb57d67..821ab04d8c44c 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less @@ -237,3 +237,16 @@ float: right; } } + +@media only screen and (min-width: 768px) +{ + .product_form_product_form_advanced_pricing_modal .admin__fieldset > .admin__field > .admin__field-control{ + min-width: 682px; + } + + .admin__control-table-wrapper { + max-width: 100% !important; + overflow-x: visible !important; + overflow-y: visible !important; + } +} \ No newline at end of file From e95fee449a70264c36e0e482bd3f56c3bf7cafb4 Mon Sep 17 00:00:00 2001 From: Nagamaiah K <54108580+Nagamaiah007@users.noreply.github.com> Date: Tue, 26 Nov 2019 20:04:15 +0530 Subject: [PATCH 262/595] Update system.xml --- app/code/Magento/Analytics/etc/adminhtml/system.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Analytics/etc/adminhtml/system.xml b/app/code/Magento/Analytics/etc/adminhtml/system.xml index c7da840b7e665..ad542cd30758d 100644 --- a/app/code/Magento/Analytics/etc/adminhtml/system.xml +++ b/app/code/Magento/Analytics/etc/adminhtml/system.xml @@ -15,7 +15,7 @@ <label>Advanced Reporting</label> <comment><![CDATA[This service provides a dynamic suite of reports with rich insights about your business. Your reports can be accessed securely on a personalized dashboard outside of the admin panel by clicking on the - "Go to Advanced Reporting" link. </br> For more information, see our <a href="https://magento.com/legal/terms/cloud-terms"> + "Go to Advanced Reporting" link. </br> For more information, see our <a target="_blank" href="https://magento.com/legal/terms/cloud-terms"> terms and conditions</a>.]]></comment> <field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0"> <label>Advanced Reporting Service</label> From c4a3e5158af088b9735ff8c2abdd881960b344ae Mon Sep 17 00:00:00 2001 From: Fabricio Sobral <fabricio.sobral@webjump.com.br> Date: Tue, 26 Nov 2019 13:52:15 -0300 Subject: [PATCH 263/595] add changes in blank theme --- .../blank/Magento_Checkout/web/css/source/module/_cart.less | 4 ++++ .../luma/Magento_Checkout/web/css/source/module/_cart.less | 1 + 2 files changed, 5 insertions(+) diff --git a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_cart.less b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_cart.less index d3d15019f0e87..3142d5de64be1 100644 --- a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_cart.less +++ b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_cart.less @@ -346,6 +346,10 @@ .widget { float: left; + + &.block { + margin-bottom: @indent__base; + } } } diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less index ac0ab760ead62..cbf1d185a5a08 100644 --- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less +++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less @@ -563,6 +563,7 @@ .widget { float: left; + &.block { margin-bottom: @indent__base; } From 6991ebae4d56490f6cd7ba06fe74dfd1cc08ae81 Mon Sep 17 00:00:00 2001 From: Dmytro Yushkin <dyushkin@adobe.com> Date: Mon, 25 Nov 2019 16:42:05 -0600 Subject: [PATCH 264/595] MC-18459: Remove Special Price From and To Date fields from the Mass Update page --- .../Helper/Product/Edit/Action/Attribute.php | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Catalog/Helper/Product/Edit/Action/Attribute.php b/app/code/Magento/Catalog/Helper/Product/Edit/Action/Attribute.php index 2c1bacdb99e12..09d53427a3043 100644 --- a/app/code/Magento/Catalog/Helper/Product/Edit/Action/Attribute.php +++ b/app/code/Magento/Catalog/Helper/Product/Edit/Action/Attribute.php @@ -3,15 +3,15 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); -/** - * Adminhtml catalog product action attribute update helper - */ namespace Magento\Catalog\Helper\Product\Edit\Action; /** - * Class Attribute + * Adminhtml catalog product action attribute update helper. + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) */ class Attribute extends \Magento\Backend\Helper\Data { @@ -32,7 +32,7 @@ class Attribute extends \Magento\Backend\Helper\Data /** * Excluded from batch update attribute codes * - * @var string[] + * @var array */ protected $_excludedAttributes = ['url_key']; @@ -92,6 +92,7 @@ public function __construct( /** * Return product collection with selected product filter + * * Product collection didn't load * * @return \Magento\Catalog\Model\ResourceModel\Product\Collection @@ -171,8 +172,8 @@ public function getAttributes() $this->getProductsSetIds() ); - if ($this->_excludedAttributes) { - $this->_attributes->addFieldToFilter('attribute_code', ['nin' => $this->_excludedAttributes]); + if ($excludedAttributes = $this->getExcludedAttributes()) { + $this->_attributes->addFieldToFilter('attribute_code', ['nin' => $excludedAttributes]); } // check product type apply to limitation and remove attributes that impossible to change in mass-update @@ -193,11 +194,24 @@ public function getAttributes() } /** + * Gets website id. + * * @param int $storeId * @return int + * @throws \Magento\Framework\Exception\NoSuchEntityException */ public function getStoreWebsiteId($storeId) { return $this->_storeManager->getStore($storeId)->getWebsiteId(); } + + /** + * Retrieve excluded attributes. + * + * @return array + */ + public function getExcludedAttributes(): array + { + return $this->_excludedAttributes; + } } From b9ef877799ab4e94e5d5fd5a50342f7c8c8c8c6a Mon Sep 17 00:00:00 2001 From: Andrii Beziazychnyi <a.beziazychnyi@atwix.com> Date: Tue, 26 Nov 2019 20:54:14 +0200 Subject: [PATCH 265/595] Magento#25739: fixed grunt jobs - added paths to directory "generated/" - fixed clean options --- dev/tools/grunt/configs/clean.js | 15 +++++++++++++-- dev/tools/grunt/configs/path.js | 3 ++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/dev/tools/grunt/configs/clean.js b/dev/tools/grunt/configs/clean.js index 2edf358670473..6e5512ab8a69d 100644 --- a/dev/tools/grunt/configs/clean.js +++ b/dev/tools/grunt/configs/clean.js @@ -38,7 +38,6 @@ var cleanOptions = { "dot": true, "src": [ "<%= path.tmp %>/cache/**/*", - "<%= path.tmp %>/generation/**/*", "<%= path.tmp %>/log/**/*", "<%= path.tmp %>/maps/**/*", "<%= path.tmp %>/page_cache/**/*", @@ -89,7 +88,6 @@ var cleanOptions = { "dot": true, "src": [ "<%= path.tmp %>/cache/**/*", - "<%= path.tmp %>/generation/**/*", "<%= path.tmp %>/view_preprocessed/html/**/*", "<%= path.tmp %>/page_cache/**/*" ] @@ -110,6 +108,19 @@ var cleanOptions = { ] } ] + }, + "generation": { + "force": true, + "files": [ + { + "force": true, + "dot": true, + "src": [ + "<%= path.generation %>code/**/*", + "<%= path.generation %>metadata/**/*" + ] + } + ] } }; diff --git a/dev/tools/grunt/configs/path.js b/dev/tools/grunt/configs/path.js index 5a9a4f6ad1598..e2320d702441e 100644 --- a/dev/tools/grunt/configs/path.js +++ b/dev/tools/grunt/configs/path.js @@ -32,5 +32,6 @@ module.exports = { whitelist: 'dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/', blacklist: 'dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/', tmp: 'validation-files.txt' - } + }, + generation: 'generated/' }; From e0cecbabdabbaf181073cb9af6970e0c7a4198ad Mon Sep 17 00:00:00 2001 From: Anusha Vattam <avattam@adobe.com> Date: Tue, 26 Nov 2019 14:12:02 -0600 Subject: [PATCH 266/595] MC-23217: [GraphQL] Url rewrites is invalid - Fixed the code to add entity type --- .../CatalogUrlRewriteGraphQl/etc/di.xml | 8 +++ .../Model/Resolver/UrlRewrite.php | 69 +++++++++++++++++-- .../GraphQl/Catalog/UrlRewritesTest.php | 34 +++++++-- 3 files changed, 100 insertions(+), 11 deletions(-) diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml b/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml index e99f89477e807..2c9a43d5e6807 100644 --- a/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml @@ -22,4 +22,12 @@ </argument> </arguments> </type> + + <type name="Magento\UrlRewriteGraphQl\Model\Resolver\UrlRewrite"> + <arguments> + <argument name="allowedEntityTypes" xsi:type="array"> + <item name="catalog_product" xsi:type="string">Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator::ENTITY_TYPE</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/UrlRewrite.php b/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/UrlRewrite.php index 01583602348d3..2c82d72f25425 100644 --- a/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/UrlRewrite.php +++ b/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/UrlRewrite.php @@ -11,9 +11,11 @@ use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Query\ResolverInterface; -use Magento\Framework\Model\AbstractModel; use Magento\UrlRewrite\Model\UrlFinderInterface; use Magento\UrlRewrite\Service\V1\Data\UrlRewrite as UrlRewriteDTO; +use Magento\Framework\Model\AbstractModel; +use Magento\Framework\EntityManager\TypeResolver; +use Magento\Framework\EntityManager\MetadataPool; /** * Returns URL rewrites list for the specified product @@ -25,13 +27,37 @@ class UrlRewrite implements ResolverInterface */ private $urlFinder; + /** + * @var array + */ + private $allowedEntityTypes; + + /** + * @var MetadataPool + */ + private $metadataPool; + + /** + * @var TypeResolver + */ + private $typeResolver; + /** * @param UrlFinderInterface $urlFinder + * @param TypeResolver $typeResolver + * @param MetadataPool $metadataPool + * @param array $allowedEntityTypes */ public function __construct( - UrlFinderInterface $urlFinder + UrlFinderInterface $urlFinder, + TypeResolver $typeResolver, + MetadataPool $metadataPool, + array $allowedEntityTypes = [] ) { $this->urlFinder = $urlFinder; + $this->typeResolver = $typeResolver; + $this->metadataPool = $metadataPool; + $this->allowedEntityTypes = $allowedEntityTypes; } /** @@ -48,11 +74,24 @@ public function resolve( throw new LocalizedException(__('"model" value should be specified')); } - /** @var AbstractModel $entity */ + /** @var AbstractModel $entity */ $entity = $value['model']; $entityId = $entity->getEntityId(); - $urlRewriteCollection = $this->urlFinder->findAllByData([UrlRewriteDTO::ENTITY_ID => $entityId]); + $resolveEntityType = $this->typeResolver->resolve($entity); + $metadata = $this->metadataPool->getMetadata($resolveEntityType); + $entityType = $this->getEntityType($metadata->getEavEntityType()); + + $storeId = (int)$context->getExtensionAttributes()->getStore()->getId(); + + $data = [ + UrlRewriteDTO::ENTITY_TYPE => $entityType, + UrlRewriteDTO::ENTITY_ID => $entityId, + UrlRewriteDTO::STORE_ID => $storeId + ]; + + $urlRewriteCollection = $this->urlFinder->findAllByData($data); + $urlRewrites = []; /** @var UrlRewriteDTO $urlRewrite */ @@ -80,9 +119,8 @@ private function getUrlParameters(string $targetPath): array { $urlParameters = []; $targetPathParts = explode('/', trim($targetPath, '/')); - $count = count($targetPathParts) - 1; - for ($i = 3; $i < $count; $i += 2) { + for ($i = 3; ($i < sizeof($targetPathParts) - 1); $i += 2) { $urlParameters[] = [ 'name' => $targetPathParts[$i], 'value' => $targetPathParts[$i + 1] @@ -91,4 +129,23 @@ private function getUrlParameters(string $targetPath): array return $urlParameters; } + + /** + * Get the entity type + * + * @param string $entityTypeMetadata + * @return string + */ + private function getEntityType(string $entityTypeMetadata) : string + { + $entityType = ''; + if ($entityTypeMetadata) { + switch ($entityTypeMetadata){ + case 'catalog_product': + $entityType = $this->allowedEntityTypes['catalog_product']; + break; + } + } + return $entityType; + } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/UrlRewritesTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/UrlRewritesTest.php index 1c32200384e70..977d2e1de95ac 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/UrlRewritesTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/UrlRewritesTest.php @@ -12,6 +12,8 @@ use Magento\TestFramework\TestCase\GraphQlAbstract; use Magento\UrlRewrite\Model\UrlFinderInterface; use Magento\UrlRewrite\Service\V1\Data\UrlRewrite as UrlRewriteDTO; +use Magento\Eav\Model\Config as EavConfig; +use Magento\Store\Model\StoreManagerInterface; /** * Test of getting URL rewrites data from products @@ -54,9 +56,20 @@ public function testProductWithNoCategoriesAssigned() $productRepository = ObjectManager::getInstance()->get(ProductRepositoryInterface::class); $product = $productRepository->get('virtual-product', false, null, true); + $storeId = ObjectManager::getInstance()->get(StoreManagerInterface::class)->getStore()->getId(); $urlFinder = ObjectManager::getInstance()->get(UrlFinderInterface::class); + $entityType = ObjectManager::getInstance()->create(EavConfig::class)->getEntityType('catalog_product'); - $rewritesCollection = $urlFinder->findAllByData([UrlRewriteDTO::ENTITY_ID => $product->getId()]); + $entityTypeCode = $entityType->getEntityTypeCode(); + if ($entityTypeCode === 'catalog_product') { + $entityTypeCode = 'product'; + } + + $rewritesCollection = $urlFinder->findAllByData([ + UrlRewriteDTO::ENTITY_ID => $product->getId(), + UrlRewriteDTO::ENTITY_TYPE => $entityTypeCode, + UrlRewriteDTO::STORE_ID => $storeId + ]); /* There should be only one rewrite */ /** @var UrlRewriteDTO $urlRewrite */ @@ -110,12 +123,24 @@ public function testProductWithOneCategoryAssigned() $productRepository = ObjectManager::getInstance()->get(ProductRepositoryInterface::class); $product = $productRepository->get('simple', false, null, true); + $storeId = ObjectManager::getInstance()->get(StoreManagerInterface::class)->getStore()->getId(); $urlFinder = ObjectManager::getInstance()->get(UrlFinderInterface::class); + $entityType = ObjectManager::getInstance()->create(EavConfig::class)->getEntityType('catalog_product'); - $rewritesCollection = $urlFinder->findAllByData([UrlRewriteDTO::ENTITY_ID => $product->getId()]); - $rewritesCount = count($rewritesCollection); + $entityTypeCode = $entityType->getEntityTypeCode(); + if ($entityTypeCode === 'catalog_product') { + $entityTypeCode = 'product'; + } + $rewritesCollection = $urlFinder->findAllByData([ + UrlRewriteDTO::ENTITY_ID => $product->getId(), + UrlRewriteDTO::ENTITY_TYPE => $entityTypeCode, + UrlRewriteDTO::STORE_ID => $storeId + ]); + + $rewritesCount = count($rewritesCollection); $this->assertArrayHasKey('url_rewrites', $response['products']['items'][0]); + $this->assertCount(1, $response['products']['items'][0]['url_rewrites']); $this->assertCount($rewritesCount, $response['products']['items'][0]['url_rewrites']); for ($i = 0; $i < $rewritesCount; $i++) { @@ -140,9 +165,8 @@ private function getUrlParameters(string $targetPath): array { $urlParameters = []; $targetPathParts = explode('/', trim($targetPath, '/')); - $count = count($targetPathParts) - 1; - for ($i = 3; $i < $count; $i += 2) { + for ($i = 3; ($i < sizeof($targetPathParts) - 1); $i += 2) { $urlParameters[] = [ 'name' => $targetPathParts[$i], 'value' => $targetPathParts[$i + 1] From a873aef50ce93b8bc33596d04690bb608c1098ac Mon Sep 17 00:00:00 2001 From: Anusha Vattam <avattam@adobe.com> Date: Tue, 26 Nov 2019 14:42:04 -0600 Subject: [PATCH 267/595] MC-23217: [GraphQL] Url rewrites is invalid - Fixed the code changes from review --- app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml b/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml index 2c9a43d5e6807..624b27eff6478 100644 --- a/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml @@ -26,7 +26,7 @@ <type name="Magento\UrlRewriteGraphQl\Model\Resolver\UrlRewrite"> <arguments> <argument name="allowedEntityTypes" xsi:type="array"> - <item name="catalog_product" xsi:type="string">Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator::ENTITY_TYPE</item> + <item name="catalog_product" xsi:type="const">Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator::ENTITY_TYPE</item> </argument> </arguments> </type> From 461e398719ac71e8b74a9123b3a73f380725a9ce Mon Sep 17 00:00:00 2001 From: Anusha Vattam <avattam@adobe.com> Date: Tue, 26 Nov 2019 15:08:47 -0600 Subject: [PATCH 268/595] MC-23217: [GraphQL] Url rewrites is invalid - Fixed the code changes from static failures --- .../Model/Resolver/UrlRewrite.php | 7 ++--- .../GraphQl/Catalog/UrlRewritesTest.php | 28 +++++++++++-------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/UrlRewrite.php b/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/UrlRewrite.php index 2c82d72f25425..4ec2a8c1c4cfb 100644 --- a/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/UrlRewrite.php +++ b/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/UrlRewrite.php @@ -119,14 +119,13 @@ private function getUrlParameters(string $targetPath): array { $urlParameters = []; $targetPathParts = explode('/', trim($targetPath, '/')); - - for ($i = 3; ($i < sizeof($targetPathParts) - 1); $i += 2) { + //phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall + for ($i = 3; ($i < count($targetPathParts) - 1); $i += 2) { $urlParameters[] = [ 'name' => $targetPathParts[$i], 'value' => $targetPathParts[$i + 1] ]; } - return $urlParameters; } @@ -140,7 +139,7 @@ private function getEntityType(string $entityTypeMetadata) : string { $entityType = ''; if ($entityTypeMetadata) { - switch ($entityTypeMetadata){ + switch ($entityTypeMetadata) { case 'catalog_product': $entityType = $this->allowedEntityTypes['catalog_product']; break; diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/UrlRewritesTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/UrlRewritesTest.php index 977d2e1de95ac..431c22e60f4f6 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/UrlRewritesTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/UrlRewritesTest.php @@ -65,11 +65,13 @@ public function testProductWithNoCategoriesAssigned() $entityTypeCode = 'product'; } - $rewritesCollection = $urlFinder->findAllByData([ - UrlRewriteDTO::ENTITY_ID => $product->getId(), - UrlRewriteDTO::ENTITY_TYPE => $entityTypeCode, - UrlRewriteDTO::STORE_ID => $storeId - ]); + $rewritesCollection = $urlFinder->findAllByData( + [ + UrlRewriteDTO::ENTITY_ID => $product->getId(), + UrlRewriteDTO::ENTITY_TYPE => $entityTypeCode, + UrlRewriteDTO::STORE_ID => $storeId + ] + ); /* There should be only one rewrite */ /** @var UrlRewriteDTO $urlRewrite */ @@ -132,11 +134,13 @@ public function testProductWithOneCategoryAssigned() $entityTypeCode = 'product'; } - $rewritesCollection = $urlFinder->findAllByData([ - UrlRewriteDTO::ENTITY_ID => $product->getId(), - UrlRewriteDTO::ENTITY_TYPE => $entityTypeCode, - UrlRewriteDTO::STORE_ID => $storeId - ]); + $rewritesCollection = $urlFinder->findAllByData( + [ + UrlRewriteDTO::ENTITY_ID => $product->getId(), + UrlRewriteDTO::ENTITY_TYPE => $entityTypeCode, + UrlRewriteDTO::STORE_ID => $storeId + ] + ); $rewritesCount = count($rewritesCollection); $this->assertArrayHasKey('url_rewrites', $response['products']['items'][0]); @@ -165,8 +169,8 @@ private function getUrlParameters(string $targetPath): array { $urlParameters = []; $targetPathParts = explode('/', trim($targetPath, '/')); - - for ($i = 3; ($i < sizeof($targetPathParts) - 1); $i += 2) { + //phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall + for ($i = 3; ($i < count($targetPathParts) - 1); $i += 2) { $urlParameters[] = [ 'name' => $targetPathParts[$i], 'value' => $targetPathParts[$i + 1] From 9c5870c080b45e42cd40e05aaaa658110b57054c Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Tue, 26 Nov 2019 15:47:22 -0600 Subject: [PATCH 269/595] MC-23091: Performance improvements on configurable product - removing complexity on configurable processing --- .../CatalogGraphQl/Model/Resolver/Product.php | 8 +- .../Resolver/Product/MediaGallery/Label.php | 87 ------------------- .../Resolver/Product/MediaGallery/Url.php | 20 +++-- .../Model/Resolver/Product/ProductImage.php | 28 +++++- .../AttributeProcessor.php | 60 ++++++++++++- .../Products/Query/FieldSelection.php | 4 +- .../Magento/CatalogGraphQl/etc/graphql/di.xml | 27 ++++++ .../CatalogGraphQl/etc/schema.graphqls | 2 +- .../Configurable/Attribute/Collection.php | 1 + .../Model/Resolver/ConfigurableVariant.php | 38 +++----- .../Model/Resolver/Variant/Attributes.php | 59 ++++++++++--- .../Model/Variant/Collection.php | 18 +++- .../Theme/Model/Theme/ThemeProvider.php | 6 +- 13 files changed, 212 insertions(+), 146 deletions(-) delete mode 100644 app/code/Magento/CatalogGraphQl/Model/Resolver/Product/MediaGallery/Label.php diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product.php index 86137990cc57d..889735a5f4d88 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product.php @@ -14,6 +14,7 @@ use Magento\Framework\GraphQl\Query\Resolver\ValueFactory; use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\Framework\Exception\LocalizedException; /** * @inheritdoc @@ -63,10 +64,13 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value $this->productDataProvider->addEavAttributes($fields); $result = function () use ($value) { - $data = $this->productDataProvider->getProductBySku($value['sku']); + $data = $value['product'] ?? $this->productDataProvider->getProductBySku($value['sku']); if (empty($data)) { return null; } + if (!isset($data['model'])) { + throw new LocalizedException(__('"model" value should be specified')); + } $productModel = $data['model']; /** @var \Magento\Catalog\Model\Product $productModel */ $data = $productModel->getData(); @@ -79,10 +83,8 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value } } } - return array_replace($value, $data); }; - return $this->valueFactory->create($result); } } diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/MediaGallery/Label.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/MediaGallery/Label.php deleted file mode 100644 index 4ec76fe59ca88..0000000000000 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/MediaGallery/Label.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\CatalogGraphQl\Model\Resolver\Product\MediaGallery; - -use Magento\Catalog\Model\Product; -use Magento\Catalog\Model\ResourceModel\Product as ProductResourceModel; -use Magento\Framework\Exception\LocalizedException; -use Magento\Framework\GraphQl\Config\Element\Field; -use Magento\Framework\GraphQl\Query\ResolverInterface; -use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; -use Magento\Store\Api\Data\StoreInterface; - -/** - * Return media label - */ -class Label implements ResolverInterface -{ - /** - * @var ProductResourceModel - */ - private $productResource; - - /** - * @param ProductResourceModel $productResource - */ - public function __construct( - ProductResourceModel $productResource - ) { - $this->productResource = $productResource; - } - - /** - * @inheritdoc - */ - public function resolve( - Field $field, - $context, - ResolveInfo $info, - array $value = null, - array $args = null - ) { - - if (isset($value['label'])) { - return $value['label']; - } - - if (!isset($value['model'])) { - throw new LocalizedException(__('"model" value should be specified')); - } - - /** @var Product $product */ - $product = $value['model']; - $productId = (int)$product->getEntityId(); - /** @var StoreInterface $store */ - $store = $context->getExtensionAttributes()->getStore(); - $storeId = (int)$store->getId(); - if (!isset($value['image_type'])) { - return $this->getAttributeValue($productId, 'name', $storeId); - } - $imageType = $value['image_type']; - $imageLabel = $this->getAttributeValue($productId, $imageType . '_label', $storeId); - if ($imageLabel == null) { - $imageLabel = $this->getAttributeValue($productId, 'name', $storeId); - } - - return $imageLabel; - } - - /** - * Get attribute value - * - * @param int $productId - * @param string $attributeCode - * @param int $storeId - * @return null|string Null if attribute value is not exists - */ - private function getAttributeValue(int $productId, string $attributeCode, int $storeId): ?string - { - $value = $this->productResource->getAttributeRawValue($productId, $attributeCode, $storeId); - return is_array($value) && empty($value) ? null : $value; - } -} diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/MediaGallery/Url.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/MediaGallery/Url.php index eaab159cddae6..359d295095667 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/MediaGallery/Url.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/MediaGallery/Url.php @@ -24,11 +24,17 @@ class Url implements ResolverInterface * @var ImageFactory */ private $productImageFactory; + /** * @var PlaceholderProvider */ private $placeholderProvider; + /** + * @var string[] + */ + private $placeholderCache = []; + /** * @param ImageFactory $productImageFactory * @param PlaceholderProvider $placeholderProvider @@ -64,12 +70,8 @@ public function resolve( if (isset($value['image_type'])) { $imagePath = $product->getData($value['image_type']); return $this->getImageUrl($value['image_type'], $imagePath); - } - if (isset($value['file'])) { - $image = $this->productImageFactory->create(); - $image->setDestinationSubdir('image')->setBaseFile($value['file']); - $imageUrl = $image->getUrl(); - return $imageUrl; + } elseif (isset($value['file'])) { + return $this->getImageUrl('image', $value['file']); } return []; } @@ -84,12 +86,16 @@ public function resolve( */ private function getImageUrl(string $imageType, ?string $imagePath): string { + if (empty($imagePath) && !empty($this->placeholderCache[$imageType])) { + return $this->placeholderCache[$imageType]; + } $image = $this->productImageFactory->create(); $image->setDestinationSubdir($imageType) ->setBaseFile($imagePath); if ($image->isBaseFilePlaceholder()) { - return $this->placeholderProvider->getPlaceholder($imageType); + $this->placeholderCache[$imageType] = $this->placeholderProvider->getPlaceholder($imageType); + return $this->placeholderCache[$imageType]; } return $image->getUrl(); diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductImage.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductImage.php index d1566162472b0..7c08f91c922bd 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductImage.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductImage.php @@ -18,6 +18,25 @@ */ class ProductImage implements ResolverInterface { + /** @var array */ + private static $catalogImageLabelTypes = [ + 'image' => 'image_label', + 'small_image' => 'small_image_label', + 'thumbnail' => 'thumbnail_label' + ]; + + /** @var array */ + private $imageTypeLabels; + + /** + * @param array $imageTypeLabels + */ + public function __construct( + array $imageTypeLabels = [] + ) { + $this->imageTypeLabels = array_replace(self::$catalogImageLabelTypes, $imageTypeLabels); + } + /** * @inheritdoc */ @@ -34,11 +53,16 @@ public function resolve( /** @var Product $product */ $product = $value['model']; - $imageType = $field->getName(); + $label = $value['name'] ?? null; + if (isset($this->imageTypeLabels[$info->fieldName]) + && !empty($value[$this->imageTypeLabels[$info->fieldName]])) { + $label = $value[$this->imageTypeLabels[$info->fieldName]]; + } return [ 'model' => $product, - 'image_type' => $imageType, + 'image_type' => $field->getName(), + 'label' => $label ]; } } diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product/CollectionProcessor/AttributeProcessor.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product/CollectionProcessor/AttributeProcessor.php index 2ad05fbfa1e08..fef224b12acfc 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product/CollectionProcessor/AttributeProcessor.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product/CollectionProcessor/AttributeProcessor.php @@ -51,6 +51,27 @@ public function process( /** * Add attribute to collection select * + * Add attributes to the collection where graphql fields names don't match attributes names, or if attributes exist + * on a nested level and they need to be loaded. + * + * Format of the attribute can be string or array while array can have different formats. + * Example: [ + * 'price_range' => + * [ + * 'price' => 'price', + * 'price_type' => 'price_type', + * ], + * 'thumbnail' => //complex array where more than one attribute is needed to compute a value + * [ + * 'label' => + * [ + * 'attribute' => 'thumbnail_label', // the actual attribute + * 'fallback_attribute' => 'name', //used as default value in case attribute value is null + * ], + * 'url' => 'thumbnail', + * ] + * ] + * * @param Collection $collection * @param string $attribute */ @@ -59,9 +80,7 @@ private function addAttribute(Collection $collection, string $attribute): void if (isset($this->fieldToAttributeMap[$attribute])) { $attributeMap = $this->fieldToAttributeMap[$attribute]; if (is_array($attributeMap)) { - foreach ($attributeMap as $attributeName) { - $collection->addAttributeToSelect($attributeName); - } + $this->addAttributeAsArray($collection, $attributeMap); } else { $collection->addAttributeToSelect($attributeMap); } @@ -70,4 +89,39 @@ private function addAttribute(Collection $collection, string $attribute): void $collection->addAttributeToSelect($attribute); } } + + /** + * Add an array defined attribute to the collection + * + * @param Collection $collection + * @param array $attributeMap + * @return void + */ + private function addAttributeAsArray(Collection $collection, array $attributeMap): void + { + foreach ($attributeMap as $attribute) { + if (is_array($attribute)) { + $this->addAttributeComplexArrayToCollection($collection, $attribute); + } else { + $collection->addAttributeToSelect($attribute); + } + } + } + + /** + * Add a complex array defined attribute to the collection + * + * @param Collection $collection + * @param array $attribute + * @return void + */ + private function addAttributeComplexArrayToCollection(Collection $collection, array $attribute): void + { + if (isset($attribute['attribute'])) { + $collection->addAttributeToSelect($attribute['attribute']); + } + if (isset($attribute['fallback_attribute'])) { + $collection->addAttributeToSelect($attribute['fallback_attribute']); + } + } } diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/FieldSelection.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/FieldSelection.php index ae4f2e911a5b0..ffa0a3e6848e1 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/FieldSelection.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/FieldSelection.php @@ -50,11 +50,11 @@ private function getProductFields(ResolveInfo $info): array { $fieldNames = []; foreach ($info->fieldNodes as $node) { - if ($node->name->value !== 'products') { + if ($node->name->value !== 'products' && $node->name->value !== 'variants') { continue; } foreach ($node->selectionSet->selections as $selection) { - if ($selection->name->value !== 'items') { + if ($selection->name->value !== 'items' && $selection->name->value !== 'product') { continue; } $fieldNames[] = $this->collectProductFieldNames($selection, $fieldNames); diff --git a/app/code/Magento/CatalogGraphQl/etc/graphql/di.xml b/app/code/Magento/CatalogGraphQl/etc/graphql/di.xml index 76456166ded30..066a7b38d8967 100644 --- a/app/code/Magento/CatalogGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/CatalogGraphQl/etc/graphql/di.xml @@ -134,6 +134,33 @@ <item name="price_range" xsi:type="array"> <item name="price" xsi:type="string">price</item> </item> + <item name="thumbnail" xsi:type="array"> + <item name="label" xsi:type="array"> + <item name="attribute" xsi:type="string">thumbnail_label</item> + <item name="fallback_attribute" xsi:type="string">name</item> + </item> + <item name="url" xsi:type="string">thumbnail</item> + </item> + <item name="small_image" xsi:type="array"> + <item name="label" xsi:type="array"> + <item name="attribute" xsi:type="string">small_image_label</item> + <item name="fallback_attribute" xsi:type="string">name</item> + </item> + <item name="url" xsi:type="string">small_image</item> + </item> + <item name="image" xsi:type="array"> + <item name="label" xsi:type="array"> + <item name="attribute" xsi:type="string">image_label</item> + <item name="fallback_attribute" xsi:type="string">name</item> + </item> + <item name="url" xsi:type="string">image</item> + </item> + <item name="media_gallery" xsi:type="array"> + <item name="label" xsi:type="array"> + <item name="attribute" xsi:type="string">image_label</item> + <item name="fallback_attribute" xsi:type="string">name</item> + </item> + </item> </argument> </arguments> </type> diff --git a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls index 81323a50fb424..f70a32a1b549e 100644 --- a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls @@ -198,7 +198,7 @@ type CustomizableFileValue @doc(description: "CustomizableFileValue defines the interface MediaGalleryInterface @doc(description: "Contains basic information about a product image or video.") @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\MediaGalleryTypeResolver") { url: String @doc(description: "The URL of the product image or video.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\MediaGallery\\Url") - label: String @doc(description: "The label of the product image or video.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\MediaGallery\\Label") + label: String @doc(description: "The label of the product image or video.") } type ProductImage implements MediaGalleryInterface @doc(description: "Product image information. Contains the image URL and label.") { diff --git a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Attribute/Collection.php b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Attribute/Collection.php index 59920a1ade5e0..57f701721a6f3 100644 --- a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Attribute/Collection.php +++ b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Attribute/Collection.php @@ -331,6 +331,7 @@ protected function loadOptions() 'use_default_value' => true ]; } + $item->setOptionsMap($values); $values = array_values($values); $item->setOptions($values); } diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableVariant.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableVariant.php index 3e07fecb2ebe7..f28bf97adf930 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableVariant.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableVariant.php @@ -18,6 +18,7 @@ use Magento\Framework\GraphQl\Config\Element\Field; use Magento\Framework\GraphQl\Query\Resolver\ValueFactory; use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\CatalogGraphQl\Model\Resolver\Products\Query\FieldSelection; /** * @inheritdoc @@ -49,25 +50,33 @@ class ConfigurableVariant implements ResolverInterface */ private $metadataPool; + /** + * @var FieldSelection + */ + private $fieldSelection; + /** * @param Collection $variantCollection * @param OptionCollection $optionCollection * @param ValueFactory $valueFactory * @param AttributeCollection $attributeCollection * @param MetadataPool $metadataPool + * @param FieldSelection $fieldSelection */ public function __construct( Collection $variantCollection, OptionCollection $optionCollection, ValueFactory $valueFactory, AttributeCollection $attributeCollection, - MetadataPool $metadataPool + MetadataPool $metadataPool, + FieldSelection $fieldSelection ) { $this->variantCollection = $variantCollection; $this->optionCollection = $optionCollection; $this->valueFactory = $valueFactory; $this->attributeCollection = $attributeCollection; $this->metadataPool = $metadataPool; + $this->fieldSelection = $fieldSelection; } /** @@ -84,9 +93,8 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value } $this->variantCollection->addParentProduct($value['model']); - $fields = $this->getProductFields($info); - $matchedFields = $this->attributeCollection->getRequestAttributes($fields); - $this->variantCollection->addEavAttributes($matchedFields); + $fields = $this->fieldSelection->getProductsFieldSelection($info); + $this->variantCollection->addEavAttributes($fields); $this->optionCollection->addProductId((int)$value[$linkField]); $result = function () use ($value, $linkField) { @@ -103,26 +111,4 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value return $this->valueFactory->create($result); } - - /** - * Return field names for all requested product fields. - * - * @param ResolveInfo $info - * @return string[] - */ - private function getProductFields(ResolveInfo $info) - { - $fieldNames = []; - foreach ($info->fieldNodes as $node) { - if ($node->name->value !== 'product') { - continue; - } - - foreach ($node->selectionSet->selections as $selectionNode) { - $fieldNames[] = $selectionNode->name->value; - } - } - - return $fieldNames; - } } diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/Variant/Attributes.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/Variant/Attributes.php index dd2b84e1da539..db31723183d78 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/Variant/Attributes.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/Variant/Attributes.php @@ -44,7 +44,10 @@ public function resolve( } $data = []; - foreach ($value['options'] as $option) { + foreach ($value['options'] as $optionId => $option) { + if (!isset($option['attribute_code'])) { + continue; + } $code = $option['attribute_code']; /** @var Product|null $model */ $model = $value['product']['model'] ?? null; @@ -52,18 +55,54 @@ public function resolve( continue; } - foreach ($option['values'] as $optionValue) { - if ($optionValue['value_index'] != $model->getData($code)) { - continue; + if (isset($option['options_map'])) { + $optionsFromMap = $this->getOptionsFromMap( + $option['options_map'] ?? [], + $code, + (int) $optionId, + (int) $model->getData($code) + ); + if (!empty($optionsFromMap)) { + $data[] = $optionsFromMap; } - $data[] = [ - 'label' => $optionValue['label'], - 'code' => $code, - 'use_default_value' => $optionValue['use_default_value'], - 'value_index' => $optionValue['value_index'] - ]; } } return $data; } + + /** + * Get options by index mapping + * + * @param array $optionMap + * @param string $code + * @param int $optionId + * @param int $attributeCodeId + * @return array + */ + private function getOptionsFromMap(array $optionMap, string $code, int $optionId, int $attributeCodeId): array + { + $data = []; + if (isset($optionMap[$optionId . ':' . $attributeCodeId])) { + $optionValue = $optionMap[$optionId . ':' . $attributeCodeId]; + $data = $this->getOptionsArray($optionValue, $code); + } + return $data; + } + + /** + * Get options formatted as array + * + * @param array $optionValue + * @param string $code + * @return array + */ + private function getOptionsArray(array $optionValue, string $code) + { + return [ + 'label' => $optionValue['label'] ?? null, + 'code' => $code, + 'use_default_value' => $optionValue['use_default_value'] ?? null, + 'value_index' => $optionValue['value_index'] ?? null, + ]; + } } diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Variant/Collection.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Variant/Collection.php index d517c9aa29bd3..6c4371b23927e 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Variant/Collection.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Variant/Collection.php @@ -14,6 +14,7 @@ use Magento\Framework\EntityManager\MetadataPool; use Magento\Framework\Api\SearchCriteriaBuilder; use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessorInterface; +use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionPostProcessor; /** * Collection for fetching configurable child product data. @@ -55,22 +56,30 @@ class Collection */ private $collectionProcessor; + /** + * @var CollectionPostProcessor + */ + private $collectionPostProcessor; + /** * @param CollectionFactory $childCollectionFactory * @param SearchCriteriaBuilder $searchCriteriaBuilder * @param MetadataPool $metadataPool * @param CollectionProcessorInterface $collectionProcessor + * @param CollectionPostProcessor $collectionPostProcessor */ public function __construct( CollectionFactory $childCollectionFactory, SearchCriteriaBuilder $searchCriteriaBuilder, MetadataPool $metadataPool, - CollectionProcessorInterface $collectionProcessor + CollectionProcessorInterface $collectionProcessor, + CollectionPostProcessor $collectionPostProcessor ) { $this->childCollectionFactory = $childCollectionFactory; $this->searchCriteriaBuilder = $searchCriteriaBuilder; $this->metadataPool = $metadataPool; $this->collectionProcessor = $collectionProcessor; + $this->collectionPostProcessor = $collectionPostProcessor; } /** @@ -126,7 +135,6 @@ public function getChildProductsByParentId(int $id) : array * Fetch all children products from parent id's. * * @return array - * @throws \Exception */ private function fetch() : array { @@ -144,9 +152,11 @@ private function fetch() : array $this->searchCriteriaBuilder->create(), $attributeData ); + $childCollection->load(); + $this->collectionPostProcessor->process($childCollection, $attributeData); /** @var Product $childProduct */ - foreach ($childCollection->getItems() as $childProduct) { + foreach ($childCollection as $childProduct) { $formattedChild = ['model' => $childProduct, 'sku' => $childProduct->getSku()]; $parentId = (int)$childProduct->getParentId(); if (!isset($this->childrenMap[$parentId])) { @@ -168,7 +178,7 @@ private function fetch() : array */ private function getAttributesCodes(Product $currentProduct): array { - $attributeCodes = []; + $attributeCodes = $this->attributeCodes; $allowAttributes = $currentProduct->getTypeInstance()->getConfigurableAttributes($currentProduct); foreach ($allowAttributes as $attribute) { $productAttribute = $attribute->getProductAttribute(); diff --git a/app/code/Magento/Theme/Model/Theme/ThemeProvider.php b/app/code/Magento/Theme/Model/Theme/ThemeProvider.php index cd3f7f8a2dc0e..04e4c131dbcd3 100644 --- a/app/code/Magento/Theme/Model/Theme/ThemeProvider.php +++ b/app/code/Magento/Theme/Model/Theme/ThemeProvider.php @@ -93,8 +93,8 @@ public function getThemeByFullPath($fullPath) if ($theme->getId()) { $this->saveThemeToCache($theme, 'theme' . $fullPath); $this->saveThemeToCache($theme, 'theme-by-id-' . $theme->getId()); - $this->themes[$fullPath] = $theme; } + $this->themes[$fullPath] = $theme; return $theme; } @@ -167,6 +167,8 @@ private function saveThemeToCache(\Magento\Theme\Model\Theme $theme, $cacheId) } /** + * Get theme list + * * @deprecated 100.1.3 * @return ListInterface */ @@ -179,6 +181,8 @@ private function getThemeList() } /** + * Get deployment config + * * @deprecated 100.1.3 * @return DeploymentConfig */ From 8dea65ba967de572e272f700aa747867eb555fb7 Mon Sep 17 00:00:00 2001 From: Anusha Vattam <avattam@adobe.com> Date: Tue, 26 Nov 2019 16:29:01 -0600 Subject: [PATCH 270/595] MC-23217: [GraphQL] Url rewrites is invalid - Fixed the code changes from review --- .../UrlRewriteGraphQl/Model/Resolver/UrlRewrite.php | 13 +++++-------- .../Magento/GraphQl/Catalog/UrlRewritesTest.php | 13 +++++++------ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/UrlRewrite.php b/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/UrlRewrite.php index 4ec2a8c1c4cfb..053c746428c6f 100644 --- a/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/UrlRewrite.php +++ b/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/UrlRewrite.php @@ -119,11 +119,12 @@ private function getUrlParameters(string $targetPath): array { $urlParameters = []; $targetPathParts = explode('/', trim($targetPath, '/')); + $count = count($targetPathParts) - 1; //phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall - for ($i = 3; ($i < count($targetPathParts) - 1); $i += 2) { + for ($index = 3; $index < $count; $index += 2) { $urlParameters[] = [ - 'name' => $targetPathParts[$i], - 'value' => $targetPathParts[$i + 1] + 'name' => $targetPathParts[$index], + 'value' => $targetPathParts[$index + 1] ]; } return $urlParameters; @@ -139,11 +140,7 @@ private function getEntityType(string $entityTypeMetadata) : string { $entityType = ''; if ($entityTypeMetadata) { - switch ($entityTypeMetadata) { - case 'catalog_product': - $entityType = $this->allowedEntityTypes['catalog_product']; - break; - } + $entityType = $this->allowedEntityTypes[$entityTypeMetadata]; } return $entityType; } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/UrlRewritesTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/UrlRewritesTest.php index 431c22e60f4f6..0d808c6dd0696 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/UrlRewritesTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/UrlRewritesTest.php @@ -147,10 +147,10 @@ public function testProductWithOneCategoryAssigned() $this->assertCount(1, $response['products']['items'][0]['url_rewrites']); $this->assertCount($rewritesCount, $response['products']['items'][0]['url_rewrites']); - for ($i = 0; $i < $rewritesCount; $i++) { - $urlRewrite = $rewritesCollection[$i]; + for ($index = 0; $index < $rewritesCount; $index++) { + $urlRewrite = $rewritesCollection[$index]; $this->assertResponseFields( - $response['products']['items'][0]['url_rewrites'][$i], + $response['products']['items'][0]['url_rewrites'][$index], [ "url" => $urlRewrite->getRequestPath(), "parameters" => $this->getUrlParameters($urlRewrite->getTargetPath()) @@ -169,11 +169,12 @@ private function getUrlParameters(string $targetPath): array { $urlParameters = []; $targetPathParts = explode('/', trim($targetPath, '/')); + $count = count($targetPathParts) - 1; //phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall - for ($i = 3; ($i < count($targetPathParts) - 1); $i += 2) { + for ($index = 3; $index < $count; $index += 2) { $urlParameters[] = [ - 'name' => $targetPathParts[$i], - 'value' => $targetPathParts[$i + 1] + 'name' => $targetPathParts[$index], + 'value' => $targetPathParts[$index + 1] ]; } From eb13667714a5635b4196adc75e77fc080634eae4 Mon Sep 17 00:00:00 2001 From: Anusha Vattam <avattam@adobe.com> Date: Tue, 26 Nov 2019 16:41:07 -0600 Subject: [PATCH 271/595] MC-23217: [GraphQL] Url rewrites is invalid - addressed the review comments --- .../UrlRewriteGraphQl/Model/Resolver/UrlRewrite.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/UrlRewrite.php b/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/UrlRewrite.php index 053c746428c6f..9fb7127b289bb 100644 --- a/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/UrlRewrite.php +++ b/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/UrlRewrite.php @@ -30,7 +30,7 @@ class UrlRewrite implements ResolverInterface /** * @var array */ - private $allowedEntityTypes; + private $entityTypeMapping; /** * @var MetadataPool @@ -46,18 +46,18 @@ class UrlRewrite implements ResolverInterface * @param UrlFinderInterface $urlFinder * @param TypeResolver $typeResolver * @param MetadataPool $metadataPool - * @param array $allowedEntityTypes + * @param array $entityTypeMapping */ public function __construct( UrlFinderInterface $urlFinder, TypeResolver $typeResolver, MetadataPool $metadataPool, - array $allowedEntityTypes = [] + array $entityTypeMapping = [] ) { $this->urlFinder = $urlFinder; $this->typeResolver = $typeResolver; $this->metadataPool = $metadataPool; - $this->allowedEntityTypes = $allowedEntityTypes; + $this->entityTypeMapping = $entityTypeMapping; } /** @@ -140,7 +140,7 @@ private function getEntityType(string $entityTypeMetadata) : string { $entityType = ''; if ($entityTypeMetadata) { - $entityType = $this->allowedEntityTypes[$entityTypeMetadata]; + $entityType = $this->entityTypeMapping[$entityTypeMetadata]; } return $entityType; } From e2d6d58983a8a19d020dde8b2884c489d7939aef Mon Sep 17 00:00:00 2001 From: Ashna-Jahan <32352950+Ashna-Jahan@users.noreply.github.com> Date: Wed, 27 Nov 2019 11:42:33 +0530 Subject: [PATCH 272/595] Fixed Indentation Issues. --- .../web/css/source/forms/fields/_control-table.less | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less index 821ab04d8c44c..3ebb02e11ffa9 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less @@ -238,15 +238,13 @@ } } -@media only screen and (min-width: 768px) -{ - .product_form_product_form_advanced_pricing_modal .admin__fieldset > .admin__field > .admin__field-control{ +@media only screen and (min-width: 768px) { + .product_form_product_form_advanced_pricing_modal .admin__fieldset > .admin__field > .admin__field-control { min-width: 682px; - } - +} .admin__control-table-wrapper { max-width: 100% !important; overflow-x: visible !important; overflow-y: visible !important; } -} \ No newline at end of file +} From 51e17d4db5bb7dbed9829c33c5cfd07e4e073294 Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Wed, 27 Nov 2019 00:06:53 -0700 Subject: [PATCH 273/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- .../Model/Rule/ConfigurableProductHandler.php | 29 ++----------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Rule/ConfigurableProductHandler.php b/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Rule/ConfigurableProductHandler.php index d57ce702f70b8..d27c424ed9ea3 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Rule/ConfigurableProductHandler.php +++ b/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/Rule/ConfigurableProductHandler.php @@ -1,14 +1,16 @@ <?php /** + * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\CatalogRuleConfigurable\Plugin\CatalogRule\Model\Rule; +use Magento\ConfigurableProduct\Model\Product\Type\Configurable; use Magento\CatalogRuleConfigurable\Plugin\CatalogRule\Model\ConfigurableProductsProvider; /** - * Add configurable sub products to catalog rule indexer on reindex + * Add configurable sub products to catalog rule indexer on full reindex */ class ConfigurableProductHandler { @@ -40,31 +42,6 @@ public function __construct( } /** - * Add configurable products during setting product ids for filtering - * - * @param \Magento\CatalogRule\Model\Rule $rule - * @param int|array $productIds - * @return array - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function beforeSetProductsFilter(\Magento\CatalogRule\Model\Rule $rule, $productIds) - { - if ($productIds) { - $configurableProductIds = $this->configurable->getParentIdsByChild($productIds); - if ($configurableProductIds) { - $productIds = array_merge((array) $productIds, $configurableProductIds); - - } - } - - return [ - $productIds, - ]; - } - - /** - * Add configurable products for matched products - * * @param \Magento\CatalogRule\Model\Rule $rule * @param array $productIds * @return array From 4c0f128c7ccd8bf1642f1ab870b4380ab0821c41 Mon Sep 17 00:00:00 2001 From: Ashna-Jahan <32352950+Ashna-Jahan@users.noreply.github.com> Date: Wed, 27 Nov 2019 13:18:34 +0530 Subject: [PATCH 274/595] Fixed the issue with window resizing. --- .../css/source/forms/fields/_control-table.less | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less index 3ebb02e11ffa9..5b5f6682d027e 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less @@ -238,13 +238,13 @@ } } -@media only screen and (min-width: 768px) { - .product_form_product_form_advanced_pricing_modal .admin__fieldset > .admin__field > .admin__field-control { - min-width: 682px; +.product_form_product_form_advanced_pricing_modal .admin__fieldset > .admin__field > .admin__field-control { + min-width: 682px; } - .admin__control-table-wrapper { - max-width: 100% !important; - overflow-x: visible !important; - overflow-y: visible !important; - } + +.admin__control-table-wrapper { + max-width: 100% !important; + overflow-x: visible !important; + overflow-y: visible !important; } + From 2bd319ba7865fb65d57a0ffdcd4745e33b9387b0 Mon Sep 17 00:00:00 2001 From: Ashna-Jahan <32352950+Ashna-Jahan@users.noreply.github.com> Date: Wed, 27 Nov 2019 13:49:55 +0530 Subject: [PATCH 275/595] Remove the unwanted spaces. --- .../web/css/source/forms/fields/_control-table.less | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less index 5b5f6682d027e..b304ae1de4c5a 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less @@ -241,10 +241,10 @@ .product_form_product_form_advanced_pricing_modal .admin__fieldset > .admin__field > .admin__field-control { min-width: 682px; } - + .admin__control-table-wrapper { - max-width: 100% !important; - overflow-x: visible !important; - overflow-y: visible !important; + max-width: 100%; + overflow-x: visible; + overflow-y: visible; } From f34fd5cf66c9791a6943b8a540257a5b7fce578f Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Wed, 27 Nov 2019 01:53:26 -0700 Subject: [PATCH 276/595] MC-19646: [Magento Cloud] - Catalog Product Rule Indexer stuck --- app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php index 0ca9c544b74c9..1fc53c78985fb 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/IndexBuilder.php @@ -293,6 +293,7 @@ protected function doReindexByIds($ids) /** @var Rule[] $activeRules */ $activeRules = $this->getActiveRules()->getItems(); foreach ($activeRules as $rule) { + $rule->setProductsFilter($ids); $this->reindexRuleProduct->execute($rule, $this->batchCount); } From e6ea90ef32bff884a97c34b48ff5c9400fa5891f Mon Sep 17 00:00:00 2001 From: Mastiuhin Olexandr <mastiuhin.olexandr@transoftgroup.com> Date: Wed, 27 Nov 2019 11:52:37 +0200 Subject: [PATCH 277/595] MC-28956: Discounted shipping price is incorrectly displayed on multishipping review order page --- .../Test/Unit/Model/Checkout/Type/MultishippingTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Multishipping/Test/Unit/Model/Checkout/Type/MultishippingTest.php b/app/code/Magento/Multishipping/Test/Unit/Model/Checkout/Type/MultishippingTest.php index 731365974c235..fba3245bec68d 100644 --- a/app/code/Magento/Multishipping/Test/Unit/Model/Checkout/Type/MultishippingTest.php +++ b/app/code/Magento/Multishipping/Test/Unit/Model/Checkout/Type/MultishippingTest.php @@ -420,13 +420,16 @@ public function testSetShippingMethods() $methodsArray = [1 => 'flatrate_flatrate', 2 => 'tablerate_bestway']; $addressId = 1; $addressMock = $this->getMockBuilder(QuoteAddress::class) - ->setMethods(['getId', 'setShippingMethod']) + ->setMethods(['getId', 'setShippingMethod', 'setCollectShippingRates']) ->disableOriginalConstructor() ->getMock(); $addressMock->expects($this->once())->method('getId')->willReturn($addressId); $this->quoteMock->expects($this->once())->method('getAllShippingAddresses')->willReturn([$addressMock]); $addressMock->expects($this->once())->method('setShippingMethod')->with($methodsArray[$addressId]); + $addressMock->expects($this->once()) + ->method('setCollectShippingRates') + ->with(true); $this->quoteMock->expects($this->once()) ->method('__call') ->with('setTotalsCollectedFlag', [false]) From ed92b99eae3b856a46aa903f8514ac118d1d808e Mon Sep 17 00:00:00 2001 From: chorniy_andrey <mr.chornij@gmail.com> Date: Wed, 27 Nov 2019 12:30:21 +0200 Subject: [PATCH 278/595] delete code which doesn't have any sense here --- .../Catalog/view/frontend/templates/product/listing.phtml | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/listing.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/listing.phtml index b776fd4f7e193..6cebd51284f48 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/listing.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/listing.phtml @@ -16,7 +16,6 @@ */ ?> <?php -$start = microtime(true); $_productCollection = $block->getLoadedProductCollection(); $_helper = $this->helper(Magento\Catalog\Helper\Output::class); ?> @@ -98,4 +97,3 @@ $_helper = $this->helper(Magento\Catalog\Helper\Output::class); </div> <?= $block->getToolbarHtml() ?> <?php endif; ?> -<?= $time_taken = microtime(true) - $start ?> From a738307bdf9ff9153deb96569f8e3363337b15d3 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Wed, 27 Nov 2019 14:46:43 +0200 Subject: [PATCH 279/595] Refactoring Action Groups --- ...NavigateToNewRelicConfigurationActionGroup.xml | 15 +++++++++++++++ ...ToggleNewRelicReportingEnabledActionGroup.xml} | 2 +- ...nUncheckNewRelicUseSystemValueActionGroup.xml} | 2 +- ...ewRelicConfigFieldIsNotVisibleActionGroup.xml} | 2 +- ...inNewRelicConfigFieldIsVisibleActionGroup.xml} | 2 +- .../AdminChecksSystemConfigDependencyTest.xml | 10 +++++----- 6 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminNavigateToNewRelicConfigurationActionGroup.xml rename app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/{AdminTogglesEnabledConfigActionGroup.xml => AdminToggleNewRelicReportingEnabledActionGroup.xml} (88%) rename app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/{AdminUnchecksUseSystemValueActionGroup.xml => AdminUncheckNewRelicUseSystemValueActionGroup.xml} (86%) rename app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/{AssertAdminDoesntSeeConfigFieldActionGroup.xml => AssertAdminNewRelicConfigFieldIsNotVisibleActionGroup.xml} (86%) rename app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/{AssertAdminSeesConfigFieldActionGroup.xml => AssertAdminNewRelicConfigFieldIsVisibleActionGroup.xml} (87%) diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminNavigateToNewRelicConfigurationActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminNavigateToNewRelicConfigurationActionGroup.xml new file mode 100644 index 0000000000000..9e8314792b0bd --- /dev/null +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminNavigateToNewRelicConfigurationActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AdminNavigateToNewRelicConfigurationActionGroup"> + <amOnPage url="{{AdminNewRelicConfigPage.url}}" stepKey="navigateToNewRelicConfigurationPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminTogglesEnabledConfigActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminToggleNewRelicReportingEnabledActionGroup.xml similarity index 88% rename from app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminTogglesEnabledConfigActionGroup.xml rename to app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminToggleNewRelicReportingEnabledActionGroup.xml index f9632784f4a92..602484189dda4 100644 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminTogglesEnabledConfigActionGroup.xml +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminToggleNewRelicReportingEnabledActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminTogglesEnabledConfigActionGroup"> + <actionGroup name="AdminToggleNewRelicReportingEnabledActionGroup"> <arguments> <argument name="state" type="string"/> </arguments> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUnchecksUseSystemValueActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUncheckNewRelicUseSystemValueActionGroup.xml similarity index 86% rename from app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUnchecksUseSystemValueActionGroup.xml rename to app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUncheckNewRelicUseSystemValueActionGroup.xml index 7d90c1d8dd478..31c57c680b2ef 100644 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUnchecksUseSystemValueActionGroup.xml +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUncheckNewRelicUseSystemValueActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminUnchecksUseSystemValueActionGroup"> + <actionGroup name="AdminUncheckNewRelicUseSystemValueActionGroup"> <uncheckOption selector="{{AdminNewRelicConfigSystemSection.useSystemValueForEnabled}}" stepKey="uncheckCheckbox"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminDoesntSeeConfigFieldActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminNewRelicConfigFieldIsNotVisibleActionGroup.xml similarity index 86% rename from app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminDoesntSeeConfigFieldActionGroup.xml rename to app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminNewRelicConfigFieldIsNotVisibleActionGroup.xml index 6e87dbbfbbf4b..1c347512c1737 100644 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminDoesntSeeConfigFieldActionGroup.xml +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminNewRelicConfigFieldIsNotVisibleActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AssertAdminDoesntSeeConfigFieldActionGroup"> + <actionGroup name="AssertAdminNewRelicConfigFieldIsNotVisibleActionGroup"> <arguments> <argument name="config" type="string"/> </arguments> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminSeesConfigFieldActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminNewRelicConfigFieldIsVisibleActionGroup.xml similarity index 87% rename from app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminSeesConfigFieldActionGroup.xml rename to app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminNewRelicConfigFieldIsVisibleActionGroup.xml index 4df7099e50b28..fd3b3e47719c0 100644 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminSeesConfigFieldActionGroup.xml +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AssertAdminNewRelicConfigFieldIsVisibleActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AssertAdminSeesConfigFieldActionGroup"> + <actionGroup name="AssertAdminNewRelicConfigFieldIsVisibleActionGroup"> <arguments> <argument name="config" type="string"/> </arguments> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml index eabacffe9b181..676d1dcacf75f 100644 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml @@ -20,21 +20,21 @@ <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <actionGroup ref="AdminNavigateToNewRelicConfigurationActionGroup" stepKey="goToConfigPage"/> - <actionGroup ref="AdminExpandNewRelicConfigTabActionGroup" stepKey="expandGeneralTab"> + <actionGroup ref="AdminExpandNewRelicConfigTabActionGroup" stepKey="expandingGeneralTab"> <argument name="tabName" value="general"/> </actionGroup> </before> <after> <actionGroup ref="logout" stepKey="logoutOfAdmin"/> </after> - <actionGroup ref="AssertAdminDontSeeConfigFieldActionGroup" stepKey="checkIfApiUrlIsNotVisible"> + <actionGroup ref="AssertAdminNewRelicConfigFieldIsNotVisibleActionGroup" stepKey="checkingIfApiUrlIsNotVisible"> <argument name="config" value="{{AdminNewRelicConfigSystemSection.apiUrl}}"/> </actionGroup> - <actionGroup ref="AdminUnchecksUseSystemValueActionGroup" stepKey="uncheckUseSystemValue"/> - <actionGroup ref="AdminTogglesEnabledConfigActionGroup" stepKey="enableNewRelic"> + <actionGroup ref="AdminUncheckNewRelicUseSystemValueActionGroup" stepKey="uncheckUseSystemValue"/> + <actionGroup ref="AdminToggleNewRelicReportingEnabledActionGroup" stepKey="enablingNewRelicReporting"> <argument name="state" value="Yes"/> </actionGroup> - <actionGroup ref="AssertAdminSeesConfigFieldActionGroup" stepKey="checkIfApiUrlIsVisible"> + <actionGroup ref="AssertAdminNewRelicConfigFieldIsVisibleActionGroup" stepKey="checkingIfApiUrlIsVisible"> <argument name="config" value="{{AdminNewRelicConfigSystemSection.apiUrl}}"/> </actionGroup> </test> From 42a7983135d0017ed5765f3252186634b5e29dbc Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Wed, 27 Nov 2019 15:12:43 +0200 Subject: [PATCH 280/595] Giving the possibility to have a config dependency based on empty field value --- .../Config/Structure/Element/Dependency/Field.php | 2 +- .../Structure/Element/Dependency/FieldTest.php | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php b/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php index 8f4d82eed51c5..6ed9be0d10e11 100644 --- a/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php +++ b/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php @@ -41,7 +41,7 @@ public function __construct(array $fieldData = [], $fieldPrefix = "") if (isset($fieldData['separator'])) { $this->_values = explode($fieldData['separator'], $fieldData['value']); } else { - $this->_values = [$fieldData['value']]; + $this->_values = [isset($fieldData['value']) ? $fieldData['value'] : '']; } $fieldId = $fieldPrefix . (isset( $fieldData['dependPath'] diff --git a/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Element/Dependency/FieldTest.php b/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Element/Dependency/FieldTest.php index 750a829eef7ec..22cf979a9bd63 100644 --- a/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Element/Dependency/FieldTest.php +++ b/app/code/Magento/Config/Test/Unit/Model/Config/Structure/Element/Dependency/FieldTest.php @@ -12,6 +12,8 @@ class FieldTest extends \PHPUnit\Framework\TestCase */ const SIMPLE_VALUE = 'someValue'; + const EMPTY_VALUE = ''; + const COMPLEX_VALUE1 = 'value_1'; const COMPLEX_VALUE2 = 'value_2'; @@ -150,8 +152,19 @@ public function getValuesDataProvider() return [ [$this->_getSimpleData(), true, [self::SIMPLE_VALUE]], [$this->_getSimpleData(), false, [self::SIMPLE_VALUE]], + [$this->_getSimpleEmptyData(), false, [static::EMPTY_VALUE]], [$this->_getComplexData(), true, $complexDataValues], [$this->_getComplexData(), false, $complexDataValues] ]; } + + /** + * Providing a field data with no field value + * + * @return array + */ + protected function _getSimpleEmptyData(): array + { + return ['dependPath' => ['section_2', 'group_3', 'field_4']]; + } } From dd12c89adf4b5f780f7f4b6f1e93e61c494b3a79 Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Tue, 26 Nov 2019 17:29:35 -0600 Subject: [PATCH 281/595] MC-21821: Magento 2.2.8 Can't save products after updating - Fix error message not showing when there are invalid fields in advanced inventory --- .../DataProvider/Product/Form/Modifier/AdvancedInventory.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/CatalogInventory/Ui/DataProvider/Product/Form/Modifier/AdvancedInventory.php b/app/code/Magento/CatalogInventory/Ui/DataProvider/Product/Form/Modifier/AdvancedInventory.php index 22896c5e47567..aafde14a28584 100644 --- a/app/code/Magento/CatalogInventory/Ui/DataProvider/Product/Form/Modifier/AdvancedInventory.php +++ b/app/code/Magento/CatalogInventory/Ui/DataProvider/Product/Form/Modifier/AdvancedInventory.php @@ -255,6 +255,9 @@ private function prepareMeta() 'actionName' => 'toggleModal', ], ], + 'imports' => [ + 'childError' => 'product_form.product_form.advanced_inventory_modal.stock_data:error', + ], 'title' => __('Advanced Inventory'), 'provider' => false, 'additionalForGroup' => true, From a9d33f0ab89c354dd835bac6398770dd7b8f0923 Mon Sep 17 00:00:00 2001 From: Mykhailo Matiola <mykhailo.matiola@transoftgroup.com> Date: Wed, 27 Nov 2019 16:39:51 +0200 Subject: [PATCH 282/595] MC-29212: Magento\LayeredNavigation\Block\Navigation\Category\SelectFilterTest.testGetFiltersWithCustomAttribute fails on nightly builds with mysql search --- .../_files/product_dropdown_attribute.php | 67 +++++++++++++++++++ .../product_dropdown_attribute_rollback.php | 25 +++++++ .../Navigation/Category/SelectFilterTest.php | 2 +- 3 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/product_dropdown_attribute.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/product_dropdown_attribute_rollback.php diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_dropdown_attribute.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_dropdown_attribute.php new file mode 100644 index 0000000000000..ae0c1d3613380 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_dropdown_attribute.php @@ -0,0 +1,67 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\Data\ProductAttributeInterface; +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; +use Magento\Catalog\Model\ResourceModel\Eav\Attribute; +use Magento\Catalog\Setup\CategorySetup; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var $attribute Attribute */ +$attribute = $objectManager->create(Attribute::class); +/** @var ProductAttributeRepositoryInterface $attributeRepository */ +$attributeRepository = $objectManager->create(ProductAttributeRepositoryInterface::class); +/** @var $installer CategorySetup */ +$installer = $objectManager->create(CategorySetup::class); +$entityTypeId = $installer->getEntityTypeId(ProductAttributeInterface::ENTITY_TYPE_CODE); + +if (!$attribute->loadByCode($entityTypeId, 'dropdown_attribute')->getId()) { + $attribute->setData( + [ + 'attribute_code' => 'dropdown_attribute', + 'entity_type_id' => $entityTypeId, + 'is_global' => 0, + 'is_user_defined' => 1, + 'frontend_input' => 'select', + 'is_unique' => 0, + 'is_required' => 0, + 'is_searchable' => 0, + 'is_visible_in_advanced_search' => 0, + 'is_comparable' => 0, + 'is_filterable' => 0, + 'is_filterable_in_search' => 0, + 'is_used_for_promo_rules' => 0, + 'is_html_allowed_on_front' => 1, + 'is_visible_on_front' => 1, + 'used_in_product_listing' => 1, + 'used_for_sort_by' => 0, + 'frontend_label' => ['Drop-Down Attribute'], + 'backend_type' => 'int', + 'option' => [ + 'value' => [ + 'option_1' => ['Option 1'], + 'option_2' => ['Option 2'], + 'option_3' => ['Option 3'], + ], + 'order' => [ + 'option_1' => 1, + 'option_2' => 2, + 'option_3' => 3, + ], + ], + ] + ); + $attributeRepository->save($attribute); + /* Assign attribute to attribute set */ + $installer->addAttributeToGroup( + ProductAttributeInterface::ENTITY_TYPE_CODE, + 'Default', + 'Attributes', + $attribute->getId() + ); +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_dropdown_attribute_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_dropdown_attribute_rollback.php new file mode 100644 index 0000000000000..b48acc0ca0ac6 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_dropdown_attribute_rollback.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Framework\Registry; +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; + +$objectManager = Bootstrap::getObjectManager(); +$registry = $objectManager->get(Registry::class); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); +/** @var ProductAttributeRepositoryInterface $attributeRepository */ +$attributeRepository = $objectManager->create(ProductAttributeRepositoryInterface::class); + +try { + $attributeRepository->deleteById('dropdown_attribute'); +} catch (NoSuchEntityException $e) { +} +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/SelectFilterTest.php b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/SelectFilterTest.php index c0677bbc6b72b..76217e9683993 100644 --- a/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/SelectFilterTest.php +++ b/dev/tests/integration/testsuite/Magento/LayeredNavigation/Block/Navigation/Category/SelectFilterTest.php @@ -19,7 +19,7 @@ class SelectFilterTest extends AbstractFiltersTest { /** - * @magentoDataFixture Magento/Catalog/_files/dropdown_attribute.php + * @magentoDataFixture Magento/Catalog/_files/product_dropdown_attribute.php * @magentoDataFixture Magento/Catalog/_files/category_with_different_price_products.php * @dataProvider getFiltersWithCustomAttributeDataProvider * @param array $products From fa123f4d201318518cffd7b4998c2a789f985119 Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Wed, 27 Nov 2019 09:44:33 -0600 Subject: [PATCH 283/595] MC-23091: Performance improvements on configurable product - fixing static --- .../Model/Resolver/Variant/Attributes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/Variant/Attributes.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/Variant/Attributes.php index db31723183d78..faf666144422c 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/Variant/Attributes.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/Variant/Attributes.php @@ -96,7 +96,7 @@ private function getOptionsFromMap(array $optionMap, string $code, int $optionId * @param string $code * @return array */ - private function getOptionsArray(array $optionValue, string $code) + private function getOptionsArray(array $optionValue, string $code): array { return [ 'label' => $optionValue['label'] ?? null, From bad59fd91b87711891d46521d28b1a1ce49f36fa Mon Sep 17 00:00:00 2001 From: Anusha Vattam <avattam@adobe.com> Date: Wed, 27 Nov 2019 12:25:02 -0600 Subject: [PATCH 284/595] MC-23217: [GraphQL] Url rewrites is invalid - addressed the missing name chznge in di.xml --- app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml b/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml index 624b27eff6478..8724972e71b17 100644 --- a/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml @@ -25,7 +25,7 @@ <type name="Magento\UrlRewriteGraphQl\Model\Resolver\UrlRewrite"> <arguments> - <argument name="allowedEntityTypes" xsi:type="array"> + <argument name="entityTypeMapping" xsi:type="array"> <item name="catalog_product" xsi:type="const">Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator::ENTITY_TYPE</item> </argument> </arguments> From 05294b54282e16a774cf6bfd39bad18f2e60c6aa Mon Sep 17 00:00:00 2001 From: Anusha Vattam <avattam@adobe.com> Date: Wed, 27 Nov 2019 12:32:20 -0600 Subject: [PATCH 285/595] MC-23217: [GraphQL] Url rewrites is invalid - addressed the missing name chznge in di.xml and resolver --- app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml | 2 +- .../Magento/UrlRewriteGraphQl/Model/Resolver/UrlRewrite.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml b/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml index 624b27eff6478..8724972e71b17 100644 --- a/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/etc/di.xml @@ -25,7 +25,7 @@ <type name="Magento\UrlRewriteGraphQl\Model\Resolver\UrlRewrite"> <arguments> - <argument name="allowedEntityTypes" xsi:type="array"> + <argument name="entityTypeMapping" xsi:type="array"> <item name="catalog_product" xsi:type="const">Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator::ENTITY_TYPE</item> </argument> </arguments> diff --git a/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/UrlRewrite.php b/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/UrlRewrite.php index 9fb7127b289bb..55cd505928f42 100644 --- a/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/UrlRewrite.php +++ b/app/code/Magento/UrlRewriteGraphQl/Model/Resolver/UrlRewrite.php @@ -120,6 +120,9 @@ private function getUrlParameters(string $targetPath): array $urlParameters = []; $targetPathParts = explode('/', trim($targetPath, '/')); $count = count($targetPathParts) - 1; + + /** $index starts from 3 to eliminate catalog/product/view/ part and fetch only name, + value data from from target path */ //phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall for ($index = 3; $index < $count; $index += 2) { $urlParameters[] = [ From 9a3d147d9947e83a9af80453acdcf07207449076 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Wed, 27 Nov 2019 22:10:39 +0200 Subject: [PATCH 286/595] Refactoring the test coverage --- .../AdminExpandConfigSectionActionGroup.xml | 22 +++++++++++++++++++ .../Test/Mftf/Section/AdminConfigSection.xml | 3 +++ ...dminExpandNewRelicConfigTabActionGroup.xml | 17 -------------- ...checkNewRelicUseSystemValueActionGroup.xml | 8 +++++-- .../AdminNewRelicConfigSystemSection.xml | 3 +-- ...eckNewRelicSystemConfigDependencyTest.xml} | 12 +++++----- 6 files changed, 39 insertions(+), 26 deletions(-) create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/AdminExpandConfigSectionActionGroup.xml delete mode 100644 app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminExpandNewRelicConfigTabActionGroup.xml rename app/code/Magento/NewRelicReporting/Test/Mftf/Test/{AdminChecksSystemConfigDependencyTest.xml => AdminCheckNewRelicSystemConfigDependencyTest.xml} (78%) diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/AdminExpandConfigSectionActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/AdminExpandConfigSectionActionGroup.xml new file mode 100644 index 0000000000000..03a3a45ef0947 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/AdminExpandConfigSectionActionGroup.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="AdminExpandConfigSectionActionGroup"> + <annotations> + <description>Expands configuration section passed via argument as Section Name.</description> + </annotations> + <arguments> + <argument name="sectionName" type="string"/> + </arguments> + + <conditionalClick selector="{{AdminConfigSection.collapsibleSectionByTitle(sectionName)}}" dependentSelector="{{AdminConfigSection.expandedSectionByTitle(sectionName)}}" visible="false" stepKey="expandSection" /> + <waitForElement selector="{{AdminConfigSection.expandedSectionByTitle(sectionName)}}" stepKey="waitOpenedSection"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/Section/AdminConfigSection.xml b/app/code/Magento/Config/Test/Mftf/Section/AdminConfigSection.xml index ffe3f0076ca8d..3bad136935734 100644 --- a/app/code/Magento/Config/Test/Mftf/Section/AdminConfigSection.xml +++ b/app/code/Magento/Config/Test/Mftf/Section/AdminConfigSection.xml @@ -19,5 +19,8 @@ <element name="defaultConfigButton" type="button" selector="#store-change-button" timeout="30"/> <element name="defaultConfigDropdown" type="button" selector="//ul[@class='dropdown-menu']" timeout="30"/> <element name="fieldError" type="text" selector="label.mage-error"/> + <element name="useSystemValue" type="checkbox" selector="#{{element}} > .use-default > input" parameterized="true"/> + <element name="collapsibleSectionByTitle" type="text" selector="//form[@id='config-edit-form']//div[@class='section-config'][contains(.,'{{sectionTitle}}')]" parameterized="true" /> + <element name="expandedSectionByTitle" type="text" selector="//form[@id='config-edit-form']//div[@class='section-config active'][contains(.,'{{sectionTitle}}')]" parameterized="true" /> </section> </sections> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminExpandNewRelicConfigTabActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminExpandNewRelicConfigTabActionGroup.xml deleted file mode 100644 index 4dc3d2ea8ea34..0000000000000 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminExpandNewRelicConfigTabActionGroup.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="AdminExpandNewRelicConfigTabActionGroup"> - <arguments> - <argument name="tabName" type="string"/> - </arguments> - <conditionalClick selector="{{AdminNewRelicConfigSystemSection.tab(tabName)}}" dependentSelector="{{AdminNewRelicConfigSystemSection.status}}" visible="false" stepKey="expandTab"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUncheckNewRelicUseSystemValueActionGroup.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUncheckNewRelicUseSystemValueActionGroup.xml index 31c57c680b2ef..41f18f0f90d8d 100644 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUncheckNewRelicUseSystemValueActionGroup.xml +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/ActionGroup/AdminUncheckNewRelicUseSystemValueActionGroup.xml @@ -8,7 +8,11 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminUncheckNewRelicUseSystemValueActionGroup"> - <uncheckOption selector="{{AdminNewRelicConfigSystemSection.useSystemValueForEnabled}}" stepKey="uncheckCheckbox"/> + <actionGroup name="AdminUncheckUseSystemValueActionGroup"> + <arguments> + <argument name="rowId" type="string"/> + </arguments> + + <uncheckOption selector="{{AdminConfigSection.useSystemValue(rowId)}}" stepKey="uncheckCheckbox"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml index 79625273b988e..8cecf62999bc3 100644 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml @@ -9,9 +9,8 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminNewRelicConfigSystemSection"> - <element name="tab" type="button" selector="#newrelicreporting_{{tab}}-head" parameterized="true"/> + <element name="statusRowId" type="text" selector="#row_newrelicreporting_general_enable"/> <element name="status" type="select" selector="#row_newrelicreporting_general_enable [data-ui-id='select-groups-general-fields-enable-value']"/> - <element name="useSystemValueForEnabled" type="checkbox" selector="#newrelicreporting_general_enable_inherit"/> <element name="apiUrl" type="select" selector="input#newrelicreporting_general_api_url"/> </section> </sections> diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminCheckNewRelicSystemConfigDependencyTest.xml similarity index 78% rename from app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml rename to app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminCheckNewRelicSystemConfigDependencyTest.xml index 676d1dcacf75f..c343f93de2c58 100644 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminChecksSystemConfigDependencyTest.xml +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/Test/AdminCheckNewRelicSystemConfigDependencyTest.xml @@ -8,20 +8,20 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminChecksSystemConfigDependencyTest"> + <test name="AdminCheckNewRelicSystemConfigDependencyTest"> <annotations> <features value="NewRelicReporting"/> <stories value="Admin is able to see the configuration fields only after enabling the feature"/> <title value="Admin can see the configuration fields only after enabling the feature"/> <description value="The system configs should be available only after enabling the New Relic feature."/> - <severity value="CRITICAL"/> + <severity value="MINOR"/> <group value="NewRelicReporting"/> </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <actionGroup ref="AdminNavigateToNewRelicConfigurationActionGroup" stepKey="goToConfigPage"/> - <actionGroup ref="AdminExpandNewRelicConfigTabActionGroup" stepKey="expandingGeneralTab"> - <argument name="tabName" value="general"/> + <actionGroup ref="AdminExpandConfigSectionActionGroup" stepKey="expandingGeneralSection"> + <argument name="sectionName" value="General"/> </actionGroup> </before> <after> @@ -30,7 +30,9 @@ <actionGroup ref="AssertAdminNewRelicConfigFieldIsNotVisibleActionGroup" stepKey="checkingIfApiUrlIsNotVisible"> <argument name="config" value="{{AdminNewRelicConfigSystemSection.apiUrl}}"/> </actionGroup> - <actionGroup ref="AdminUncheckNewRelicUseSystemValueActionGroup" stepKey="uncheckUseSystemValue"/> + <actionGroup ref="AdminUncheckUseSystemValueActionGroup" stepKey="uncheckUseSystemValue"> + <argument name="rowId" value="row_newrelicreporting_general_enable"/> + </actionGroup> <actionGroup ref="AdminToggleNewRelicReportingEnabledActionGroup" stepKey="enablingNewRelicReporting"> <argument name="state" value="Yes"/> </actionGroup> From d504f549ba789758a6ce271b23e63ab058611043 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Wed, 27 Nov 2019 22:12:39 +0200 Subject: [PATCH 287/595] Refactoring the test coverage --- .../Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml b/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml index 8cecf62999bc3..5bf849cd0134e 100644 --- a/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml +++ b/app/code/Magento/NewRelicReporting/Test/Mftf/Section/AdminNewRelicConfigSystemSection.xml @@ -9,8 +9,7 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminNewRelicConfigSystemSection"> - <element name="statusRowId" type="text" selector="#row_newrelicreporting_general_enable"/> <element name="status" type="select" selector="#row_newrelicreporting_general_enable [data-ui-id='select-groups-general-fields-enable-value']"/> - <element name="apiUrl" type="select" selector="input#newrelicreporting_general_api_url"/> + <element name="apiUrl" type="input" selector="input#newrelicreporting_general_api_url"/> </section> </sections> From f78f0c1da3f770d2fc2128b5ec846bfadb1509e8 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Wed, 27 Nov 2019 22:23:25 +0200 Subject: [PATCH 288/595] Renaming the selector --- .../Magento/Config/Test/Mftf/Section/AdminConfigSection.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Config/Test/Mftf/Section/AdminConfigSection.xml b/app/code/Magento/Config/Test/Mftf/Section/AdminConfigSection.xml index 3bad136935734..a4fb3c7e32975 100644 --- a/app/code/Magento/Config/Test/Mftf/Section/AdminConfigSection.xml +++ b/app/code/Magento/Config/Test/Mftf/Section/AdminConfigSection.xml @@ -19,7 +19,7 @@ <element name="defaultConfigButton" type="button" selector="#store-change-button" timeout="30"/> <element name="defaultConfigDropdown" type="button" selector="//ul[@class='dropdown-menu']" timeout="30"/> <element name="fieldError" type="text" selector="label.mage-error"/> - <element name="useSystemValue" type="checkbox" selector="#{{element}} > .use-default > input" parameterized="true"/> + <element name="useSystemValue" type="checkbox" selector="#{{configRowId}} > .use-default > input" parameterized="true"/> <element name="collapsibleSectionByTitle" type="text" selector="//form[@id='config-edit-form']//div[@class='section-config'][contains(.,'{{sectionTitle}}')]" parameterized="true" /> <element name="expandedSectionByTitle" type="text" selector="//form[@id='config-edit-form']//div[@class='section-config active'][contains(.,'{{sectionTitle}}')]" parameterized="true" /> </section> From e695e09b98621ed5d8b593f079299d8e5cdefc40 Mon Sep 17 00:00:00 2001 From: Iryna Lagno <ilagno@adobe.com> Date: Wed, 27 Nov 2019 14:18:22 -0600 Subject: [PATCH 289/595] MC-17545: Remove deprecation annotations from the PatchVersionInterface --- .../Magento/Framework/Setup/Patch/PatchVersionInterface.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/internal/Magento/Framework/Setup/Patch/PatchVersionInterface.php b/lib/internal/Magento/Framework/Setup/Patch/PatchVersionInterface.php index 1638d67041a11..c1f4439d692a4 100644 --- a/lib/internal/Magento/Framework/Setup/Patch/PatchVersionInterface.php +++ b/lib/internal/Magento/Framework/Setup/Patch/PatchVersionInterface.php @@ -7,6 +7,8 @@ /** * For backward compatibility with versioned style module installation. + * The interface should be used for migration from the legacy installation approach to the declarative installation + * mechanism. The usage of this interface prohibited for the new data or schema patches. * */ interface PatchVersionInterface From d3f5c94a9582f3cce62e56affa18b3886b634e6b Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Wed, 27 Nov 2019 16:30:56 -0600 Subject: [PATCH 290/595] MC-29033: admin catalog can't load css in the cloud --- .../Framework/View/Asset/Minification.php | 49 ++++++++++++++++- .../MinificationFilenameResolver.php | 54 +++++++++++++++++-- .../View/Asset/PreProcessor/Minify.php | 48 +++++++++++++++-- 3 files changed, 141 insertions(+), 10 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Asset/Minification.php b/lib/internal/Magento/Framework/View/Asset/Minification.php index 087d57ffa4162..40ac4dd1f3ba3 100644 --- a/lib/internal/Magento/Framework/View/Asset/Minification.php +++ b/lib/internal/Magento/Framework/View/Asset/Minification.php @@ -83,7 +83,7 @@ public function addMinifiedSign($filename) { $extension = pathinfo($filename, PATHINFO_EXTENSION); - if ($this->isEnabled($extension) && + if ($this->isEnabledForArea($filename) && !$this->isExcluded($filename) && !$this->isMinifiedFilename($filename) ) { @@ -102,7 +102,7 @@ public function removeMinifiedSign($filename) { $extension = pathinfo($filename, PATHINFO_EXTENSION); - if ($this->isEnabled($extension) && + if ($this->isEnabledForArea($filename) && !$this->isExcluded($filename) && $this->isMinifiedFilename($filename) ) { @@ -180,4 +180,49 @@ private function getMinificationExcludeValues($key) } return array_values($configValues); } + + /** + * Check whether asset minification is on for specified content type and for area + * + * @param string $filename + * @return bool + */ + private function isEnabledForArea(string $filename): bool + { + $area = $this->getAreaFromPath($filename); + $extension = pathinfo($filename, PATHINFO_EXTENSION); + + if ($area !== 'adminhtml') { + $result = $this->isEnabled($extension); + } else { + $cacheConfigKey = $area . '_' . $extension; + if (!isset($this->configCache[self::XML_PATH_MINIFICATION_ENABLED][$cacheConfigKey])) { + $this->configCache[self::XML_PATH_MINIFICATION_ENABLED][$cacheConfigKey] = + $this->appState->getMode() != State::MODE_DEVELOPER && + $this->scopeConfig->isSetFlag( + sprintf(self::XML_PATH_MINIFICATION_ENABLED, $extension), + 'default' + ); + } + + $result = $this->configCache[self::XML_PATH_MINIFICATION_ENABLED][$cacheConfigKey]; + } + return $result; + } + + /** + * Get area from the path + * + * @param string $filename + * @return string + */ + private function getAreaFromPath(string $filename): string + { + $area = ''; + $pathParts = explode('/', $filename); + if (!empty($pathParts) && isset($pathParts[0])) { + $area = $pathParts[0]; + } + return $area; + } } diff --git a/lib/internal/Magento/Framework/View/Asset/PreProcessor/MinificationFilenameResolver.php b/lib/internal/Magento/Framework/View/Asset/PreProcessor/MinificationFilenameResolver.php index 313f2daa80bcd..a6d7b3de00104 100644 --- a/lib/internal/Magento/Framework/View/Asset/PreProcessor/MinificationFilenameResolver.php +++ b/lib/internal/Magento/Framework/View/Asset/PreProcessor/MinificationFilenameResolver.php @@ -6,6 +6,8 @@ namespace Magento\Framework\View\Asset\PreProcessor; use Magento\Framework\View\Asset\Minification; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\State; /** * Class MinificationFilenameResolver @@ -22,14 +24,31 @@ class MinificationFilenameResolver implements FilenameResolverInterface */ private $minification; + /** + * @var State + */ + private $appState; + + /** + * @var ScopeConfigInterface + */ + private $scopeConfig; + /** * Constructor * * @param Minification $minification + * @param ScopeConfigInterface $scopeConfig + * @param State $appState */ - public function __construct(Minification $minification) - { + public function __construct( + Minification $minification, + ScopeConfigInterface $scopeConfig, + State $appState + ) { $this->minification = $minification; + $this->scopeConfig = $scopeConfig; + $this->appState = $appState; } /** @@ -40,10 +59,35 @@ public function __construct(Minification $minification) */ public function resolve($path) { - if (!$this->minification->isEnabled(pathinfo($path, PATHINFO_EXTENSION))) { - return $path; + $result = $path; + if ($this->isEnabledForArea($path)) { + $result = str_replace(self::FILE_PART, '.', $path); } - return str_replace(self::FILE_PART, '.', $path); + return $result; + } + + /** + * Check whether asset minification is on for specified content type and for area + * + * @param string $filename + * @return bool + */ + private function isEnabledForArea(string $filename): bool + { + $extension = pathinfo($filename, PATHINFO_EXTENSION); + $result = $this->minification->isEnabled($extension); + $pathParts = explode('/', $filename); + if (!empty($pathParts) && isset($pathParts[0])) { + $area = $pathParts[0]; + if ($area === 'adminhtml') { + $result = $this->appState->getMode() != State::MODE_DEVELOPER && + $this->scopeConfig->isSetFlag( + sprintf(Minification::XML_PATH_MINIFICATION_ENABLED, $extension), + 'default' + ); + } + } + return $result; } } diff --git a/lib/internal/Magento/Framework/View/Asset/PreProcessor/Minify.php b/lib/internal/Magento/Framework/View/Asset/PreProcessor/Minify.php index c447285bc692b..4cf5b0cc8c70c 100644 --- a/lib/internal/Magento/Framework/View/Asset/PreProcessor/Minify.php +++ b/lib/internal/Magento/Framework/View/Asset/PreProcessor/Minify.php @@ -9,6 +9,8 @@ use Magento\Framework\View\Asset\Minification; use Magento\Framework\View\Asset\PreProcessor; use Magento\Framework\View\Asset\PreProcessorInterface; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\State; /** * Assets minification pre-processor @@ -25,14 +27,30 @@ class Minify implements PreProcessorInterface */ protected $minification; + /** + * @var State + */ + private $appState; + + /** + * @var ScopeConfigInterface + */ + private $scopeConfig; + /** * @param AdapterInterface $adapter * @param Minification $minification */ - public function __construct(AdapterInterface $adapter, Minification $minification) - { + public function __construct( + AdapterInterface $adapter, + Minification $minification, + ScopeConfigInterface $scopeConfig, + State $appState + ) { $this->adapter = $adapter; $this->minification = $minification; + $this->scopeConfig = $scopeConfig; + $this->appState = $appState; } /** @@ -43,7 +61,7 @@ public function __construct(AdapterInterface $adapter, Minification $minificatio */ public function process(PreProcessor\Chain $chain) { - if ($this->minification->isEnabled(pathinfo($chain->getTargetAssetPath(), PATHINFO_EXTENSION)) && + if ($this->isEnabledForArea($chain->getTargetAssetPath()) && $this->minification->isMinifiedFilename($chain->getTargetAssetPath()) && !$this->minification->isMinifiedFilename($chain->getOrigAssetPath()) ) { @@ -51,4 +69,28 @@ public function process(PreProcessor\Chain $chain) $chain->setContent($content); } } + + /** + * Check whether asset minification is on for specified content type and for area + * + * @param string $filename + * @return bool + */ + private function isEnabledForArea(string $filename): bool + { + $extension = pathinfo($filename, PATHINFO_EXTENSION); + $result = $this->minification->isEnabled($extension); + $pathParts = explode('/', $filename); + if (!empty($pathParts) && isset($pathParts[0])) { + $area = $pathParts[0]; + if ($area === 'adminhtml') { + $result = $this->appState->getMode() != State::MODE_DEVELOPER && + $this->scopeConfig->isSetFlag( + sprintf(Minification::XML_PATH_MINIFICATION_ENABLED, $extension), + 'default' + ); + } + } + return $result; + } } From efa91afa14117efcbef33e880243177ba7841994 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Wed, 27 Nov 2019 17:21:56 -0600 Subject: [PATCH 291/595] MC-29033: admin catalog can't load css in the cloud --- .../MinificationConfigProvider.php | 72 +++++++++++++++++++ .../MinificationFilenameResolver.php | 46 ++---------- .../View/Asset/PreProcessor/Minify.php | 44 ++---------- .../MinificationFilenameResolverTest.php | 13 ++-- .../Unit/Asset/PreProcessor/MinifyTest.php | 18 +++-- 5 files changed, 106 insertions(+), 87 deletions(-) create mode 100644 lib/internal/Magento/Framework/View/Asset/PreProcessor/MinificationConfigProvider.php diff --git a/lib/internal/Magento/Framework/View/Asset/PreProcessor/MinificationConfigProvider.php b/lib/internal/Magento/Framework/View/Asset/PreProcessor/MinificationConfigProvider.php new file mode 100644 index 0000000000000..c779e84a5a51c --- /dev/null +++ b/lib/internal/Magento/Framework/View/Asset/PreProcessor/MinificationConfigProvider.php @@ -0,0 +1,72 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare (strict_types=1); + +namespace Magento\Framework\View\Asset\PreProcessor; + +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\State; +use Magento\Framework\View\Asset\Minification; + +/** + * Minification configuration provider + */ +class MinificationConfigProvider +{ + /** + * @var Minification + */ + private $minification; + + /** + * @var State + */ + private $appState; + + /** + * @var ScopeConfigInterface + */ + private $scopeConfig; + + /** + * @param Minification $minification + * @param ScopeConfigInterface $scopeConfig + * @param State $appState + */ + public function __construct( + Minification $minification, + ScopeConfigInterface $scopeConfig, + State $appState + ) { + $this->minification = $minification; + $this->scopeConfig = $scopeConfig; + $this->appState = $appState; + } + + /** + * Check whether asset minification is on + * + * @param string $filename + * @return bool + */ + public function isMinificationEnabled(string $filename): bool + { + $extension = pathinfo($filename, PATHINFO_EXTENSION); + $result = $this->minification->isEnabled($extension); + $pathParts = explode('/', $filename); + if (!empty($pathParts) && isset($pathParts[0])) { + $area = $pathParts[0]; + if ($area === 'adminhtml') { + $result = $this->appState->getMode() != State::MODE_DEVELOPER && + $this->scopeConfig->isSetFlag( + sprintf(Minification::XML_PATH_MINIFICATION_ENABLED, $extension), + 'default' + ); + } + } + return $result; + } +} diff --git a/lib/internal/Magento/Framework/View/Asset/PreProcessor/MinificationFilenameResolver.php b/lib/internal/Magento/Framework/View/Asset/PreProcessor/MinificationFilenameResolver.php index a6d7b3de00104..6a2e953a4c22d 100644 --- a/lib/internal/Magento/Framework/View/Asset/PreProcessor/MinificationFilenameResolver.php +++ b/lib/internal/Magento/Framework/View/Asset/PreProcessor/MinificationFilenameResolver.php @@ -6,8 +6,6 @@ namespace Magento\Framework\View\Asset\PreProcessor; use Magento\Framework\View\Asset\Minification; -use Magento\Framework\App\Config\ScopeConfigInterface; -use Magento\Framework\App\State; /** * Class MinificationFilenameResolver @@ -25,30 +23,22 @@ class MinificationFilenameResolver implements FilenameResolverInterface private $minification; /** - * @var State + * @var MinificationConfigProvider */ - private $appState; - - /** - * @var ScopeConfigInterface - */ - private $scopeConfig; + private $minificationConfig; /** * Constructor * * @param Minification $minification - * @param ScopeConfigInterface $scopeConfig - * @param State $appState + * @param MinificationConfigProvider $minificationConfig */ public function __construct( Minification $minification, - ScopeConfigInterface $scopeConfig, - State $appState + MinificationConfigProvider $minificationConfig ) { $this->minification = $minification; - $this->scopeConfig = $scopeConfig; - $this->appState = $appState; + $this->minificationConfig = $minificationConfig; } /** @@ -60,34 +50,10 @@ public function __construct( public function resolve($path) { $result = $path; - if ($this->isEnabledForArea($path)) { + if ($this->minificationConfig->isMinificationEnabled($path)) { $result = str_replace(self::FILE_PART, '.', $path); } return $result; } - - /** - * Check whether asset minification is on for specified content type and for area - * - * @param string $filename - * @return bool - */ - private function isEnabledForArea(string $filename): bool - { - $extension = pathinfo($filename, PATHINFO_EXTENSION); - $result = $this->minification->isEnabled($extension); - $pathParts = explode('/', $filename); - if (!empty($pathParts) && isset($pathParts[0])) { - $area = $pathParts[0]; - if ($area === 'adminhtml') { - $result = $this->appState->getMode() != State::MODE_DEVELOPER && - $this->scopeConfig->isSetFlag( - sprintf(Minification::XML_PATH_MINIFICATION_ENABLED, $extension), - 'default' - ); - } - } - return $result; - } } diff --git a/lib/internal/Magento/Framework/View/Asset/PreProcessor/Minify.php b/lib/internal/Magento/Framework/View/Asset/PreProcessor/Minify.php index 4cf5b0cc8c70c..3fa26b794c524 100644 --- a/lib/internal/Magento/Framework/View/Asset/PreProcessor/Minify.php +++ b/lib/internal/Magento/Framework/View/Asset/PreProcessor/Minify.php @@ -9,8 +9,6 @@ use Magento\Framework\View\Asset\Minification; use Magento\Framework\View\Asset\PreProcessor; use Magento\Framework\View\Asset\PreProcessorInterface; -use Magento\Framework\App\Config\ScopeConfigInterface; -use Magento\Framework\App\State; /** * Assets minification pre-processor @@ -28,29 +26,23 @@ class Minify implements PreProcessorInterface protected $minification; /** - * @var State + * @var MinificationConfigProvider */ - private $appState; - - /** - * @var ScopeConfigInterface - */ - private $scopeConfig; + private $minificationConfig; /** * @param AdapterInterface $adapter * @param Minification $minification + * @param MinificationConfigProvider $minificationConfig */ public function __construct( AdapterInterface $adapter, Minification $minification, - ScopeConfigInterface $scopeConfig, - State $appState + MinificationConfigProvider $minificationConfig ) { $this->adapter = $adapter; $this->minification = $minification; - $this->scopeConfig = $scopeConfig; - $this->appState = $appState; + $this->minificationConfig = $minificationConfig; } /** @@ -61,7 +53,7 @@ public function __construct( */ public function process(PreProcessor\Chain $chain) { - if ($this->isEnabledForArea($chain->getTargetAssetPath()) && + if ($this->minificationConfig->isMinificationEnabled($chain->getTargetAssetPath()) && $this->minification->isMinifiedFilename($chain->getTargetAssetPath()) && !$this->minification->isMinifiedFilename($chain->getOrigAssetPath()) ) { @@ -69,28 +61,4 @@ public function process(PreProcessor\Chain $chain) $chain->setContent($content); } } - - /** - * Check whether asset minification is on for specified content type and for area - * - * @param string $filename - * @return bool - */ - private function isEnabledForArea(string $filename): bool - { - $extension = pathinfo($filename, PATHINFO_EXTENSION); - $result = $this->minification->isEnabled($extension); - $pathParts = explode('/', $filename); - if (!empty($pathParts) && isset($pathParts[0])) { - $area = $pathParts[0]; - if ($area === 'adminhtml') { - $result = $this->appState->getMode() != State::MODE_DEVELOPER && - $this->scopeConfig->isSetFlag( - sprintf(Minification::XML_PATH_MINIFICATION_ENABLED, $extension), - 'default' - ); - } - } - return $result; - } } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/MinificationFilenameResolverTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/MinificationFilenameResolverTest.php index bcd1d03a629ce..c398aa502bb5b 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/MinificationFilenameResolverTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/MinificationFilenameResolverTest.php @@ -7,6 +7,7 @@ use Magento\Framework\View\Asset\Minification; use Magento\Framework\View\Asset\PreProcessor\MinificationFilenameResolver; +use Magento\Framework\View\Asset\PreProcessor\MinificationConfigProvider; /** * Class MinificationFilenameResolverTest @@ -29,13 +30,15 @@ public function testResolve($isMin, $input, $expected) $minificationMock = $this->getMockBuilder(Minification::class) ->disableOriginalConstructor() ->getMock(); - - $minificationMock->expects(self::once()) - ->method('isEnabled') - ->with('ext') + $minificationConfigMock = $this->getMockBuilder(MinificationConfigProvider::class) + ->disableOriginalConstructor() + ->getMock(); + $minificationConfigMock->expects(self::once()) + ->method('isMinificationEnabled') + ->with($input) ->willReturn($isMin); - $resolver = new MinificationFilenameResolver($minificationMock); + $resolver = new MinificationFilenameResolver($minificationMock, $minificationConfigMock); self::assertEquals($expected, $resolver->resolve($input)); } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/MinifyTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/MinifyTest.php index 51ad9886d87a8..a46df9f27e19b 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/MinifyTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/PreProcessor/MinifyTest.php @@ -7,6 +7,7 @@ namespace Magento\Framework\View\Test\Unit\Asset\PreProcessor; use Magento\Framework\View\Asset\PreProcessor\Minify; +use Magento\Framework\View\Asset\PreProcessor\MinificationConfigProvider; /** * Unit test for Magento\Framework\View\Asset\PreProcessor\Minify @@ -28,6 +29,11 @@ class MinifyTest extends \PHPUnit\Framework\TestCase */ protected $minificationMock; + /** + * @var MinificationConfigProvider|\PHPUnit_Framework_MockObject_MockObject + */ + private $minificationConfigMock; + /** * {@inheritDoc} */ @@ -40,10 +46,14 @@ protected function setUp() $this->minificationMock = $this->getMockBuilder(\Magento\Framework\View\Asset\Minification::class) ->disableOriginalConstructor() ->getMock(); + $this->minificationConfigMock = $this->getMockBuilder(MinificationConfigProvider::class) + ->disableOriginalConstructor() + ->getMock(); $this->minify = new Minify( $this->adapterMock, - $this->minificationMock + $this->minificationMock, + $this->minificationConfigMock ); } @@ -84,10 +94,10 @@ public function testProcess($targetPath, $originalPath, $minifyCalls, $setConten ->with('original content') ->willReturn('minified content'); - $this->minificationMock + $this->minificationConfigMock ->expects($this->any()) - ->method('isEnabled') - ->willReturnMap([['css', $isEnabled]]); + ->method('isMinificationEnabled') + ->willReturnMap([[$targetPath, $isEnabled]]); $this->minificationMock ->expects($this->any()) From 4697d936287d368d9beb258c6c58bc868b13cd93 Mon Sep 17 00:00:00 2001 From: Subash Natarajan <subash.natarajan@ziffity.com> Date: Thu, 28 Nov 2019 14:27:34 +0530 Subject: [PATCH 292/595] Fixed the usage of deprecated methods of Messagemanager --- .../Magento/Customer/Controller/Account/Confirm.php | 2 +- .../Customer/Controller/Account/CreatePost.php | 12 ++++++------ .../Magento/Customer/Controller/Account/EditPost.php | 6 +++--- .../Customer/Controller/Account/LoginPost.php | 6 +++--- .../Controller/Account/ResetPasswordPost.php | 12 ++++++------ .../Magento/Customer/Controller/Address/Delete.php | 4 ++-- .../Adminhtml/Customer/InvalidateToken.php | 6 +++--- .../Customer/Controller/Adminhtml/Group/Delete.php | 6 +++--- .../Customer/Controller/Adminhtml/Group/Save.php | 4 ++-- .../Adminhtml/Index/AbstractMassAction.php | 2 +- .../Customer/Controller/Adminhtml/Index/Delete.php | 6 +++--- .../Customer/Observer/AfterAddressSaveObserver.php | 6 +++--- .../Test/Unit/Controller/Account/ConfirmTest.php | 4 ++-- .../Test/Unit/Controller/Account/CreatePostTest.php | 4 ++-- .../Test/Unit/Controller/Account/LoginPostTest.php | 10 +++++----- .../Test/Unit/Controller/Address/DeleteTest.php | 4 ++-- .../Unit/Controller/Adminhtml/Group/SaveTest.php | 4 ++-- .../Controller/Adminhtml/Index/InlineEditTest.php | 4 ++-- .../Adminhtml/Index/MassAssignGroupTest.php | 2 +- .../Controller/Adminhtml/Index/MassDeleteTest.php | 2 +- .../Controller/Adminhtml/Index/MassSubscribeTest.php | 2 +- .../Adminhtml/Index/MassUnsubscribeTest.php | 2 +- .../Unit/Observer/AfterAddressSaveObserverTest.php | 6 +++--- 23 files changed, 58 insertions(+), 58 deletions(-) diff --git a/app/code/Magento/Customer/Controller/Account/Confirm.php b/app/code/Magento/Customer/Controller/Account/Confirm.php index adca90c5e5f24..3aa08cfbf847e 100644 --- a/app/code/Magento/Customer/Controller/Account/Confirm.php +++ b/app/code/Magento/Customer/Controller/Account/Confirm.php @@ -168,7 +168,7 @@ public function execute() $metadata->setPath('/'); $this->getCookieManager()->deleteCookie('mage-cache-sessid', $metadata); } - $this->messageManager->addSuccess($this->getSuccessMessage()); + $this->messageManager->addSuccessMessage($this->getSuccessMessage()); $resultRedirect->setUrl($this->getSuccessRedirect()); return $resultRedirect; } catch (StateException $e) { diff --git a/app/code/Magento/Customer/Controller/Account/CreatePost.php b/app/code/Magento/Customer/Controller/Account/CreatePost.php index a2be0f68b56cb..ebece9ef5a4a0 100644 --- a/app/code/Magento/Customer/Controller/Account/CreatePost.php +++ b/app/code/Magento/Customer/Controller/Account/CreatePost.php @@ -367,7 +367,7 @@ public function execute() if ($confirmationStatus === AccountManagementInterface::ACCOUNT_CONFIRMATION_REQUIRED) { $email = $this->customerUrl->getEmailConfirmationUrl($customer->getEmail()); // @codingStandardsIgnoreStart - $this->messageManager->addSuccess( + $this->messageManager->addSuccessMessage( __( 'You must confirm your account. Please check your email for the confirmation link or <a href="%1">click here</a> for a new link.', $email @@ -378,7 +378,7 @@ public function execute() $resultRedirect->setUrl($this->_redirect->success($url)); } else { $this->session->setCustomerDataAsLoggedIn($customer); - $this->messageManager->addSuccess($this->getSuccessMessage()); + $this->messageManager->addSuccessMessage($this->getSuccessMessage()); $requestedRedirect = $this->accountRedirect->getRedirectCookie(); if (!$this->scopeConfig->getValue('customer/startup/redirect_dashboard') && $requestedRedirect) { $resultRedirect->setUrl($this->_redirect->success($requestedRedirect)); @@ -402,14 +402,14 @@ public function execute() $url ); // @codingStandardsIgnoreEnd - $this->messageManager->addError($message); + $this->messageManager->addErrorMessage($message); } catch (InputException $e) { - $this->messageManager->addError($this->escaper->escapeHtml($e->getMessage())); + $this->messageManager->addErrorMessage($this->escaper->escapeHtml($e->getMessage())); foreach ($e->getErrors() as $error) { - $this->messageManager->addError($this->escaper->escapeHtml($error->getMessage())); + $this->messageManager->addErrorMessage($this->escaper->escapeHtml($error->getMessage())); } } catch (LocalizedException $e) { - $this->messageManager->addError($this->escaper->escapeHtml($e->getMessage())); + $this->messageManager->addErrorMessage($this->escaper->escapeHtml($e->getMessage())); } catch (\Exception $e) { $this->messageManager->addException($e, __('We can\'t save the customer.')); } diff --git a/app/code/Magento/Customer/Controller/Account/EditPost.php b/app/code/Magento/Customer/Controller/Account/EditPost.php index 4eb41cedea29a..04b5b72ae776b 100644 --- a/app/code/Magento/Customer/Controller/Account/EditPost.php +++ b/app/code/Magento/Customer/Controller/Account/EditPost.php @@ -216,7 +216,7 @@ public function execute() $isPasswordChanged ); $this->dispatchSuccessEvent($customerCandidateDataObject); - $this->messageManager->addSuccess(__('You saved the account information.')); + $this->messageManager->addSuccessMessage(__('You saved the account information.')); return $resultRedirect->setPath('customer/account'); } catch (InvalidEmailOrPasswordException $e) { $this->messageManager->addErrorMessage($this->escaper->escapeHtml($e->getMessage())); @@ -227,7 +227,7 @@ public function execute() ); $this->session->logout(); $this->session->start(); - $this->messageManager->addError($message); + $this->messageManager->addErrorMessage($message); return $resultRedirect->setPath('customer/account/login'); } catch (InputException $e) { $this->messageManager->addErrorMessage($this->escaper->escapeHtml($e->getMessage())); @@ -235,7 +235,7 @@ public function execute() $this->messageManager->addErrorMessage($this->escaper->escapeHtml($error->getMessage())); } } catch (\Magento\Framework\Exception\LocalizedException $e) { - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addException($e, __('We can\'t save the customer.')); } diff --git a/app/code/Magento/Customer/Controller/Account/LoginPost.php b/app/code/Magento/Customer/Controller/Account/LoginPost.php index 04051fbbf366b..a7632401933e6 100644 --- a/app/code/Magento/Customer/Controller/Account/LoginPost.php +++ b/app/code/Magento/Customer/Controller/Account/LoginPost.php @@ -217,17 +217,17 @@ public function execute() $message = $e->getMessage(); } catch (\Exception $e) { // PA DSS violation: throwing or logging an exception here can disclose customer password - $this->messageManager->addError( + $this->messageManager->addErrorMessage( __('An unspecified error occurred. Please contact us for assistance.') ); } finally { if (isset($message)) { - $this->messageManager->addError($message); + $this->messageManager->addErrorMessage($message); $this->session->setUsername($login['username']); } } } else { - $this->messageManager->addError(__('A login and a password are required.')); + $this->messageManager->addErrorMessage(__('A login and a password are required.')); } } diff --git a/app/code/Magento/Customer/Controller/Account/ResetPasswordPost.php b/app/code/Magento/Customer/Controller/Account/ResetPasswordPost.php index 27a00f86dd95d..a127f2acf538f 100644 --- a/app/code/Magento/Customer/Controller/Account/ResetPasswordPost.php +++ b/app/code/Magento/Customer/Controller/Account/ResetPasswordPost.php @@ -73,13 +73,13 @@ public function execute() $passwordConfirmation = (string)$this->getRequest()->getPost('password_confirmation'); if ($password !== $passwordConfirmation) { - $this->messageManager->addError(__("New Password and Confirm New Password values didn't match.")); + $this->messageManager->addErrorMessage(__("New Password and Confirm New Password values didn't match.")); $resultRedirect->setPath('*/*/createPassword', ['token' => $resetPasswordToken]); return $resultRedirect; } if (iconv_strlen($password) <= 0) { - $this->messageManager->addError(__('Please enter a new password.')); + $this->messageManager->addErrorMessage(__('Please enter a new password.')); $resultRedirect->setPath('*/*/createPassword', ['token' => $resetPasswordToken]); return $resultRedirect; @@ -92,17 +92,17 @@ public function execute() $password ); $this->session->unsRpToken(); - $this->messageManager->addSuccess(__('You updated your password.')); + $this->messageManager->addSuccessMessage(__('You updated your password.')); $resultRedirect->setPath('*/*/login'); return $resultRedirect; } catch (InputException $e) { - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); foreach ($e->getErrors() as $error) { - $this->messageManager->addError($error->getMessage()); + $this->messageManager->addErrorMessage($error->getMessage()); } } catch (\Exception $exception) { - $this->messageManager->addError(__('Something went wrong while saving the new password.')); + $this->messageManager->addErrorMessage(__('Something went wrong while saving the new password.')); } $resultRedirect->setPath('*/*/createPassword', ['token' => $resetPasswordToken]); diff --git a/app/code/Magento/Customer/Controller/Address/Delete.php b/app/code/Magento/Customer/Controller/Address/Delete.php index a30e15db4b3f8..2024b2c58b8ef 100644 --- a/app/code/Magento/Customer/Controller/Address/Delete.php +++ b/app/code/Magento/Customer/Controller/Address/Delete.php @@ -27,9 +27,9 @@ public function execute() $address = $this->_addressRepository->getById($addressId); if ($address->getCustomerId() === $this->_getSession()->getCustomerId()) { $this->_addressRepository->deleteById($addressId); - $this->messageManager->addSuccess(__('You deleted the address.')); + $this->messageManager->addSuccessMessage(__('You deleted the address.')); } else { - $this->messageManager->addError(__('We can\'t delete the address right now.')); + $this->messageManager->addErrorMessage(__('We can\'t delete the address right now.')); } } catch (\Exception $other) { $this->messageManager->addException($other, __('We can\'t delete the address right now.')); diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Customer/InvalidateToken.php b/app/code/Magento/Customer/Controller/Adminhtml/Customer/InvalidateToken.php index b69410ecbfce7..7747d80595cdc 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Customer/InvalidateToken.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Customer/InvalidateToken.php @@ -139,14 +139,14 @@ public function execute() if ($customerId = $this->getRequest()->getParam('customer_id')) { try { $this->tokenService->revokeCustomerAccessToken($customerId); - $this->messageManager->addSuccess(__('You have revoked the customer\'s tokens.')); + $this->messageManager->addSuccessMessage(__('You have revoked the customer\'s tokens.')); $resultRedirect->setPath('customer/index/edit', ['id' => $customerId, '_current' => true]); } catch (\Exception $e) { - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); $resultRedirect->setPath('customer/index/edit', ['id' => $customerId, '_current' => true]); } } else { - $this->messageManager->addError(__('We can\'t find a customer to revoke.')); + $this->messageManager->addErrorMessage(__('We can\'t find a customer to revoke.')); $resultRedirect->setPath('customer/index/index'); } return $resultRedirect; diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Group/Delete.php b/app/code/Magento/Customer/Controller/Adminhtml/Group/Delete.php index ab32ea08a44aa..819a49178a24d 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Group/Delete.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Group/Delete.php @@ -24,12 +24,12 @@ public function execute() if ($id) { try { $this->groupRepository->deleteById($id); - $this->messageManager->addSuccess(__('You deleted the customer group.')); + $this->messageManager->addSuccessMessage(__('You deleted the customer group.')); } catch (NoSuchEntityException $e) { - $this->messageManager->addError(__('The customer group no longer exists.')); + $this->messageManager->addErrorMessage(__('The customer group no longer exists.')); return $resultRedirect->setPath('customer/*/'); } catch (\Exception $e) { - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); return $resultRedirect->setPath('customer/group/edit', ['id' => $id]); } } diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Group/Save.php b/app/code/Magento/Customer/Controller/Adminhtml/Group/Save.php index 5ffce4cbcd989..64c94fa230fb1 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Group/Save.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Group/Save.php @@ -93,10 +93,10 @@ public function execute() $this->groupRepository->save($customerGroup); - $this->messageManager->addSuccess(__('You saved the customer group.')); + $this->messageManager->addSuccessMessage(__('You saved the customer group.')); $resultRedirect->setPath('customer/group'); } catch (\Exception $e) { - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); if ($customerGroup != null) { $this->storeCustomerGroupDataToSession( $this->dataObjectProcessor->buildOutputDataArray( diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/AbstractMassAction.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/AbstractMassAction.php index e26b49aaebe7a..08c6e5148ade5 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/AbstractMassAction.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/AbstractMassAction.php @@ -64,7 +64,7 @@ public function execute() $collection = $this->filter->getCollection($this->collectionFactory->create()); return $this->massAction($collection); } catch (\Exception $e) { - $this->messageManager->addError($e->getMessage()); + $this->messageManager->addErrorMessage($e->getMessage()); /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); return $resultRedirect->setPath($this->redirectUrl); diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/Delete.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/Delete.php index ab39ca098162f..4b2f2614948cf 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/Delete.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/Delete.php @@ -31,7 +31,7 @@ public function execute() $formKeyIsValid = $this->_formKeyValidator->validate($this->getRequest()); $isPost = $this->getRequest()->isPost(); if (!$formKeyIsValid || !$isPost) { - $this->messageManager->addError(__('Customer could not be deleted.')); + $this->messageManager->addErrorMessage(__('Customer could not be deleted.')); return $resultRedirect->setPath('customer/index'); } @@ -39,9 +39,9 @@ public function execute() if (!empty($customerId)) { try { $this->_customerRepository->deleteById($customerId); - $this->messageManager->addSuccess(__('You deleted the customer.')); + $this->messageManager->addSuccessMessage(__('You deleted the customer.')); } catch (\Exception $exception) { - $this->messageManager->addError($exception->getMessage()); + $this->messageManager->addErrorMessage($exception->getMessage()); } } diff --git a/app/code/Magento/Customer/Observer/AfterAddressSaveObserver.php b/app/code/Magento/Customer/Observer/AfterAddressSaveObserver.php index 41311abee5da8..8677abfa89904 100644 --- a/app/code/Magento/Customer/Observer/AfterAddressSaveObserver.php +++ b/app/code/Magento/Customer/Observer/AfterAddressSaveObserver.php @@ -255,7 +255,7 @@ protected function addValidMessage($customerAddress, $validationResult) : (string)__('You will not be charged tax.'); } - $this->messageManager->addSuccess(implode(' ', $message)); + $this->messageManager->addSuccessMessage(implode(' ', $message)); return $this; } @@ -280,7 +280,7 @@ protected function addInvalidMessage($customerAddress) $message[] = (string)__('You will be charged tax.'); } - $this->messageManager->addError(implode(' ', $message)); + $this->messageManager->addErrorMessage(implode(' ', $message)); return $this; } @@ -307,7 +307,7 @@ protected function addErrorMessage($customerAddress) $email = $this->scopeConfig->getValue('trans_email/ident_support/email', ScopeInterface::SCOPE_STORE); $message[] = (string)__('If you believe this is an error, please contact us at %1', $email); - $this->messageManager->addError(implode(' ', $message)); + $this->messageManager->addErrorMessage(implode(' ', $message)); return $this; } diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Account/ConfirmTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Account/ConfirmTest.php index 28f897adf9176..5565a807b8135 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Account/ConfirmTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Account/ConfirmTest.php @@ -282,7 +282,7 @@ public function testSuccessMessage($customerId, $key, $vatValidationEnabled, $ad ->willReturnSelf(); $this->messageManagerMock->expects($this->any()) - ->method('addSuccess') + ->method('addSuccessMessage') ->with($this->stringContains($successMessage)) ->willReturnSelf(); @@ -402,7 +402,7 @@ public function testSuccessRedirect( ->willReturnSelf(); $this->messageManagerMock->expects($this->any()) - ->method('addSuccess') + ->method('addSuccessMessage') ->with($this->stringContains($successMessage)) ->willReturnSelf(); diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Account/CreatePostTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Account/CreatePostTest.php index f8f47eedba3ef..ac52c395d6787 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Account/CreatePostTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Account/CreatePostTest.php @@ -371,7 +371,7 @@ public function testSuccessMessage( ->with($this->equalTo($customerId)); $this->messageManagerMock->expects($this->any()) - ->method('addSuccess') + ->method('addSuccessMessage') ->with($this->stringContains($successMessage)) ->will($this->returnSelf()); @@ -502,7 +502,7 @@ public function testSuccessRedirect( ->with($this->equalTo($customerId)); $this->messageManagerMock->expects($this->any()) - ->method('addSuccess') + ->method('addSuccessMessage') ->with($this->stringContains($successMessage)) ->will($this->returnSelf()); diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Account/LoginPostTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Account/LoginPostTest.php index 762c76b695dee..51b84d807dc13 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Account/LoginPostTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Account/LoginPostTest.php @@ -222,7 +222,7 @@ public function testExecuteEmptyLoginData() ->willReturn([]); $this->messageManager->expects($this->once()) - ->method('addError') + ->method('addErrorMessage') ->with(__('A login and a password are required.')) ->willReturnSelf(); @@ -551,7 +551,7 @@ protected function mockExceptions($exception, $username) $url ); $this->messageManager->expects($this->once()) - ->method('addError') + ->method('addErrorMessage') ->with($message) ->willReturnSelf(); @@ -563,7 +563,7 @@ protected function mockExceptions($exception, $username) case \Magento\Framework\Exception\AuthenticationException::class: $this->messageManager->expects($this->once()) - ->method('addError') + ->method('addErrorMessage') ->with( __( 'The account sign-in was incorrect or your account is disabled temporarily. ' @@ -580,7 +580,7 @@ protected function mockExceptions($exception, $username) case '\Exception': $this->messageManager->expects($this->once()) - ->method('addError') + ->method('addErrorMessage') ->with(__('An unspecified error occurred. Please contact us for assistance.')) ->willReturnSelf(); break; @@ -591,7 +591,7 @@ protected function mockExceptions($exception, $username) . 'Please wait and try again later.' ); $this->messageManager->expects($this->once()) - ->method('addError') + ->method('addErrorMessage') ->with($message) ->willReturnSelf(); $this->session->expects($this->once()) diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Address/DeleteTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Address/DeleteTest.php index 4064b8586257d..3af3cc60010bb 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Address/DeleteTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Address/DeleteTest.php @@ -146,7 +146,7 @@ public function testExecute() ->method('deleteById') ->with($addressId); $this->messageManager->expects($this->once()) - ->method('addSuccess') + ->method('addSuccessMessage') ->with(__('You deleted the address.')); $this->resultRedirect->expects($this->once()) ->method('setPath') @@ -183,7 +183,7 @@ public function testExecuteWithException() ->willReturn(34); $exception = new \Exception('Exception'); $this->messageManager->expects($this->once()) - ->method('addError') + ->method('addErrorMessage') ->with(__('We can\'t delete the address right now.')) ->willThrowException($exception); $this->messageManager->expects($this->once()) diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Group/SaveTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Group/SaveTest.php index 5f7064d5b124b..c9f885315b0ef 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Group/SaveTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Group/SaveTest.php @@ -167,7 +167,7 @@ public function testExecuteWithTaxClassAndException() ->method('save') ->with($this->group); $this->messageManager->expects($this->once()) - ->method('addSuccess') + ->method('addSuccessMessage') ->with(__('You saved the customer group.')); $exception = new \Exception('Exception'); $this->resultRedirect->expects($this->at(0)) @@ -175,7 +175,7 @@ public function testExecuteWithTaxClassAndException() ->with('customer/group') ->willThrowException($exception); $this->messageManager->expects($this->once()) - ->method('addError') + ->method('addErrorMessage') ->with('Exception'); $this->dataObjectProcessorMock->expects($this->once()) ->method('buildOutputDataArray') diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/InlineEditTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/InlineEditTest.php index 45e64f6557d51..c198eb3a212fa 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/InlineEditTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/InlineEditTest.php @@ -366,7 +366,7 @@ public function testExecuteLocalizedException() ->with($this->customerData) ->willThrowException($exception); $this->messageManager->expects($this->once()) - ->method('addError') + ->method('addErrorMessage') ->with('[Customer ID: 12] Exception message'); $this->logger->expects($this->once()) ->method('critical') @@ -394,7 +394,7 @@ public function testExecuteException() ->with($this->customerData) ->willThrowException($exception); $this->messageManager->expects($this->once()) - ->method('addError') + ->method('addErrorMessage') ->with('[Customer ID: 12] We can\'t save the customer.'); $this->logger->expects($this->once()) ->method('critical') diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassAssignGroupTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassAssignGroupTest.php index cb5ff88ab704a..4157359959ae4 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassAssignGroupTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassAssignGroupTest.php @@ -199,7 +199,7 @@ public function testExecuteWithException() ->willThrowException(new \Exception('Some message.')); $this->messageManagerMock->expects($this->once()) - ->method('addError') + ->method('addErrorMessage') ->with('Some message.'); $this->massAction->execute(); diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassDeleteTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassDeleteTest.php index 1f39e6306b996..b436b5b137c78 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassDeleteTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassDeleteTest.php @@ -179,7 +179,7 @@ public function testExecuteWithException() ->willThrowException(new \Exception('Some message.')); $this->messageManagerMock->expects($this->once()) - ->method('addError') + ->method('addErrorMessage') ->with('Some message.'); $this->massAction->execute(); diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php index 90bff0b61bcbf..33e578224400b 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php @@ -195,7 +195,7 @@ public function testExecuteWithException() ->willThrowException(new \Exception('Some message.')); $this->messageManagerMock->expects($this->once()) - ->method('addError') + ->method('addErrorMessage') ->with('Some message.'); $this->massAction->execute(); diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php index 1bffa836f5034..971efc0e490bc 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php @@ -195,7 +195,7 @@ public function testExecuteWithException() ->willThrowException(new \Exception('Some message.')); $this->messageManagerMock->expects($this->once()) - ->method('addError') + ->method('addErrorMessage') ->with('Some message.'); $this->massAction->execute(); diff --git a/app/code/Magento/Customer/Test/Unit/Observer/AfterAddressSaveObserverTest.php b/app/code/Magento/Customer/Test/Unit/Observer/AfterAddressSaveObserverTest.php index 8592d1bda66c1..4501b611aa11f 100644 --- a/app/code/Magento/Customer/Test/Unit/Observer/AfterAddressSaveObserverTest.php +++ b/app/code/Magento/Customer/Test/Unit/Observer/AfterAddressSaveObserverTest.php @@ -575,7 +575,7 @@ public function testAfterAddressSaveNewGroup( if ($resultValidMessage) { $this->messageManager->expects($this->once()) - ->method('addSuccess') + ->method('addSuccessMessage') ->with($resultValidMessage) ->willReturnSelf(); } @@ -585,7 +585,7 @@ public function testAfterAddressSaveNewGroup( ->with($vatId) ->willReturn($vatId); $this->messageManager->expects($this->once()) - ->method('addError') + ->method('addErrorMessage') ->with($resultInvalidMessage) ->willReturnSelf(); } @@ -595,7 +595,7 @@ public function testAfterAddressSaveNewGroup( ->with('trans_email/ident_support/email', ScopeInterface::SCOPE_STORE) ->willReturn('admin@example.com'); $this->messageManager->expects($this->once()) - ->method('addError') + ->method('addErrorMessage') ->with($resultErrorMessage) ->willReturnSelf(); } From a1c3ade9d7afa02049f124b25c034c91733a626b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 10:46:26 +0100 Subject: [PATCH 293/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../ActionGroup/CreateBackupActionGroup.xml | 64 ------------------- .../CreateDatabaseBackupActionGroup.xml | 28 ++++++++ .../CreateMediaBackupActionGroup.xml | 28 ++++++++ .../CreateSystemBackupActionGroup.xml | 28 ++++++++ .../Test/AdminCreateAndDeleteBackupsTest.xml | 6 +- 5 files changed, 87 insertions(+), 67 deletions(-) delete mode 100644 app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateBackupActionGroup.xml create mode 100644 app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateDatabaseBackupActionGroup.xml create mode 100644 app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateMediaBackupActionGroup.xml create mode 100644 app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateSystemBackupActionGroup.xml diff --git a/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateBackupActionGroup.xml b/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateBackupActionGroup.xml deleted file mode 100644 index cc7691752c62e..0000000000000 --- a/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateBackupActionGroup.xml +++ /dev/null @@ -1,64 +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="createSystemBackup"> - <annotations> - <description>Creates a System Backup using provided Backup Entity.</description> - </annotations> - <arguments> - <argument name="backup" defaultValue="SystemBackup"/> - </arguments> - - <click selector="{{AdminMainActionsSection.systemBackup}}" stepKey="clickCreateBackupButton"/> - <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> - <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> - <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> - <waitForElementNotVisible selector=".loading-mask" time="300" stepKey="waitForBackupProcess"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You created the system backup." stepKey="seeSuccessMessage"/> - <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> - <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> - </actionGroup> - - <actionGroup name="createMediaBackup"> - <annotations> - <description>Creates a Media Backup using provided Backup Entity.</description> - </annotations> - <arguments> - <argument name="backup" defaultValue="MediaBackup"/> - </arguments> - - <click selector="{{AdminMainActionsSection.mediaBackup}}" stepKey="clickCreateBackupButton"/> - <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> - <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> - <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> - <waitForPageLoad time="120" stepKey="waitForBackupProcess"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You created the database and media backup." stepKey="seeSuccessMessage"/> - <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> - <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> - </actionGroup> - - <actionGroup name="createDatabaseBackup"> - <annotations> - <description>Creates a Database Backup using provided Backup Entity.</description> - </annotations> - <arguments> - <argument name="backup" defaultValue="DatabaseBackup"/> - </arguments> - - <click selector="{{AdminMainActionsSection.databaseBackup}}" stepKey="clickCreateBackupButton"/> - <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> - <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> - <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> - <waitForPageLoad time="120" stepKey="waitForBackupProcess"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You created the database backup." stepKey="seeSuccessMessage"/> - <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> - <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateDatabaseBackupActionGroup.xml b/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateDatabaseBackupActionGroup.xml new file mode 100644 index 0000000000000..5d4e4a19509ea --- /dev/null +++ b/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateDatabaseBackupActionGroup.xml @@ -0,0 +1,28 @@ +<?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="createDatabaseBackup"> + <annotations> + <description>Creates a Database Backup using provided Backup Entity.</description> + </annotations> + <arguments> + <argument name="backup" defaultValue="DatabaseBackup"/> + </arguments> + + <click selector="{{AdminMainActionsSection.databaseBackup}}" stepKey="clickCreateBackupButton"/> + <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> + <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> + <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> + <waitForPageLoad time="120" stepKey="waitForBackupProcess"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You created the database backup." stepKey="seeSuccessMessage"/> + <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> + <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateMediaBackupActionGroup.xml b/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateMediaBackupActionGroup.xml new file mode 100644 index 0000000000000..ffa66ae230c04 --- /dev/null +++ b/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateMediaBackupActionGroup.xml @@ -0,0 +1,28 @@ +<?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="CreateMediaBackupActionGroup"> + <annotations> + <description>Creates a Media Backup using provided Backup Entity.</description> + </annotations> + <arguments> + <argument name="backup" defaultValue="MediaBackup"/> + </arguments> + + <click selector="{{AdminMainActionsSection.mediaBackup}}" stepKey="clickCreateBackupButton"/> + <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> + <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> + <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> + <waitForPageLoad time="120" stepKey="waitForBackupProcess"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You created the database and media backup." stepKey="seeSuccessMessage"/> + <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> + <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateSystemBackupActionGroup.xml b/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateSystemBackupActionGroup.xml new file mode 100644 index 0000000000000..ca4f7ad1544df --- /dev/null +++ b/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateSystemBackupActionGroup.xml @@ -0,0 +1,28 @@ +<?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="CreateSystemBackupActionGroup"> + <annotations> + <description>Creates a System Backup using provided Backup Entity.</description> + </annotations> + <arguments> + <argument name="backup" defaultValue="SystemBackup"/> + </arguments> + + <click selector="{{AdminMainActionsSection.systemBackup}}" stepKey="clickCreateBackupButton"/> + <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> + <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> + <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> + <waitForElementNotVisible selector=".loading-mask" time="300" stepKey="waitForBackupProcess"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You created the system backup." stepKey="seeSuccessMessage"/> + <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> + <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml b/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml index 26f8817c0a1bb..778c6d5112b6a 100644 --- a/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml +++ b/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml @@ -30,13 +30,13 @@ <waitForPageLoad stepKey="waitForBackupPage"/> <!--Create system backup--> - <actionGroup ref="createSystemBackup" stepKey="createSystemBackup"/> + <actionGroup ref="CreateSystemBackupActionGroup" stepKey="createSystemBackup"/> <!--Create database/media backup--> - <actionGroup ref="createMediaBackup" stepKey="createMediaBackup"/> + <actionGroup ref="CreateMediaBackupActionGroup" stepKey="createMediaBackup"/> <!--Create database backup--> - <actionGroup ref="createDatabaseBackup" stepKey="createDatabaseBackup"/> + <actionGroup ref="CreateDatabaseBackupActionGroup" stepKey="createDatabaseBackup"/> <!--Delete system backup--> <actionGroup ref="deleteBackup" stepKey="deleteSystemBackup"> From 31e35c68f0a02a10a77ce0069acfec6ca1b1ba2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 10:55:34 +0100 Subject: [PATCH 294/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../AdminCreateNewRoleActionGroup.xml | 32 ++++++++++ ...oup.xml => AdminCreateUserActionGroup.xml} | 15 +---- .../AdminDeleteRoleActionGroup.xml | 27 ++++++++ .../Mftf/ActionGroup/AdminRoleActionGroup.xml | 62 ------------------- .../ConfigureBraintreeActionGroup.xml | 11 +--- .../DisableBraintreeActionGroup.xml | 19 ++++++ .../ActionGroup/GoToAllUsersActionGroup.xml | 21 +++++++ .../ActionGroup/GoToUserRolesActionGroup.xml | 21 +++++++ ...AnAdminOrderUsingBraintreePaymentTest1.xml | 14 ++--- 9 files changed, 129 insertions(+), 93 deletions(-) create mode 100644 app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminCreateNewRoleActionGroup.xml rename app/code/Magento/Braintree/Test/Mftf/ActionGroup/{AdminUserActionGroup.xml => AdminCreateUserActionGroup.xml} (77%) create mode 100644 app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminDeleteRoleActionGroup.xml delete mode 100644 app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminRoleActionGroup.xml create mode 100644 app/code/Magento/Braintree/Test/Mftf/ActionGroup/DisableBraintreeActionGroup.xml create mode 100644 app/code/Magento/Braintree/Test/Mftf/ActionGroup/GoToAllUsersActionGroup.xml create mode 100644 app/code/Magento/Braintree/Test/Mftf/ActionGroup/GoToUserRolesActionGroup.xml diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminCreateNewRoleActionGroup.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminCreateNewRoleActionGroup.xml new file mode 100644 index 0000000000000..29000563ee87f --- /dev/null +++ b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminCreateNewRoleActionGroup.xml @@ -0,0 +1,32 @@ +<?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="AdminCreateNewRoleActionGroup"> + <annotations> + <description>Creates a User Role using the provided Data.</description> + </annotations> + <arguments> + <argument name="role" type="string" defaultValue=""/> + <argument name="resource" type="string" defaultValue="All"/> + <argument name="scope" type="string" defaultValue="Custom"/> + <argument name="websites" type="string" defaultValue="Main Website"/> + </arguments> + + <click selector="{{AdminCreateRoleSection.create}}" stepKey="clickToAddNewRole"/> + <fillField selector="{{AdminCreateRoleSection.name}}" userInput="{{role.name}}" stepKey="setRoleName"/> + <fillField stepKey="setPassword" selector="{{AdminCreateRoleSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> + <click selector="{{AdminCreateRoleSection.roleResources}}" stepKey="clickToOpenRoleResources"/> + <waitForPageLoad stepKey="waitForRoleResourcePage" time="5"/> + <click stepKey="checkSales" selector="//a[text()='Sales']"/> + <click selector="{{AdminCreateRoleSection.save}}" stepKey="clickToSaveRole"/> + <waitForPageLoad stepKey="waitForPageLoad" time="10"/> + <see userInput="You saved the role." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminUserActionGroup.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml similarity index 77% rename from app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminUserActionGroup.xml rename to app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml index 78e0db6bc44ee..82491f6362573 100644 --- a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminUserActionGroup.xml +++ b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml @@ -7,20 +7,7 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!--Go to all users--> - <actionGroup name="GoToAllUsers"> - <annotations> - <description>Navigate to the Users page via Backend Admin Side Menu. PLEASE NOTE: Use the amOnPage action instead.</description> - </annotations> - - <click selector="{{AdminCreateUserSection.system}}" stepKey="clickOnSystemIcon"/> - <waitForPageLoad stepKey="waitForSystemsPageToOpen"/> - <click selector="{{AdminCreateUserSection.allUsers}}" stepKey="clickToSelectUserRoles"/> - <waitForPageLoad stepKey="waitForUserRolesPageToOpen"/> - </actionGroup> - - <!--Create new user with specified role--> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminCreateUserAction"> <annotations> <description>Creates a User using the NewAdmin User Entity and User Role Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminDeleteRoleActionGroup.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminDeleteRoleActionGroup.xml new file mode 100644 index 0000000000000..9ee3c79d1288e --- /dev/null +++ b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminDeleteRoleActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AdminDeleteRoleActionGroup"> + <annotations> + <description>Deletes a User Role that contains the text 'Role'. PLEASE NOTE: The Action Group values are Hardcoded.</description> + </annotations> + <arguments> + <argument name="role" defaultValue=""/> + </arguments> + + <click stepKey="clickOnRole" selector="{{AdminDeleteRoleSection.theRole}}"/> + <fillField stepKey="TypeCurrentPassword" selector="{{AdminDeleteRoleSection.current_pass}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> + <click stepKey="clickToDeleteRole" selector="{{AdminDeleteRoleSection.delete}}"/> + <waitForAjaxLoad stepKey="waitForDeleteConfirmationPopup" time="5"/> + <click stepKey="clickToConfirm" selector="{{AdminDeleteRoleSection.confirm}}"/> + <waitForPageLoad stepKey="waitForPageLoad" time="10"/> + <see stepKey="seeSuccessMessage" userInput="You deleted the role."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminRoleActionGroup.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminRoleActionGroup.xml deleted file mode 100644 index 384ccbf379bc3..0000000000000 --- a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminRoleActionGroup.xml +++ /dev/null @@ -1,62 +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="GoToUserRoles"> - <annotations> - <description>Navigate to the User Roles page via Backend Admin Side Menu. PLEASE NOTE: Use the amOnPage action instead.</description> - </annotations> - - <click selector="#menu-magento-backend-system" stepKey="clickOnSystemIcon"/> - <waitForPageLoad stepKey="waitForSystemsPageToOpen"/> - <click selector="//span[contains(text(), 'User Roles')]" stepKey="clickToSelectUserRoles"/> - <waitForPageLoad stepKey="waitForUserRolesPageToOpen"/> - </actionGroup> - - <!--Create new role--> - <actionGroup name="AdminCreateNewRole"> - <annotations> - <description>Creates a User Role using the provided Data.</description> - </annotations> - <arguments> - <argument name="role" type="string" defaultValue=""/> - <argument name="resource" type="string" defaultValue="All"/> - <argument name="scope" type="string" defaultValue="Custom"/> - <argument name="websites" type="string" defaultValue="Main Website"/> - </arguments> - - <click selector="{{AdminCreateRoleSection.create}}" stepKey="clickToAddNewRole"/> - <fillField selector="{{AdminCreateRoleSection.name}}" userInput="{{role.name}}" stepKey="setRoleName"/> - <fillField stepKey="setPassword" selector="{{AdminCreateRoleSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> - <click selector="{{AdminCreateRoleSection.roleResources}}" stepKey="clickToOpenRoleResources"/> - <waitForPageLoad stepKey="waitForRoleResourcePage" time="5"/> - <click stepKey="checkSales" selector="//a[text()='Sales']"/> - <click selector="{{AdminCreateRoleSection.save}}" stepKey="clickToSaveRole"/> - <waitForPageLoad stepKey="waitForPageLoad" time="10"/> - <see userInput="You saved the role." stepKey="seeSuccessMessage"/> - </actionGroup> - - <!--Delete role--> - <actionGroup name="AdminDeleteRoleActionGroup"> - <annotations> - <description>Deletes a User Role that contains the text 'Role'. PLEASE NOTE: The Action Group values are Hardcoded.</description> - </annotations> - <arguments> - <argument name="role" defaultValue=""/> - </arguments> - - <click stepKey="clickOnRole" selector="{{AdminDeleteRoleSection.theRole}}"/> - <fillField stepKey="TypeCurrentPassword" selector="{{AdminDeleteRoleSection.current_pass}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> - <click stepKey="clickToDeleteRole" selector="{{AdminDeleteRoleSection.delete}}"/> - <waitForAjaxLoad stepKey="waitForDeleteConfirmationPopup" time="5"/> - <click stepKey="clickToConfirm" selector="{{AdminDeleteRoleSection.confirm}}"/> - <waitForPageLoad stepKey="waitForPageLoad" time="10"/> - <see stepKey="seeSuccessMessage" userInput="You deleted the role."/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/ConfigureBraintreeActionGroup.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/ConfigureBraintreeActionGroup.xml index 6f379c2e66a48..5e5f6d634caad 100644 --- a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/ConfigureBraintreeActionGroup.xml +++ b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/ConfigureBraintreeActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="ConfigureBraintree"> + <actionGroup name="ConfigureBraintreeActionGroup"> <annotations> <description>Sets up the Braintree configuration setting using the BraintreeConfigurationSection Data Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> </annotations> @@ -49,13 +49,4 @@ <click stepKey="save" selector="{{BraintreeConfiguraionSection.save}}"/> <waitForElementVisible selector="{{BraintreeConfiguraionSection.successfulMessage}}" stepKey="waitForSuccessfullyConfigured" time="10"/> </actionGroup> - - <actionGroup name="DisableBrainTree"> - <annotations> - <description>Disables the Braintree and BraintreePaypal configuration settings via the CLI.</description> - </annotations> - - <magentoCLI stepKey="disableBrainTree" command="config:set payment/braintree/active 0"/> - <magentoCLI stepKey="disableBrainTreePaypal" command="config:set payment/braintree_paypal/active 0"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/DisableBraintreeActionGroup.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/DisableBraintreeActionGroup.xml new file mode 100644 index 0000000000000..9f8b7735fc067 --- /dev/null +++ b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/DisableBraintreeActionGroup.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="DisableBraintreeActionGroup"> + <annotations> + <description>Disables the Braintree and BraintreePaypal configuration settings via the CLI.</description> + </annotations> + + <magentoCLI stepKey="disableBrainTree" command="config:set payment/braintree/active 0"/> + <magentoCLI stepKey="disableBrainTreePaypal" command="config:set payment/braintree_paypal/active 0"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/GoToAllUsersActionGroup.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/GoToAllUsersActionGroup.xml new file mode 100644 index 0000000000000..f5cffbe81b509 --- /dev/null +++ b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/GoToAllUsersActionGroup.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="GoToAllUsersActionGroup"> + <annotations> + <description>Navigate to the Users page via Backend Admin Side Menu. PLEASE NOTE: Use the amOnPage action instead.</description> + </annotations> + + <click selector="{{AdminCreateUserSection.system}}" stepKey="clickOnSystemIcon"/> + <waitForPageLoad stepKey="waitForSystemsPageToOpen"/> + <click selector="{{AdminCreateUserSection.allUsers}}" stepKey="clickToSelectUserRoles"/> + <waitForPageLoad stepKey="waitForUserRolesPageToOpen"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/GoToUserRolesActionGroup.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/GoToUserRolesActionGroup.xml new file mode 100644 index 0000000000000..43bdb3cb02c0d --- /dev/null +++ b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/GoToUserRolesActionGroup.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="GoToUserRolesActionGroup"> + <annotations> + <description>Navigate to the User Roles page via Backend Admin Side Menu. PLEASE NOTE: Use the amOnPage action instead.</description> + </annotations> + + <click selector="#menu-magento-backend-system" stepKey="clickOnSystemIcon"/> + <waitForPageLoad stepKey="waitForSystemsPageToOpen"/> + <click selector="//span[contains(text(), 'User Roles')]" stepKey="clickToSelectUserRoles"/> + <waitForPageLoad stepKey="waitForUserRolesPageToOpen"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml index 2594d245f9ff0..1e134b604d497 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml @@ -42,14 +42,14 @@ <actionGroup ref="ConfigureBraintree" stepKey="configureBraintree"/> <!--Create New Role--> - <actionGroup ref="GoToUserRoles" stepKey="GoToUserRoles"/> + <actionGroup ref="GoToUserRolesActionGroup" stepKey="GoToUserRoles"/> <waitForPageLoad stepKey="waitForAllRoles" time="15"/> - <actionGroup ref="AdminCreateNewRole" stepKey="AdminCreateNewRole"/> + <actionGroup ref="AdminCreateNewRoleActionGroup" stepKey="AdminCreateNewRole"/> <!--Create new admin user--> - <actionGroup ref="GoToAllUsers" stepKey="GoToAllUsers"/> + <actionGroup ref="GoToAllUsersActionGroup" stepKey="GoToAllUsers"/> <waitForPageLoad stepKey="waitForUsers" time="15"/> - <actionGroup ref="AdminCreateUserAction" stepKey="AdminCreateNewUser"/> + <actionGroup ref="AdminCreateUserActionGroup" stepKey="AdminCreateNewUser"/> <!--SignOut--> <actionGroup ref="logout" stepKey="signOutFromAdmin"/> @@ -88,7 +88,7 @@ <after> <!-- Disable BrainTree --> - <actionGroup ref="DisableBrainTree" stepKey="disableBrainTree"/> + <actionGroup ref="DisableBraintreeActionGroup" stepKey="disableBrainTree"/> <!--SignOut--> <actionGroup ref="SignOut" stepKey="signOutFromNewUser"/> @@ -101,11 +101,11 @@ <deleteData stepKey="deleteCustomer" createDataKey="createCustomer"/> <!--Delete User --> - <actionGroup ref="GoToAllUsers" stepKey="GoBackToAllUsers"/> + <actionGroup ref="GoToAllUsersActionGroup" stepKey="GoBackToAllUsers"/> <actionGroup ref="AdminDeleteNewUserActionGroup" stepKey="AdminDeleteUserActionGroup"/> <!--Delete Role--> - <actionGroup ref="GoToUserRoles" stepKey="GoBackToUserRoles"/> + <actionGroup ref="GoToUserRolesActionGroup" stepKey="GoBackToUserRoles"/> <actionGroup ref="AdminDeleteRoleActionGroup" stepKey="AdminDeleteRoleActionGroup"/> </after> </test> From 097228c7f2aba5cef9b079225940c7878892dfc5 Mon Sep 17 00:00:00 2001 From: Maximilian Fickers <m.fickers@basecom.de> Date: Thu, 28 Nov 2019 11:34:40 +0100 Subject: [PATCH 295/595] #20463 Fix order summary view details label misalign --- .../luma/Magento_Checkout/web/css/source/module/_minicart.less | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less index c5788d9c6fa51..43ccee738a45e 100644 --- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less +++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less @@ -315,7 +315,8 @@ .toggle { &:extend(.abs-toggling-title all); border: 0; - padding: 0 @indent__m @indent__xs 0; + padding: 0 0 @indent__xs 0; + white-space: nowrap; &:after { .lib-css(color, @color-gray56); From a9d15943f0f6f35a1d42eee15c5b992ed66810ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torben=20Ho=CC=88hn?= <torhoehn@gmail.com> Date: Thu, 28 Nov 2019 11:58:48 +0100 Subject: [PATCH 296/595] add unit test for attribute creation --- .../Product/Attribute/ValidateTest.php | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) diff --git a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Attribute/ValidateTest.php b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Attribute/ValidateTest.php index 742148b1bf7f1..4f797cdd763c0 100644 --- a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Attribute/ValidateTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Attribute/ValidateTest.php @@ -439,6 +439,127 @@ public function provideEmptyOption() ]; } + /** + * Check that admin scope labels which only contain spaces will trigger error. + * + * @dataProvider provideWhitespaceOption + * @param array $options + * @param $result + * @throws \Magento\Framework\Exception\NotFoundException + */ + public function testWhitespaceOption(array $options, $result) + { + $serializedOptions = '{"key":"value"}'; + $this->requestMock->expects($this->any()) + ->method('getParam') + ->willReturnMap([ + ['frontend_label', null, null], + ['frontend_input', 'select', 'multipleselect'], + ['attribute_code', null, "test_attribute_code"], + ['new_attribute_set_name', null, 'test_attribute_set_name'], + ['message_key', Validate::DEFAULT_MESSAGE_KEY, 'message'], + ['serialized_options', '[]', $serializedOptions], + ]); + + $this->formDataSerializerMock + ->expects($this->once()) + ->method('unserialize') + ->with($serializedOptions) + ->willReturn($options); + + $this->objectManagerMock->expects($this->once()) + ->method('create') + ->willReturn($this->attributeMock); + + $this->attributeMock->expects($this->once()) + ->method('loadByCode') + ->willReturnSelf(); + + $this->attributeCodeValidatorMock->expects($this->once()) + ->method('isValid') + ->with('test_attribute_code') + ->willReturn(true); + + $this->resultJsonFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($this->resultJson); + + $this->resultJson->expects($this->once()) + ->method('setJsonData') + ->willReturnArgument(0); + + $response = $this->getModel()->execute(); + $responseObject = json_decode($response); + $this->assertEquals($responseObject, $result); + } + + /** + * Dataprovider for testWhitespaceOption. + * + * @return array + */ + public function provideWhitespaceOption() + { + return [ + 'whitespace admin scope options' => [ + [ + 'option' => [ + 'value' => [ + "option_0" => [' '], + ], + ], + ], + (object) [ + 'error' => true, + 'message' => 'The value of Admin scope can\'t be empty.', + ] + ], + 'not empty admin scope options' => [ + [ + 'option' => [ + 'value' => [ + "option_0" => ['asdads'], + ], + ], + ], + (object) [ + 'error' => false, + ] + ], + 'whitespace admin scope options and deleted' => [ + [ + 'option' => [ + 'value' => [ + "option_0" => [' '], + ], + 'delete' => [ + 'option_0' => '1', + ], + ], + ], + (object) [ + 'error' => false, + ], + ], + 'whitespace admin scope options and not deleted' => [ + [ + 'option' => [ + 'value' => [ + "option_0" => [' '], + ], + 'delete' => [ + 'option_0' => '0', + ], + ], + ], + (object) [ + 'error' => true, + 'message' => 'The value of Admin scope can\'t be empty.', + ], + ], + ]; + } + /** * @throws \Magento\Framework\Exception\NotFoundException */ From c71d695be0142a370fb220599282f62ff425153b Mon Sep 17 00:00:00 2001 From: Subash Natarajan <subash.natarajan@ziffity.com> Date: Thu, 28 Nov 2019 16:59:29 +0530 Subject: [PATCH 297/595] Unit test case change reverted --- .../Test/Unit/Controller/Adminhtml/Index/InlineEditTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/InlineEditTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/InlineEditTest.php index c198eb3a212fa..45e64f6557d51 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/InlineEditTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/InlineEditTest.php @@ -366,7 +366,7 @@ public function testExecuteLocalizedException() ->with($this->customerData) ->willThrowException($exception); $this->messageManager->expects($this->once()) - ->method('addErrorMessage') + ->method('addError') ->with('[Customer ID: 12] Exception message'); $this->logger->expects($this->once()) ->method('critical') @@ -394,7 +394,7 @@ public function testExecuteException() ->with($this->customerData) ->willThrowException($exception); $this->messageManager->expects($this->once()) - ->method('addErrorMessage') + ->method('addError') ->with('[Customer ID: 12] We can\'t save the customer.'); $this->logger->expects($this->once()) ->method('critical') From 236988709f6db007988ca274bfbf837c2b609bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 12:51:34 +0100 Subject: [PATCH 298/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...dBundleOptionWithOneProductActionGroup.xml | 26 +++ ...BundleOptionWithSixProductsActionGroup.xml | 55 ++++++ ...undleOptionWithTreeProductsActionGroup.xml | 31 +++ ...BundleOptionWithTwoProductsActionGroup.xml | 48 +++++ ...AdminCreateApiBundleProductActionGroup.xml | 184 ------------------ ...eateApiDynamicBundleProductActionGroup.xml | 65 +++++++ ...BundleProductAllOptionTypesActionGroup.xml | 74 +++++++ ...CreateApiFixedBundleProductActionGroup.xml | 65 +++++++ ...AncillaryPrepBundleProductActionGroup.xml} | 19 +- ...edFieldsInBundleProductFormActionGroup.xml | 23 +++ .../CreateBasicBundleProductActionGroup.xml | 29 +++ .../CreateBundleProductActionGroup.xml | 162 --------------- .../DeleteBundleOptionByIndexActionGroup.xml | 23 +++ .../FillMainBundleProductFormActionGroup.xml | 23 +++ .../FindProductToEditActionGroup.xml | 24 +++ ...leProductFromCategoryToCartActionGroup.xml | 27 +++ ...dleProductFromProductToCartActionGroup.xml | 24 +++ ...roductToCartWithMultiOptionActionGroup.xml | 22 +++ ...CategoryBundleProductToCartActionGroup.xml | 30 +++ .../StorefrontProductCartActionGroup.xml | 77 -------- ...ewBundleProductInAdminGridActionGroup.xml} | 31 +-- .../Mftf/Test/AdminAddBundleItemsTest.xml | 2 +- ...CreateAndEditBundleProductSettingsTest.xml | 14 +- .../Mftf/Test/AdminDeleteABundleProduct.xml | 2 +- .../AdminFilterProductListByBundleProduct.xml | 2 +- .../Test/AdminMassDeleteBundleProducts.xml | 2 +- .../Test/AdminProductBundleCreationTest.xml | 2 +- .../Test/BundleProductFixedPricingTest.xml | 2 +- .../BundleProductWithTierPriceInCartTest.xml | 6 +- ...urrencyChangingBundleProductInCartTest.xml | 4 +- .../EnableDisableBundleProductStatusTest.xml | 2 +- .../MassEnableDisableBundleProductsTest.xml | 2 +- .../StorefrontAddBundleOptionsToCartTest.xml | 6 +- .../Mftf/Test/StorefrontBundleCartTest.xml | 16 +- .../StorefrontBundleProductDetailsTest.xml | 2 +- ...undleProductShownInCategoryListAndGrid.xml | 2 +- ...tCustomerSelectAndSetBundleOptionsTest.xml | 8 +- ...ontGoToDetailsPageWhenAddingToCartTest.xml | 2 +- .../Mftf/Test/SearchEntityResultsTest.xml | 2 +- ...inCartRulesAppliedForProductInCartTest.xml | 2 +- 40 files changed, 632 insertions(+), 510 deletions(-) create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithOneProductActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithSixProductsActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithTreeProductsActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithTwoProductsActionGroup.xml delete mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiBundleProductActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiDynamicBundleProductActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiDynamicBundleProductAllOptionTypesActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiFixedBundleProductActionGroup.xml rename app/code/Magento/Bundle/Test/Mftf/ActionGroup/{EnableDisableProductActionGroup.xml => AncillaryPrepBundleProductActionGroup.xml} (51%) create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/CheckRequiredFieldsInBundleProductFormActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/CreateBasicBundleProductActionGroup.xml delete mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/CreateBundleProductActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/DeleteBundleOptionByIndexActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/FillMainBundleProductFormActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/FindProductToEditActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromCategoryToCartActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromProductToCartActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromProductToCartWithMultiOptionActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddCategoryBundleProductToCartActionGroup.xml delete mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml rename app/code/Magento/Bundle/Test/Mftf/ActionGroup/{AdminBundleProductActionGroup.xml => ViewBundleProductInAdminGridActionGroup.xml} (50%) diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithOneProductActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithOneProductActionGroup.xml new file mode 100644 index 0000000000000..7c60cde4e20d3 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithOneProductActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AddBundleOptionWithOneProductActionGroup" extends="AddBundleOptionWithTwoProductsActionGroup"> + <annotations> + <description>Requires Navigation to the Product Creation page. Adds Bundle Option with One Product as specified in arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> + </annotations> + + <remove keyForRemoval="openProductFilters2"/> + <remove keyForRemoval="fillProductSkuFilter2"/> + <remove keyForRemoval="clickApplyFilters2"/> + <remove keyForRemoval="waitForFilteredGridLoad2"/> + <remove keyForRemoval="selectProduct2"/> + <remove keyForRemoval="selectProduct2"/> + <remove keyForRemoval="fillQuantity1"/> + <remove keyForRemoval="fillQuantity2"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity" after="clickAddButton1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithSixProductsActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithSixProductsActionGroup.xml new file mode 100644 index 0000000000000..9fd89bbbfe6d5 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithSixProductsActionGroup.xml @@ -0,0 +1,55 @@ +<?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="AddBundleOptionWithSixProductsActionGroup" extends="AddBundleOptionWithTwoProductsActionGroup"> + <annotations> + <description>Requires Navigation to Product Creation page. Adds Bundle Option with Six Products as specified in arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> + </annotations> + <arguments> + <argument name="prodTreeSku" type="string"/> + <argument name="prodFourSku" type="string"/> + <argument name="prodFiveSku" type="string"/> + <argument name="prodSixSku" type="string"/> + </arguments> + + <remove keyForRemoval="fillQuantity1"/> + <remove keyForRemoval="fillQuantity2"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters4" after="selectProduct3"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters4" after="clickClearFilters4"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFourSku}}" stepKey="fillProductSkuFilter4" after="openProductFilters4"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters4" after="fillProductSkuFilter4"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad4" time="30" after="clickApplyFilters4"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct4" after="clickApplyFilters4"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters5" after="selectProduct4"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters5" after="clickClearFilters5"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFiveSku}}" stepKey="fillProductSkuFilter5" after="openProductFilters5"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters5" after="fillProductSkuFilter5"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad5" time="30" after="clickApplyFilters5"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct5" after="waitForFilteredGridLoad5"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters6" after="selectProduct5"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters6" after="clickClearFilters6"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodSixSku}}" stepKey="fillProductSkuFilter6" after="openProductFilters6"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters6" after="fillProductSkuFilter6"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad6" time="30" after="clickApplyFilters6"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct6" after="waitForFilteredGridLoad6"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="2" stepKey="fillQuantity1" after="clickAddButton1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="2" stepKey="fillQuantity2" after="fillQuantity1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="2" stepKey="fillQuantity3" after="fillQuantity2"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '3')}}" userInput="2" stepKey="fillQuantity4" after="fillQuantity3"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '4')}}" userInput="2" stepKey="fillQuantity5" after="fillQuantity4"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '5')}}" userInput="2" stepKey="fillQuantity6" after="fillQuantity5"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithTreeProductsActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithTreeProductsActionGroup.xml new file mode 100644 index 0000000000000..085ee47b89e0e --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithTreeProductsActionGroup.xml @@ -0,0 +1,31 @@ +<?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="AddBundleOptionWithThreeProductsActionGroup" extends="AddBundleOptionWithTwoProductsActionGroup"> + <annotations> + <description>Requires Navigation to the Product Creation page. Adds Bundle Option with Three Products using the provided arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> + </annotations> + <arguments> + <argument name="prodTreeSku" type="string"/> + </arguments> + + <remove keyForRemoval="fillQuantity1"/> + <remove keyForRemoval="fillQuantity2"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity1" after="clickAddButton1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="1" stepKey="fillQuantity2" after="fillQuantity1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="1" stepKey="fillQuantity3" after="fillQuantity2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithTwoProductsActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithTwoProductsActionGroup.xml new file mode 100644 index 0000000000000..f54704de9dbd9 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AddBundleOptionWithTwoProductsActionGroup.xml @@ -0,0 +1,48 @@ +<?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="AddBundleOptionWithTwoProductsActionGroup"> + <annotations> + <description>Requires Navigation to the Product Creation page. Adds Bundle Option with Two Products using the provided arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> + </annotations> + <arguments> + <argument name="x" type="string"/> + <argument name="n" type="string"/> + <argument name="prodOneSku" type="string"/> + <argument name="prodTwoSku" type="string"/> + <argument name="optionTitle" type="string"/> + <argument name="inputType" type="string"/> + </arguments> + + <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> + <scrollTo selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" stepKey="scrollUpABit"/> + <click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption"/> + <waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle(x)}}" stepKey="waitForOptions"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle(x)}}" userInput="{{optionTitle}}" stepKey="fillTitle"/> + <selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType(x)}}" userInput="{{inputType}}" stepKey="selectType"/> + <waitForElementVisible selector="{{AdminProductFormBundleSection.nthAddProductsToOption(n)}}" stepKey="waitForAddBtn"/> + <click selector="{{AdminProductFormBundleSection.nthAddProductsToOption(n)}}" stepKey="clickAdd"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters1"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters1"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodOneSku}}" stepKey="fillProductSkuFilter1"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters1"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad1" time="30"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct1"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters2"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters2"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTwoSku}}" stepKey="fillProductSkuFilter2"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters2"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad2" time="30"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct2"/> + <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddButton1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="50" stepKey="fillQuantity1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="50" stepKey="fillQuantity2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiBundleProductActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiBundleProductActionGroup.xml deleted file mode 100644 index 8993a936475b4..0000000000000 --- a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiBundleProductActionGroup.xml +++ /dev/null @@ -1,184 +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="AdminCreateApiDynamicBundleProductActionGroup"> - <annotations> - <description>Creates 4 products with varying prices. Creates the bundle product with specified name. Adds the multiple select and checkbox options and 4 links to the created products. Uses the 'ApiBundleProduct' entity.</description> - </annotations> - <arguments> - <argument name="productName" defaultValue="Api Dynamic Bundle Product" type="string"/> - </arguments> - - <!--Create 4 simple products--> - <createData entity="SimpleProduct2" stepKey="simpleProduct1"> - <field key="price">4.99</field> - </createData> - <createData entity="SimpleProduct2" stepKey="simpleProduct2"> - <field key="price">2.89</field> - </createData> - <createData entity="SimpleProduct2" stepKey="simpleProduct3"> - <field key="price">7.33</field> - </createData> - <createData entity="SimpleProduct2" stepKey="simpleProduct4"> - <field key="price">18.25</field> - </createData> - - <!-- Create the bundle product based --> - <createData entity="ApiBundleProduct" stepKey="createBundleProduct"> - <field key="name">{{productName}}</field> - </createData> - <createData entity="MultipleSelectOption" stepKey="createBundleOption1_1"> - <requiredEntity createDataKey="createBundleProduct"/> - <field key="required">false</field> - </createData> - <createData entity="CheckboxOption" stepKey="createBundleOption1_2"> - <requiredEntity createDataKey="createBundleProduct"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkOptionToProduct"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleOption1_1"/> - <requiredEntity createDataKey="simpleProduct1"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkOptionToProduct2"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleOption1_1"/> - <requiredEntity createDataKey="simpleProduct2"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkOptionToProduct3"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleOption1_2"/> - <requiredEntity createDataKey="simpleProduct3"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkOptionToProduct4"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleOption1_2"/> - <requiredEntity createDataKey="simpleProduct4"/> - </createData> - </actionGroup> - - <actionGroup name="AdminCreateApiFixedBundleProductActionGroup"> - <annotations> - <description>Creates 4 products with varying prices. Creates the bundle product with specified name. Adds the multiple select and checkbox options and 4 links to the created products. Uses the 'ApiFixedBundleProduct' entity.</description> - </annotations> - <arguments> - <argument name="productName" defaultValue="Api Fixed Bundle Product" type="string"/> - </arguments> - - <!--Create 4 simple products--> - <createData entity="SimpleProduct2" stepKey="simpleProduct1"> - <field key="price">4.99</field> - </createData> - <createData entity="SimpleProduct2" stepKey="simpleProduct2"> - <field key="price">2.89</field> - </createData> - <createData entity="SimpleProduct2" stepKey="simpleProduct3"> - <field key="price">7.33</field> - </createData> - <createData entity="SimpleProduct2" stepKey="simpleProduct4"> - <field key="price">18.25</field> - </createData> - - <!-- Create the bundle product based --> - <createData entity="ApiFixedBundleProduct" stepKey="createBundleProduct"> - <field key="name">{{productName}}</field> - </createData> - <createData entity="MultipleSelectOption" stepKey="createBundleOption1_1"> - <requiredEntity createDataKey="createBundleProduct"/> - <field key="required">false</field> - </createData> - <createData entity="CheckboxOption" stepKey="createBundleOption1_2"> - <requiredEntity createDataKey="createBundleProduct"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkOptionToProduct"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleOption1_1"/> - <requiredEntity createDataKey="simpleProduct1"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkOptionToProduct2"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleOption1_1"/> - <requiredEntity createDataKey="simpleProduct2"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkOptionToProduct3"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleOption1_2"/> - <requiredEntity createDataKey="simpleProduct3"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkOptionToProduct4"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleOption1_2"/> - <requiredEntity createDataKey="simpleProduct4"/> - </createData> - </actionGroup> - - <actionGroup name="AdminCreateApiDynamicBundleProductAllOptionTypesActionGroup"> - <annotations> - <description>Creates 3 products with varying prices. Creates the dynamic bundle product with specified name. Adds the multiple select, checkbox options and links to the created products. Uses the 'ApiBundleProduct' entity.</description> - </annotations> - <arguments> - <argument name="productName" defaultValue="Api Dynamic Bundle Product" type="string"/> - </arguments> - - <!-- Create simple products --> - <createData entity="SimpleProduct2" stepKey="simpleProduct1"> - <field key="price">10</field> - </createData> - <createData entity="SimpleProduct2" stepKey="simpleProduct2"> - <field key="price">20</field> - </createData> - - <!-- Create Bundle product --> - <createData entity="ApiBundleProduct" stepKey="createBundleProduct"> - <field key="name">{{productName}}</field> - </createData> - <createData entity="DropDownBundleOption" stepKey="createDropDownBundleOption"> - <requiredEntity createDataKey="createBundleProduct"/> - <field key="title">Drop-down Option</field> - </createData> - <createData entity="RadioButtonsOption" stepKey="createBundleRadioButtonsOption"> - <requiredEntity createDataKey="createBundleProduct"/> - <field key="title">Radio Buttons Option</field> - </createData> - <createData entity="CheckboxOption" stepKey="createBundleCheckboxOption"> - <requiredEntity createDataKey="createBundleProduct"/> - <field key="title">Checkbox Option</field> - </createData> - <createData entity="ApiBundleLink" stepKey="linkCheckboxOptionToProduct1"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleCheckboxOption"/> - <requiredEntity createDataKey="simpleProduct1"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkCheckboxOptionToProduct2"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleCheckboxOption"/> - <requiredEntity createDataKey="simpleProduct2"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkDropDownOptionToProduct1"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createDropDownBundleOption"/> - <requiredEntity createDataKey="simpleProduct1"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkDropDownOptionToProduct2"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createDropDownBundleOption"/> - <requiredEntity createDataKey="simpleProduct2"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkRadioButtonsOptionToProduct1"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleRadioButtonsOption"/> - <requiredEntity createDataKey="simpleProduct1"/> - </createData> - <createData entity="ApiBundleLink" stepKey="linkRadioButtonsOptionToProduct2"> - <requiredEntity createDataKey="createBundleProduct"/> - <requiredEntity createDataKey="createBundleRadioButtonsOption"/> - <requiredEntity createDataKey="simpleProduct2"/> - </createData> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiDynamicBundleProductActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiDynamicBundleProductActionGroup.xml new file mode 100644 index 0000000000000..7e17822710a18 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiDynamicBundleProductActionGroup.xml @@ -0,0 +1,65 @@ +<?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="AdminCreateApiDynamicBundleProductActionGroup"> + <annotations> + <description>Creates 4 products with varying prices. Creates the bundle product with specified name. Adds the multiple select and checkbox options and 4 links to the created products. Uses the 'ApiBundleProduct' entity.</description> + </annotations> + <arguments> + <argument name="productName" defaultValue="Api Dynamic Bundle Product" type="string"/> + </arguments> + + <!--Create 4 simple products--> + <createData entity="SimpleProduct2" stepKey="simpleProduct1"> + <field key="price">4.99</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct2"> + <field key="price">2.89</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct3"> + <field key="price">7.33</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct4"> + <field key="price">18.25</field> + </createData> + + <!-- Create the bundle product based --> + <createData entity="ApiBundleProduct" stepKey="createBundleProduct"> + <field key="name">{{productName}}</field> + </createData> + <createData entity="MultipleSelectOption" stepKey="createBundleOption1_1"> + <requiredEntity createDataKey="createBundleProduct"/> + <field key="required">false</field> + </createData> + <createData entity="CheckboxOption" stepKey="createBundleOption1_2"> + <requiredEntity createDataKey="createBundleProduct"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_1"/> + <requiredEntity createDataKey="simpleProduct1"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct2"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_1"/> + <requiredEntity createDataKey="simpleProduct2"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct3"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_2"/> + <requiredEntity createDataKey="simpleProduct3"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct4"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_2"/> + <requiredEntity createDataKey="simpleProduct4"/> + </createData> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiDynamicBundleProductAllOptionTypesActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiDynamicBundleProductAllOptionTypesActionGroup.xml new file mode 100644 index 0000000000000..c9f5c52c05736 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiDynamicBundleProductAllOptionTypesActionGroup.xml @@ -0,0 +1,74 @@ +<?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="AdminCreateApiDynamicBundleProductAllOptionTypesActionGroup"> + <annotations> + <description>Creates 3 products with varying prices. Creates the dynamic bundle product with specified name. Adds the multiple select, checkbox options and links to the created products. Uses the 'ApiBundleProduct' entity.</description> + </annotations> + <arguments> + <argument name="productName" defaultValue="Api Dynamic Bundle Product" type="string"/> + </arguments> + + <!-- Create simple products --> + <createData entity="SimpleProduct2" stepKey="simpleProduct1"> + <field key="price">10</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct2"> + <field key="price">20</field> + </createData> + + <!-- Create Bundle product --> + <createData entity="ApiBundleProduct" stepKey="createBundleProduct"> + <field key="name">{{productName}}</field> + </createData> + <createData entity="DropDownBundleOption" stepKey="createDropDownBundleOption"> + <requiredEntity createDataKey="createBundleProduct"/> + <field key="title">Drop-down Option</field> + </createData> + <createData entity="RadioButtonsOption" stepKey="createBundleRadioButtonsOption"> + <requiredEntity createDataKey="createBundleProduct"/> + <field key="title">Radio Buttons Option</field> + </createData> + <createData entity="CheckboxOption" stepKey="createBundleCheckboxOption"> + <requiredEntity createDataKey="createBundleProduct"/> + <field key="title">Checkbox Option</field> + </createData> + <createData entity="ApiBundleLink" stepKey="linkCheckboxOptionToProduct1"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleCheckboxOption"/> + <requiredEntity createDataKey="simpleProduct1"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkCheckboxOptionToProduct2"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleCheckboxOption"/> + <requiredEntity createDataKey="simpleProduct2"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkDropDownOptionToProduct1"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createDropDownBundleOption"/> + <requiredEntity createDataKey="simpleProduct1"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkDropDownOptionToProduct2"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createDropDownBundleOption"/> + <requiredEntity createDataKey="simpleProduct2"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkRadioButtonsOptionToProduct1"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleRadioButtonsOption"/> + <requiredEntity createDataKey="simpleProduct1"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkRadioButtonsOptionToProduct2"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleRadioButtonsOption"/> + <requiredEntity createDataKey="simpleProduct2"/> + </createData> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiFixedBundleProductActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiFixedBundleProductActionGroup.xml new file mode 100644 index 0000000000000..13c31cf2e7127 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminCreateApiFixedBundleProductActionGroup.xml @@ -0,0 +1,65 @@ +<?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="AdminCreateApiFixedBundleProductActionGroup"> + <annotations> + <description>Creates 4 products with varying prices. Creates the bundle product with specified name. Adds the multiple select and checkbox options and 4 links to the created products. Uses the 'ApiFixedBundleProduct' entity.</description> + </annotations> + <arguments> + <argument name="productName" defaultValue="Api Fixed Bundle Product" type="string"/> + </arguments> + + <!--Create 4 simple products--> + <createData entity="SimpleProduct2" stepKey="simpleProduct1"> + <field key="price">4.99</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct2"> + <field key="price">2.89</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct3"> + <field key="price">7.33</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct4"> + <field key="price">18.25</field> + </createData> + + <!-- Create the bundle product based --> + <createData entity="ApiFixedBundleProduct" stepKey="createBundleProduct"> + <field key="name">{{productName}}</field> + </createData> + <createData entity="MultipleSelectOption" stepKey="createBundleOption1_1"> + <requiredEntity createDataKey="createBundleProduct"/> + <field key="required">false</field> + </createData> + <createData entity="CheckboxOption" stepKey="createBundleOption1_2"> + <requiredEntity createDataKey="createBundleProduct"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_1"/> + <requiredEntity createDataKey="simpleProduct1"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct2"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_1"/> + <requiredEntity createDataKey="simpleProduct2"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct3"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_2"/> + <requiredEntity createDataKey="simpleProduct3"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct4"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_2"/> + <requiredEntity createDataKey="simpleProduct4"/> + </createData> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/EnableDisableProductActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AncillaryPrepBundleProductActionGroup.xml similarity index 51% rename from app/code/Magento/Bundle/Test/Mftf/ActionGroup/EnableDisableProductActionGroup.xml rename to app/code/Magento/Bundle/Test/Mftf/ActionGroup/AncillaryPrepBundleProductActionGroup.xml index 92d885485949c..99551742deca1 100644 --- a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/EnableDisableProductActionGroup.xml +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AncillaryPrepBundleProductActionGroup.xml @@ -7,8 +7,8 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AncillaryPrepBundleProduct"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AncillaryPrepBundleProductActionGroup"> <annotations> <description>Requires Navigation to the Product Creation page. Fills out Name, Sku, and SEO information using the BundleProduct Data Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> </annotations> @@ -25,19 +25,4 @@ <!--Fill URL input--> <fillField userInput="{{BundleProduct.urlKey}}" selector="{{AdminProductFormBundleSection.urlKey}}" stepKey="FillsinSEOlinkExtension"/> </actionGroup> - - <!--Edit existing product by searching in product catalog--> - <actionGroup name="FindProductToEdit"> - <annotations> - <description>Clears the Backend Admin Grid Filters on the Backend Admin Product Grid page. Searches for the BundleProduct Data Entity. Then clicks on the first item in the Admin Grid. PLEASE NOTE: The Action Group values are Hardcoded.</description> - </annotations> - - <amOnPage url="{{ProductCatalogPage.url}}" stepKey="GoToProductCatalog"/> - <waitForPageLoad stepKey="WaitForCatalogProductPageToLoad"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <fillField userInput="{{BundleProduct.name}}" selector="#fulltext" stepKey="EnterProductNameInSearch"/> - <click stepKey="ClickSearch" selector="{{AdminProductFormBundleSection.searchButton}}"/> - <click stepKey="ClickOnProduct" selector="{{AdminProductFormBundleSection.firstCatalogProduct}}"/> - <waitForPageLoad stepKey="WaitForProductEditPageToLoad"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/CheckRequiredFieldsInBundleProductFormActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/CheckRequiredFieldsInBundleProductFormActionGroup.xml new file mode 100644 index 0000000000000..9575349ba3110 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/CheckRequiredFieldsInBundleProductFormActionGroup.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="CheckRequiredFieldsInBundleProductFormActionGroup"> + <annotations> + <description>Clears the Name and SKU fields when adding a Product and then verifies that they are required after attempting to Save.</description> + </annotations> + + <clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductSku"/> + <clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductName"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/> + <see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/> + <see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/CreateBasicBundleProductActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/CreateBasicBundleProductActionGroup.xml new file mode 100644 index 0000000000000..fd81b392db708 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/CreateBasicBundleProductActionGroup.xml @@ -0,0 +1,29 @@ +<?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="CreateBasicBundleProductActionGroup"> + <annotations> + <description>Requires Navigation to the Product Creation page. Fills out Name, Sku, and SEO information using the BundleProduct Data Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> + </annotations> + + <!--PreReq: Go to bundle product creation page--> + <!--Product name and SKU--> + <fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/> + <fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/> + + <!--Trigger SEO drop down--> + <scrollTo selector="{{AdminProductFormBundleSection.seoDropdown}}" stepKey="scrollToSeoDropDown"/> + <conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.urlKey}}" visible="false" stepKey="openDropDownIfClosed"/> + <waitForPageLoad stepKey="waitForDropDownSEO"/> + + <!--Fill URL input--> + <fillField userInput="{{BundleProduct.urlKey}}" selector="{{AdminProductFormBundleSection.urlKey}}" stepKey="fillsInSeoLinkExtension"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/CreateBundleProductActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/CreateBundleProductActionGroup.xml deleted file mode 100644 index 33740c346155a..0000000000000 --- a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/CreateBundleProductActionGroup.xml +++ /dev/null @@ -1,162 +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="CreateBasicBundleProduct"> - <annotations> - <description>Requires Navigation to the Product Creation page. Fills out Name, Sku, and SEO information using the BundleProduct Data Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> - </annotations> - - <!--PreReq: Go to bundle product creation page--> - <!--Product name and SKU--> - <fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/> - - <!--Trigger SEO drop down--> - <scrollTo selector="{{AdminProductFormBundleSection.seoDropdown}}" stepKey="scrollToSeoDropDown"/> - <conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.urlKey}}" visible="false" stepKey="openDropDownIfClosed"/> - <waitForPageLoad stepKey="waitForDropDownSEO"/> - - <!--Fill URL input--> - <fillField userInput="{{BundleProduct.urlKey}}" selector="{{AdminProductFormBundleSection.urlKey}}" stepKey="fillsInSeoLinkExtension"/> - </actionGroup> - - <actionGroup name="addBundleOptionWithTwoProducts"> - <annotations> - <description>Requires Navigation to the Product Creation page. Adds Bundle Option with Two Products using the provided arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> - </annotations> - <arguments> - <argument name="x" type="string"/> - <argument name="n" type="string"/> - <argument name="prodOneSku" type="string"/> - <argument name="prodTwoSku" type="string"/> - <argument name="optionTitle" type="string"/> - <argument name="inputType" type="string"/> - </arguments> - - <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> - <scrollTo selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" stepKey="scrollUpABit"/> - <click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption"/> - <waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle(x)}}" stepKey="waitForOptions"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle(x)}}" userInput="{{optionTitle}}" stepKey="fillTitle"/> - <selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType(x)}}" userInput="{{inputType}}" stepKey="selectType"/> - <waitForElementVisible selector="{{AdminProductFormBundleSection.nthAddProductsToOption(n)}}" stepKey="waitForAddBtn"/> - <click selector="{{AdminProductFormBundleSection.nthAddProductsToOption(n)}}" stepKey="clickAdd"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters1"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters1"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodOneSku}}" stepKey="fillProductSkuFilter1"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters1"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad1" time="30"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct1"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters2"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters2"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTwoSku}}" stepKey="fillProductSkuFilter2"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters2"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad2" time="30"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct2"/> - <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddButton1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="50" stepKey="fillQuantity1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="50" stepKey="fillQuantity2"/> - </actionGroup> - - <actionGroup name="addBundleOptionWithOneProduct" extends="addBundleOptionWithTwoProducts"> - <annotations> - <description>Requires Navigation to the Product Creation page. Adds Bundle Option with One Product as specified in arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> - </annotations> - - <remove keyForRemoval="openProductFilters2"/> - <remove keyForRemoval="fillProductSkuFilter2"/> - <remove keyForRemoval="clickApplyFilters2"/> - <remove keyForRemoval="waitForFilteredGridLoad2"/> - <remove keyForRemoval="selectProduct2"/> - <remove keyForRemoval="selectProduct2"/> - <remove keyForRemoval="fillQuantity1"/> - <remove keyForRemoval="fillQuantity2"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity" after="clickAddButton1"/> - </actionGroup> - - <actionGroup name="addBundleOptionWithTreeProducts" extends="addBundleOptionWithTwoProducts"> - <annotations> - <description>Requires Navigation to the Product Creation page. Adds Bundle Option with Three Products using the provided arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> - </annotations> - <arguments> - <argument name="prodTreeSku" type="string"/> - </arguments> - - <remove keyForRemoval="fillQuantity1"/> - <remove keyForRemoval="fillQuantity2"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity1" after="clickAddButton1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="1" stepKey="fillQuantity2" after="fillQuantity1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="1" stepKey="fillQuantity3" after="fillQuantity2"/> - </actionGroup> - - <actionGroup name="addBundleOptionWithSixProducts" extends="addBundleOptionWithTwoProducts"> - <annotations> - <description>Requires Navigation to Product Creation page. Adds Bundle Option with Six Products as specified in arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> - </annotations> - <arguments> - <argument name="prodTreeSku" type="string"/> - <argument name="prodFourSku" type="string"/> - <argument name="prodFiveSku" type="string"/> - <argument name="prodSixSku" type="string"/> - </arguments> - - <remove keyForRemoval="fillQuantity1"/> - <remove keyForRemoval="fillQuantity2"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters4" after="selectProduct3"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters4" after="clickClearFilters4"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFourSku}}" stepKey="fillProductSkuFilter4" after="openProductFilters4"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters4" after="fillProductSkuFilter4"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad4" time="30" after="clickApplyFilters4"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct4" after="clickApplyFilters4"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters5" after="selectProduct4"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters5" after="clickClearFilters5"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFiveSku}}" stepKey="fillProductSkuFilter5" after="openProductFilters5"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters5" after="fillProductSkuFilter5"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad5" time="30" after="clickApplyFilters5"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct5" after="waitForFilteredGridLoad5"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters6" after="selectProduct5"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters6" after="clickClearFilters6"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodSixSku}}" stepKey="fillProductSkuFilter6" after="openProductFilters6"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters6" after="fillProductSkuFilter6"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad6" time="30" after="clickApplyFilters6"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct6" after="waitForFilteredGridLoad6"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="2" stepKey="fillQuantity1" after="clickAddButton1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="2" stepKey="fillQuantity2" after="fillQuantity1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="2" stepKey="fillQuantity3" after="fillQuantity2"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '3')}}" userInput="2" stepKey="fillQuantity4" after="fillQuantity3"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '4')}}" userInput="2" stepKey="fillQuantity5" after="fillQuantity4"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '5')}}" userInput="2" stepKey="fillQuantity6" after="fillQuantity5"/> - </actionGroup> - - <actionGroup name="deleteBundleOptionByIndex"> - <annotations> - <description>Requires Navigation to Product Creation page. Removes any Bundle Option by index specified in arguments. 'deleteIndex' refers to Bundle option number.</description> - </annotations> - <arguments> - <argument name="deleteIndex" type="string"/> - </arguments> - - <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> - <scrollTo selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" stepKey="scrollUpABit"/> - <click selector="{{AdminProductFormBundleSection.deleteOption(deleteIndex)}}" stepKey="clickDeleteOption"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/DeleteBundleOptionByIndexActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/DeleteBundleOptionByIndexActionGroup.xml new file mode 100644 index 0000000000000..52a4897f8e354 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/DeleteBundleOptionByIndexActionGroup.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="DeleteBundleOptionByIndexActionGroup"> + <annotations> + <description>Requires Navigation to Product Creation page. Removes any Bundle Option by index specified in arguments. 'deleteIndex' refers to Bundle option number.</description> + </annotations> + <arguments> + <argument name="deleteIndex" type="string"/> + </arguments> + + <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> + <scrollTo selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" stepKey="scrollUpABit"/> + <click selector="{{AdminProductFormBundleSection.deleteOption(deleteIndex)}}" stepKey="clickDeleteOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/FillMainBundleProductFormActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/FillMainBundleProductFormActionGroup.xml new file mode 100644 index 0000000000000..71baf0c450759 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/FillMainBundleProductFormActionGroup.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="FillMainBundleProductFormActionGroup"> + <annotations> + <description>Fills the Name, SKU and Stock Status fields.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="BundleProduct"/> + </arguments> + + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> + <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="selectStockStatus"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/FindProductToEditActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/FindProductToEditActionGroup.xml new file mode 100644 index 0000000000000..bd6dbb79489b3 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/FindProductToEditActionGroup.xml @@ -0,0 +1,24 @@ +<?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="FindProductToEditActionGroup"> + <annotations> + <description>Clears the Backend Admin Grid Filters on the Backend Admin Product Grid page. Searches for the BundleProduct Data Entity. Then clicks on the first item in the Admin Grid. PLEASE NOTE: The Action Group values are Hardcoded.</description> + </annotations> + + <amOnPage url="{{ProductCatalogPage.url}}" stepKey="GoToProductCatalog"/> + <waitForPageLoad stepKey="WaitForCatalogProductPageToLoad"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <fillField userInput="{{BundleProduct.name}}" selector="#fulltext" stepKey="EnterProductNameInSearch"/> + <click stepKey="ClickSearch" selector="{{AdminProductFormBundleSection.searchButton}}"/> + <click stepKey="ClickOnProduct" selector="{{AdminProductFormBundleSection.firstCatalogProduct}}"/> + <waitForPageLoad stepKey="WaitForProductEditPageToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromCategoryToCartActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromCategoryToCartActionGroup.xml new file mode 100644 index 0000000000000..ccfa356881594 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromCategoryToCartActionGroup.xml @@ -0,0 +1,27 @@ +<?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="StorefrontAddBundleProductFromCategoryToCartActionGroup"> + <annotations> + <description>Adds a Bundled Product to the Cart from the Product page. PLEASE NOTE: The Quantity selection is not available in the Action Group.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductTitleByName(productName)}}" stepKey="moveMouseOverProduct"/> + <click selector="{{StorefrontCategoryProductSection.ProductTitleByName(productName)}}" stepKey="openProductPage"/> + <waitForPageLoad time="30" stepKey="waitForBundleProductPageLoad"/> + <click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomizeAndAddToCart"/> + <click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddBundleProductToCart"/> + <waitForElementVisible selector="{{StorefrontMinicartSection.productCount}}" stepKey="waitProductCount"/> + <see userInput="You added {{productName}} to your shopping cart." selector="{{StorefrontMessagesSection.success}}" stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromProductToCartActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromProductToCartActionGroup.xml new file mode 100644 index 0000000000000..cf4cfa4659264 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromProductToCartActionGroup.xml @@ -0,0 +1,24 @@ +<?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="StorefrontAddBundleProductFromProductToCartActionGroup"> + <annotations> + <description>Adds a Bundled Product to the Cart from the Product page. PLEASE NOTE: The Quantity selection is not available in the Action Group.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + + <click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomizeAndAddToCart"/> + <click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddBundleProductToCart"/> + <waitForElementVisible selector="{{StorefrontMinicartSection.productCount}}" stepKey="waitProductCount"/> + <see userInput="You added {{productName}} to your shopping cart." selector="{{StorefrontMessagesSection.success}}" stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromProductToCartWithMultiOptionActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromProductToCartWithMultiOptionActionGroup.xml new file mode 100644 index 0000000000000..49adf670b4c98 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddBundleProductFromProductToCartWithMultiOptionActionGroup.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="StorefrontAddBundleProductFromProductToCartWithMultiOptionActionGroup" extends="StorefrontAddBundleProductFromProductToCartActionGroup"> + <annotations> + <description>Selects a Bundled Product option on the Bundled Product page. PLEASE NOTE: The Quantity selection is not available in the Action Group.</description> + </annotations> + <arguments> + <argument name="optionName" type="string"/> + <argument name="value" type="string"/> + </arguments> + + <selectOption selector="{{StorefrontBundledSection.multiselectOptionFourProducts(optionName)}}" userInput="{{value}}" stepKey="selectValue" before="clickAddBundleProductToCart"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddCategoryBundleProductToCartActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddCategoryBundleProductToCartActionGroup.xml new file mode 100644 index 0000000000000..bf0e7068fbbde --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontAddCategoryBundleProductToCartActionGroup.xml @@ -0,0 +1,30 @@ +<?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="StorefrontAddCategoryBundleProductToCartActionGroup"> + <annotations> + <description>Adds a Bundled Product to the Cart from the Category page.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="quantity" defaultValue="1" type="string"/> + </arguments> + + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> + <click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="clickAddToCart"/> + <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> + <click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickCustomizeAndAddToCart"/> + <waitForPageLoad time="30" stepKey="waitForPageLoad2"/> + <fillField selector="{{StorefrontBundleProductActionSection.quantityField}}" userInput="{{quantity}}" stepKey="fillBundleProductQuantity"/> + <click selector="{{StorefrontBundleProductActionSection.addToCartButton}}" stepKey="clickAddBundleProductToCart"/> + <waitForPageLoad time="30" stepKey="waitForPageLoad3"/> + <waitForText userInput="{{quantity}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml deleted file mode 100644 index b260068dedf7c..0000000000000 --- a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml +++ /dev/null @@ -1,77 +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"> - <!-- Add Bundle Product to Cart from the category page with specified quantity to cart --> - <actionGroup name="StorefrontAddCategoryBundleProductToCartActionGroup"> - <annotations> - <description>Adds a Bundled Product to the Cart from the Category page.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="quantity" defaultValue="1" type="string"/> - </arguments> - - <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> - <click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="clickAddToCart"/> - <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> - <click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickCustomizeAndAddToCart"/> - <waitForPageLoad time="30" stepKey="waitForPageLoad2"/> - <fillField selector="{{StorefrontBundleProductActionSection.quantityField}}" userInput="{{quantity}}" stepKey="fillBundleProductQuantity"/> - <click selector="{{StorefrontBundleProductActionSection.addToCartButton}}" stepKey="clickAddBundleProductToCart"/> - <waitForPageLoad time="30" stepKey="waitForPageLoad3"/> - <waitForText userInput="{{quantity}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/> - </actionGroup> - - <!-- Add Bundle Product to Cart from the category page --> - <actionGroup name="StorefrontAddBundleProductFromCategoryToCartActionGroup"> - <annotations> - <description>Adds a Bundled Product to the Cart from the Product page. PLEASE NOTE: The Quantity selection is not available in the Action Group.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - </arguments> - - <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductTitleByName(productName)}}" stepKey="moveMouseOverProduct"/> - <click selector="{{StorefrontCategoryProductSection.ProductTitleByName(productName)}}" stepKey="openProductPage"/> - <waitForPageLoad time="30" stepKey="waitForBundleProductPageLoad"/> - <click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomizeAndAddToCart"/> - <click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddBundleProductToCart"/> - <waitForElementVisible selector="{{StorefrontMinicartSection.productCount}}" stepKey="waitProductCount"/> - <see userInput="You added {{productName}} to your shopping cart." selector="{{StorefrontMessagesSection.success}}" stepKey="seeSuccessMessage"/> - </actionGroup> - - <!-- Add Bundle Product to Cart from product Page--> - <actionGroup name="StorefrontAddBundleProductFromProductToCartActionGroup"> - <annotations> - <description>Adds a Bundled Product to the Cart from the Product page. PLEASE NOTE: The Quantity selection is not available in the Action Group.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - </arguments> - - <click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomizeAndAddToCart"/> - <click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddBundleProductToCart"/> - <waitForElementVisible selector="{{StorefrontMinicartSection.productCount}}" stepKey="waitProductCount"/> - <see userInput="You added {{productName}} to your shopping cart." selector="{{StorefrontMessagesSection.success}}" stepKey="seeSuccessMessage"/> - </actionGroup> - - <!-- Add Bundled Product to Cart with selected multiselect option--> - <actionGroup name="StorefrontAddBundleProductFromProductToCartWithMultiOption" extends="StorefrontAddBundleProductFromProductToCartActionGroup"> - <annotations> - <description>Selects a Bundled Product option on the Bundled Product page. PLEASE NOTE: The Quantity selection is not available in the Action Group.</description> - </annotations> - <arguments> - <argument name="optionName" type="string"/> - <argument name="value" type="string"/> - </arguments> - - <selectOption selector="{{StorefrontBundledSection.multiselectOptionFourProducts(optionName)}}" userInput="{{value}}" stepKey="selectValue" before="clickAddBundleProductToCart"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminBundleProductActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/ViewBundleProductInAdminGridActionGroup.xml similarity index 50% rename from app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminBundleProductActionGroup.xml rename to app/code/Magento/Bundle/Test/Mftf/ActionGroup/ViewBundleProductInAdminGridActionGroup.xml index e49126f4cf275..96179b49206c8 100644 --- a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminBundleProductActionGroup.xml +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/ViewBundleProductInAdminGridActionGroup.xml @@ -7,36 +7,7 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!--Fill main fields in create product form--> - <actionGroup name="fillMainBundleProductForm"> - <annotations> - <description>Fills the Name, SKU and Stock Status fields.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="BundleProduct"/> - </arguments> - - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> - <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="selectStockStatus"/> - </actionGroup> - - <!--Check that required fields are actually required--> - <actionGroup name="checkRequiredFieldsInBundleProductForm"> - <annotations> - <description>Clears the Name and SKU fields when adding a Product and then verifies that they are required after attempting to Save.</description> - </annotations> - - <clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductSku"/> - <clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductName"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/> - <see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/> - <see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/> - </actionGroup> - - <!--Filter product grid and see expected product--> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="viewBundleProductInAdminGrid"> <annotations> <description>Clears the Grid Filters on the Catalog Grid page and applies Filter by Name and Sku. Then checks to see if the Product exists in the 1st row. Then clears the Grid Filters again for future Tests.</description> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml index 401d360a34c64..f2cd278451724 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml @@ -64,7 +64,7 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> <!--Fill out ancillary data on bundle product--> - <actionGroup ref="AncillaryPrepBundleProduct" stepKey="createBundledProductForTwoSimpleProducts"> + <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"> <argument name="bundleProduct" value="BundleProduct"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml index 42584a31651d7..2418668235262 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml @@ -47,10 +47,10 @@ </actionGroup> <!-- Fill all main fields --> - <actionGroup ref="fillMainBundleProductForm" stepKey="fillMainProductFields"/> + <actionGroup ref="FillMainBundleProductFormActionGroup" stepKey="fillMainProductFields"/> <!-- Add the bundle option to the product --> - <actionGroup ref="addBundleOptionWithOneProduct" stepKey="addBundleOption"> + <actionGroup ref="AddBundleOptionWithOneProductActionGroup" stepKey="addBundleOption"> <argument name="x" value="0"/> <argument name="n" value="1"/> <argument name="prodOneSku" value="$$createSimpleProduct.sku$$"/> @@ -189,10 +189,10 @@ </actionGroup> <!-- Fill all main fields --> - <actionGroup ref="fillMainBundleProductForm" stepKey="fillMainProductFields"/> + <actionGroup ref="FillMainBundleProductFormActionGroup" stepKey="fillMainProductFields"/> <!-- Add first bundle option to the product --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addFirstBundleOption"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addFirstBundleOption"> <argument name="x" value="0"/> <argument name="n" value="1"/> <argument name="prodOneSku" value="$$createFirstSimpleProduct.sku$$"/> @@ -202,7 +202,7 @@ </actionGroup> <!-- Add second bundle option to the product --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addSecondBundleOption"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addSecondBundleOption"> <argument name="x" value="1"/> <argument name="n" value="2"/> <argument name="prodOneSku" value="$$createFirstSimpleProduct.sku$$"/> @@ -212,7 +212,7 @@ </actionGroup> <!-- Add third bundle option to the product --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addThirdBundleOption"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addThirdBundleOption"> <argument name="x" value="2"/> <argument name="n" value="3"/> <argument name="prodOneSku" value="$$createFirstSimpleProduct.sku$$"/> @@ -238,7 +238,7 @@ </actionGroup> <!-- Remove second option --> - <actionGroup ref="deleteBundleOptionByIndex" stepKey="deleteSecondOption"> + <actionGroup ref="DeleteBundleOptionByIndexActionGroup" stepKey="deleteSecondOption"> <argument name="deleteIndex" value="1"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProduct.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProduct.xml index 86db6f372b5f8..0b91141f9369a 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProduct.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProduct.xml @@ -53,7 +53,7 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> <!--Fill out ancillary data on bundle product--> - <actionGroup ref="AncillaryPrepBundleProduct" stepKey="createBundledProductForTwoSimpleProducts"/> + <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"/> <!--Save the product--> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProduct.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProduct.xml index 40a6e1b75c60a..bb1893f69d785 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProduct.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProduct.xml @@ -53,7 +53,7 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> <!--Fill out ancillary data on bundle product--> - <actionGroup ref="AncillaryPrepBundleProduct" stepKey="createBundledProductForTwoSimpleProducts"/> + <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"/> <!--Save the product--> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProducts.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProducts.xml index 2f891fcc8f169..16a109032556b 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProducts.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProducts.xml @@ -61,7 +61,7 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> <!--Fill out ancillary data on bundle product--> - <actionGroup ref="AncillaryPrepBundleProduct" stepKey="createBundledProductForTwoSimpleProducts"> + <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"> <argument name="bundleProduct" value="BundleProduct"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml index 1f46e1fc9f0b1..634d6bcf53547 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml @@ -61,7 +61,7 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> <!--Create a bundle product with ancillary data--> - <actionGroup ref="CreateBasicBundleProduct" stepKey="createBundledProduct"> + <actionGroup ref="CreateBasicBundleProductActionGroup" stepKey="createBundledProduct"> <argument name="bundleProduct" value="BundleProduct"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml index c922b981aecd9..08763ea67da00 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml @@ -63,7 +63,7 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> <!--Fill out ancillary data on bundle product--> - <actionGroup ref="AncillaryPrepBundleProduct" stepKey="createBundledProductForTwoSimpleProducts"> + <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"> <argument name="bundleProduct" value="BundleProduct"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml index 46c6114637af6..1536eadfe1329 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml @@ -37,8 +37,8 @@ </after> <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage"/> <waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/> - <actionGroup ref="fillMainBundleProductForm" stepKey="fillMainFieldsForBundle"/> - <actionGroup ref="addBundleOptionWithOneProduct" stepKey="addBundleOption1"> + <actionGroup ref="FillMainBundleProductFormActionGroup" stepKey="fillMainFieldsForBundle"/> + <actionGroup ref="AddBundleOptionWithOneProductActionGroup" stepKey="addBundleOption1"> <argument name="x" value="0"/> <argument name="n" value="1"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -46,7 +46,7 @@ <argument name="optionTitle" value="Option1"/> <argument name="inputType" value="checkbox"/> </actionGroup> - <actionGroup ref="addBundleOptionWithOneProduct" stepKey="addBundleOption2"> + <actionGroup ref="AddBundleOptionWithOneProductActionGroup" stepKey="addBundleOption2"> <argument name="x" value="1"/> <argument name="n" value="2"/> <argument name="prodOneSku" value="$$simpleProduct2.sku$$"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml index ded8bb3c83337..42d8ab522787b 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml @@ -46,9 +46,9 @@ <!--Go to bundle product creation page--> <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage"/> <waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/> - <actionGroup ref="fillMainBundleProductForm" stepKey="fillMainFieldsForBundle"/> + <actionGroup ref="FillMainBundleProductFormActionGroup" stepKey="fillMainFieldsForBundle"/> <!-- Add Option, a "Radio Buttons" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts2"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts2"> <argument name="x" value="0"/> <argument name="n" value="1"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml index 0cfd1f99a8ce0..16e64c5584450 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml @@ -59,7 +59,7 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> <!--Fill out ancillary data on bundle product--> - <actionGroup ref="AncillaryPrepBundleProduct" stepKey="createBundledProductForTwoSimpleProducts"> + <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"> <argument name="bundleProduct" value="BundleProduct"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml index ff192538637ef..713262e6ada01 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml @@ -60,7 +60,7 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> - <actionGroup ref="AncillaryPrepBundleProduct" stepKey="createBundledProductForTwoSimpleProducts"/> + <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"/> <!--Save the product--> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleOptionsToCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleOptionsToCartTest.xml index a1630128638d9..fe20044e9ae2a 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleOptionsToCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleOptionsToCartTest.xml @@ -62,7 +62,7 @@ </actionGroup> <!-- Add Option One, a "Checkbox" type option, with tree products --> - <actionGroup ref="addBundleOptionWithTreeProducts" stepKey="addBundleOptionWithTreeProducts"> + <actionGroup ref="AddBundleOptionWithThreeProductsActionGroup" stepKey="addBundleOptionWithTreeProducts"> <argument name="x" value="0"/> <argument name="n" value="1"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -73,7 +73,7 @@ </actionGroup> <!-- Add Option Two, a "Radio Buttons" type option, with one product --> - <actionGroup ref="addBundleOptionWithOneProduct" stepKey="addBundleOptionWithOneProduct"> + <actionGroup ref="AddBundleOptionWithOneProductActionGroup" stepKey="addBundleOptionWithOneProduct"> <argument name="x" value="1"/> <argument name="n" value="2"/> <argument name="prodOneSku" value="$$simpleProduct4.sku$$"/> @@ -83,7 +83,7 @@ </actionGroup> <!-- Add Option Tree, a "Checkbox" type option, with six products --> - <actionGroup ref="addBundleOptionWithSixProducts" stepKey="addBundleOptionWithSixProducts"> + <actionGroup ref="AddBundleOptionWithSixProductsActionGroup" stepKey="addBundleOptionWithSixProducts"> <argument name="x" value="2"/> <argument name="n" value="3"/> <argument name="prodOneSku" value="$$simpleProduct5.sku$$"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleCartTest.xml index 695c3a8bf7dbb..4c2a25977b5b4 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleCartTest.xml @@ -40,7 +40,7 @@ </actionGroup> <!-- Add Option One, a "Drop-down" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts1"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts1"> <argument name="x" value="0"/> <argument name="n" value="1"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -50,7 +50,7 @@ </actionGroup> <!-- Add Option Two, a "Radio Buttons" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts2"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts2"> <argument name="x" value="1"/> <argument name="n" value="2"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -60,7 +60,7 @@ </actionGroup> <!-- Add Option Three, a "Checkbox" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts3"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts3"> <argument name="x" value="2"/> <argument name="n" value="3"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -70,7 +70,7 @@ </actionGroup> <!-- Add Option Four, a "Multi Select" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts4"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts4"> <argument name="x" value="3"/> <argument name="n" value="4"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -157,7 +157,7 @@ </actionGroup> <!-- Add Option One, a "Drop-down" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts1"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts1"> <argument name="x" value="0"/> <argument name="n" value="1"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -167,7 +167,7 @@ </actionGroup> <!-- Add Option Two, a "Radio Buttons" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts2"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts2"> <argument name="x" value="1"/> <argument name="n" value="2"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -177,7 +177,7 @@ </actionGroup> <!-- Add Option Three, a "Checkbox" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts3"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts3"> <argument name="x" value="2"/> <argument name="n" value="3"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -187,7 +187,7 @@ </actionGroup> <!-- Add Option Four, a "Multi Select" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts4"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts4"> <argument name="x" value="3"/> <argument name="n" value="4"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml index d7394b2dbf32e..2b77e8c5ae338 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml @@ -68,7 +68,7 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> <!--Create a basic bundle product--> - <actionGroup ref="CreateBasicBundleProduct" stepKey="createBundledProductForTwoSimpleProducts"> + <actionGroup ref="CreateBasicBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"> <argument name="bundleProduct" value="BundleProduct"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGrid.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGrid.xml index 88db5b64fa42d..fdaeeb7e2955d 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGrid.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGrid.xml @@ -70,7 +70,7 @@ <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="AncillaryPrepBundleProduct" stepKey="createBundledProductForTwoSimpleProducts"/> + <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"/> <!--Save the product--> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml index 5e6e891541420..2b322b3e7e200 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml @@ -44,7 +44,7 @@ </actionGroup> <!-- Add Option One, a "Drop-down" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts1"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts1"> <argument name="x" value="0"/> <argument name="n" value="1"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -56,7 +56,7 @@ <checkOption selector="{{AdminProductFormBundleSection.userDefinedQuantity('0', '1')}}" stepKey="userDefinedQuantitiyOption0Product1"/> <!-- Add Option Two, a "Radio Buttons" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts2"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts2"> <argument name="x" value="1"/> <argument name="n" value="2"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -68,7 +68,7 @@ <checkOption selector="{{AdminProductFormBundleSection.userDefinedQuantity('1', '1')}}" stepKey="userDefinedQuantitiyOption1Product1"/> <!-- Add Option Three, a "Checkbox" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts3"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts3"> <argument name="x" value="2"/> <argument name="n" value="3"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> @@ -78,7 +78,7 @@ </actionGroup> <!-- Add Option Four, a "Multi Select" type option --> - <actionGroup ref="addBundleOptionWithTwoProducts" stepKey="addBundleOptionWithTwoProducts4"> + <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts4"> <argument name="x" value="3"/> <argument name="n" value="4"/> <argument name="prodOneSku" value="$$simpleProduct1.sku$$"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml index ccd6a58223b3c..cc7711e99ff1a 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml @@ -59,7 +59,7 @@ <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="AncillaryPrepBundleProduct" stepKey="createBundledProductForTwoSimpleProducts"/> + <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"/> <!--Save the product--> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml index 3b60e4b09de28..f360e746a7481 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml @@ -593,7 +593,7 @@ <argument name="productName" value="$createBundleProduct.name$"/> <argument name="productUrlKey" value="$createBundleProduct.custom_attributes[url_key]$"/> </actionGroup> - <actionGroup ref="StorefrontAddBundleProductFromProductToCartWithMultiOption" stepKey="addProductToCart"> + <actionGroup ref="StorefrontAddBundleProductFromProductToCartWithMultiOptionActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$createBundleProduct.name$"/> <argument name="optionName" value="$createBundleOption1_1.name$"/> <argument name="value" value="$simpleProduct1.name$"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml index ab085dc5ae137..ec22c1fe489ee 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml @@ -73,7 +73,7 @@ <click selector="{{AdminProductFormBundleSection.categoriesLabel}}" stepKey="clickOnCategoriesLabelToCloseOptions"/> <!-- Add option, a "Radio Buttons" type option, with one product and set fixed price 200--> - <actionGroup ref="addBundleOptionWithOneProduct" stepKey="addBundleOptionWithOneProduct"> + <actionGroup ref="AddBundleOptionWithOneProductActionGroup" stepKey="addBundleOptionWithOneProduct"> <argument name="x" value="0"/> <argument name="n" value="1"/> <argument name="prodOneSku" value="$$simpleProduct.sku$$"/> From a12c1b46576a64595cd366395e8445b100221090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 13:00:30 +0100 Subject: [PATCH 299/595] FIX: Issues when building the project (use global AdmincreateUserActionGroup instead of local one. --- .../AdminCreateUserActionGroup.xml | 36 ------------------- ...AnAdminOrderUsingBraintreePaymentTest1.xml | 9 ++--- 2 files changed, 5 insertions(+), 40 deletions(-) delete mode 100644 app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml deleted file mode 100644 index 82491f6362573..0000000000000 --- a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml +++ /dev/null @@ -1,36 +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="AdminCreateUserAction"> - <annotations> - <description>Creates a User using the NewAdmin User Entity and User Role Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> - </annotations> - - <click selector="{{AdminCreateUserSection.create}}" stepKey="clickToCreateNewUser"/> - <waitForPageLoad stepKey="waitForNewUserPageLoad" time="10"/> - <fillField selector="{{AdminCreateUserSection.usernameTextField}}" userInput="{{NewAdmin.username}}" stepKey="enterUserName"/> - <fillField selector="{{AdminCreateUserSection.firstNameTextField}}" userInput="{{NewAdmin.firstName}}" stepKey="enterFirstName"/> - <fillField selector="{{AdminCreateUserSection.lastNameTextField}}" userInput="{{NewAdmin.lastName}}" stepKey="enterLastName"/> - <fillField selector="{{AdminCreateUserSection.emailTextField}}" userInput="{{NewAdmin.email}}" stepKey="enterEmail"/> - <fillField selector="{{AdminCreateUserSection.passwordTextField}}" userInput="{{NewAdmin.password}}" stepKey="enterPassword"/> - <fillField selector="{{AdminCreateUserSection.pwConfirmationTextField}}" userInput="{{NewAdmin.password}}" stepKey="confirmPassword"/> - <fillField selector="{{AdminCreateUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword"/> - <scrollToTopOfPage stepKey="scrollToTopOfPage"/> - <click selector="{{AdminCreateUserSection.userRoleTab}}" stepKey="clickUserRole"/> - <waitForAjaxLoad stepKey="waitForRoles" time="5"/> - <fillField selector="{{AdminCreateRoleSection.roleNameFilterTextField}}" userInput="{{role.name}}" stepKey="filterRole"/> - <click selector="{{AdminCreateRoleSection.searchButton}}" stepKey="clickSearch"/> - <waitForPageLoad stepKey="waitForSearch" time="10"/> - <click selector="{{AdminCreateRoleSection.searchResultFirstRow}}" stepKey="selectRole"/> - <click selector="{{AdminCreateUserSection.saveButton}}" stepKey="clickSaveUser"/> - <waitForPageLoad stepKey="waitForSaveUser" time="10"/> - <see userInput="You saved the user." stepKey="seeSuccessMessage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml index 1e134b604d497..67081ca08d97a 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml @@ -21,8 +21,6 @@ <issueId value="MQE-1576"/> </skip> </annotations> - - <before> <!--Login As Admin--> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> @@ -39,7 +37,7 @@ <!--Configure Braintree--> - <actionGroup ref="ConfigureBraintree" stepKey="configureBraintree"/> + <actionGroup ref="ConfigureBraintreeActionGroup" stepKey="configureBraintree"/> <!--Create New Role--> <actionGroup ref="GoToUserRolesActionGroup" stepKey="GoToUserRoles"/> @@ -49,7 +47,10 @@ <!--Create new admin user--> <actionGroup ref="GoToAllUsersActionGroup" stepKey="GoToAllUsers"/> <waitForPageLoad stepKey="waitForUsers" time="15"/> - <actionGroup ref="AdminCreateUserActionGroup" stepKey="AdminCreateNewUser"/> + <actionGroup ref="AdminCreateUserActionGroup" stepKey="AdminCreateNewUser"> + <argument name="role" value="role"/> + <argument name="User" value="NewAdmin"/> + </actionGroup> <!--SignOut--> <actionGroup ref="logout" stepKey="signOutFromAdmin"/> From 96e4a24e00895aa3f58e81cacd6e8dbac4b5cb5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 13:03:02 +0100 Subject: [PATCH 300/595] FIX: Issues when building the project (missing rename) --- .../Test/Mftf/ActionGroup/CreateDatabaseBackupActionGroup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateDatabaseBackupActionGroup.xml b/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateDatabaseBackupActionGroup.xml index 5d4e4a19509ea..171bdb88dc428 100644 --- a/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateDatabaseBackupActionGroup.xml +++ b/app/code/Magento/Backup/Test/Mftf/ActionGroup/CreateDatabaseBackupActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="createDatabaseBackup"> + <actionGroup name="CreateDatabaseBackupActionGroup"> <annotations> <description>Creates a Database Backup using provided Backup Entity.</description> </annotations> From 9abcf547c0d5160de4cfa0c5e3b907056fb8f311 Mon Sep 17 00:00:00 2001 From: Maximilian Fickers <m.fickers@basecom.de> Date: Thu, 28 Nov 2019 13:05:28 +0100 Subject: [PATCH 301/595] #25042 Remove logo dimension parameters from layout files for blank and luma theme --- app/code/Magento/Theme/Block/Html/Header/Logo.php | 4 ++-- app/code/Magento/Theme/view/frontend/layout/default.xml | 7 +------ .../frontend/Magento/luma/Magento_Theme/layout/default.xml | 6 ------ 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/app/code/Magento/Theme/Block/Html/Header/Logo.php b/app/code/Magento/Theme/Block/Html/Header/Logo.php index b51f624c20339..626a771b4e309 100644 --- a/app/code/Magento/Theme/Block/Html/Header/Logo.php +++ b/app/code/Magento/Theme/Block/Html/Header/Logo.php @@ -98,7 +98,7 @@ public function getLogoWidth() \Magento\Store\Model\ScopeInterface::SCOPE_STORE ); } - return (int)$this->_data['logo_width'] ? : (int)$this->getLogoImgWidth(); + return (int)$this->_data['logo_width']; } /** @@ -114,7 +114,7 @@ public function getLogoHeight() \Magento\Store\Model\ScopeInterface::SCOPE_STORE ); } - return (int)$this->_data['logo_height'] ? : (int)$this->getLogoImgHeight(); + return (int)$this->_data['logo_height']; } /** diff --git a/app/code/Magento/Theme/view/frontend/layout/default.xml b/app/code/Magento/Theme/view/frontend/layout/default.xml index 81cffe8c040b3..8eaac4aa3e794 100644 --- a/app/code/Magento/Theme/view/frontend/layout/default.xml +++ b/app/code/Magento/Theme/view/frontend/layout/default.xml @@ -50,12 +50,7 @@ </container> </container> <container name="header-wrapper" label="Page Header" as="header-wrapper" htmlTag="div" htmlClass="header content"> - <block class="Magento\Theme\Block\Html\Header\Logo" name="logo"> - <arguments> - <argument name="logo_img_width" xsi:type="number">189</argument> - <argument name="logo_img_height" xsi:type="number">64</argument> - </arguments> - </block> + <block class="Magento\Theme\Block\Html\Header\Logo" name="logo"/> </container> </referenceContainer> <referenceContainer name="page.top"> diff --git a/app/design/frontend/Magento/luma/Magento_Theme/layout/default.xml b/app/design/frontend/Magento/luma/Magento_Theme/layout/default.xml index 5f0f3b92ab44a..ce397fad64f44 100644 --- a/app/design/frontend/Magento/luma/Magento_Theme/layout/default.xml +++ b/app/design/frontend/Magento/luma/Magento_Theme/layout/default.xml @@ -14,12 +14,6 @@ </arguments> </block> </referenceContainer> - <referenceBlock name="logo"> - <arguments> - <argument name="logo_img_width" xsi:type="number">148</argument> - <argument name="logo_img_height" xsi:type="number">43</argument> - </arguments> - </referenceBlock> <referenceContainer name="footer"> <block class="Magento\Store\Block\Switcher" name="store_switcher" as="store_switcher" after="footer_links" template="Magento_Store::switch/stores.phtml"/> </referenceContainer> From 2e810cf830cd285085653c74861c277579b1455b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 13:15:41 +0100 Subject: [PATCH 302/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...listIsPersistedUnderLongTermCookieTest.xml | 8 +- ...sertCustomerWishlistIsEmptyActionGroup.xml | 15 ++ ...ddCategoryProductToWishlistActionGroup.xml | 25 ++++ ...artFromWishlistUsingSidebarActionGroup.xml | 23 +++ ...ustomerAddProductToWishlistActionGroup.xml | 25 ++++ ...tomerCheckProductInWishlistActionGroup.xml | 25 ++++ ...eckProductInWishlistSidebarActionGroup.xml | 24 +++ ...stomerEditProductInWishlistActionGroup.xml | 28 ++++ ...uctFromWishlistUsingSidebarActionGroup.xml | 23 +++ ...efrontCustomerShareWishlistActionGroup.xml | 22 +++ .../StorefrontCustomerWishlistActionGroup.xml | 138 ------------------ .../Mftf/Test/EndToEndB2CLoggedInUserTest.xml | 8 +- ...uctsToCartFromWishlistUsingSidebarTest.xml | 4 +- ...teBundleDynamicProductFromWishlistTest.xml | 4 +- ...leteBundleFixedProductFromWishlistTest.xml | 2 +- ...eteConfigurableProductFromWishlistTest.xml | 2 +- ...veProductsFromWishlistUsingSidebarTest.xml | 4 +- .../Test/StorefrontUpdateWishlistTest.xml | 4 +- .../Test/WishListWithDisabledProductTest.xml | 4 +- 19 files changed, 230 insertions(+), 158 deletions(-) create mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontAssertCustomerWishlistIsEmptyActionGroup.xml create mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddCategoryProductToWishlistActionGroup.xml create mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddProductToCartFromWishlistUsingSidebarActionGroup.xml create mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddProductToWishlistActionGroup.xml create mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerCheckProductInWishlistActionGroup.xml create mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerCheckProductInWishlistSidebarActionGroup.xml create mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerEditProductInWishlistActionGroup.xml create mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerRemoveProductFromWishlistUsingSidebarActionGroup.xml create mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerShareWishlistActionGroup.xml delete mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerWishlistActionGroup.xml diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml index dc6f87bef0ba8..0b9938d18d11f 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml @@ -95,10 +95,10 @@ </actionGroup> <!--The My Wishlist widget displays Simple Product 1 and Simple Product 2--> <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="openCategoryPageToCheckProductsInWishlistSidebar"/> - <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebar" stepKey="checkSimpleProductInWishlistSidebar"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebarActionGroup" stepKey="checkSimpleProductInWishlistSidebar"> <argument name="productVar" value="$$createSimpleProduct$$"/> </actionGroup> - <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebar" stepKey="checkSecondSimpleProductInWishlistSidebar"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebarActionGroup" stepKey="checkSecondSimpleProductInWishlistSidebar"> <argument name="productVar" value="$$createSecondSimpleProduct$$"/> </actionGroup> @@ -150,7 +150,7 @@ <actionGroup ref="StorefrontAssertProductInRecentlyViewedWidgetActionGroup" stepKey="checkSimpleProductInRecentlyViewedWidgetAfterLogout"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> - <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebar" stepKey="checkSimpleProductInWishlistSidebarAfterLogout"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebarActionGroup" stepKey="checkSimpleProductInWishlistSidebarAfterLogout"> <argument name="productVar" value="$$createSimpleProduct$$"/> </actionGroup> <actionGroup ref="StorefrontAssertProductInRecentlyComparedWidgetActionGroup" stepKey="checkSimpleProductInRecentlyComparedWidgetAfterLogout"> @@ -177,7 +177,7 @@ <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="openCategoryPageToCheckWidgets"/> <see userInput="Welcome, $$createCustomer.firstname$$ $$createCustomer.lastname$$!" selector="{{StorefrontPanelHeaderSection.WelcomeMessage}}" stepKey="checkWelcomeMessageAfterLogin"/> - <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebar" stepKey="checkSimpleProductNameInWishlistSidebarAfterLogin"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebarActionGroup" stepKey="checkSimpleProductNameInWishlistSidebarAfterLogin"> <argument name="productVar" value="$$createSimpleProduct$$"/> </actionGroup> <actionGroup ref="StorefrontAssertProductInRecentlyViewedWidgetActionGroup" stepKey="checkSimpleProductInRecentlyViewedWidgetAfterLogin"> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontAssertCustomerWishlistIsEmptyActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontAssertCustomerWishlistIsEmptyActionGroup.xml new file mode 100644 index 0000000000000..fad33a405c5e4 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontAssertCustomerWishlistIsEmptyActionGroup.xml @@ -0,0 +1,15 @@ +<?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="StorefrontAssertCustomerWishlistIsEmptyActionGroup"> + <dontSeeElement selector="{{StorefrontCustomerWishlistProductSection.pager}}" stepKey="checkThatPagerIsAbsent"/> + <see selector="{{StorefrontCustomerWishlistProductSection.wishlistEmpty}}" userInput="You have no items in your wish list." stepKey="checkNoItemsMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddCategoryProductToWishlistActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddCategoryProductToWishlistActionGroup.xml new file mode 100644 index 0000000000000..336841901a7ec --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddCategoryProductToWishlistActionGroup.xml @@ -0,0 +1,25 @@ +<?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="StorefrontCustomerAddCategoryProductToWishlistActionGroup"> + <annotations> + <description>Adds the provided Product to the Wish List from a Storefront Category page. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(productVar.name)}}" stepKey="addCategoryProductToWishlistMoveMouseOverProduct"/> + <click selector="{{StorefrontCategoryProductSection.ProductAddToWishlistByName(productVar.name)}}" stepKey="addCategoryProductToWishlistClickAddProductToWishlist"/> + <waitForElement selector="{{StorefrontCustomerWishlistSection.successMsg}}" time="30" stepKey="addCategoryProductToWishlistWaitForSuccessMessage"/> + <see selector="{{StorefrontCustomerWishlistSection.successMsg}}" userInput="{{productVar.name}} has been added to your Wish List." stepKey="addCategoryProductToWishlistSeeProductNameAddedToWishlist"/> + <seeCurrentUrlMatches regex="~/wishlist_id/\d+/$~" stepKey="seeCurrentUrlMatches"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddProductToCartFromWishlistUsingSidebarActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddProductToCartFromWishlistUsingSidebarActionGroup.xml new file mode 100644 index 0000000000000..a28a80c57fb67 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddProductToCartFromWishlistUsingSidebarActionGroup.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="StorefrontCustomerAddProductToCartFromWishlistUsingSidebarActionGroup"> + <annotations> + <description>Add the provided Product to the Cart from the Wish List side bar menu. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <click selector="{{StorefrontCustomerWishlistSidebarSection.ProductAddToCartByName(product.name)}}" stepKey="AddProductToCartFromWishlistUsingSidebarClickAddToCartFromWishlist"/> + <waitForElement selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="AddProductToCartFromWishlistUsingSidebarWaitForSuccessMessage"/> + <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added {{product.name}} to your shopping cart." stepKey="AddProductToCartFromWishlistUsingSidebarSeeProductNameAddedToCartFromWishlist"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddProductToWishlistActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddProductToWishlistActionGroup.xml new file mode 100644 index 0000000000000..69d8365096999 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerAddProductToWishlistActionGroup.xml @@ -0,0 +1,25 @@ +<?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="StorefrontCustomerAddProductToWishlistActionGroup"> + <annotations> + <description>Adds the provided Product to the Wish List from the Storefront Product page. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" stepKey="WaitForWishList" time="30"/> + <click selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" stepKey="addProductToWishlistClickAddToWishlist"/> + <waitForElement selector="{{StorefrontCustomerWishlistSection.successMsg}}" time="30" stepKey="addProductToWishlistWaitForSuccessMessage"/> + <see selector="{{StorefrontCustomerWishlistSection.successMsg}}" userInput="{{productVar.name}} has been added to your Wish List. Click here to continue shopping." stepKey="addProductToWishlistSeeProductNameAddedToWishlist"/> + <seeCurrentUrlMatches regex="~/wishlist_id/\d+/$~" stepKey="seeCurrentUrlMatches"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerCheckProductInWishlistActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerCheckProductInWishlistActionGroup.xml new file mode 100644 index 0000000000000..7380ee2172532 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerCheckProductInWishlistActionGroup.xml @@ -0,0 +1,25 @@ +<?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="StorefrontCustomerCheckProductInWishlistActionGroup"> + <annotations> + <description>Validates that the provided Product details (Price and Name) are present in the Storefront Customer Dashboard Wish List.</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <waitForElement selector="{{StorefrontCustomerWishlistProductSection.ProductTitleByName(productVar.name)}}" time="30" stepKey="assertWishlistProductName"/> + <see userInput="${{productVar.price}}.00" selector="{{StorefrontCustomerWishlistProductSection.ProductPriceByName(productVar.name)}}" stepKey="AssertWishlistProductPrice"/> + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(productVar.name)}}" stepKey="wishlistMoveMouseOverProduct"/> + <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductAddToCartByName(productVar.name)}}" stepKey="AssertWishlistAddToCart"/> + <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductImageByName(productVar.name)}}" stepKey="AssertWishlistProductImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerCheckProductInWishlistSidebarActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerCheckProductInWishlistSidebarActionGroup.xml new file mode 100644 index 0000000000000..04277897c0cb2 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerCheckProductInWishlistSidebarActionGroup.xml @@ -0,0 +1,24 @@ +<?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="StorefrontCustomerCheckProductInWishlistSidebarActionGroup"> + <annotations> + <description>Validates that the provided Product details (Name) are present in the Wish List side bar menu.</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <waitForElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductTitleByName(productVar.name)}}" time="30" stepKey="assertWishlistSidebarProductName"/> + <see userInput="${{productVar.price}}.00" selector="{{StorefrontCustomerWishlistSidebarSection.ProductPriceByName(productVar.name)}}" stepKey="AssertWishlistSidebarProductPrice"/> + <seeElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductAddToCartByName(productVar.name)}}" stepKey="AssertWishlistSidebarAddToCart"/> + <seeElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductImageByName(productVar.name)}}" stepKey="AssertWishlistSidebarProductImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerEditProductInWishlistActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerEditProductInWishlistActionGroup.xml new file mode 100644 index 0000000000000..f4fe023411e67 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerEditProductInWishlistActionGroup.xml @@ -0,0 +1,28 @@ +<?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="StorefrontCustomerEditProductInWishlistActionGroup"> + <annotations> + <description>Edits the provided Product on the Storefront Wish List page. Fills in the provided Description and Quantity. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="description" type="string"/> + <argument name="quantity" type="string"/> + </arguments> + + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(product.name)}}" stepKey="mouseOverOnProduct"/> + <fillField selector="{{StorefrontCustomerWishlistProductSection.ProductDescription(product.name)}}" userInput="{{description}}" stepKey="fillDescription"/> + <fillField selector="{{StorefrontCustomerWishlistProductSection.ProductQuantity(product.name)}}" userInput="{{quantity}}" stepKey="fillQuantity"/> + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductAddAllToCart}}" stepKey="mouseOver"/> + <click selector="{{StorefrontCustomerWishlistProductSection.ProductUpdateWishList}}" stepKey="submitUpdateWishlist"/> + <see selector="{{StorefrontCustomerWishlistProductSection.ProductSuccessUpdateMessage}}" userInput="{{product.name}} has been updated in your Wish List." stepKey="successMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerRemoveProductFromWishlistUsingSidebarActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerRemoveProductFromWishlistUsingSidebarActionGroup.xml new file mode 100644 index 0000000000000..a563e57c25230 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerRemoveProductFromWishlistUsingSidebarActionGroup.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="StorefrontCustomerRemoveProductFromWishlistUsingSidebarActionGroup"> + <annotations> + <description>Removes the provided Product from the Wish List side bar menu. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <click selector="{{StorefrontCustomerWishlistSidebarSection.ProductRemoveByName(product.name)}}" stepKey="RemoveProductFromWishlistUsingSidebarClickRemoveItemFromWishlist"/> + <waitForElement selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="RemoveProductFromWishlistUsingSidebarWaitForSuccessMessage"/> + <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="{{product.name}} has been removed from your Wish List." stepKey="RemoveProductFromWishlistUsingSidebarSeeProductNameRemovedFromWishlist"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerShareWishlistActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerShareWishlistActionGroup.xml new file mode 100644 index 0000000000000..1f7ac9fc85f50 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerShareWishlistActionGroup.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="StorefrontCustomerShareWishlistActionGroup"> + <annotations> + <description>Shares the Wish List from the Storefront Wish List page. PLEASE NOTE: The details for sharing are Hardcoded using 'Wishlist'.</description> + </annotations> + + <click selector="{{StorefrontCustomerWishlistProductSection.productShareWishList}}" stepKey="clickMyWishListButton"/> + <fillField userInput="{{Wishlist.shareInfo_emails}}" selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistEmail}}" stepKey="fillEmailsForShare"/> + <fillField userInput="{{Wishlist.shareInfo_message}}" selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistTextMessage}}" stepKey="fillShareMessage"/> + <click selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistButton}}" stepKey="sendWishlist"/> + <see selector="{{StorefrontCustomerWishlistProductSection.productSuccessShareMessage}}" userInput="Your wish list has been shared." stepKey="successMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerWishlistActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerWishlistActionGroup.xml deleted file mode 100644 index 4c1c088c102cd..0000000000000 --- a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerWishlistActionGroup.xml +++ /dev/null @@ -1,138 +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"> - <!-- Add Product to wishlist from the category page and check message --> - <actionGroup name="StorefrontCustomerAddCategoryProductToWishlistActionGroup"> - <annotations> - <description>Adds the provided Product to the Wish List from a Storefront Category page. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="productVar"/> - </arguments> - - <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(productVar.name)}}" stepKey="addCategoryProductToWishlistMoveMouseOverProduct"/> - <click selector="{{StorefrontCategoryProductSection.ProductAddToWishlistByName(productVar.name)}}" stepKey="addCategoryProductToWishlistClickAddProductToWishlist"/> - <waitForElement selector="{{StorefrontCustomerWishlistSection.successMsg}}" time="30" stepKey="addCategoryProductToWishlistWaitForSuccessMessage"/> - <see selector="{{StorefrontCustomerWishlistSection.successMsg}}" userInput="{{productVar.name}} has been added to your Wish List." stepKey="addCategoryProductToWishlistSeeProductNameAddedToWishlist"/> - <seeCurrentUrlMatches regex="~/wishlist_id/\d+/$~" stepKey="seeCurrentUrlMatches"/> - </actionGroup> - - <!-- Add Product to wishlist from the product page and check message --> - <actionGroup name="StorefrontCustomerAddProductToWishlistActionGroup"> - <annotations> - <description>Adds the provided Product to the Wish List from the Storefront Product page. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="productVar"/> - </arguments> - - <waitForElementVisible selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" stepKey="WaitForWishList" time="30"/> - <click selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" stepKey="addProductToWishlistClickAddToWishlist"/> - <waitForElement selector="{{StorefrontCustomerWishlistSection.successMsg}}" time="30" stepKey="addProductToWishlistWaitForSuccessMessage"/> - <see selector="{{StorefrontCustomerWishlistSection.successMsg}}" userInput="{{productVar.name}} has been added to your Wish List. Click here to continue shopping." stepKey="addProductToWishlistSeeProductNameAddedToWishlist"/> - <seeCurrentUrlMatches regex="~/wishlist_id/\d+/$~" stepKey="seeCurrentUrlMatches"/> - </actionGroup> - - <!-- Check product in wishlist --> - <actionGroup name="StorefrontCustomerCheckProductInWishlist"> - <annotations> - <description>Validates that the provided Product details (Price and Name) are present in the Storefront Customer Dashboard Wish List.</description> - </annotations> - <arguments> - <argument name="productVar"/> - </arguments> - - <waitForElement selector="{{StorefrontCustomerWishlistProductSection.ProductTitleByName(productVar.name)}}" time="30" stepKey="assertWishlistProductName"/> - <see userInput="${{productVar.price}}.00" selector="{{StorefrontCustomerWishlistProductSection.ProductPriceByName(productVar.name)}}" stepKey="AssertWishlistProductPrice"/> - <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(productVar.name)}}" stepKey="wishlistMoveMouseOverProduct"/> - <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductAddToCartByName(productVar.name)}}" stepKey="AssertWishlistAddToCart"/> - <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductImageByName(productVar.name)}}" stepKey="AssertWishlistProductImage"/> - </actionGroup> - - <!-- Check product in wishlist sidebar --> - <actionGroup name="StorefrontCustomerCheckProductInWishlistSidebar"> - <annotations> - <description>Validates that the provided Product details (Name) are present in the Wish List side bar menu.</description> - </annotations> - <arguments> - <argument name="productVar"/> - </arguments> - - <waitForElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductTitleByName(productVar.name)}}" time="30" stepKey="assertWishlistSidebarProductName"/> - <see userInput="${{productVar.price}}.00" selector="{{StorefrontCustomerWishlistSidebarSection.ProductPriceByName(productVar.name)}}" stepKey="AssertWishlistSidebarProductPrice"/> - <seeElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductAddToCartByName(productVar.name)}}" stepKey="AssertWishlistSidebarAddToCart"/> - <seeElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductImageByName(productVar.name)}}" stepKey="AssertWishlistSidebarProductImage"/> - </actionGroup> - - <!--Remove a product from the wishlist using the sidebar --> - <actionGroup name="StorefrontCustomerRemoveProductFromWishlistUsingSidebar"> - <annotations> - <description>Removes the provided Product from the Wish List side bar menu. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <click selector="{{StorefrontCustomerWishlistSidebarSection.ProductRemoveByName(product.name)}}" stepKey="RemoveProductFromWishlistUsingSidebarClickRemoveItemFromWishlist"/> - <waitForElement selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="RemoveProductFromWishlistUsingSidebarWaitForSuccessMessage"/> - <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="{{product.name}} has been removed from your Wish List." stepKey="RemoveProductFromWishlistUsingSidebarSeeProductNameRemovedFromWishlist"/> - </actionGroup> - - <!--Add a product to the cart from the wishlist using the sidebar --> - <actionGroup name="StorefrontCustomerAddProductToCartFromWishlistUsingSidebar"> - <annotations> - <description>Add the provided Product to the Cart from the Wish List side bar menu. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <click selector="{{StorefrontCustomerWishlistSidebarSection.ProductAddToCartByName(product.name)}}" stepKey="AddProductToCartFromWishlistUsingSidebarClickAddToCartFromWishlist"/> - <waitForElement selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="AddProductToCartFromWishlistUsingSidebarWaitForSuccessMessage"/> - <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added {{product.name}} to your shopping cart." stepKey="AddProductToCartFromWishlistUsingSidebarSeeProductNameAddedToCartFromWishlist"/> - </actionGroup> - - <actionGroup name="StorefrontCustomerEditProductInWishlist"> - <annotations> - <description>Edits the provided Product on the Storefront Wish List page. Fills in the provided Description and Quantity. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="description" type="string"/> - <argument name="quantity" type="string"/> - </arguments> - - <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(product.name)}}" stepKey="mouseOverOnProduct"/> - <fillField selector="{{StorefrontCustomerWishlistProductSection.ProductDescription(product.name)}}" userInput="{{description}}" stepKey="fillDescription"/> - <fillField selector="{{StorefrontCustomerWishlistProductSection.ProductQuantity(product.name)}}" userInput="{{quantity}}" stepKey="fillQuantity"/> - <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductAddAllToCart}}" stepKey="mouseOver"/> - <click selector="{{StorefrontCustomerWishlistProductSection.ProductUpdateWishList}}" stepKey="submitUpdateWishlist"/> - <see selector="{{StorefrontCustomerWishlistProductSection.ProductSuccessUpdateMessage}}" userInput="{{product.name}} has been updated in your Wish List." stepKey="successMessage"/> - </actionGroup> - - <!-- Share wishlist --> - <actionGroup name="StorefrontCustomerShareWishlistActionGroup"> - <annotations> - <description>Shares the Wish List from the Storefront Wish List page. PLEASE NOTE: The details for sharing are Hardcoded using 'Wishlist'.</description> - </annotations> - - <click selector="{{StorefrontCustomerWishlistProductSection.productShareWishList}}" stepKey="clickMyWishListButton"/> - <fillField userInput="{{Wishlist.shareInfo_emails}}" selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistEmail}}" stepKey="fillEmailsForShare"/> - <fillField userInput="{{Wishlist.shareInfo_message}}" selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistTextMessage}}" stepKey="fillShareMessage"/> - <click selector="{{StorefrontCustomerWishlistShareSection.ProductShareWishlistButton}}" stepKey="sendWishlist"/> - <see selector="{{StorefrontCustomerWishlistProductSection.productSuccessShareMessage}}" userInput="Your wish list has been shared." stepKey="successMessage"/> - </actionGroup> - - <!-- Check that wishlist is empty --> - <actionGroup name="StorefrontAssertCustomerWishlistIsEmpty"> - <dontSeeElement selector="{{StorefrontCustomerWishlistProductSection.pager}}" stepKey="checkThatPagerIsAbsent"/> - <see selector="{{StorefrontCustomerWishlistProductSection.wishlistEmpty}}" userInput="You have no items in your wish list." stepKey="checkNoItemsMessage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml index 7eb42d1fbfed9..d5a5fccb30be3 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml @@ -17,10 +17,10 @@ <actionGroup ref="StorefrontCustomerAddCategoryProductToWishlistActionGroup" after="wishlistGotoCategory1" stepKey="wishlistAddSimpleProduct1ToWishlist"> <argument name="productVar" value="$$createSimpleProduct1$$"/> </actionGroup> - <actionGroup ref="StorefrontCustomerCheckProductInWishlist" after="wishlistAddSimpleProduct1ToWishlist" stepKey="wishlistCheckSimpleProduct1InWishlist"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistActionGroup" after="wishlistAddSimpleProduct1ToWishlist" stepKey="wishlistCheckSimpleProduct1InWishlist"> <argument name="productVar" value="$$createSimpleProduct1$$"/> </actionGroup> - <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebar" after="wishlistCheckSimpleProduct1InWishlist" stepKey="wishlistCheckSimpleProduct1InWishlistSidebar"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebarActionGroup" after="wishlistCheckSimpleProduct1InWishlist" stepKey="wishlistCheckSimpleProduct1InWishlistSidebar"> <argument name="productVar" value="$$createSimpleProduct1$$"/> </actionGroup> @@ -31,10 +31,10 @@ <actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" after="wishlistClickSimpleProduct2" stepKey="wishlistAddSimpleProduct2ToWishlist"> <argument name="productVar" value="$$createSimpleProduct2$$"/> </actionGroup> - <actionGroup ref="StorefrontCustomerCheckProductInWishlist" after="wishlistAddSimpleProduct2ToWishlist" stepKey="wishlistCheckSimpleProduct2InWishlist"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistActionGroup" after="wishlistAddSimpleProduct2ToWishlist" stepKey="wishlistCheckSimpleProduct2InWishlist"> <argument name="productVar" value="$$createSimpleProduct2$$"/> </actionGroup> - <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebar" after="wishlistCheckSimpleProduct2InWishlist" stepKey="wishlistCheckSimpleProduct2InWishlistSidebar"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebarActionGroup" after="wishlistCheckSimpleProduct2InWishlist" stepKey="wishlistCheckSimpleProduct2InWishlistSidebar"> <argument name="productVar" value="$$createSimpleProduct2$$"/> </actionGroup> <comment userInput="End of adding products to wishlist" after="wishlistCheckSimpleProduct2InWishlistSidebar" stepKey="endOfAddingProductsToWishlist" /> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddProductsToCartFromWishlistUsingSidebarTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddProductsToCartFromWishlistUsingSidebarTest.xml index 82c53bc343e51..7240313e8d980 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddProductsToCartFromWishlistUsingSidebarTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddProductsToCartFromWishlistUsingSidebarTest.xml @@ -53,10 +53,10 @@ <!--Add product to the cart from the Wishlist using the sidebar from the second category page--> <amOnPage url="{{StorefrontCategoryPage.url($$categorySecond.name$$)}}" stepKey="navigateToCategorySecondPage"/> <actionGroup ref="StorefrontSwitchCategoryViewToListMode" stepKey="switchCategoryViewToListMode"/> - <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebar" stepKey="checkSimpleProduct1InWishlistSidebar"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebarActionGroup" stepKey="checkSimpleProduct1InWishlistSidebar"> <argument name="productVar" value="$$simpleProduct1$$"/> </actionGroup> - <actionGroup ref="StorefrontCustomerAddProductToCartFromWishlistUsingSidebar" stepKey="addProduct1ToCartFromWishlistUsingSidebar"> + <actionGroup ref="StorefrontCustomerAddProductToCartFromWishlistUsingSidebarActionGroup" stepKey="addProduct1ToCartFromWishlistUsingSidebar"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <!--Check that a customer on the same page as before--> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleDynamicProductFromWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleDynamicProductFromWishlistTest.xml index ae65a4171d883..3d190a039920a 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleDynamicProductFromWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleDynamicProductFromWishlistTest.xml @@ -74,7 +74,7 @@ <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductFromCategory"> <argument name="productUrlKey" value="$$createBundleProduct.custom_attributes[url_key]$$"/> </actionGroup> - + <!-- Add created product to Wishlist according to dataset and assert add product to wishlist success message --> <actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addProductToWishlist"> <argument name="productVar" value="$$createBundleProduct$$"/> @@ -90,6 +90,6 @@ <click selector="{{StorefrontCustomerWishlistProductSection.removeProduct}}" stepKey="clickRemoveButton"/> <!-- Assert Wishlist is empty --> - <actionGroup ref="StorefrontAssertCustomerWishlistIsEmpty" stepKey="assertWishlistIsEmpty"/> + <actionGroup ref="StorefrontAssertCustomerWishlistIsEmptyActionGroup" stepKey="assertWishlistIsEmpty"/> </test> </tests> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleFixedProductFromWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleFixedProductFromWishlistTest.xml index a0bff949f00f5..cdd86bfecccc8 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleFixedProductFromWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleFixedProductFromWishlistTest.xml @@ -83,6 +83,6 @@ <click selector="{{StorefrontCustomerWishlistProductSection.removeProduct}}" stepKey="clickRemoveButton"/> <!-- Assert Wishlist is empty --> - <actionGroup ref="StorefrontAssertCustomerWishlistIsEmpty" stepKey="assertWishlistIsEmpty"/> + <actionGroup ref="StorefrontAssertCustomerWishlistIsEmptyActionGroup" stepKey="assertWishlistIsEmpty"/> </test> </tests> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromWishlistTest.xml index ee66825878728..6a718ebdfcf0f 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromWishlistTest.xml @@ -145,6 +145,6 @@ <click selector="{{StorefrontCustomerWishlistProductSection.removeProduct}}" stepKey="clickRemoveButton"/> <!-- Assert Wishlist is empty --> - <actionGroup ref="StorefrontAssertCustomerWishlistIsEmpty" stepKey="assertWishlistIsEmpty"/> + <actionGroup ref="StorefrontAssertCustomerWishlistIsEmptyActionGroup" stepKey="assertWishlistIsEmpty"/> </test> </tests> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontRemoveProductsFromWishlistUsingSidebarTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontRemoveProductsFromWishlistUsingSidebarTest.xml index 6c73cb6708ae4..4c44f9b72e86c 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontRemoveProductsFromWishlistUsingSidebarTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontRemoveProductsFromWishlistUsingSidebarTest.xml @@ -54,10 +54,10 @@ <!--Remove product from the Wishlist using the sidebar from the second category page--> <amOnPage url="{{StorefrontCategoryPage.url($$categorySecond.name$$)}}" stepKey="navigateToCategorySecondPage"/> <actionGroup ref="StorefrontSwitchCategoryViewToListMode" stepKey="switchCategoryViewToListMode"/> - <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebar" stepKey="checkSimpleProduct1InWishlistSidebar"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebarActionGroup" stepKey="checkSimpleProduct1InWishlistSidebar"> <argument name="productVar" value="$$simpleProduct1$$"/> </actionGroup> - <actionGroup ref="StorefrontCustomerRemoveProductFromWishlistUsingSidebar" stepKey="removeProduct1FromWishlistUsingSidebar"> + <actionGroup ref="StorefrontCustomerRemoveProductFromWishlistUsingSidebarActionGroup" stepKey="removeProduct1FromWishlistUsingSidebar"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <!--Check that a customer on the same page as before--> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontUpdateWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontUpdateWishlistTest.xml index b8a84a327b58f..08698658588ae 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontUpdateWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontUpdateWishlistTest.xml @@ -43,11 +43,11 @@ <argument name="productVar" value="$$product$$"/> </actionGroup> - <actionGroup ref="StorefrontCustomerCheckProductInWishlist" stepKey="checkProductInWishlist"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistActionGroup" stepKey="checkProductInWishlist"> <argument name="productVar" value="$$product$$"/> </actionGroup> - <actionGroup ref="StorefrontCustomerEditProductInWishlist" stepKey="updateProductInWishlist"> + <actionGroup ref="StorefrontCustomerEditProductInWishlistActionGroup" stepKey="updateProductInWishlist"> <argument name="product" value="$$product$$"/> <argument name="description" value="some text"/> <argument name="quantity" value="2"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml index af216c139e7fe..aca3ebbc6b48c 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml @@ -35,7 +35,7 @@ <actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addProductToWishlist"> <argument name="productVar" value="$$createProduct$$"/> </actionGroup> - <actionGroup ref="StorefrontCustomerCheckProductInWishlist" stepKey="checkProductInWishlist"> + <actionGroup ref="StorefrontCustomerCheckProductInWishlistActionGroup" stepKey="checkProductInWishlist"> <argument name="productVar" value="$$createProduct$$"/> </actionGroup> <openNewTab stepKey="openNewTab"/> @@ -45,6 +45,6 @@ <actionGroup ref="saveProductForm" stepKey="saveProduct"/> <closeTab stepKey="closeSecondTab"/> <reloadPage stepKey="refreshPage"/> - <actionGroup ref="StorefrontAssertCustomerWishlistIsEmpty" stepKey="checkProductIsAbsentInWishlistIsEmpty"/> + <actionGroup ref="StorefrontAssertCustomerWishlistIsEmptyActionGroup" stepKey="checkProductIsAbsentInWishlistIsEmpty"/> </test> </tests> From 16e6fdace4f1e297a43fe396b4d8f45432e82702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 13:40:58 +0100 Subject: [PATCH 303/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...eDynamicBlocksRotatorWidgetActionGroup.xml | 21 +++++ ...dminCreateProductLinkWidgetActionGroup.xml | 28 ++++++ ...minCreateProductsListWidgetActionGroup.xml | 27 ++++++ .../AdminCreateWidgetActionGroup.xml | 94 ------------------- .../AdminDeleteWidgetActionGroup.xml | 32 +++++++ ...pecificPageWidgetMainFieldsActionGroup.xml | 36 +++++++ 6 files changed, 144 insertions(+), 94 deletions(-) create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateDynamicBlocksRotatorWidgetActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateProductLinkWidgetActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateProductsListWidgetActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminDeleteWidgetActionGroup.xml create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminFillSpecificPageWidgetMainFieldsActionGroup.xml diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateDynamicBlocksRotatorWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateDynamicBlocksRotatorWidgetActionGroup.xml new file mode 100644 index 0000000000000..16efe55202bb0 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateDynamicBlocksRotatorWidgetActionGroup.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="AdminCreateDynamicBlocksRotatorWidgetActionGroup" extends="AdminCreateWidgetActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateWidgetActionGroup. Creates a Dynamic Block Rotate Widget.</description> + </annotations> + + <selectOption selector="{{AdminNewWidgetSection.displayMode}}" userInput="{{widget.display_mode}}" stepKey="selectDisplayMode"/> + <selectOption selector="{{AdminNewWidgetSection.restrictTypes}}" userInput="{{widget.restrict_type}}" stepKey="selectRestrictType"/> + <click selector="{{AdminNewWidgetSection.saveAndContinue}}" stepKey="clickSaveWidget"/> + <see selector="{{AdminMessagesSection.success}}" userInput="The widget instance has been saved" stepKey="seeSuccess"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateProductLinkWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateProductLinkWidgetActionGroup.xml new file mode 100644 index 0000000000000..cb82f5ad068fd --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateProductLinkWidgetActionGroup.xml @@ -0,0 +1,28 @@ +<?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="AdminCreateProductLinkWidgetActionGroup" extends="AdminCreateWidgetActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateWidgetActionGroup. Creates a Product List Widget using the provided Product. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <selectOption selector="{{AdminNewWidgetSection.selectTemplate}}" userInput="{{widget.template}}" after="waitForPageLoad" stepKey="setTemplate"/> + <waitForAjaxLoad after="setTemplate" stepKey="waitForPageLoad2"/> + <click selector="{{AdminNewWidgetSection.selectProduct}}" after="clickWidgetOptions" stepKey="clickSelectProduct"/> + <fillField selector="{{AdminNewWidgetSelectProductPopupSection.filterBySku}}" userInput="{{product.sku}}" after="clickSelectProduct" stepKey="fillProductNameInFilter"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" after="fillProductNameInFilter" stepKey="applyFilter"/> + <click selector="{{AdminNewWidgetSelectProductPopupSection.firstRow}}" after="applyFilter" stepKey="selectProduct"/> + <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveWidget"/> + <see selector="{{AdminMessagesSection.success}}" userInput="The widget instance has been saved" stepKey="seeSuccess"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateProductsListWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateProductsListWidgetActionGroup.xml new file mode 100644 index 0000000000000..e3845adc9cd4a --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateProductsListWidgetActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AdminCreateProductsListWidgetActionGroup" extends="AdminCreateWidgetActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateWidgetActionGroup. Creates a Product List Widget. Validates that the Success Message is present and correct.</description> + </annotations> + + <click selector="{{AdminNewWidgetSection.addNewCondition}}" stepKey="clickAddNewCondition"/> + <selectOption selector="{{AdminNewWidgetSection.selectCondition}}" userInput="{{widget.condition}}" stepKey="selectCondition"/> + <waitForElement selector="{{AdminNewWidgetSection.ruleParameter}}" stepKey="waitRuleParameter"/> + <click selector="{{AdminNewWidgetSection.ruleParameter}}" stepKey="clickRuleParameter"/> + <click selector="{{AdminNewWidgetSection.openChooser}}" stepKey="clickChooser"/> + <waitForAjaxLoad stepKey="waitForAjaxLoad"/> + <click selector="{{AdminNewWidgetSection.selectAll}}" stepKey="clickSelectAll"/> + <click selector="{{AdminNewWidgetSection.applyParameter}}" stepKey="clickApplyRuleParameter"/> + <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveWidget"/> + <see selector="{{AdminMessagesSection.success}}" userInput="The widget instance has been saved" stepKey="seeSuccess"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml index d304b1876b7e3..e657b3eb73b53 100644 --- a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml @@ -30,98 +30,4 @@ <scrollToTopOfPage stepKey="scrollToTopOfPage"/> <click selector="{{AdminNewWidgetSection.widgetOptions}}" stepKey="clickWidgetOptions"/> </actionGroup> - <actionGroup name="AdminFillSpecificPageWidgetMainFieldsActionGroup"> - <annotations> - <description>Fill widget main fields and widget layout by index for specified page DisplayOn option</description> - </annotations> - <arguments> - <argument name="widget" type="entity" defaultValue="ProductsListWidget"/> - <argument name="index" type="string" defaultValue="0"/> - </arguments> - <selectOption selector="{{AdminNewWidgetSection.widgetType}}" userInput="{{widget.type}}" stepKey="setWidgetType"/> - <selectOption selector="{{AdminNewWidgetSection.widgetDesignTheme}}" userInput="{{widget.design_theme}}" stepKey="setWidgetDesignTheme"/> - <click selector="{{AdminNewWidgetSection.continue}}" stepKey="clickContinue"/> - <fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/> - <selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" parameterArray="{{widget.store_ids}}" stepKey="setWidgetStoreIds"/> - <fillField selector="{{AdminNewWidgetSection.widgetSortOrder}}" userInput="{{widget.sort_order}}" stepKey="fillSortOrder"/> - <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> - <waitForElementVisible selector="{{AdminNewWidgetSection.selectDisplayOn}}" stepKey="waitForSelectElement"/> - <selectOption selector="{{AdminNewWidgetSection.displayOnByIndex(index)}}" userInput="{{widget.display_on}}" stepKey="setDisplayOn"/> - <waitForPageLoad stepKey="waitForDisplayOnChangesApplied"/> - <selectOption selector="{{AdminNewWidgetSection.layoutByIndex(index)}}" userInput="{{widget.page}}" stepKey="selectPage"/> - <selectOption selector="{{AdminNewWidgetSection.templateByIndex(index)}}" userInput="{{widget.template}}" stepKey="selectTemplate"/> - <scrollTo selector="{{AdminNewWidgetSection.containerByIndex(index)}}" stepKey="scrollToSelectContainerElement"/> - <waitForPageLoad stepKey="waitForScroll"/> - <selectOption selector="{{AdminNewWidgetSection.containerByIndex(index)}}" userInput="{{widget.container}}" stepKey="setContainer"/> - <waitForPageLoad stepKey="waitForContainerChangesApplied"/> - </actionGroup> - <!--Create Product List Widget--> - <actionGroup name="AdminCreateProductsListWidgetActionGroup" extends="AdminCreateWidgetActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateWidgetActionGroup. Creates a Product List Widget. Validates that the Success Message is present and correct.</description> - </annotations> - - <click selector="{{AdminNewWidgetSection.addNewCondition}}" stepKey="clickAddNewCondition"/> - <selectOption selector="{{AdminNewWidgetSection.selectCondition}}" userInput="{{widget.condition}}" stepKey="selectCondition"/> - <waitForElement selector="{{AdminNewWidgetSection.ruleParameter}}" stepKey="waitRuleParameter"/> - <click selector="{{AdminNewWidgetSection.ruleParameter}}" stepKey="clickRuleParameter"/> - <click selector="{{AdminNewWidgetSection.openChooser}}" stepKey="clickChooser"/> - <waitForAjaxLoad stepKey="waitForAjaxLoad"/> - <click selector="{{AdminNewWidgetSection.selectAll}}" stepKey="clickSelectAll"/> - <click selector="{{AdminNewWidgetSection.applyParameter}}" stepKey="clickApplyRuleParameter"/> - <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveWidget"/> - <see selector="{{AdminMessagesSection.success}}" userInput="The widget instance has been saved" stepKey="seeSuccess"/> - </actionGroup> - - <!--Create Dynamic Block Rotate Widget--> - <actionGroup name="AdminCreateDynamicBlocksRotatorWidgetActionGroup" extends="AdminCreateWidgetActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateWidgetActionGroup. Creates a Dynamic Block Rotate Widget.</description> - </annotations> - - <selectOption selector="{{AdminNewWidgetSection.displayMode}}" userInput="{{widget.display_mode}}" stepKey="selectDisplayMode"/> - <selectOption selector="{{AdminNewWidgetSection.restrictTypes}}" userInput="{{widget.restrict_type}}" stepKey="selectRestrictType"/> - <click selector="{{AdminNewWidgetSection.saveAndContinue}}" stepKey="clickSaveWidget"/> - <see selector="{{AdminMessagesSection.success}}" userInput="The widget instance has been saved" stepKey="seeSuccess"/> - </actionGroup> - - <actionGroup name="AdminDeleteWidgetActionGroup"> - <annotations> - <description>Goes to the Admin Widget grid page. Deletes the provided Widget. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="widget"/> - </arguments> - - <amOnPage url="{{AdminWidgetsPage.url}}" stepKey="amOnAdmin"/> - <waitForPageLoad stepKey="waitWidgetsLoad"/> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> - <fillField selector="{{AdminWidgetsSection.widgetTitleSearch}}" userInput="{{widget.name}}" stepKey="fillTitle"/> - <click selector="{{AdminWidgetsSection.searchButton}}" stepKey="clickContinue"/> - <click selector="{{AdminWidgetsSection.searchResult}}" stepKey="clickSearchResult"/> - <waitForPageLoad stepKey="waitForResultLoad"/> - <click selector="{{AdminMainActionsSection.delete}}" stepKey="clickDelete"/> - <waitForAjaxLoad stepKey="waitForAjaxLoad"/> - <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDelete"/> - <waitForPageLoad stepKey="waitForDeleteLoad"/> - <see selector="{{AdminMessagesSection.success}}" userInput="The widget instance has been deleted" stepKey="seeSuccess"/> - </actionGroup> - - <actionGroup name="AdminCreateProductLinkWidgetActionGroup" extends="AdminCreateWidgetActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateWidgetActionGroup. Creates a Product List Widget using the provided Product. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <selectOption selector="{{AdminNewWidgetSection.selectTemplate}}" userInput="{{widget.template}}" after="waitForPageLoad" stepKey="setTemplate"/> - <waitForAjaxLoad after="setTemplate" stepKey="waitForPageLoad2"/> - <click selector="{{AdminNewWidgetSection.selectProduct}}" after="clickWidgetOptions" stepKey="clickSelectProduct"/> - <fillField selector="{{AdminNewWidgetSelectProductPopupSection.filterBySku}}" userInput="{{product.sku}}" after="clickSelectProduct" stepKey="fillProductNameInFilter"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" after="fillProductNameInFilter" stepKey="applyFilter"/> - <click selector="{{AdminNewWidgetSelectProductPopupSection.firstRow}}" after="applyFilter" stepKey="selectProduct"/> - <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveWidget"/> - <see selector="{{AdminMessagesSection.success}}" userInput="The widget instance has been saved" stepKey="seeSuccess"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminDeleteWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminDeleteWidgetActionGroup.xml new file mode 100644 index 0000000000000..889c8a9477534 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminDeleteWidgetActionGroup.xml @@ -0,0 +1,32 @@ +<?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="AdminDeleteWidgetActionGroup"> + <annotations> + <description>Goes to the Admin Widget grid page. Deletes the provided Widget. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="widget"/> + </arguments> + + <amOnPage url="{{AdminWidgetsPage.url}}" stepKey="amOnAdmin"/> + <waitForPageLoad stepKey="waitWidgetsLoad"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> + <fillField selector="{{AdminWidgetsSection.widgetTitleSearch}}" userInput="{{widget.name}}" stepKey="fillTitle"/> + <click selector="{{AdminWidgetsSection.searchButton}}" stepKey="clickContinue"/> + <click selector="{{AdminWidgetsSection.searchResult}}" stepKey="clickSearchResult"/> + <waitForPageLoad stepKey="waitForResultLoad"/> + <click selector="{{AdminMainActionsSection.delete}}" stepKey="clickDelete"/> + <waitForAjaxLoad stepKey="waitForAjaxLoad"/> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDelete"/> + <waitForPageLoad stepKey="waitForDeleteLoad"/> + <see selector="{{AdminMessagesSection.success}}" userInput="The widget instance has been deleted" stepKey="seeSuccess"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminFillSpecificPageWidgetMainFieldsActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminFillSpecificPageWidgetMainFieldsActionGroup.xml new file mode 100644 index 0000000000000..c0fa53da7c688 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminFillSpecificPageWidgetMainFieldsActionGroup.xml @@ -0,0 +1,36 @@ +<?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="AdminFillSpecificPageWidgetMainFieldsActionGroup"> + <annotations> + <description>Fill widget main fields and widget layout by index for specified page DisplayOn option</description> + </annotations> + <arguments> + <argument name="widget" type="entity" defaultValue="ProductsListWidget"/> + <argument name="index" type="string" defaultValue="0"/> + </arguments> + <selectOption selector="{{AdminNewWidgetSection.widgetType}}" userInput="{{widget.type}}" stepKey="setWidgetType"/> + <selectOption selector="{{AdminNewWidgetSection.widgetDesignTheme}}" userInput="{{widget.design_theme}}" stepKey="setWidgetDesignTheme"/> + <click selector="{{AdminNewWidgetSection.continue}}" stepKey="clickContinue"/> + <fillField selector="{{AdminNewWidgetSection.widgetTitle}}" userInput="{{widget.name}}" stepKey="fillTitle"/> + <selectOption selector="{{AdminNewWidgetSection.widgetStoreIds}}" parameterArray="{{widget.store_ids}}" stepKey="setWidgetStoreIds"/> + <fillField selector="{{AdminNewWidgetSection.widgetSortOrder}}" userInput="{{widget.sort_order}}" stepKey="fillSortOrder"/> + <click selector="{{AdminNewWidgetSection.addLayoutUpdate}}" stepKey="clickAddLayoutUpdate"/> + <waitForElementVisible selector="{{AdminNewWidgetSection.selectDisplayOn}}" stepKey="waitForSelectElement"/> + <selectOption selector="{{AdminNewWidgetSection.displayOnByIndex(index)}}" userInput="{{widget.display_on}}" stepKey="setDisplayOn"/> + <waitForPageLoad stepKey="waitForDisplayOnChangesApplied"/> + <selectOption selector="{{AdminNewWidgetSection.layoutByIndex(index)}}" userInput="{{widget.page}}" stepKey="selectPage"/> + <selectOption selector="{{AdminNewWidgetSection.templateByIndex(index)}}" userInput="{{widget.template}}" stepKey="selectTemplate"/> + <scrollTo selector="{{AdminNewWidgetSection.containerByIndex(index)}}" stepKey="scrollToSelectContainerElement"/> + <waitForPageLoad stepKey="waitForScroll"/> + <selectOption selector="{{AdminNewWidgetSection.containerByIndex(index)}}" userInput="{{widget.container}}" stepKey="setContainer"/> + <waitForPageLoad stepKey="waitForContainerChangesApplied"/> + </actionGroup> +</actionGroups> From 35f470c05ddbe439960903957798f5d9a8cf8999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 13:43:42 +0100 Subject: [PATCH 304/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../CreateCustomVariableActionGroup.xml | 16 ------------ .../DeleteCustomVariableActionGroup.xml | 26 +++++++++++++++++++ 2 files changed, 26 insertions(+), 16 deletions(-) create mode 100644 app/code/Magento/Variable/Test/Mftf/ActionGroup/DeleteCustomVariableActionGroup.xml diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/CreateCustomVariableActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/CreateCustomVariableActionGroup.xml index 1aa9a3fa6c6ab..75f09b478170e 100644 --- a/app/code/Magento/Variable/Test/Mftf/ActionGroup/CreateCustomVariableActionGroup.xml +++ b/app/code/Magento/Variable/Test/Mftf/ActionGroup/CreateCustomVariableActionGroup.xml @@ -21,20 +21,4 @@ <fillField selector="{{CustomVariableSection.variablePlain}}" userInput="{{customVariable.plain}}" stepKey="fillVariablePlain"/> <click selector="{{CustomVariableSection.saveCustomVariable}}" stepKey="clickSaveVariable"/> </actionGroup> - - <actionGroup name="DeleteCustomVariableActionGroup"> - <annotations> - <description>Goes to the Custom Variable grid page. Deletes the Custom Variable. PLEASE NOTE: The Custom Variable that is deleted is Hardcoded using 'customVariable'.</description> - </annotations> - - <amOnPage url="admin/admin/system_variable/" stepKey="goToVarialeGrid"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <click selector="{{CustomVariableSection.GridCustomVariableCode(customVariable.code)}}" stepKey="goToCustomVariableEditPage"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <waitForElementVisible selector="{{CustomVariableSection.delete}}" stepKey="waitForDeleteBtn"/> - <click selector="{{CustomVariableSection.delete}}" stepKey="deleteCustomVariable"/> - <waitForText userInput="Are you sure you want to do this?" stepKey="waitForText"/> - <click selector="{{CustomVariableSection.confirmDelete}}" stepKey="confirmDelete"/> - <waitForPageLoad stepKey="waitForPageLoad3"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/DeleteCustomVariableActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/DeleteCustomVariableActionGroup.xml new file mode 100644 index 0000000000000..df77d7d1fb9d0 --- /dev/null +++ b/app/code/Magento/Variable/Test/Mftf/ActionGroup/DeleteCustomVariableActionGroup.xml @@ -0,0 +1,26 @@ +<?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="DeleteCustomVariableActionGroup"> + <annotations> + <description>Goes to the Custom Variable grid page. Deletes the Custom Variable. PLEASE NOTE: The Custom Variable that is deleted is Hardcoded using 'customVariable'.</description> + </annotations> + + <amOnPage url="admin/admin/system_variable/" stepKey="goToVarialeGrid"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <click selector="{{CustomVariableSection.GridCustomVariableCode(customVariable.code)}}" stepKey="goToCustomVariableEditPage"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <waitForElementVisible selector="{{CustomVariableSection.delete}}" stepKey="waitForDeleteBtn"/> + <click selector="{{CustomVariableSection.delete}}" stepKey="deleteCustomVariable"/> + <waitForText userInput="Are you sure you want to do this?" stepKey="waitForText"/> + <click selector="{{CustomVariableSection.confirmDelete}}" stepKey="confirmDelete"/> + <waitForPageLoad stepKey="waitForPageLoad3"/> + </actionGroup> +</actionGroups> From b17b871c9990bc99ae77d1c878173b9ecd8db929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 13:58:12 +0100 Subject: [PATCH 305/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...ctedUserAddCategoryFromProductPageTest.xml | 6 +-- .../AdminAddNewUserRoleActionGroup.xml | 7 --- ...serRoleWithCustomRoleScopesActionGroup.xml | 17 +++++++ .../AdminAddRestrictedRoleActionGroup.xml | 22 ++++++++++ .../AdminCreateRoleActionGroup.xml | 44 ------------------- .../AdminCreateUserActionGroup.xml | 30 ------------- .../AdminCreateUserWithApiRoleActionGroup.xml | 14 ++++++ .../AdminCreateUserWithRoleActionGroup.xml | 36 +++++++++++++++ .../AdminDeleteCreatedRoleActionGroup.xml | 3 -- .../AdminDeleteCreatedUserActionGroup.xml | 19 +------- .../AdminDeleteCustomUserActionGroup.xml | 33 ++++++++++++++ .../AdminDeleteNewUserActionGroup.xml | 27 ++++++++++++ .../AdminDeleteRoleByRoleNameActionGroup.xml | 14 ++++++ .../AdminDeleteUserActionGroup.xml | 23 ---------- ...minFillUserRoleRequiredDataActionGroup.xml | 20 +++++++++ 15 files changed, 187 insertions(+), 128 deletions(-) create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddNewUserRoleWithCustomRoleScopesActionGroup.xml create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddRestrictedRoleActionGroup.xml create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithApiRoleActionGroup.xml create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithRoleActionGroup.xml create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCustomUserActionGroup.xml create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteNewUserActionGroup.xml create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteRoleByRoleNameActionGroup.xml create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminFillUserRoleRequiredDataActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRestrictedUserAddCategoryFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRestrictedUserAddCategoryFromProductPageTest.xml index 7b5455951fb27..da93db7ac8e17 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRestrictedUserAddCategoryFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRestrictedUserAddCategoryFromProductPageTest.xml @@ -51,16 +51,16 @@ </after> <!--Create user role--> <comment userInput="Create user role" stepKey="commentCreateUserRole"/> - <actionGroup ref="AdminFillUserRoleRequiredData" stepKey="fillUserRoleRequiredData"> + <actionGroup ref="AdminFillUserRoleRequiredDataActionGroup" stepKey="fillUserRoleRequiredData"> <argument name="User" value="adminRole"/> <argument name="restrictedRole" value="Stores"/> </actionGroup> <click selector="{{AdminEditRoleInfoSection.roleResourcesTab}}" stepKey="clickRoleResourcesTab" /> - <actionGroup ref="AdminAddRestrictedRole" stepKey="addRestrictedRoleStores"> + <actionGroup ref="AdminAddRestrictedRoleActionGroup" stepKey="addRestrictedRoleStores"> <argument name="User" value="adminRole"/> <argument name="restrictedRole" value="Stores"/> </actionGroup> - <actionGroup ref="AdminAddRestrictedRole" stepKey="addRestrictedRoleProducts"> + <actionGroup ref="AdminAddRestrictedRoleActionGroup" stepKey="addRestrictedRoleProducts"> <argument name="User" value="adminRole"/> <argument name="restrictedRole" value="Products"/> </actionGroup> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddNewUserRoleActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddNewUserRoleActionGroup.xml index 175f6203350c7..28cbaba4b8241 100644 --- a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddNewUserRoleActionGroup.xml +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddNewUserRoleActionGroup.xml @@ -38,11 +38,4 @@ <waitForPageLoad stepKey="waitForSaving"/> <see userInput="You saved the role." selector="{{AdminMessagesSection.success}}" stepKey="seeMessage"/> </actionGroup> - - <actionGroup name="AdminAddNewUserRoleWithCustomRoleScopes" extends="AdminAddNewUserRoleActionGroup"> - <arguments> - <argument name="customWebsiteName" type="string"/> - </arguments> - <checkOption selector="{{AdminCreateRoleSection.selectWebsite(customWebsiteName)}}" stepKey="checkWebsite" after="selectRoleResources"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddNewUserRoleWithCustomRoleScopesActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddNewUserRoleWithCustomRoleScopesActionGroup.xml new file mode 100644 index 0000000000000..142ed8af09fcf --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddNewUserRoleWithCustomRoleScopesActionGroup.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="AdminAddNewUserRoleWithCustomRoleScopesActionGroup" extends="AdminAddNewUserRoleActionGroup"> + <arguments> + <argument name="customWebsiteName" type="string"/> + </arguments> + <checkOption selector="{{AdminCreateRoleSection.selectWebsite(customWebsiteName)}}" stepKey="checkWebsite" after="selectRoleResources"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddRestrictedRoleActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddRestrictedRoleActionGroup.xml new file mode 100644 index 0000000000000..37f06b8c14ad8 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminAddRestrictedRoleActionGroup.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="AdminAddRestrictedRoleActionGroup" extends="AdminCreateRoleActionGroup"> + <remove keyForRemoval="navigateToNewRole"/> + <remove keyForRemoval="waitForPageLoad1"/> + <remove keyForRemoval="fillRoleName"/> + <remove keyForRemoval="enterPassword"/> + <remove keyForRemoval="clickRoleResourcesTab"/> + <remove keyForRemoval="waitForScopeSelection"/> + <remove keyForRemoval="clickSaveRoleButton"/> + <remove keyForRemoval="waitForPageLoad2"/> + <scrollTo selector="{{AdminEditRoleInfoSection.blockName('restrictedRole')}}" x="0" y="-100" stepKey="scrollToResourceElement" after="selectResourceAccessCustom"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateRoleActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateRoleActionGroup.xml index 9e8262d5564fb..15deee5fbd049 100644 --- a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateRoleActionGroup.xml +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateRoleActionGroup.xml @@ -29,48 +29,4 @@ <click selector="{{AdminEditRoleInfoSection.saveButton}}" stepKey="clickSaveRoleButton"/> <waitForPageLoad stepKey="waitForPageLoad2"/> </actionGroup> - - <actionGroup name="AdminFillUserRoleRequiredData" extends="AdminCreateRoleActionGroup"> - <remove keyForRemoval="clickRoleResourcesTab"/> - <remove keyForRemoval="waitForScopeSelection"/> - <remove keyForRemoval="selectResourceAccessCustom"/> - <remove keyForRemoval="waitForElementVisible"/> - <remove keyForRemoval="clickContentBlockCheckbox"/> - <remove keyForRemoval="clickSaveRoleButton"/> - <remove keyForRemoval="waitForPageLoad2"/> - </actionGroup> - <actionGroup name="AdminAddRestrictedRole" extends="AdminCreateRoleActionGroup"> - <remove keyForRemoval="navigateToNewRole"/> - <remove keyForRemoval="waitForPageLoad1"/> - <remove keyForRemoval="fillRoleName"/> - <remove keyForRemoval="enterPassword"/> - <remove keyForRemoval="clickRoleResourcesTab"/> - <remove keyForRemoval="waitForScopeSelection"/> - <remove keyForRemoval="clickSaveRoleButton"/> - <remove keyForRemoval="waitForPageLoad2"/> - <scrollTo selector="{{AdminEditRoleInfoSection.blockName('restrictedRole')}}" x="0" y="-100" stepKey="scrollToResourceElement" after="selectResourceAccessCustom"/> - </actionGroup> - - <!--Create new role--> - <actionGroup name="AdminCreateRole"> - <annotations> - <description>Clicks on 'Add New Role'. Fills in the provided details (Role, Resource, Scope and Websites). Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="role" type="string" defaultValue=""/> - <argument name="resource" type="string" defaultValue="All"/> - <argument name="scope" type="string" defaultValue="Custom"/> - <argument name="websites" type="string" defaultValue="Main Website"/> - </arguments> - - <click selector="{{AdminCreateRoleSection.create}}" stepKey="clickToAddNewRole"/> - <fillField selector="{{AdminCreateRoleSection.name}}" userInput="{{role.name}}" stepKey="setRoleName"/> - <fillField stepKey="setPassword" selector="{{AdminCreateRoleSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> - <click selector="{{AdminCreateRoleSection.roleResources}}" stepKey="clickToOpenRoleResources"/> - <waitForPageLoad stepKey="waitForRoleResourcePage" time="5"/> - <click stepKey="checkSales" selector="//a[text()='Sales']"/> - <click selector="{{AdminCreateRoleSection.save}}" stepKey="clickToSaveRole"/> - <waitForPageLoad stepKey="waitForPageLoad" time="10"/> - <see userInput="You saved the role." stepKey="seeSuccessMessage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml index 2738ef9f1cb3f..8abb4e9224b0a 100644 --- a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserActionGroup.xml @@ -37,34 +37,4 @@ <waitForPageLoad stepKey="waitForPageLoad2"/> <see userInput="You saved the user." stepKey="seeSuccessMessage"/> </actionGroup> - - <!--Create new user with role--> - <actionGroup name="AdminCreateUserWithRoleActionGroup"> - <annotations> - <description>Goes to the Admin Users grid page. Clicks on Create User. Fills in the provided Role and User.</description> - </annotations> - <arguments> - <argument name="role"/> - <argument name="user" defaultValue="newAdmin"/> - </arguments> - - <amOnPage url="{{AdminNewUserPage.url}}" stepKey="navigateToNewUser"/> - <waitForPageLoad stepKey="waitForUsersPage"/> - <fillField selector="{{AdminCreateUserSection.usernameTextField}}" userInput="{{user.username}}" stepKey="enterUserName"/> - <fillField selector="{{AdminCreateUserSection.firstNameTextField}}" userInput="{{user.firstName}}" stepKey="enterFirstName"/> - <fillField selector="{{AdminCreateUserSection.lastNameTextField}}" userInput="{{user.lastName}}" stepKey="enterLastName"/> - <fillField selector="{{AdminCreateUserSection.emailTextField}}" userInput="{{user.username}}@magento.com" stepKey="enterEmail"/> - <fillField selector="{{AdminCreateUserSection.passwordTextField}}" userInput="{{user.password}}" stepKey="enterPassword"/> - <fillField selector="{{AdminCreateUserSection.pwConfirmationTextField}}" userInput="{{user.password}}" stepKey="confirmPassword"/> - <fillField selector="{{AdminCreateUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword"/> - <scrollToTopOfPage stepKey="scrollToTopOfPage"/> - <click stepKey="clickUserRole" selector="{{AdminCreateUserSection.userRoleTab}}"/> - <click stepKey="chooseRole" selector="{{AdminStoreSection.createdRoleInUserPage(role.name)}}"/> - <click selector="{{AdminCreateUserSection.saveButton}}" stepKey="clickSaveUser"/> - <waitForPageLoad stepKey="waitForSaveTheUser"/> - <see userInput="You saved the user." stepKey="seeSuccessMessage"/> - </actionGroup> - <actionGroup name="AdminCreateUserWithApiRoleActionGroup" extends="AdminCreateUserWithRoleActionGroup"> - <click stepKey="chooseRole" selector="{{AdminCreateUserSection.createdRoleInUserPage(role.rolename)}}"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithApiRoleActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithApiRoleActionGroup.xml new file mode 100644 index 0000000000000..d3f7278765d47 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithApiRoleActionGroup.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="AdminCreateUserWithApiRoleActionGroup" extends="AdminCreateUserWithRoleActionGroup"> + <click stepKey="chooseRole" selector="{{AdminCreateUserSection.createdRoleInUserPage(role.rolename)}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithRoleActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithRoleActionGroup.xml new file mode 100644 index 0000000000000..dd4f181204040 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminCreateUserWithRoleActionGroup.xml @@ -0,0 +1,36 @@ +<?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="AdminCreateUserWithRoleActionGroup"> + <annotations> + <description>Goes to the Admin Users grid page. Clicks on Create User. Fills in the provided Role and User.</description> + </annotations> + <arguments> + <argument name="role"/> + <argument name="user" defaultValue="newAdmin"/> + </arguments> + + <amOnPage url="{{AdminNewUserPage.url}}" stepKey="navigateToNewUser"/> + <waitForPageLoad stepKey="waitForUsersPage"/> + <fillField selector="{{AdminCreateUserSection.usernameTextField}}" userInput="{{user.username}}" stepKey="enterUserName"/> + <fillField selector="{{AdminCreateUserSection.firstNameTextField}}" userInput="{{user.firstName}}" stepKey="enterFirstName"/> + <fillField selector="{{AdminCreateUserSection.lastNameTextField}}" userInput="{{user.lastName}}" stepKey="enterLastName"/> + <fillField selector="{{AdminCreateUserSection.emailTextField}}" userInput="{{user.username}}@magento.com" stepKey="enterEmail"/> + <fillField selector="{{AdminCreateUserSection.passwordTextField}}" userInput="{{user.password}}" stepKey="enterPassword"/> + <fillField selector="{{AdminCreateUserSection.pwConfirmationTextField}}" userInput="{{user.password}}" stepKey="confirmPassword"/> + <fillField selector="{{AdminCreateUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword"/> + <scrollToTopOfPage stepKey="scrollToTopOfPage"/> + <click stepKey="clickUserRole" selector="{{AdminCreateUserSection.userRoleTab}}"/> + <click stepKey="chooseRole" selector="{{AdminStoreSection.createdRoleInUserPage(role.name)}}"/> + <click selector="{{AdminCreateUserSection.saveButton}}" stepKey="clickSaveUser"/> + <waitForPageLoad stepKey="waitForSaveTheUser"/> + <see userInput="You saved the user." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCreatedRoleActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCreatedRoleActionGroup.xml index c1659610feda5..813e22df227c8 100644 --- a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCreatedRoleActionGroup.xml +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCreatedRoleActionGroup.xml @@ -21,7 +21,4 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <see stepKey="seeSuccessMessage" userInput="You deleted the role."/> </actionGroup> - <actionGroup name="AdminDeleteRoleByRoleNameActionGroup" extends="AdminDeleteCreatedRoleActionGroup"> - <click stepKey="clickToAddNewRole" selector="{{AdminDeleteRoleSection.role(role.rolename)}}"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCreatedUserActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCreatedUserActionGroup.xml index 6be5e80ec3e30..0939626660ad0 100644 --- a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCreatedUserActionGroup.xml +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCreatedUserActionGroup.xml @@ -15,7 +15,7 @@ <arguments> <argument name="user"/> </arguments> - + <amOnPage stepKey="amOnAdminUsersPage" url="{{AdminUsersPage.url}}"/> <click stepKey="openTheUser" selector="{{AdminDeleteUserSection.role(user.username)}}"/> <waitForPageLoad stepKey="waitForSingleUserPageToLoad"/> @@ -26,21 +26,4 @@ <click stepKey="clickToConfirm" selector="{{AdminDeleteUserSection.confirm}}"/> <see stepKey="seeDeleteMessageForUser" userInput="You deleted the user."/> </actionGroup> - <!--Delete User--> - <actionGroup name="AdminDeleteNewUserActionGroup"> - <annotations> - <description>Deletes a User that contains the name 'John'. PLEASE NOTE: The Action Group values are Hardcoded.</description> - </annotations> - <arguments> - <argument name="userName" type="string" defaultValue="John"/> - </arguments> - <click stepKey="clickOnUser" selector="{{AdminDeleteUserSection.theUser(userName)}}"/> - <fillField stepKey="typeCurrentPassword" selector="{{AdminDeleteUserSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> - <scrollToTopOfPage stepKey="scrollToTop"/> - <click stepKey="clickToDeleteUser" selector="{{AdminDeleteUserSection.delete}}"/> - <waitForPageLoad stepKey="waitForDeletePopupOpen" time="5"/> - <click stepKey="clickToConfirm" selector="{{AdminDeleteUserSection.confirm}}"/> - <waitForPageLoad stepKey="waitForPageLoad" time="10"/> - <see userInput="You deleted the user." stepKey="seeSuccessMessage" /> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCustomUserActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCustomUserActionGroup.xml new file mode 100644 index 0000000000000..598d95b8d562c --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteCustomUserActionGroup.xml @@ -0,0 +1,33 @@ +<?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="AdminDeleteCustomUserActionGroup"> + <annotations> + <description>Goes to the Admin Users grid page. Deletes the provided User. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="user"/> + </arguments> + + <amOnPage url="{{AdminUsersPage.url}}" stepKey="navigateToUserGrid"/> + <fillField selector="{{AdminUserGridSection.usernameFilterTextField}}" userInput="{{user.username}}" stepKey="enterUserName"/> + <click selector="{{AdminUserGridSection.searchButton}}" stepKey="clickSearch"/> + <waitForPageLoad stepKey="waitForGridToLoad"/> + <see selector="{{AdminUserGridSection.usernameInFirstRow}}" userInput="{{user.username}}" stepKey="seeUser"/> + <click selector="{{AdminUserGridSection.searchResultFirstRow}}" stepKey="openUserEdit"/> + <waitForPageLoad stepKey="waitForUserEditPageLoad"/> + <fillField selector="{{AdminEditUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterThePassword"/> + <click selector="{{AdminMainActionsSection.delete}}" stepKey="deleteUser"/> + <waitForElementVisible selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForConfirmModal"/> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDelete"/> + <waitForPageLoad stepKey="waitForSave"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the user." stepKey="seeUserDeleteMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteNewUserActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteNewUserActionGroup.xml new file mode 100644 index 0000000000000..a4e5492f8e3e6 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteNewUserActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AdminDeleteNewUserActionGroup"> + <annotations> + <description>Deletes a User that contains the name 'John'. PLEASE NOTE: The Action Group values are Hardcoded.</description> + </annotations> + <arguments> + <argument name="userName" type="string" defaultValue="John"/> + </arguments> + <click stepKey="clickOnUser" selector="{{AdminDeleteUserSection.theUser(userName)}}"/> + <fillField stepKey="typeCurrentPassword" selector="{{AdminDeleteUserSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> + <scrollToTopOfPage stepKey="scrollToTop"/> + <click stepKey="clickToDeleteUser" selector="{{AdminDeleteUserSection.delete}}"/> + <waitForPageLoad stepKey="waitForDeletePopupOpen" time="5"/> + <click stepKey="clickToConfirm" selector="{{AdminDeleteUserSection.confirm}}"/> + <waitForPageLoad stepKey="waitForPageLoad" time="10"/> + <see userInput="You deleted the user." stepKey="seeSuccessMessage" /> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteRoleByRoleNameActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteRoleByRoleNameActionGroup.xml new file mode 100644 index 0000000000000..82602c007586c --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteRoleByRoleNameActionGroup.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="AdminDeleteRoleByRoleNameActionGroup" extends="AdminDeleteCreatedRoleActionGroup"> + <click stepKey="clickToAddNewRole" selector="{{AdminDeleteRoleSection.role(role.rolename)}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteUserActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteUserActionGroup.xml index 084f60dcf8542..67075eb52a678 100644 --- a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteUserActionGroup.xml +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteUserActionGroup.xml @@ -27,27 +27,4 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <see stepKey="seeDeleteMessageForUser" userInput="You deleted the user."/> </actionGroup> - - <actionGroup name="AdminDeleteCustomUserActionGroup"> - <annotations> - <description>Goes to the Admin Users grid page. Deletes the provided User. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="user"/> - </arguments> - - <amOnPage url="{{AdminUsersPage.url}}" stepKey="navigateToUserGrid"/> - <fillField selector="{{AdminUserGridSection.usernameFilterTextField}}" userInput="{{user.username}}" stepKey="enterUserName"/> - <click selector="{{AdminUserGridSection.searchButton}}" stepKey="clickSearch"/> - <waitForPageLoad stepKey="waitForGridToLoad"/> - <see selector="{{AdminUserGridSection.usernameInFirstRow}}" userInput="{{user.username}}" stepKey="seeUser"/> - <click selector="{{AdminUserGridSection.searchResultFirstRow}}" stepKey="openUserEdit"/> - <waitForPageLoad stepKey="waitForUserEditPageLoad"/> - <fillField selector="{{AdminEditUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterThePassword"/> - <click selector="{{AdminMainActionsSection.delete}}" stepKey="deleteUser"/> - <waitForElementVisible selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForConfirmModal"/> - <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDelete"/> - <waitForPageLoad stepKey="waitForSave"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the user." stepKey="seeUserDeleteMessage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminFillUserRoleRequiredDataActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminFillUserRoleRequiredDataActionGroup.xml new file mode 100644 index 0000000000000..236db105fad14 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminFillUserRoleRequiredDataActionGroup.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="AdminFillUserRoleRequiredDataActionGroup" extends="AdminCreateRoleActionGroup"> + <remove keyForRemoval="clickRoleResourcesTab"/> + <remove keyForRemoval="waitForScopeSelection"/> + <remove keyForRemoval="selectResourceAccessCustom"/> + <remove keyForRemoval="waitForElementVisible"/> + <remove keyForRemoval="clickContentBlockCheckbox"/> + <remove keyForRemoval="clickSaveRoleButton"/> + <remove keyForRemoval="waitForPageLoad2"/> + </actionGroup> +</actionGroups> From d0771dc3ab7e57c8efcfbc4cbe1d616239b3ef16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 14:18:57 +0100 Subject: [PATCH 306/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../AdminAddCustomUrlRewriteActionGroup.xml | 38 ++++++ ...dminAddUrlRewriteForProductActionGroup.xml | 34 +++++ .../AdminDeleteUrlRewriteActionGroup.xml | 35 +++++ ...chAndSelectUrlRewriteInGridActionGroup.xml | 29 ++++ .../AdminSearchByRequestPathActionGroup.xml | 32 +++++ ...dminSearchDeletedUrlRewriteActionGroup.xml | 28 ++++ ...earchUrlRewriteProductBySkuActionGroup.xml | 29 ++++ ...AdminUpdateCustomUrlRewriteActionGroup.xml | 32 +++++ .../AdminUpdateUrlRewriteActionGroup.xml | 31 +++++ .../AdminUrlRewriteActionGroup.xml | 97 +------------- .../AdminUrlRewriteGridActionGroup.xml | 126 ------------------ ...tPageByUrlRewriteIsNotFoundActionGroup.xml | 23 ++++ ...tStorefrontProductRedirectActionGroup.xml} | 21 +-- ...torefrontUrlRewriteRedirectActionGroup.xml | 25 ++++ ...ateURLRewriteWhenCategoryIsDeletedTest.xml | 12 +- ...CategoryUrlRewriteAndAddNoRedirectTest.xml | 4 +- ...yUrlRewriteAndAddPermanentRedirectTest.xml | 6 +- ...yUrlRewriteAndAddTemporaryRedirectTest.xml | 6 +- ...eUrlRewriteAndAddPermanentRedirectTest.xml | 8 +- ...eUrlRewriteAndAddTemporaryRedirectTest.xml | 8 +- ...yUrlRewriteAndAddPermanentRedirectTest.xml | 12 +- ...tUrlRewriteAndAddTemporaryRedirectTest.xml | 12 +- ...eProductURLRewriteAndAddNoRedirectTest.xml | 10 +- ...ithCategoryAndAddTemporaryRedirectTest.xml | 12 +- ...tUrLRewriteAndAddPermanentRedirectTest.xml | 10 +- ...tUrLRewriteAndAddTemporaryRedirectTest.xml | 10 +- ...SeveralWebsitesAndCheckURLRewritesTest.xml | 6 +- .../Test/AdminDeleteCustomUrlRewriteTest.xml | 8 +- ...CreateUrlRewriteForCustomStoreViewTest.xml | 6 +- ...oryUrlRewriteAndAddAspxRequestPathTest.xml | 8 +- ...CategoryUrlRewriteAndAddNoRedirectTest.xml | 8 +- ...yUrlRewriteAndAddPermanentRedirectTest.xml | 8 +- ...yUrlRewriteAndAddTemporaryRedirectTest.xml | 8 +- ...inUpdateCustomURLRewritesPermanentTest.xml | 10 +- ...inUpdateCustomURLRewritesTemporaryTest.xml | 12 +- ...tUrlRewriteAndAddTemporaryRedirectTest.xml | 6 +- 36 files changed, 435 insertions(+), 335 deletions(-) create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddCustomUrlRewriteActionGroup.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteForProductActionGroup.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminDeleteUrlRewriteActionGroup.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchAndSelectUrlRewriteInGridActionGroup.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchByRequestPathActionGroup.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchDeletedUrlRewriteActionGroup.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchUrlRewriteProductBySkuActionGroup.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUpdateCustomUrlRewriteActionGroup.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUpdateUrlRewriteActionGroup.xml delete mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteGridActionGroup.xml create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AssertPageByUrlRewriteIsNotFoundActionGroup.xml rename app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/{StorefrontUrlRewriteRedirectActionGroup.xml => AssertStorefrontProductRedirectActionGroup.xml} (52%) create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AssertStorefrontUrlRewriteRedirectActionGroup.xml diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddCustomUrlRewriteActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddCustomUrlRewriteActionGroup.xml new file mode 100644 index 0000000000000..d4bcb5bbb414f --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddCustomUrlRewriteActionGroup.xml @@ -0,0 +1,38 @@ +<?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="AdminAddCustomUrlRewriteActionGroup"> + <annotations> + <description>Goes to the Admin URL Rewrite edit page. Adds the provided Custom URL Rewrite details. Clicks on Save. Validates that the Success Message is present.</description> + </annotations> + <arguments> + <argument name="customUrlRewriteValue" type="string"/> + <argument name="storeValue" type="string"/> + <argument name="requestPath" type="string"/> + <argument name="targetPath" type="string"/> + <argument name="redirectTypeValue" type="string"/> + <argument name="description" type="string"/> + </arguments> + + <amOnPage url="{{AdminUrlRewriteEditPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad" after="openUrlRewriteEditPage"/> + <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewrite}}" stepKey="clickOnCustonUrlRewrite"/> + <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewriteValue('customUrlRewriteValue')}}" stepKey="selectCustom"/> + <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> + <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> + <fillField selector="{{AdminUrlRewriteEditSection.targetPath}}" userInput="{{targetPath}}" stepKey="fillTargetPath"/> + <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> + <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue('redirectTypeValue')}}" stepKey="selectRedirectTypeValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> + <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> + <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteForProductActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteForProductActionGroup.xml new file mode 100644 index 0000000000000..51436fc5de584 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteForProductActionGroup.xml @@ -0,0 +1,34 @@ +<?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="AdminAddUrlRewriteForProductActionGroup"> + <annotations> + <description>Adds the provided URL Rewrite details for a Product.</description> + </annotations> + <arguments> + <argument name="storeValue" type="string"/> + <argument name="requestPath" type="string"/> + <argument name="redirectTypeValue" type="string"/> + <argument name="description" type="string"/> + </arguments> + + <waitForElementVisible selector="{{AdminUrlRewriteProductSection.skipCategoryButton}}" stepKey="waitForSkipCategoryButton"/> + <click selector="{{AdminUrlRewriteProductSection.skipCategoryButton}}" stepKey="clickOnSkipCategoryButton"/> + <waitForPageLoad stepKey="waitForProductPageToLoad"/> + <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> + <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> + <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> + <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue('redirectTypeValue')}}" stepKey="clickOnRedirectTypeValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> + <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> + <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminDeleteUrlRewriteActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminDeleteUrlRewriteActionGroup.xml new file mode 100644 index 0000000000000..bc3953c4dedd4 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminDeleteUrlRewriteActionGroup.xml @@ -0,0 +1,35 @@ +<?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="AdminDeleteUrlRewriteActionGroup"> + <annotations> + <description>Goes to the Admin URL Rewrite grid page. Deletes the provided Request Path. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="requestPath" type="string"/> + </arguments> + + <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> + <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> + <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + <click selector="{{AdminUrlRewriteIndexSection.editButton('1')}}" stepKey="clickOnEditButton"/> + <waitForPageLoad stepKey="waitForEditPageToLoad"/> + <click selector="{{AdminUrlRewriteEditSection.deleteButton}}" stepKey="clickOnDeleteButton"/> + <waitForPageLoad stepKey="waitForPageToLoad2"/> + <waitForElementVisible selector="{{AdminUrlRewriteEditSection.okButton}}" stepKey="waitForOkButtonToVisible"/> + <click selector="{{AdminUrlRewriteEditSection.okButton}}" stepKey="clickOnOkButton"/> + <waitForPageLoad stepKey="waitForPageToLoad3"/> + <see selector="{{AdminUrlRewriteIndexSection.successMessage}}" userInput="You deleted the URL rewrite." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchAndSelectUrlRewriteInGridActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchAndSelectUrlRewriteInGridActionGroup.xml new file mode 100644 index 0000000000000..f2f114f01cc9e --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchAndSelectUrlRewriteInGridActionGroup.xml @@ -0,0 +1,29 @@ +<?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="AdminSearchAndSelectUrlRewriteInGridActionGroup"> + <annotations> + <description>Goes to the Admin URL Rewrite grid page. Searches the grid for the provided Request Path. Clicks on Edit.</description> + </annotations> + <arguments> + <argument name="requestPath" type="string"/> + </arguments> + + <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> + <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> + <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + <click selector="{{AdminUrlRewriteIndexSection.editButton('1')}}" stepKey="clickOnEditButton"/> + <waitForPageLoad stepKey="waitForEditPageToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchByRequestPathActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchByRequestPathActionGroup.xml new file mode 100644 index 0000000000000..99ac4ea160f82 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchByRequestPathActionGroup.xml @@ -0,0 +1,32 @@ +<?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="AdminSearchByRequestPathActionGroup"> + <annotations> + <description>Goes to the Admin URL Rewrite grid page. Searches the grid based on the provided Redirect Path. Validates that the provided Redirect Path, Type and Target Path are present and correct in the grid.</description> + </annotations> + <arguments> + <argument name="redirectPath" type="string"/> + <argument name="redirectType" type="string"/> + <argument name="targetPath" type="string"/> + </arguments> + + <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> + <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{redirectPath}}" stepKey="fillRedirectPathFilter"/> + <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + <see selector="{{AdminUrlRewriteIndexSection.requestPathColumn('1')}}" userInput="{{redirectPath}}" stepKey="seeTheRedirectPathForOldUrl"/> + <see selector="{{AdminUrlRewriteIndexSection.targetPathColumn('1')}}" userInput="{{targetPath}}" stepKey="seeTheTargetPath"/> + <see selector="{{AdminUrlRewriteIndexSection.redirectTypeColumn('1')}}" userInput="{{redirectType}}" stepKey="seeTheRedirectTypeForOldUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchDeletedUrlRewriteActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchDeletedUrlRewriteActionGroup.xml new file mode 100644 index 0000000000000..2d7178f72f407 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchDeletedUrlRewriteActionGroup.xml @@ -0,0 +1,28 @@ +<?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="AdminSearchDeletedUrlRewriteActionGroup"> + <annotations> + <description>Goes to the Admin URL Rewrite grid page. Searches the grid for the provided Request Path. Validates that it does NOT appear in the grid.</description> + </annotations> + <arguments> + <argument name="requestPath" type="string"/> + </arguments> + + <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> + <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> + <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + <see selector="{{AdminUrlRewriteIndexSection.emptyRecords}}" userInput="We couldn't find any records." stepKey="seeEmptyRecordMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchUrlRewriteProductBySkuActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchUrlRewriteProductBySkuActionGroup.xml new file mode 100644 index 0000000000000..d77621ccd768f --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminSearchUrlRewriteProductBySkuActionGroup.xml @@ -0,0 +1,29 @@ +<?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="AdminSearchUrlRewriteProductBySkuActionGroup"> + <annotations> + <description>Goes to the Admin URL Rewrite grid page. Searches the grid based on the provided Product SKU. Clicks on the 1st row in the grid.</description> + </annotations> + <arguments> + <argument name="productSku" type="string"/> + </arguments> + + <amOnPage url="{{AdminUrlRewriteProductPage.url}}" stepKey="openUrlRewriteProductPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteProductPageToLoad"/> + <click selector="{{AdminUrlRewriteProductSection.resetFilter}}" stepKey="clickOnResetFilter"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminUrlRewriteProductSection.skuFilter}}" userInput="{{productSku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminUrlRewriteProductSection.searchFilter}}" stepKey="clickOnSearchFilter"/> + <waitForPageLoad stepKey="waitForProductToLoad"/> + <click selector="{{AdminUrlRewriteProductSection.productRow}}" stepKey="clickOnFirstRow"/> + <waitForPageLoad stepKey="waitForProductCategoryPageToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUpdateCustomUrlRewriteActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUpdateCustomUrlRewriteActionGroup.xml new file mode 100644 index 0000000000000..0d0c754fe076e --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUpdateCustomUrlRewriteActionGroup.xml @@ -0,0 +1,32 @@ +<?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="AdminUpdateCustomUrlRewriteActionGroup"> + <annotations> + <description>Updates the Custom URL Rewrite fields with the provided details.</description> + </annotations> + <arguments> + <argument name="storeValue" type="string"/> + <argument name="requestPath" type="string"/> + <argument name="targetPath" type="string"/> + <argument name="redirectTypeValue" type="string"/> + <argument name="description" type="string"/> + </arguments> + + <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> + <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> + <fillField selector="{{AdminUrlRewriteEditSection.targetPath}}" userInput="{{targetPath}}" stepKey="fillTargetPath"/> + <selectOption selector="{{AdminUrlRewriteEditSection.redirectType}}" userInput="{{redirectTypeValue}}" stepKey="selectRedirectTypeValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> + <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> + <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUpdateUrlRewriteActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUpdateUrlRewriteActionGroup.xml new file mode 100644 index 0000000000000..4b884448a7653 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUpdateUrlRewriteActionGroup.xml @@ -0,0 +1,31 @@ +<?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="AdminUpdateUrlRewriteActionGroup"> + <annotations> + <description>Updates the URL Rewrite fields with the provided details.</description> + </annotations> + <arguments> + <argument name="storeValue" type="string"/> + <argument name="requestPath" type="string"/> + <argument name="redirectTypeValue" type="string"/> + <argument name="description" type="string"/> + </arguments> + + <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> + <click selector="{{AdminUrlRewriteEditSection.storeValue(storeValue)}}" stepKey="clickOnStoreValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> + <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> + <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue(redirectTypeValue)}}" stepKey="selectRedirectTypeValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> + <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> + <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteActionGroup.xml index 4f89c9389c32b..55f18ae5a0187 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteActionGroup.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminAddUrlRewrite"> + <actionGroup name="AdminAddUrlRewriteActionGroup"> <annotations> <description>Goes to the Admin Add URL Rewrite edit page. Fills in the provided URL details. Clicks on Save. Validates that the Success Message is present.</description> </annotations> @@ -35,99 +35,4 @@ <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> <see selector="{{AdminMessagesSection.success}}" userInput="The URL Rewrite has been saved." stepKey="seeSuccessMessage"/> </actionGroup> - - <actionGroup name="AdminAddUrlRewriteForProduct"> - <annotations> - <description>Adds the provided URL Rewrite details for a Product.</description> - </annotations> - <arguments> - <argument name="storeValue" type="string"/> - <argument name="requestPath" type="string"/> - <argument name="redirectTypeValue" type="string"/> - <argument name="description" type="string"/> - </arguments> - - <waitForElementVisible selector="{{AdminUrlRewriteProductSection.skipCategoryButton}}" stepKey="waitForSkipCategoryButton"/> - <click selector="{{AdminUrlRewriteProductSection.skipCategoryButton}}" stepKey="clickOnSkipCategoryButton"/> - <waitForPageLoad stepKey="waitForProductPageToLoad"/> - <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> - <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> - <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> - <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue('redirectTypeValue')}}" stepKey="clickOnRedirectTypeValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> - <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> - <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> - </actionGroup> - - <actionGroup name="AdminAddCustomUrlRewrite"> - <annotations> - <description>Goes to the Admin URL Rewrite edit page. Adds the provided Custom URL Rewrite details. Clicks on Save. Validates that the Success Message is present.</description> - </annotations> - <arguments> - <argument name="customUrlRewriteValue" type="string"/> - <argument name="storeValue" type="string"/> - <argument name="requestPath" type="string"/> - <argument name="targetPath" type="string"/> - <argument name="redirectTypeValue" type="string"/> - <argument name="description" type="string"/> - </arguments> - - <amOnPage url="{{AdminUrlRewriteEditPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad" after="openUrlRewriteEditPage"/> - <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewrite}}" stepKey="clickOnCustonUrlRewrite"/> - <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewriteValue('customUrlRewriteValue')}}" stepKey="selectCustom"/> - <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> - <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> - <fillField selector="{{AdminUrlRewriteEditSection.targetPath}}" userInput="{{targetPath}}" stepKey="fillTargetPath"/> - <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> - <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue('redirectTypeValue')}}" stepKey="selectRedirectTypeValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> - <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> - <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> - </actionGroup> - - <actionGroup name="AdminUpdateUrlRewrite"> - <annotations> - <description>Updates the URL Rewrite fields with the provided details.</description> - </annotations> - <arguments> - <argument name="storeValue" type="string"/> - <argument name="requestPath" type="string"/> - <argument name="redirectTypeValue" type="string"/> - <argument name="description" type="string"/> - </arguments> - - <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> - <click selector="{{AdminUrlRewriteEditSection.storeValue(storeValue)}}" stepKey="clickOnStoreValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> - <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> - <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue(redirectTypeValue)}}" stepKey="selectRedirectTypeValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> - <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> - <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> - </actionGroup> - - <actionGroup name="AdminUpdateCustomUrlRewrite"> - <annotations> - <description>Updates the Custom URL Rewrite fields with the provided details.</description> - </annotations> - <arguments> - <argument name="storeValue" type="string"/> - <argument name="requestPath" type="string"/> - <argument name="targetPath" type="string"/> - <argument name="redirectTypeValue" type="string"/> - <argument name="description" type="string"/> - </arguments> - - <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> - <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> - <fillField selector="{{AdminUrlRewriteEditSection.targetPath}}" userInput="{{targetPath}}" stepKey="fillTargetPath"/> - <selectOption selector="{{AdminUrlRewriteEditSection.redirectType}}" userInput="{{redirectTypeValue}}" stepKey="selectRedirectTypeValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> - <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> - <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteGridActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteGridActionGroup.xml deleted file mode 100644 index 2a3f4446e2b74..0000000000000 --- a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteGridActionGroup.xml +++ /dev/null @@ -1,126 +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="AdminSearchByRequestPath"> - <annotations> - <description>Goes to the Admin URL Rewrite grid page. Searches the grid based on the provided Redirect Path. Validates that the provided Redirect Path, Type and Target Path are present and correct in the grid.</description> - </annotations> - <arguments> - <argument name="redirectPath" type="string"/> - <argument name="redirectType" type="string"/> - <argument name="targetPath" type="string"/> - </arguments> - - <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> - <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{redirectPath}}" stepKey="fillRedirectPathFilter"/> - <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> - <waitForPageLoad stepKey="waitForPageToLoad1"/> - <see selector="{{AdminUrlRewriteIndexSection.requestPathColumn('1')}}" userInput="{{redirectPath}}" stepKey="seeTheRedirectPathForOldUrl"/> - <see selector="{{AdminUrlRewriteIndexSection.targetPathColumn('1')}}" userInput="{{targetPath}}" stepKey="seeTheTargetPath"/> - <see selector="{{AdminUrlRewriteIndexSection.redirectTypeColumn('1')}}" userInput="{{redirectType}}" stepKey="seeTheRedirectTypeForOldUrl"/> - </actionGroup> - - <actionGroup name="AdminSearchUrlRewriteProductBySku"> - <annotations> - <description>Goes to the Admin URL Rewrite grid page. Searches the grid based on the provided Product SKU. Clicks on the 1st row in the grid.</description> - </annotations> - <arguments> - <argument name="productSku" type="string"/> - </arguments> - - <amOnPage url="{{AdminUrlRewriteProductPage.url}}" stepKey="openUrlRewriteProductPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteProductPageToLoad"/> - <click selector="{{AdminUrlRewriteProductSection.resetFilter}}" stepKey="clickOnResetFilter"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminUrlRewriteProductSection.skuFilter}}" userInput="{{productSku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminUrlRewriteProductSection.searchFilter}}" stepKey="clickOnSearchFilter"/> - <waitForPageLoad stepKey="waitForProductToLoad"/> - <click selector="{{AdminUrlRewriteProductSection.productRow}}" stepKey="clickOnFirstRow"/> - <waitForPageLoad stepKey="waitForProductCategoryPageToLoad"/> - </actionGroup> - - <actionGroup name="AdminSearchDeletedUrlRewrite"> - <annotations> - <description>Goes to the Admin URL Rewrite grid page. Searches the grid for the provided Request Path. Validates that it does NOT appear in the grid.</description> - </annotations> - <arguments> - <argument name="requestPath" type="string"/> - </arguments> - - <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> - <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> - <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> - <waitForPageLoad stepKey="waitForPageToLoad1"/> - <see selector="{{AdminUrlRewriteIndexSection.emptyRecords}}" userInput="We couldn't find any records." stepKey="seeEmptyRecordMessage"/> - </actionGroup> - - <actionGroup name="AdminDeleteUrlRewrite"> - <annotations> - <description>Goes to the Admin URL Rewrite grid page. Deletes the provided Request Path. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="requestPath" type="string"/> - </arguments> - - <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> - <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> - <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> - <waitForPageLoad stepKey="waitForPageToLoad1"/> - <click selector="{{AdminUrlRewriteIndexSection.editButton('1')}}" stepKey="clickOnEditButton"/> - <waitForPageLoad stepKey="waitForEditPageToLoad"/> - <click selector="{{AdminUrlRewriteEditSection.deleteButton}}" stepKey="clickOnDeleteButton"/> - <waitForPageLoad stepKey="waitForPageToLoad2"/> - <waitForElementVisible selector="{{AdminUrlRewriteEditSection.okButton}}" stepKey="waitForOkButtonToVisible"/> - <click selector="{{AdminUrlRewriteEditSection.okButton}}" stepKey="clickOnOkButton"/> - <waitForPageLoad stepKey="waitForPageToLoad3"/> - <see selector="{{AdminUrlRewriteIndexSection.successMessage}}" userInput="You deleted the URL rewrite." stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="AssertPageByUrlRewriteIsNotFound"> - <annotations> - <description>Validates that the provided Request Path does NOT exist on the Storefront. Validates that the 'Whoops' message is present and correct.</description> - </annotations> - <arguments> - <argument name="requestPath" type="string"/> - </arguments> - - <amOnPage url="{{requestPath}}" stepKey="amOnPage"/> - <waitForPageLoad stepKey="waitForStorefrontPageLoad"/> - <see userInput="Whoops, our bad..." stepKey="seeWhoops"/> - </actionGroup> - - <actionGroup name="AdminSearchAndSelectUrlRewriteInGrid"> - <annotations> - <description>Goes to the Admin URL Rewrite grid page. Searches the grid for the provided Request Path. Clicks on Edit.</description> - </annotations> - <arguments> - <argument name="requestPath" type="string"/> - </arguments> - - <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> - <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> - <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> - <waitForPageLoad stepKey="waitForPageToLoad1"/> - <click selector="{{AdminUrlRewriteIndexSection.editButton('1')}}" stepKey="clickOnEditButton"/> - <waitForPageLoad stepKey="waitForEditPageToLoad"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AssertPageByUrlRewriteIsNotFoundActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AssertPageByUrlRewriteIsNotFoundActionGroup.xml new file mode 100644 index 0000000000000..4188c86a58b81 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AssertPageByUrlRewriteIsNotFoundActionGroup.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="AssertPageByUrlRewriteIsNotFoundActionGroup"> + <annotations> + <description>Validates that the provided Request Path does NOT exist on the Storefront. Validates that the 'Whoops' message is present and correct.</description> + </annotations> + <arguments> + <argument name="requestPath" type="string"/> + </arguments> + + <amOnPage url="{{requestPath}}" stepKey="amOnPage"/> + <waitForPageLoad stepKey="waitForStorefrontPageLoad"/> + <see userInput="Whoops, our bad..." stepKey="seeWhoops"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/StorefrontUrlRewriteRedirectActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AssertStorefrontProductRedirectActionGroup.xml similarity index 52% rename from app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/StorefrontUrlRewriteRedirectActionGroup.xml rename to app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AssertStorefrontProductRedirectActionGroup.xml index 325045bccc869..8a41dc4e2a9b3 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/StorefrontUrlRewriteRedirectActionGroup.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AssertStorefrontProductRedirectActionGroup.xml @@ -7,23 +7,8 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AssertStorefrontUrlRewriteRedirect"> - <annotations> - <description>Goes to the provided New URL. Validates that the redirect works and the provided Category is present.</description> - </annotations> - <arguments> - <argument name="category" type="string"/> - <argument name="newRequestPath" type="string"/> - </arguments> - - <amOnPage url="{{newRequestPath}}" stepKey="openCategoryInStorefront"/> - <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> - <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(category)}}" stepKey="seeCategoryOnStoreNavigationBar"/> - <seeElement selector="{{StorefrontCategoryMainSection.CategoryTitle(category)}}" stepKey="seeCategoryInTitle"/> - </actionGroup> - - <actionGroup name="AssertStorefrontProductRedirect"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontProductRedirectActionGroup"> <annotations> <description>Goes to the provided New Product URL. Validates that the redirect works and the provided Product is present and correct.</description> </annotations> @@ -32,7 +17,7 @@ <argument name="productSku" type="string"/> <argument name="productRequestPath" type="string"/> </arguments> - + <amOnPage url="{{productRequestPath}}" stepKey="openCategoryInStorefront"/> <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{productName}}" stepKey="seeProductNameInStoreFrontPage"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AssertStorefrontUrlRewriteRedirectActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AssertStorefrontUrlRewriteRedirectActionGroup.xml new file mode 100644 index 0000000000000..4d95c1a43876b --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AssertStorefrontUrlRewriteRedirectActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AssertStorefrontUrlRewriteRedirectActionGroup"> + <annotations> + <description>Goes to the provided New URL. Validates that the redirect works and the provided Category is present.</description> + </annotations> + <arguments> + <argument name="category" type="string"/> + <argument name="newRequestPath" type="string"/> + </arguments> + + <amOnPage url="{{newRequestPath}}" stepKey="openCategoryInStorefront"/> + <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> + <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(category)}}" stepKey="seeCategoryOnStoreNavigationBar"/> + <seeElement selector="{{StorefrontCategoryMainSection.CategoryTitle(category)}}" stepKey="seeCategoryInTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml index 52d313b21f3e1..ef63478844b20 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml @@ -30,12 +30,12 @@ </after> <!--Filter and Select the created Product --> - <actionGroup ref="AdminSearchUrlRewriteProductBySku" stepKey="searchProduct"> + <actionGroup ref="AdminSearchUrlRewriteProductBySkuActionGroup" stepKey="searchProduct"> <argument name="productSku" value="$$createSimpleProduct.sku$$"/> </actionGroup> <!-- Update the Store, RequestPath, RedirectType and Description --> - <actionGroup ref="AdminAddUrlRewriteForProduct" stepKey="addUrlRewriteForProduct"> + <actionGroup ref="AdminAddUrlRewriteForProductActionGroup" stepKey="addUrlRewriteForProduct"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{_defaultProduct.urlKey}}.html"/> <argument name="redirectTypeValue" value="Temporary (302)"/> @@ -52,22 +52,22 @@ <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> <!-- Assert Redirect path, Target Path and Redirect type in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> <argument name="redirectPath" value="$$createSimpleProduct.name$$.html" /> <argument name="redirectType" value="No" /> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> <!-- Assert Redirect path, Target Path and Redirect type in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath1"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath1"> <argument name="redirectPath" value="{{_defaultProduct.urlKey}}.html" /> <argument name="redirectType" value="Temporary (302)"/> <argument name="targetPath" value="$$createSimpleProduct.name$$.html"/> </actionGroup> <!--Assert Category Url Redirect is not present --> - <actionGroup ref="AdminSearchDeletedUrlRewrite" stepKey="searchDeletedCategory"> + <actionGroup ref="AdminSearchDeletedUrlRewriteActionGroup" stepKey="searchDeletedCategory"> <argument name="requestPath" value="$$createCategory.name$$.html"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml index 85e9d7847d5ea..42dca0c22937f 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml @@ -27,7 +27,7 @@ </after> <!--Open Url Rewrite Index Page and update the Custom Url Rewrite, Store, Request Path, Redirect Type and Description --> - <actionGroup ref="AdminAddUrlRewrite" stepKey="addUrlRewrite"> + <actionGroup ref="AdminAddUrlRewriteActionGroup" stepKey="addUrlRewrite"> <argument name="category" value="$$category.name$$"/> <argument name="customUrlRewriteValue" value="For Category"/> <argument name="storeValue" value="Default Store View"/> @@ -43,7 +43,7 @@ <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> <!-- Assert Redirect path, Target Path and Redirect type in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> <argument name="redirectPath" value="newrequestpath.html" /> <argument name="redirectType" value="No" /> <argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddPermanentRedirectTest.xml index 477742e7e3618..867b3ee54161c 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddPermanentRedirectTest.xml @@ -27,7 +27,7 @@ </after> <!--Open Url Rewrite Index Page and update the Custom Url Rewrite, Store, Request Path, Redirect Type and Description --> - <actionGroup ref="AdminAddUrlRewrite" stepKey="addUrlRewrite"> + <actionGroup ref="AdminAddUrlRewriteActionGroup" stepKey="addUrlRewrite"> <argument name="category" value="$$category.name$$"/> <argument name="customUrlRewriteValue" value="For Category"/> <argument name="storeValue" value="Default Store View"/> @@ -37,14 +37,14 @@ </actionGroup> <!-- Assert Redirect path, Target Path and Redirect type in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> <argument name="redirectPath" value="newrequestpath.html" /> <argument name="redirectType" value="Permanent (301)" /> <argument name="targetPath" value="$$category.name_lwr$$.html"/> </actionGroup> <!--Assert Updated path directs to the category storefront --> - <actionGroup ref="AssertStorefrontUrlRewriteRedirect" stepKey="openStorefrontUrlRedirectPath"> + <actionGroup ref="AssertStorefrontUrlRewriteRedirectActionGroup" stepKey="openStorefrontUrlRedirectPath"> <argument name="category" value="$$category.name$$"/> <argument name="newRequestPath" value="newrequestpath.html"/> </actionGroup> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml index 2367c3d982d15..ab18add56aeb9 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml @@ -27,7 +27,7 @@ </after> <!--Open Url Rewrite Index Page and update the Custom Url Rewrite, Store, Request Path, Redirect Type and Description --> - <actionGroup ref="AdminAddUrlRewrite" stepKey="addUrlRewrite"> + <actionGroup ref="AdminAddUrlRewriteActionGroup" stepKey="addUrlRewrite"> <argument name="category" value="$$category.name$$"/> <argument name="customUrlRewriteValue" value="For Category"/> <argument name="storeValue" value="Default Store View"/> @@ -37,14 +37,14 @@ </actionGroup> <!-- Assert Redirect path, Target Path and Redirect type in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> <argument name="redirectPath" value="newrequestpath.html" /> <argument name="redirectType" value="Temporary (302)" /> <argument name="targetPath" value="$$category.name_lwr$$.html"/> </actionGroup> <!--Assert Updated path directs to the category storefront --> - <actionGroup ref="AssertStorefrontUrlRewriteRedirect" stepKey="openStorefrontUrlRedirectPath"> + <actionGroup ref="AssertStorefrontUrlRewriteRedirectActionGroup" stepKey="openStorefrontUrlRedirectPath"> <argument name="category" value="$$category.name$$"/> <argument name="newRequestPath" value="newrequestpath.html"/> </actionGroup> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml index 358aa58aba0f7..882992da6b508 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml @@ -23,7 +23,7 @@ </before> <after> <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="{{defaultCmsPage.title}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -36,7 +36,7 @@ <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> <!-- Open UrlRewrite Edit page and update the fields and fill the created CMS Page Target Path --> - <actionGroup ref="AdminAddCustomUrlRewrite" stepKey="addCustomUrlRewrite"> + <actionGroup ref="AdminAddCustomUrlRewriteActionGroup" stepKey="addCustomUrlRewrite"> <argument name="customUrlRewriteValue" value="Custom"/> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{defaultCmsPage.title}}"/> @@ -46,14 +46,14 @@ </actionGroup> <!-- Assert updated CMS page Url Rewrite in Grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> <argument name="redirectPath" value="{{defaultCmsPage.title}}" /> <argument name="redirectType" value="Permanent (301)" /> <argument name="targetPath" value="cms/page/view/page_id/{$cmsId}"/> </actionGroup> <!-- Assert initial CMS page Url Rewrite in Grid--> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath1"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath1"> <argument name="redirectPath" value="$$createCMSPage.identifier$$" /> <argument name="redirectType" value="No"/> <argument name="targetPath" value="cms/page/view/page_id/{$cmsId}"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml index e6ee9b484059d..4af547ad550d5 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml @@ -23,7 +23,7 @@ </before> <after> <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="{{defaultCmsPage.title}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -36,7 +36,7 @@ <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> <!-- Open UrlRewrite Edit page and update the fields and fill the created CMS Page Target Path --> - <actionGroup ref="AdminAddCustomUrlRewrite" stepKey="addCustomUrlRewrite"> + <actionGroup ref="AdminAddCustomUrlRewriteActionGroup" stepKey="addCustomUrlRewrite"> <argument name="customUrlRewriteValue" value="Custom"/> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{defaultCmsPage.title}}"/> @@ -46,14 +46,14 @@ </actionGroup> <!-- Assert updated CMS page Url Rewrite in Grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> <argument name="redirectPath" value="{{defaultCmsPage.title}}" /> <argument name="redirectType" value="Temporary (302)" /> <argument name="targetPath" value="cms/page/view/page_id/{$cmsId}"/> </actionGroup> <!-- Assert initial CMS page Url Rewrite in Grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath1"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath1"> <argument name="redirectPath" value="$$createCMSPage.identifier$$" /> <argument name="redirectType" value="No"/> <argument name="targetPath" value="cms/page/view/page_id/{$cmsId}"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml index b123bc14cb1ed..b8c981dd772cb 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml @@ -23,7 +23,7 @@ </before> <after> <deleteData createDataKey="category" stepKey="deleteCategory"/> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="{{FirstLevelSubCat.name}}.html"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -36,7 +36,7 @@ <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> <!-- Open UrlRewrite Edit page and update the fields and fill the created category Target Path --> - <actionGroup ref="AdminAddCustomUrlRewrite" stepKey="addCustomUrlRewrite"> + <actionGroup ref="AdminAddCustomUrlRewriteActionGroup" stepKey="addCustomUrlRewrite"> <argument name="customUrlRewriteValue" value="Custom"/> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{FirstLevelSubCat.name}}.html"/> @@ -46,27 +46,27 @@ </actionGroup> <!-- Assert updated category Url Rewrite in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByCategoryRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByCategoryRequestPath"> <argument name="redirectPath" value="$$category.name$$.html" /> <argument name="redirectType" value="No" /> <argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/> </actionGroup> <!--Assert initial category Url Rewrite in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByNewRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByNewRequestPath"> <argument name="redirectPath" value="{{FirstLevelSubCat.name}}.html" /> <argument name="redirectType" value="Permanent (301)" /> <argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/> </actionGroup> <!-- Assert updated Category redirect in Store Front --> - <actionGroup ref="AssertStorefrontUrlRewriteRedirect" stepKey="verifyCategoryInStoreFront"> + <actionGroup ref="AssertStorefrontUrlRewriteRedirectActionGroup" stepKey="verifyCategoryInStoreFront"> <argument name="category" value="$$category.name$$"/> <argument name="newRequestPath" value="{{FirstLevelSubCat.name}}.html"/> </actionGroup> <!-- Assert initial Category redirect in Store Front --> - <actionGroup ref="AssertStorefrontUrlRewriteRedirect" stepKey="verifyCategoryInStoreFront1"> + <actionGroup ref="AssertStorefrontUrlRewriteRedirectActionGroup" stepKey="verifyCategoryInStoreFront1"> <argument name="category" value="$$category.name$$"/> <argument name="newRequestPath" value="catalog/category/view/id/{$categoryId}"/> </actionGroup> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml index 711d5389b013b..b450c8d3c759d 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml @@ -23,7 +23,7 @@ </before> <after> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="{{_defaultProduct.name}}.html"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -36,7 +36,7 @@ <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> <!-- Open UrlRewrite Edit page and update the fields and fill the created product Target Path --> - <actionGroup ref="AdminAddCustomUrlRewrite" stepKey="addCustomUrlRewrite"> + <actionGroup ref="AdminAddCustomUrlRewriteActionGroup" stepKey="addCustomUrlRewrite"> <argument name="customUrlRewriteValue" value="Custom"/> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{_defaultProduct.name}}.html"/> @@ -46,28 +46,28 @@ </actionGroup> <!--Assert updated product Url Rewrite in Grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> <argument name="redirectPath" value="{{_defaultProduct.name}}.html" /> <argument name="redirectType" value="Temporary (302)" /> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> <!-- Assert initial product Url rewrite in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath1"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath1"> <argument name="redirectPath" value="$$createProduct.name$$.html" /> <argument name="redirectType" value="No"/> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> <!-- Assert updated product redirect in Store Front--> - <actionGroup ref="AssertStorefrontProductRedirect" stepKey="verifyProductInStoreFront"> + <actionGroup ref="AssertStorefrontProductRedirectActionGroup" stepKey="verifyProductInStoreFront"> <argument name="productName" value="$$createProduct.name$$"/> <argument name="productSku" value="$$createProduct.sku$$"/> <argument name="productRequestPath" value="{{_defaultProduct.name}}.html"/> </actionGroup> <!-- Assert initial product redirect in Store Front--> - <actionGroup ref="AssertStorefrontProductRedirect" stepKey="verifyProductInStoreFront1"> + <actionGroup ref="AssertStorefrontProductRedirectActionGroup" stepKey="verifyProductInStoreFront1"> <argument name="productName" value="$$createProduct.name$$"/> <argument name="productSku" value="$$createProduct.sku$$"/> <argument name="productRequestPath" value="$$createProduct.name$$.html"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteAndAddNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteAndAddNoRedirectTest.xml index f8d297c92a176..2cd10d3548cfb 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteAndAddNoRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteAndAddNoRedirectTest.xml @@ -27,12 +27,12 @@ </after> <!--Filter and Select the created Product --> - <actionGroup ref="AdminSearchUrlRewriteProductBySku" stepKey="searchProduct"> + <actionGroup ref="AdminSearchUrlRewriteProductBySkuActionGroup" stepKey="searchProduct"> <argument name="productSku" value="$$createSimpleProduct.sku$$"/> </actionGroup> <!-- Update the Store, RequestPath, RedirectType and Description --> - <actionGroup ref="AdminAddUrlRewriteForProduct" stepKey="addUrlRewrite"> + <actionGroup ref="AdminAddUrlRewriteForProductActionGroup" stepKey="addUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{_defaultProduct.urlKey}}.html"/> <argument name="redirectTypeValue" value="No"/> @@ -46,17 +46,17 @@ <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> <!--Assert Product Redirect --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> <argument name="redirectPath" value="{{_defaultProduct.urlKey}}.html" /> <argument name="redirectType" value="No" /> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> <!-- Assert Redirect path, Target Path and Redirect type in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath1"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath1"> <argument name="redirectPath" value="$$createSimpleProduct.name$$.html" /> <argument name="redirectType" value="No" /> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml index ae18ab33ba6ce..82473fb13a33b 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml @@ -31,12 +31,12 @@ </after> <!--Filter and Select the created Product --> - <actionGroup ref="AdminSearchUrlRewriteProductBySku" stepKey="searchProduct"> + <actionGroup ref="AdminSearchUrlRewriteProductBySkuActionGroup" stepKey="searchProduct"> <argument name="productSku" value="$$createSimpleProduct.sku$$"/> </actionGroup> <!-- Update the Store, RequestPath, RedirectType and Description --> - <actionGroup ref="AdminAddUrlRewriteForProduct" stepKey="addUrlRewrite"> + <actionGroup ref="AdminAddUrlRewriteForProductActionGroup" stepKey="addUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{FirstLevelSubCat.name_lwr}}/{{_defaultProduct.urlKey}}.html"/> <argument name="redirectTypeValue" value="Temporary (302)"/> @@ -44,7 +44,7 @@ </actionGroup> <!--Assert Product Redirect --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> <argument name="redirectPath" value="{{FirstLevelSubCat.name_lwr}}/{{_defaultProduct.urlKey}}.html" /> <argument name="redirectType" value="Temporary (302)" /> <argument name="targetPath" value="$$createSimpleProduct.name$$.html"/> @@ -57,7 +57,7 @@ <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> <!-- Assert Redirect path, Target Path and Redirect type in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath1"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath1"> <argument name="redirectPath" value="$$createSimpleProduct.name$$.html" /> <argument name="redirectType" value="No" /> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> @@ -70,10 +70,10 @@ <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> <!-- Assert Redirect path, Target Path and Redirect type in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath2"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath2"> <argument name="redirectPath" value="$$createCategory.name$$.html" /> <argument name="redirectType" value="No" /> <argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddPermanentRedirectTest.xml index 66c586d4fe891..bfecd98eaa6be 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddPermanentRedirectTest.xml @@ -26,12 +26,12 @@ </after> <!--Filter and Select the created Product --> - <actionGroup ref="AdminSearchUrlRewriteProductBySku" stepKey="searchProduct"> + <actionGroup ref="AdminSearchUrlRewriteProductBySkuActionGroup" stepKey="searchProduct"> <argument name="productSku" value="$$createSimpleProduct.sku$$"/> </actionGroup> <!-- Update the Store, RequestPath, RedirectType and Description --> - <actionGroup ref="AdminAddUrlRewriteForProduct" stepKey="addUrlRewrite"> + <actionGroup ref="AdminAddUrlRewriteForProductActionGroup" stepKey="addUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{_defaultProduct.urlKey}}.html"/> <argument name="redirectTypeValue" value="Permanent (301)"/> @@ -46,17 +46,17 @@ <!--Assert Product Redirect --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> <argument name="redirectPath" value="{{_defaultProduct.urlKey}}.html" /> <argument name="redirectType" value="Permanent (301)" /> <argument name="targetPath" value="$$createSimpleProduct.name$$.html"/> </actionGroup> <!-- Assert Redirect Path, Target Path and Redirect type in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath1"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath1"> <argument name="redirectPath" value="$$createSimpleProduct.name$$.html" /> <argument name="redirectType" value="No" /> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddTemporaryRedirectTest.xml index 2d797a12bedf5..899564287757b 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddTemporaryRedirectTest.xml @@ -27,12 +27,12 @@ </after> <!--Filter and Select the created Product --> - <actionGroup ref="AdminSearchUrlRewriteProductBySku" stepKey="searchProduct"> + <actionGroup ref="AdminSearchUrlRewriteProductBySkuActionGroup" stepKey="searchProduct"> <argument name="productSku" value="$$createSimpleProduct.sku$$"/> </actionGroup> <!-- Update the Store, RequestPath, RedirectType and Description --> - <actionGroup ref="AdminAddUrlRewriteForProduct" stepKey="addUrlRewrite"> + <actionGroup ref="AdminAddUrlRewriteForProductActionGroup" stepKey="addUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{_defaultProduct.urlKey}}.html"/> <argument name="redirectTypeValue" value="Temporary (302)"/> @@ -46,17 +46,17 @@ <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> <!--Assert Product Redirect --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> <argument name="redirectPath" value="{{_defaultProduct.urlKey}}.html" /> <argument name="redirectType" value="Temporary (302)" /> <argument name="targetPath" value="$$createSimpleProduct.name$$.html"/> </actionGroup> <!-- Assert Redirect Path, Target Path and Redirect type in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByRequestPath1"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath1"> <argument name="redirectPath" value="$$createSimpleProduct.name$$.html" /> <argument name="redirectType" value="No" /> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml index 4dc5c85830076..96569378404e2 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml @@ -90,7 +90,7 @@ </actionGroup> <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> <!-- Open Url Rewrite page and verify new Redirect Path, RedirectType and Target Path for the grabbed category Id --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchPath"> <argument name="redirectPath" value="$$category.name$$.html"/> <argument name="redirectType" value="No"/> <argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/> @@ -104,7 +104,7 @@ </actionGroup> <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> <!-- Open Url Rewrite page and verify new Redirect Path, RedirectType and Target Path for the grabbed product Id --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchPath1"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchPath1"> <argument name="redirectPath" value="$$createProduct.name$$.html"/> <argument name="redirectType" value="No"/> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> @@ -112,4 +112,4 @@ <see selector="{{AdminUrlRewriteIndexSection.storeView('1')}}" userInput="{{customStore.name}}" stepKey="seeStoreValueForProductId"/> <see selector="{{AdminUrlRewriteIndexSection.storeView('1')}}" userInput="{{storeViewData.name}}" stepKey="seeStoreViewValueForProductId"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCustomUrlRewriteTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCustomUrlRewriteTest.xml index cf45931029778..288c32102c606 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCustomUrlRewriteTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCustomUrlRewriteTest.xml @@ -27,18 +27,18 @@ </after> <!--Delete created custom url rewrite and verify AssertUrlRewriteDeletedMessage--> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteUrlRewrite"> <argument name="requestPath" value="$$urlRewrite.request_path$$"/> </actionGroup> <!--Search and verify AssertUrlRewriteNotInGrid--> - <actionGroup ref="AdminSearchDeletedUrlRewrite" stepKey="searchDeletedUrlRewriteInGrid"> + <actionGroup ref="AdminSearchDeletedUrlRewriteActionGroup" stepKey="searchDeletedUrlRewriteInGrid"> <argument name="requestPath" value="$$urlRewrite.request_path$$"/> </actionGroup> <!--Verify AssertPageByUrlRewriteIsNotFound--> - <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="amOnPage"> + <actionGroup ref="AssertPageByUrlRewriteIsNotFoundActionGroup" stepKey="amOnPage"> <argument name="requestPath" value="$$urlRewrite.request_path$$"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml index c6ee1a7da9602..26fdd28d004f3 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml @@ -67,7 +67,7 @@ <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="onCategoryPage"> <argument name="category" value="$$createCategory$$"/> </actionGroup> - <actionGroup ref="AssertStorefrontUrlRewriteRedirect" stepKey="assertUrlCategoryOnDefaultStore"> + <actionGroup ref="AssertStorefrontUrlRewriteRedirectActionGroup" stepKey="assertUrlCategoryOnDefaultStore"> <argument name="category" value="$$createCategory.name$$"/> <argument name="newRequestPath" value="u1.html"/> </actionGroup> @@ -92,7 +92,7 @@ <argument name="storeView" value="customStore"/> </actionGroup> <!--Step 9. On Storefront Assert what URL Key for Category is changed and is correct for Custom Store View --> - <actionGroup ref="AssertStorefrontUrlRewriteRedirect" stepKey="assertUrlCategoryOnCustomStore"> + <actionGroup ref="AssertStorefrontUrlRewriteRedirectActionGroup" stepKey="assertUrlCategoryOnCustomStore"> <argument name="category" value="$$createCategory.name$$"/> <argument name="newRequestPath" value="u1.html"/> </actionGroup> @@ -105,7 +105,7 @@ <argument name="productUrl" value="$$createProduct.custom_attributes[url_key]$$"/> </actionGroup> <!--Step 11. On Storefront Assert what URL Key for product is changed and is correct for Custom Store View --> - <actionGroup ref="AssertStorefrontProductRedirect" stepKey="assertProductUrlRewriteInStoreFront"> + <actionGroup ref="AssertStorefrontProductRedirectActionGroup" stepKey="assertProductUrlRewriteInStoreFront"> <argument name="productName" value="$$createProductForUrlRewrite.name$$"/> <argument name="productSku" value="$$createProductForUrlRewrite.sku$$"/> <argument name="productRequestPath" value="u2.html"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddAspxRequestPathTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddAspxRequestPathTest.xml index 072753505223d..f03fa5b647df6 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddAspxRequestPathTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddAspxRequestPathTest.xml @@ -27,12 +27,12 @@ </after> <!-- Search and Select Edit option for created category in grid --> - <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="editUrlRewrite"> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGridActionGroup" stepKey="editUrlRewrite"> <argument name="requestPath" value="$$category.custom_attributes[url_key]$$.html"/> </actionGroup> <!-- Open UrlRewrite Edit page and update the fields --> - <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateCategoryUrlRewrite"> + <actionGroup ref="AdminUpdateUrlRewriteActionGroup" stepKey="updateCategoryUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{defaultUrlRewrite.request_path}}"/> <argument name="redirectTypeValue" value="Temporary (302)"/> @@ -46,14 +46,14 @@ <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> <!--Assert category Url Rewrite in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByNewRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByNewRequestPath"> <argument name="redirectPath" value="{{defaultUrlRewrite.request_path}}" /> <argument name="redirectType" value="Temporary (302)" /> <argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/> </actionGroup> <!-- Assert category redirect in Store Front --> - <actionGroup ref="AssertStorefrontUrlRewriteRedirect" stepKey="verifyCategoryInStoreFront"> + <actionGroup ref="AssertStorefrontUrlRewriteRedirectActionGroup" stepKey="verifyCategoryInStoreFront"> <argument name="category" value="$$category.name$$"/> <argument name="newRequestPath" value="{{defaultUrlRewrite.request_path}}"/> </actionGroup> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddNoRedirectTest.xml index 80b9dbe41bf59..30a61b49c204d 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddNoRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddNoRedirectTest.xml @@ -27,12 +27,12 @@ </after> <!-- Search and Select Edit option for created category in grid --> - <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="editUrlRewrite"> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGridActionGroup" stepKey="editUrlRewrite"> <argument name="requestPath" value="$$category.custom_attributes[url_key]$$.html"/> </actionGroup> <!-- Open UrlRewrite Edit page and update the fields --> - <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateCategoryUrlRewrite"> + <actionGroup ref="AdminUpdateUrlRewriteActionGroup" stepKey="updateCategoryUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{defaultUrlRewrite.request_path}}"/> <argument name="redirectTypeValue" value="No"/> @@ -46,14 +46,14 @@ <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> <!-- Assert category Url Rewrite in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByNewRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByNewRequestPath"> <argument name="redirectPath" value="{{defaultUrlRewrite.request_path}}" /> <argument name="redirectType" value="No" /> <argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/> </actionGroup> <!-- Assert Category redirect in Store Front --> - <actionGroup ref="AssertStorefrontUrlRewriteRedirect" stepKey="verifyCategoryInStoreFront"> + <actionGroup ref="AssertStorefrontUrlRewriteRedirectActionGroup" stepKey="verifyCategoryInStoreFront"> <argument name="category" value="$$category.name$$"/> <argument name="newRequestPath" value="{{defaultUrlRewrite.request_path}}"/> </actionGroup> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddPermanentRedirectTest.xml index be9fd1d83c8f1..430964d1f0a17 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddPermanentRedirectTest.xml @@ -27,12 +27,12 @@ </after> <!-- Search and Select Edit option for created category in grid --> - <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="editUrlRewrite"> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGridActionGroup" stepKey="editUrlRewrite"> <argument name="requestPath" value="$$category.custom_attributes[url_key]$$.html"/> </actionGroup> <!-- Open UrlRewrite Edit page and update the fields --> - <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateCategoryUrlRewrite"> + <actionGroup ref="AdminUpdateUrlRewriteActionGroup" stepKey="updateCategoryUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{defaultUrlRewrite.request_path}}"/> <argument name="redirectTypeValue" value="Permanent (301)"/> @@ -46,14 +46,14 @@ <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> <!--Assert category Url Rewrite in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByNewRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByNewRequestPath"> <argument name="redirectPath" value="{{defaultUrlRewrite.request_path}}" /> <argument name="redirectType" value="Permanent (301)" /> <argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/> </actionGroup> <!-- Assert category redirect in Store Front --> - <actionGroup ref="AssertStorefrontUrlRewriteRedirect" stepKey="verifyCategoryInStoreFront"> + <actionGroup ref="AssertStorefrontUrlRewriteRedirectActionGroup" stepKey="verifyCategoryInStoreFront"> <argument name="category" value="$$category.name$$"/> <argument name="newRequestPath" value="{{defaultUrlRewrite.request_path}}"/> </actionGroup> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml index 7e1b9acbc47ab..c37bfa15df92c 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml @@ -27,12 +27,12 @@ </after> <!-- Search and Select Edit option for created category in grid --> - <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="editUrlRewrite"> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGridActionGroup" stepKey="editUrlRewrite"> <argument name="requestPath" value="$$category.custom_attributes[url_key]$$.html"/> </actionGroup> <!-- Open UrlRewrite Edit page and update the fields --> - <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateCategoryUrlRewrite"> + <actionGroup ref="AdminUpdateUrlRewriteActionGroup" stepKey="updateCategoryUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{updateUrlRewrite.request_path}}"/> <argument name="redirectTypeValue" value="Temporary (302)"/> @@ -46,14 +46,14 @@ <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> <!--Assert category Url Rewrite in grid --> - <actionGroup ref="AdminSearchByRequestPath" stepKey="searchByNewRequestPath"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByNewRequestPath"> <argument name="redirectPath" value="{{updateUrlRewrite.request_path}}" /> <argument name="redirectType" value="Temporary (302)" /> <argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/> </actionGroup> <!-- Assert category redirect in Store Front --> - <actionGroup ref="AssertStorefrontUrlRewriteRedirect" stepKey="verifyCategoryInStoreFront"> + <actionGroup ref="AssertStorefrontUrlRewriteRedirectActionGroup" stepKey="verifyCategoryInStoreFront"> <argument name="category" value="$$category.name$$"/> <argument name="newRequestPath" value="{{updateUrlRewrite.request_path}}"/> </actionGroup> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesPermanentTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesPermanentTest.xml index 8339eb63abef1..a07f7b8c0fe60 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesPermanentTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesPermanentTest.xml @@ -23,19 +23,19 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> </before> <after> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="{{customPermanentUrlRewrite.request_path}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> </after> <!--Search default custom url rewrite in grid--> - <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="searchUrlRewrite"> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGridActionGroup" stepKey="searchUrlRewrite"> <argument name="requestPath" value="$$urlRewrite.request_path$$"/> </actionGroup> <!--Update default custom url rewrite as per requirement and verify AssertUrlRewriteSaveMessage--> - <actionGroup ref="AdminUpdateCustomUrlRewrite" stepKey="updateUrlRewrite"> + <actionGroup ref="AdminUpdateCustomUrlRewriteActionGroup" stepKey="updateUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{customPermanentUrlRewrite.request_path}}"/> <argument name="targetPath" value="{{customPermanentUrlRewrite.target_path}}"/> @@ -44,7 +44,7 @@ </actionGroup> <!--Search and verify updated AssertUrlRewriteInGrid--> - <actionGroup ref="AdminSearchByRequestPath" stepKey="verifyUpdatedUrlRewriteInGrid"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="verifyUpdatedUrlRewriteInGrid"> <argument name="redirectPath" value="{{customPermanentUrlRewrite.request_path}}"/> <argument name="redirectType" value="{{customPermanentUrlRewrite.redirect_type_label}}"/> <argument name="targetPath" value="{{customPermanentUrlRewrite.target_path}}"/> @@ -55,4 +55,4 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <seeInCurrentUrl url="{{customPermanentUrlRewrite.target_path}}" stepKey="seeAssertUrlRewrite"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesTemporaryTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesTemporaryTest.xml index 07d578cbbeca4..73720c3fb5459 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesTemporaryTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesTemporaryTest.xml @@ -25,7 +25,7 @@ </before> <after> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="{{customTemporaryUrlRewrite.request_path}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -38,12 +38,12 @@ <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> <!--Search default custom url rewrite in grid--> - <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="searchUrlRewrite"> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGridActionGroup" stepKey="searchUrlRewrite"> <argument name="requestPath" value="$$urlRewrite.request_path$$"/> </actionGroup> <!--Update default custom url rewrite as per requirement and verify AssertUrlRewriteSaveMessage--> - <actionGroup ref="AdminUpdateCustomUrlRewrite" stepKey="updateUrlRewrite"> + <actionGroup ref="AdminUpdateCustomUrlRewriteActionGroup" stepKey="updateUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="{{customTemporaryUrlRewrite.request_path}}"/> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> @@ -52,17 +52,17 @@ </actionGroup> <!--Search and verify AssertUrlRewriteInGrid--> - <actionGroup ref="AdminSearchByRequestPath" stepKey="verifyUpdatedUrlRewriteInGrid"> + <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="verifyUpdatedUrlRewriteInGrid"> <argument name="redirectPath" value="{{customTemporaryUrlRewrite.request_path}}"/> <argument name="redirectType" value="{{customTemporaryUrlRewrite.redirect_type_label}}"/> <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> <!-- AssertUrlRewriteCustomSearchRedirect--> - <actionGroup ref="AssertStorefrontProductRedirect" stepKey="verifyProductInStoreFrontPage"> + <actionGroup ref="AssertStorefrontProductRedirectActionGroup" stepKey="verifyProductInStoreFrontPage"> <argument name="productName" value="$$createProduct.name$$"/> <argument name="productSku" value="$$createProduct.sku$$"/> <argument name="productRequestPath" value="$$createProduct.name$$.html"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateProductUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateProductUrlRewriteAndAddTemporaryRedirectTest.xml index ea370d8419583..74f3a60f35cea 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateProductUrlRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateProductUrlRewriteAndAddTemporaryRedirectTest.xml @@ -27,12 +27,12 @@ </after> <!-- Search and Select Edit option for created product in grid --> - <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="editUrlRewrite"> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGridActionGroup" stepKey="editUrlRewrite"> <argument name="requestPath" value="$$createProduct.name$$"/> </actionGroup> <!-- Open UrlRewrite Edit page and update the fields --> - <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateCategoryUrlRewrite"> + <actionGroup ref="AdminUpdateUrlRewriteActionGroup" stepKey="updateCategoryUrlRewrite"> <argument name="storeValue" value="{{updateUrlRewrite.store}}"/> <argument name="requestPath" value="{{updateUrlRewrite.request_path}}"/> <argument name="redirectTypeValue" value="{{updateUrlRewrite.redirect_type_label}}"/> @@ -40,7 +40,7 @@ </actionGroup> <!-- Assert product Url Rewrite in StoreFront --> - <actionGroup ref="AssertStorefrontProductRedirect" stepKey="assertProductUrlRewriteInStoreFront"> + <actionGroup ref="AssertStorefrontProductRedirectActionGroup" stepKey="assertProductUrlRewriteInStoreFront"> <argument name="productName" value="$$createProduct.name$$"/> <argument name="productSku" value="$$createProduct.sku$$"/> <argument name="productRequestPath" value="{{updateUrlRewrite.request_path}}"/> From c6e7d1dd94d8ebba5e6a4110427a6e738ce41dec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 14:29:16 +0100 Subject: [PATCH 307/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...tualProductOutOfStockWithTierPriceTest.xml | 2 +- ...CustomOptionsSuiteAndImportOptionsTest.xml | 2 +- ...dPageNumberAfterSaveAndCloseActionTest.xml | 4 +- ...CustomizableOptionToProductWithSKUTest.xml | 2 +- ...ductGridFilteringByCustomAttributeTest.xml | 2 +- ...ctImageAssignmentForMultipleStoresTest.xml | 2 +- ...dminRemoveCustomOptionsFromProductTest.xml | 2 +- ...ToAssociateSimpleProductToWebsitesTest.xml | 2 +- ...chorIsVisibleOnViewportOnceClickedTest.xml | 4 +- ...ctCustomOptionsDifferentStoreViewsTest.xml | 4 +- ...ctWithCustomOptionsWithLongValuesTitle.xml | 2 +- .../Test/AdminDeleteCatalogPriceRuleTest.xml | 4 +- .../Mftf/Test/SearchEntityResultsTest.xml | 2 +- .../Mftf/Test/StorefrontGuestCheckoutTest.xml | 2 +- ...CheckResultsOfColorAndOtherFiltersTest.xml | 4 +- .../AdminConfigurableProductUpdateTest.xml | 2 +- ...reateConfigurableProductWithImagesTest.xml | 2 +- ...orefrontConfigurableProductDetailsTest.xml | 10 ++-- .../AdminCreateRetailCustomerGroupTest.xml | 2 +- .../AdminCreateTaxClassCustomerGroupTest.xml | 2 +- ...dminExactMatchSearchInCustomerGridTest.xml | 2 +- .../Mftf/Test/ChangeCustomerGroupTest.xml | 2 +- .../Test/SearchByEmailInCustomerGridTest.xml | 2 +- .../Test/AdminCreatingShippingLabelTest.xml | 2 +- .../AdminCheckDoubleImportOfProductsTest.xml | 4 +- ...lityDifferentStoreViewsAfterImportTest.xml | 4 +- ...utWhenCartPageIsOpenedInAnotherTabTest.xml | 4 +- .../Test/Mftf/Test/AdminCreateInvoiceTest.xml | 2 +- .../Test/AdminReorderWithCatalogPriceTest.xml | 4 +- .../CreateOrderFromEditCustomerPageTest.xml | 2 +- .../Test/Mftf/Test/EndToEndB2CAdminTest.xml | 20 +++---- ...inCartRulesAppliedForProductInCartTest.xml | 4 +- ...ductWithInvisibleIndividualProductTest.xml | 2 +- ...tImageColorWhenFilterByColorFilterTest.xml | 4 +- ...oductImagesMatchingProductSwatchesTest.xml | 4 +- ...DataGridDeleteCustomPerPageActionGroup.xml | 27 +++++++++ .../AdminDataGridFilterActionGroup.xml | 44 -------------- .../AdminDataGridPaginationActionGroup.xml | 57 ------------------- ...DataGridSelectCustomPerPageActionGroup.xml | 27 +++++++++ .../AdminDataGridSelectPerPageActionGroup.xml | 23 ++++++++ .../ClearFiltersAdminDataGridActionGroup.xml | 18 ++++++ ...tAdminDataGridToDefaultViewActionGroup.xml | 20 +++++++ ...earchAdminDataGridByKeywordActionGroup.xml | 23 ++++++++ ...tipleStoreviewsDuringProductImportTest.xml | 8 +-- ...AddMultipleStoreProductsToWishlistTest.xml | 4 +- 45 files changed, 204 insertions(+), 167 deletions(-) create mode 100644 app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridDeleteCustomPerPageActionGroup.xml delete mode 100644 app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridFilterActionGroup.xml delete mode 100644 app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridPaginationActionGroup.xml create mode 100644 app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridSelectCustomPerPageActionGroup.xml create mode 100644 app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridSelectPerPageActionGroup.xml create mode 100644 app/code/Magento/Ui/Test/Mftf/ActionGroup/ClearFiltersAdminDataGridActionGroup.xml create mode 100644 app/code/Magento/Ui/Test/Mftf/ActionGroup/ResetAdminDataGridToDefaultViewActionGroup.xml create mode 100644 app/code/Magento/Ui/Test/Mftf/ActionGroup/SearchAdminDataGridByKeywordActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml index 0b929eaddc96e..42cd489e3dcff 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml @@ -27,7 +27,7 @@ <actionGroup ref="deleteProductBySku" stepKey="deleteVirtualProduct"> <argument name="sku" value="{{virtualProductOutOfStock.sku}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml index 23f772a395a7d..9aa7f451e9091 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml @@ -27,7 +27,7 @@ <actionGroup ref="deleteProductBySku" stepKey="deleteVirtualProduct"> <argument name="sku" value="{{virtualProductCustomImportOptions.sku}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="resetOrderFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="resetOrderFilter"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberAfterSaveAndCloseActionTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberAfterSaveAndCloseActionTest.xml index eb4a561760070..991c70bb292a4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberAfterSaveAndCloseActionTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberAfterSaveAndCloseActionTest.xml @@ -40,7 +40,7 @@ <amOnPage url="{{ProductCatalogPage.url}}" stepKey="goToProductCatalog"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> <click selector="{{AdminDataGridPaginationSection.previousPage}}" stepKey="clickPrevPageOrderGrid"/> - <actionGroup ref="adminDataGridDeleteCustomPerPage" stepKey="deleteCustomAddedPerPage"> + <actionGroup ref="AdminDataGridDeleteCustomPerPageActionGroup" stepKey="deleteCustomAddedPerPage"> <argument name="perPage" value="ProductPerPage.productCount"/> </actionGroup> <deleteData stepKey="deleteCategory1" createDataKey="category1"/> @@ -51,7 +51,7 @@ </after> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="goToProductCatalog"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="adminDataGridSelectCustomPerPage" stepKey="select1OrderPerPage"> + <actionGroup ref="AdminDataGridSelectCustomPerPageActionGroup" stepKey="select1OrderPerPage"> <argument name="perPage" value="ProductPerPage.productCount"/> </actionGroup> <!--Go to the next page and edit the product--> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml index dfadfdf00481b..a941654db20a8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml @@ -45,7 +45,7 @@ <actionGroup ref="deleteProductBySku" stepKey="deleteSecondProduct"> <argument name="sku" value="$$createFirstProduct.sku$$-1"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductGridFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductGridFilter"/> <actionGroup ref="logout" stepKey="logoutOfAdmin"/> </after> <!--Change second product sku to first product sku--> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByCustomAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByCustomAttributeTest.xml index 72c270aad585c..a1548d870309e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByCustomAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByCustomAttributeTest.xml @@ -93,7 +93,7 @@ </after> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductGridFilters"/> <!--Sort by custom attribute DESC using grabbed value--> <conditionalClick selector="{{AdminProductGridSection.columnHeader($$createDropdownAttribute.attribute[frontend_labels][0][label]$$)}}" dependentSelector="{{AdminProductGridSection.columnHeader($$createDropdownAttribute.attribute[frontend_labels][0][label]$$)}}" visible="true" stepKey="ascendSortByCustomAttribute"/> <waitForPageLoad stepKey="waitForProductGridLoad"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml index 8149bc34087fb..37bc5d5f222ae 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml @@ -50,7 +50,7 @@ <argument name="customStore" value="customStoreFR"/> </actionGroup> <!-- Clear Filter Store --> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="resetFiltersOnStorePage"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="resetFiltersOnStorePage"/> <!-- Delete Category and Simple Product --> <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveCustomOptionsFromProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveCustomOptionsFromProductTest.xml index b5f212d1144be..e8eb5915572a0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveCustomOptionsFromProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveCustomOptionsFromProductTest.xml @@ -27,7 +27,7 @@ <after> <deleteData createDataKey="createProduct" stepKey="deleteProductWithOptions"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductFilter"/> <actionGroup ref="logout" stepKey="logout"/> </after> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml index 061c30b224828..b0b94461e6405 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml @@ -43,7 +43,7 @@ </actionGroup> <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="resetFiltersOnStoresIndexPage"/> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPageToResetFilters"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFiltersOnProductIndexPage"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFiltersOnProductIndexPage"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontEnsureThatAccordionAnchorIsVisibleOnViewportOnceClickedTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontEnsureThatAccordionAnchorIsVisibleOnViewportOnceClickedTest.xml index 0f9f542a97d02..6ee5adb58a18d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontEnsureThatAccordionAnchorIsVisibleOnViewportOnceClickedTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontEnsureThatAccordionAnchorIsVisibleOnViewportOnceClickedTest.xml @@ -102,7 +102,7 @@ <!-- Go to Pending reviews page and clear filters --> <actionGroup ref="AdminOpenPendingReviewsPageActionGroup" stepKey="openReviewsPage"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilters"/> <!-- Moderate first product reviews: change review status from pending to approved, save --> <actionGroup ref="AdminOpenReviewByUserNicknameActionGroup" stepKey="openFirstCustomerReviews"/> @@ -110,7 +110,7 @@ <actionGroup ref="AdminSaveReviewActionGroup" stepKey="saveModeratedFirstReview"/> <!-- Moderate second product reviews: change review status from pending to approved, save --> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/> <actionGroup ref="AdminOpenReviewByUserNicknameActionGroup" stepKey="openSecondCustomerReviews"/> <actionGroup ref="AdminChangeReviewStatusActionGroup" stepKey="changeSecondReviewStatus"/> <actionGroup ref="AdminSaveReviewActionGroup" stepKey="saveModeratedSecondReview"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml index a0670bdee54c7..e3dfd5a14bc55 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml @@ -63,12 +63,12 @@ <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView2"> <argument name="customStore" value="customStoreFR"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearWebsitesGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearWebsitesGridFilters"/> <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrdersGridFilter"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="logout" stepKey="logout"/> <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogoutStorefront"/> </after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitle.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitle.xml index e9e23cf157a26..7a667ce9667d4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitle.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsWithLongValuesTitle.xml @@ -100,7 +100,7 @@ <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearOnOrdersPage"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/> <fillField selector="{{AdminOrdersGridSection.search}}" userInput="{$grabOrderNumber}" stepKey="fillOrderNum"/> <click selector="{{AdminOrdersGridSection.submitSearch}}" stepKey="submitSearchOrderNum"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearOnSearch"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml index 16fbca2697702..ccc3296b7bcc3 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml @@ -39,10 +39,10 @@ <actionGroup ref="deleteProductBySku" stepKey="deleteConfigurableProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <amOnPage url="{{AdminCatalogPriceRuleGridPage.url}}" stepKey="goToCatalogRuleGridPage"/> <waitForPageLoad stepKey="waitForCatalogRuleGridPageLoaded"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearCatalogRuleGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearCatalogRuleGridFilters"/> <actionGroup ref="logout" stepKey="amOnLogoutPage"/> </after> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml index 3b60e4b09de28..9426e746ca0fa 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml @@ -380,7 +380,7 @@ <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="logout" stepKey="logoutFromAdmin"/> </after> <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToFrontPage"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest.xml index a0914cfc27138..a2007da317c00 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutTest.xml @@ -61,7 +61,7 @@ <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearOnOrdersPage"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/> <fillField selector="{{AdminOrdersGridSection.search}}" userInput="{$grabOrderNumber}" stepKey="fillOrderNum"/> <click selector="{{AdminOrdersGridSection.submitSearch}}" stepKey="submitSearchOrderNum"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappearOnSearch"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml index de0cca11235ea..1c5fcc5130611 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml @@ -89,7 +89,7 @@ <actionGroup ref="deleteAttributeSetByLabel" stepKey="deleteAttributeSet"> <argument name="label" value="mySet"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearAttributeSetsFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearAttributeSetsFilter"/> <!-- Delete First attribute --> <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="openProductAttributeFromSearchResultInGrid"> <argument name="productAttributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> @@ -105,7 +105,7 @@ <argument name="productAttributeCode" value="$$createConfigProductAttribute2.attribute_code$$"/> </actionGroup> <!-- Clear filters --> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductAttributesFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductAttributesFilter"/> <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductsGridFilter"/> <!-- Log out --> <actionGroup ref="logout" stepKey="logout"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml index 7c6cd57097591..bad1f0dd32391 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml @@ -40,7 +40,7 @@ <deleteData createDataKey="createProduct3" stepKey="deleteThirdProduct"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> <waitForPageLoad stepKey="waitForPageLoad"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml index 9796c14f5519a..9133b61a777b0 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml @@ -84,7 +84,7 @@ <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" time="30" stepKey="waitForConfigurationModalOpen" after="clickCreateConfigurations"/> <!-- Show 100 attributes per page --> - <actionGroup ref="adminDataGridSelectPerPage" stepKey="selectNumberOfAttributesPerPage"> + <actionGroup ref="AdminDataGridSelectPerPageActionGroup" stepKey="selectNumberOfAttributesPerPage"> <argument name="perPage" value="100"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml index 2f5ee036b1420..4ec46d4803793 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml @@ -34,7 +34,7 @@ <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="logout" stepKey="adminLogout"/> </after> @@ -79,7 +79,7 @@ <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="logout" stepKey="adminLogout"/> </after> @@ -124,7 +124,7 @@ <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="logout" stepKey="adminLogout"/> </after> @@ -166,7 +166,7 @@ <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="logout" stepKey="adminLogout"/> </after> @@ -218,7 +218,7 @@ </actionGroup> <deleteData createDataKey="createFirstAttribute" stepKey="deleteFirstAttribute"/> <deleteData createDataKey="createSecondAttribute" stepKey="deleteSecondAttribute"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/> <actionGroup ref="logout" stepKey="adminLogout"/> </after> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateRetailCustomerGroupTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateRetailCustomerGroupTest.xml index 4f1d88ffe99f5..6e08d98a53c56 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateRetailCustomerGroupTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateRetailCustomerGroupTest.xml @@ -26,7 +26,7 @@ <actionGroup ref="AdminDeleteCustomerGroupActionGroup" stepKey="deleteCustomerGroup"> <argument name="customerGroupName" value="{{CustomCustomerGroup.code}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilters"/> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Steps: 1. Log in to backend as admin user. diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateTaxClassCustomerGroupTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateTaxClassCustomerGroupTest.xml index 7d54ede7c1612..4b539ec350435 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateTaxClassCustomerGroupTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateTaxClassCustomerGroupTest.xml @@ -31,7 +31,7 @@ <actionGroup ref="AdminDeleteCustomerGroupActionGroup" stepKey="deleteCustomerGroup"> <argument name="customerGroupName" value="{{CustomCustomerGroup.code}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilters"/> <deleteData createDataKey="createCustomerTaxClass" stepKey="deleteCustomerTaxClass"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminExactMatchSearchInCustomerGridTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminExactMatchSearchInCustomerGridTest.xml index 6a7aeab78bcde..d278b6c52d330 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminExactMatchSearchInCustomerGridTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminExactMatchSearchInCustomerGridTest.xml @@ -35,7 +35,7 @@ <!--Step 1: Go to Customers > All Customers--> <amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomersGridPage"/> <!--Step 2: On Customers grid page search customer by keyword with quotes--> - <actionGroup ref="searchAdminDataGridByKeyword" stepKey="searchCustomer"> + <actionGroup ref="SearchAdminDataGridByKeywordActionGroup" stepKey="searchCustomer"> <argument name="keyword" value="$$createSecondCustomer.firstname$$"/> </actionGroup> <!--Step 3: Check if customer is placed in a first row and clear grid filter--> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml index e35a1ad61dc7c..d9b71e1e6e9ba 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml @@ -73,7 +73,7 @@ </annotations> <remove keyForRemoval="filterCustomer"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilters" before="selectCustomer"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilters" before="selectCustomer"/> <actionGroup ref="AdminSelectAllCustomers" stepKey="selectCustomer"/> </test> </tests> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/SearchByEmailInCustomerGridTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/SearchByEmailInCustomerGridTest.xml index e16ec92e507e6..5cce64495bbd2 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/SearchByEmailInCustomerGridTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/SearchByEmailInCustomerGridTest.xml @@ -33,7 +33,7 @@ <!--Step 1: Go to Customers > All Customers--> <amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomersGridPage"/> <!--Step 2: On Customers grid page search customer by keyword--> - <actionGroup ref="searchAdminDataGridByKeyword" stepKey="searchCustomer"> + <actionGroup ref="SearchAdminDataGridByKeywordActionGroup" stepKey="searchCustomer"> <argument name="keyword" value="$$createSecondCustomer.email$$"/> </actionGroup> <!--Step 3: Check if customer is placed in a first row and clear grid filter--> diff --git a/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml b/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml index 91a76383babd4..acecb62a2811d 100644 --- a/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml +++ b/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml @@ -104,7 +104,7 @@ <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> <!--Open created order in admin--> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> - <actionGroup ref="searchAdminDataGridByKeyword" stepKey="searchOrder"> + <actionGroup ref="SearchAdminDataGridByKeywordActionGroup" stepKey="searchOrder"> <argument name="keyword" value="$grabOrderNumber"/> </actionGroup> <click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckDoubleImportOfProductsTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckDoubleImportOfProductsTest.xml index 909c6101fe53e..9a6e045cbcf1e 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckDoubleImportOfProductsTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckDoubleImportOfProductsTest.xml @@ -33,8 +33,8 @@ <after> <!-- Delete all imported products --> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/> - <actionGroup ref="adminDataGridSelectPerPage" stepKey="selectNumberOfProductsPerPage"> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/> + <actionGroup ref="AdminDataGridSelectPerPageActionGroup" stepKey="selectNumberOfProductsPerPage"> <argument name="perPage" value="100"/> </actionGroup> <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductVisibilityDifferentStoreViewsAfterImportTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductVisibilityDifferentStoreViewsAfterImportTest.xml index 0a1423ece71e0..139bf0fdcf58a 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductVisibilityDifferentStoreViewsAfterImportTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductVisibilityDifferentStoreViewsAfterImportTest.xml @@ -34,8 +34,8 @@ <after> <!--Delete all imported products--> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/> - <actionGroup ref="adminDataGridSelectPerPage" stepKey="selectNumberOfProductsPerPage"> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/> + <actionGroup ref="AdminDataGridSelectPerPageActionGroup" stepKey="selectNumberOfProductsPerPage"> <argument name="perPage" value="100"/> </actionGroup> <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml index fd79d4d954cd4..7bd16809d3805 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml @@ -105,11 +105,11 @@ <waitForPageLoad stepKey="waitForOrderPageLoad"/> <!-- Go to Admin > Sales > Orders --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> - <actionGroup ref="searchAdminDataGridByKeyword" stepKey="searchFirstOrder"> + <actionGroup ref="SearchAdminDataGridByKeywordActionGroup" stepKey="searchFirstOrder"> <argument name="keyword" value="$grabFirstOrderId"/> </actionGroup> <seeElement selector="{{AdminOrdersGridSection.orderId({$grabFirstOrderId})}}" stepKey="seeAdminFirstOrder"/> - <actionGroup ref="searchAdminDataGridByKeyword" stepKey="searchSecondOrder"> + <actionGroup ref="SearchAdminDataGridByKeywordActionGroup" stepKey="searchSecondOrder"> <argument name="keyword" value="$grabSecondOrderId"/> </actionGroup> <seeElement selector="{{AdminOrdersGridSection.orderId({$grabSecondOrderId})}}" stepKey="seeAdminSecondOrder"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml index a90fe5c49f032..3ebc4240ac527 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml @@ -63,7 +63,7 @@ <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask3"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/> <fillField selector="{{AdminOrdersGridSection.search}}" userInput="{$grabOrderNumber}" stepKey="searchOrderNum"/> <click selector="{{AdminOrdersGridSection.submitSearch}}" stepKey="submitSearch"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask4"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml index 587b23e857c0c..efd7bae2c480a 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml @@ -48,9 +48,9 @@ <argument name="ruleName" value="{{CatalogRuleToPercent.name}}" /> </actionGroup> <!--Clear all filters in grid--> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="resetCatalogRuleGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="resetCatalogRuleGridFilters"/> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Login as admin --> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml index 9da5afffb48e5..22cca8248158e 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml @@ -88,7 +88,7 @@ <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteProductAttribute"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <amOnPage url="{{AdminCustomerPage.url}}" stepKey="openCustomerIndexPage"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearCustomerGridFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearCustomerGridFilter"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml index 0fdd8d8c35b32..2158755dbb307 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -168,10 +168,10 @@ <!--Search order grid by name--> <comment userInput="Admin searches order grid by name" stepKey="searchOrderGridComment" after="waitForOrderGridPageLoad"/> - <actionGroup ref="resetAdminDataGridToDefaultView" stepKey="setOrderGridToDefaultViewForSearch" after="searchOrderGridComment"/> + <actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="setOrderGridToDefaultViewForSearch" after="searchOrderGridComment"/> <!--@TODO use "Ship-to Name" when MQE-794 is fixed--> <see selector="{{AdminDataGridTableSection.column('Ship')}}" userInput="{{Simple_US_Customer.fullname}}" stepKey="seeNonFilterNameInShipNameColumn" after="setOrderGridToDefaultViewForSearch"/> - <actionGroup ref="searchAdminDataGridByKeyword" stepKey="searchOrderGridByNameKeyword" after="seeNonFilterNameInShipNameColumn"> + <actionGroup ref="SearchAdminDataGridByKeywordActionGroup" stepKey="searchOrderGridByNameKeyword" after="seeNonFilterNameInShipNameColumn"> <argument name="keyword" value="BillingAddressTX.fullname"/> </actionGroup> <dontSee selector="{{AdminDataGridTableSection.column('Ship')}}" userInput="{{Simple_US_Customer.fullname}}" stepKey="dontSeeNonFilterNameInShipNameColumn" after="searchOrderGridByNameKeyword"/> @@ -180,7 +180,7 @@ <!--Filter order grid--> <comment userInput="Admin filters order grid by 'Bill-to Name'" stepKey="filterOrderGridByNameComment" after="seeFilterNameInShipNameColumn"/> <!--Filter order grid by "Bill-to Name"--> - <actionGroup ref="resetAdminDataGridToDefaultView" stepKey="resetOrderGridForNameFilter" after="filterOrderGridByNameComment"/> + <actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetOrderGridForNameFilter" after="filterOrderGridByNameComment"/> <!--@TODO use "Bill-to Name" when MQE-794 is fixed--> <see selector="{{AdminDataGridTableSection.column('Bill')}}" userInput="{{BillingAddressTX.fullname}}" stepKey="seeNonFilterNameInColumn" after="resetOrderGridForNameFilter"/> <actionGroup ref="filterOrderGridByBillingName" stepKey="filterOrderGridByBillingName" after="seeNonFilterNameInColumn"> @@ -190,7 +190,7 @@ <see selector="{{AdminDataGridTableSection.column('Bill')}}" userInput="{{Simple_US_Customer.fullname}}" stepKey="seeFilterNameInColumn" after="dontSeeNonFilterNameInColumn"/> <!--Filter order grid by Grand Total (Base)--> <comment userInput="Admin filters order grid by 'Grand Total'" stepKey="filterOrderGridByTotalComment" after="seeFilterNameInColumn"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilterBeforeTotalFilter" after="filterOrderGridByTotalComment"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilterBeforeTotalFilter" after="filterOrderGridByTotalComment"/> <see selector="{{AdminDataGridTableSection.column('Grand Total')}}" userInput="{{AdminOrderSimpleProduct.grandTotal}}" stepKey="seeLowerTotalInGrid" after="clearFilterBeforeTotalFilter"/> <actionGroup ref="filterOrderGridByBaseTotalRange" stepKey="filterOrderGridByTotal" after="seeLowerTotalInGrid"> <argument name="from" value="OrderGrandTotalFilterRange.from"/> @@ -200,7 +200,7 @@ <see selector="{{AdminDataGridTableSection.column('Grand Total')}}" userInput="{{AdminOrderSimpleConfigurableProduct.grandTotal}}" stepKey="seeExpectedTotalInGrid" after="dontSeeLowerTotalInGrid"/> <!--Filter order grid by purchase date--> <comment userInput="Admin filters order grid by 'Purchase Date'" stepKey="filterOrderGridByDateComment" after="seeExpectedTotalInGrid"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilterBeforeOrderDateFilter" after="filterOrderGridByDateComment"/> + <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"/> @@ -216,7 +216,7 @@ <dontSee selector="{{AdminDataGridTableSection.column('Bill')}}" userInput="{{BillingAddressTX.fullname}}" stepKey="dontSeeSecondOrderInGrid" after="dontSeeFirstOrderInGrid"/> <!--Filter order grid by status--> <comment userInput="Admin filters order grid by 'Status'" stepKey="filterOrderGridByStatusComment" after="dontSeeSecondOrderInGrid"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilterBeforeStatusFilter" after="filterOrderGridByStatusComment"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilterBeforeStatusFilter" after="filterOrderGridByStatusComment"/> <actionGroup ref="filterOrderGridByStatus" stepKey="filterOrderGridByPendingStatus" after="clearFilterBeforeStatusFilter"> <argument name="status" value="OrderStatus.pending"/> </actionGroup> @@ -229,7 +229,7 @@ <dontSee selector="{{AdminDataGridTableSection.column('Status')}}" userInput="{{OrderStatus.pending}}" stepKey="dontSeePendingStatusInOrderGrid" after="seeClosedStatusInOrderGrid"/> <!--Sort order grid--> - <actionGroup ref="resetAdminDataGridToDefaultView" stepKey="resetOrderGridForSorting" after="dontSeePendingStatusInOrderGrid"/> + <actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetOrderGridForSorting" after="dontSeePendingStatusInOrderGrid"/> <!--Sort order grid by status--> <comment userInput="Admin sorts order grid by status" stepKey="sortOrderGridByStatusComment" after="resetOrderGridForSorting"/> <click selector="{{AdminDataGridTableSection.columnHeader('Status')}}" stepKey="clickStatusToSortAsc" after="sortOrderGridByStatusComment"/> @@ -239,9 +239,9 @@ <!--@TODO improve sort assertion and check price and date column when MQE-690 is resolved--> <!--Use paging on order grid--> - <actionGroup ref="resetAdminDataGridToDefaultView" stepKey="resetAdminGridBeforePaging" after="checkStatusSortOrderAsc"/> + <actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetAdminGridBeforePaging" after="checkStatusSortOrderAsc"/> <comment userInput="Admin uses paging on order grid" stepKey="usePagingOrderGridComment" after="resetAdminGridBeforePaging"/> - <actionGroup ref="adminDataGridSelectCustomPerPage" stepKey="select1OrderPerPage" after="usePagingOrderGridComment"> + <actionGroup ref="AdminDataGridSelectCustomPerPageActionGroup" stepKey="select1OrderPerPage" after="usePagingOrderGridComment"> <!--@TODO Change this to scalar when MQE-498 is implemented--> <argument name="perPage" value="Const.one"/> </actionGroup> @@ -250,7 +250,7 @@ <click selector="{{AdminDataGridPaginationSection.nextPage}}" stepKey="clickNextPageOrderGrid" after="seeOnFirstPageOrderGrid"/> <seeInField selector="{{AdminDataGridPaginationSection.currentPage}}" userInput="2" stepKey="seeOnSecondPageOrderGrid" after="clickNextPageOrderGrid"/> <seeNumberOfElements selector="{{AdminDataGridTableSection.rows}}" userInput="1" stepKey="see1RowOnSecondPage" after="seeOnSecondPageOrderGrid"/> - <actionGroup ref="adminDataGridSelectPerPage" stepKey="select50OrdersPerPage" after="see1RowOnSecondPage"> + <actionGroup ref="AdminDataGridSelectPerPageActionGroup" stepKey="select50OrdersPerPage" after="see1RowOnSecondPage"> <!--@TODO Change this to scalar when MQE-498 is implemented--> <argument name="perPage" value="Const.fifty"/> </actionGroup> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml index ab085dc5ae137..854ce67eef81a 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml @@ -39,12 +39,12 @@ <actionGroup ref="deleteProductBySku" stepKey="deleteBundleProduct"> <argument name="sku" value="{{BundleProduct.sku}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilters"/> <actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteCartPriceRule"> <argument name="ruleName" value="{{PriceRuleWithCondition.name}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilters1"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilters1"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToGroupedProductWithInvisibleIndividualProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToGroupedProductWithInvisibleIndividualProductTest.xml index 8900d838fb825..b90c8d5da0958 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToGroupedProductWithInvisibleIndividualProductTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToGroupedProductWithInvisibleIndividualProductTest.xml @@ -76,7 +76,7 @@ <actionGroup ref="AdminDeleteCartPriceRuleActionGroup" stepKey="deleteCartPriceRule"> <argument name="ruleName" value="TestSalesRule"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Start to create new cart price rule via Category conditions --> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml index 2928011662864..af75343613a3f 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml @@ -34,8 +34,8 @@ <argument name="ProductAttribute" value="visualSwatchAttribute"/> </actionGroup> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearGridFilter"/> - <actionGroup ref="adminDataGridSelectPerPage" stepKey="selectNumberOfProductsPerPage"> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearGridFilter"/> + <actionGroup ref="AdminDataGridSelectPerPageActionGroup" stepKey="selectNumberOfProductsPerPage"> <argument name="perPage" value="100"/> </actionGroup> <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml index 1717b424e4597..1fc8c3b2d2727 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml @@ -29,11 +29,11 @@ <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> <argument name="ProductAttribute" value="VisualSwatchProductAttribute"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductAttributeGridFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductAttributeGridFilter"/> <actionGroup ref="deleteAllDuplicateProductUsingProductGrid" stepKey="deleteAllChildrenProducts"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductGridFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductGridFilter"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridDeleteCustomPerPageActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridDeleteCustomPerPageActionGroup.xml new file mode 100644 index 0000000000000..275aaac39a757 --- /dev/null +++ b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridDeleteCustomPerPageActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AdminDataGridDeleteCustomPerPageActionGroup"> + <annotations> + <description>Sets the provided custom 'per page' display setting on an Admin Grid page. Deletes the Items listed in a grid. Validates that the 'per page' count in NOT present.</description> + </annotations> + <arguments> + <argument name="perPage"/> + </arguments> + + <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown1"/> + <click selector="{{AdminDataGridPaginationSection.perPageEditCustomValue(perPage)}}" stepKey="clickToEditCustomPerPage"/> + <waitForElementVisible selector="{{AdminDataGridPaginationSection.perPageDeleteCustomValue(perPage)}}" time="30" stepKey="waitForDeleteButtonVisible"/> + <click selector="{{AdminDataGridPaginationSection.perPageDeleteCustomValue(perPage)}}" stepKey="clickToDeleteCustomPerPage"/> + <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> + <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> + <dontSeeElement selector="{{AdminDataGridPaginationSection.perPageDropDownItem(perPage)}}" stepKey="dontSeeDropDownItem"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridFilterActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridFilterActionGroup.xml deleted file mode 100644 index 4c7b386a4cd00..0000000000000 --- a/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridFilterActionGroup.xml +++ /dev/null @@ -1,44 +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"> - <!--Search grid with keyword search--> - <actionGroup name="searchAdminDataGridByKeyword"> - <annotations> - <description>Fills 'Search by keyword' on an Admin Grid page. Clicks on Submit Search.</description> - </annotations> - <arguments> - <argument name="keyword"/> - </arguments> - - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <fillField selector="{{AdminDataGridHeaderSection.search}}" userInput="{{keyword}}" stepKey="fillKeywordSearchField"/> - <click selector="{{AdminDataGridHeaderSection.submitSearch}}" stepKey="clickKeywordSearch"/> - </actionGroup> - - <!--Reset data grid to default view--> - <actionGroup name="resetAdminDataGridToDefaultView"> - <annotations> - <description>Resets an Admin Grid page to the 'Default View'.</description> - </annotations> - - <click selector="{{AdminDataGridHeaderSection.bookmarkToggle}}" stepKey="openViewBookmarks"/> - <click selector="{{AdminDataGridHeaderSection.bookmarkOption('Default View')}}" stepKey="selectDefaultGridView"/> - <see selector="{{AdminDataGridHeaderSection.bookmarkToggle}}" userInput="Default View" stepKey="seeDefaultViewSelected"/> - </actionGroup> - - <!--Clear all filters in grid--> - <actionGroup name="clearFiltersAdminDataGrid"> - <annotations> - <description>Clicks on 'Clear Filters' on an Admin Grid page.</description> - </annotations> - - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridPaginationActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridPaginationActionGroup.xml deleted file mode 100644 index 11c5ef039f3e4..0000000000000 --- a/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridPaginationActionGroup.xml +++ /dev/null @@ -1,57 +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="adminDataGridSelectPerPage"> - <annotations> - <description>Sets the provided preset 'per page' display setting on an Admin Grid page.</description> - </annotations> - <arguments> - <argument name="perPage" type="string"/> - </arguments> - - <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> - <click selector="{{AdminDataGridPaginationSection.perPageOption(perPage)}}" stepKey="selectCustomPerPage"/> - <waitForPageLoad stepKey="waitForGridLoad"/> - </actionGroup> - - <actionGroup name="adminDataGridSelectCustomPerPage"> - <annotations> - <description>Sets the provided custom 'per page' display setting on an Admin Grid page.</description> - </annotations> - <arguments> - <argument name="perPage"/> - </arguments> - - <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> - <click selector="{{AdminDataGridPaginationSection.perPageOption('Custom')}}" stepKey="selectCustomPerPage"/> - <waitForElementVisible selector="{{AdminDataGridPaginationSection.perPageInput}}" time="30" stepKey="waitForInputVisible"/> - <fillField selector="{{AdminDataGridPaginationSection.perPageInput}}" userInput="{{perPage}}" stepKey="fillCustomPerPage"/> - <click selector="{{AdminDataGridPaginationSection.perPageApplyInput}}" stepKey="applyCustomPerPage"/> - <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> - <seeInField selector="{{AdminDataGridPaginationSection.perPageDropDownValue}}" userInput="{{perPage}}" stepKey="seePerPageValueInDropDown"/> - </actionGroup> - - <actionGroup name="adminDataGridDeleteCustomPerPage"> - <annotations> - <description>Sets the provided custom 'per page' display setting on an Admin Grid page. Deletes the Items listed in a grid. Validates that the 'per page' count in NOT present.</description> - </annotations> - <arguments> - <argument name="perPage"/> - </arguments> - - <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown1"/> - <click selector="{{AdminDataGridPaginationSection.perPageEditCustomValue(perPage)}}" stepKey="clickToEditCustomPerPage"/> - <waitForElementVisible selector="{{AdminDataGridPaginationSection.perPageDeleteCustomValue(perPage)}}" time="30" stepKey="waitForDeleteButtonVisible"/> - <click selector="{{AdminDataGridPaginationSection.perPageDeleteCustomValue(perPage)}}" stepKey="clickToDeleteCustomPerPage"/> - <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> - <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> - <dontSeeElement selector="{{AdminDataGridPaginationSection.perPageDropDownItem(perPage)}}" stepKey="dontSeeDropDownItem"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridSelectCustomPerPageActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridSelectCustomPerPageActionGroup.xml new file mode 100644 index 0000000000000..0d9c80e086352 --- /dev/null +++ b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridSelectCustomPerPageActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AdminDataGridSelectCustomPerPageActionGroup"> + <annotations> + <description>Sets the provided custom 'per page' display setting on an Admin Grid page.</description> + </annotations> + <arguments> + <argument name="perPage"/> + </arguments> + + <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> + <click selector="{{AdminDataGridPaginationSection.perPageOption('Custom')}}" stepKey="selectCustomPerPage"/> + <waitForElementVisible selector="{{AdminDataGridPaginationSection.perPageInput}}" time="30" stepKey="waitForInputVisible"/> + <fillField selector="{{AdminDataGridPaginationSection.perPageInput}}" userInput="{{perPage}}" stepKey="fillCustomPerPage"/> + <click selector="{{AdminDataGridPaginationSection.perPageApplyInput}}" stepKey="applyCustomPerPage"/> + <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> + <seeInField selector="{{AdminDataGridPaginationSection.perPageDropDownValue}}" userInput="{{perPage}}" stepKey="seePerPageValueInDropDown"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridSelectPerPageActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridSelectPerPageActionGroup.xml new file mode 100644 index 0000000000000..df342602a62be --- /dev/null +++ b/app/code/Magento/Ui/Test/Mftf/ActionGroup/AdminDataGridSelectPerPageActionGroup.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="AdminDataGridSelectPerPageActionGroup"> + <annotations> + <description>Sets the provided preset 'per page' display setting on an Admin Grid page.</description> + </annotations> + <arguments> + <argument name="perPage" type="string"/> + </arguments> + + <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> + <click selector="{{AdminDataGridPaginationSection.perPageOption(perPage)}}" stepKey="selectCustomPerPage"/> + <waitForPageLoad stepKey="waitForGridLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/ClearFiltersAdminDataGridActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/ClearFiltersAdminDataGridActionGroup.xml new file mode 100644 index 0000000000000..74b4a6c75ed2a --- /dev/null +++ b/app/code/Magento/Ui/Test/Mftf/ActionGroup/ClearFiltersAdminDataGridActionGroup.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="ClearFiltersAdminDataGridActionGroup"> + <annotations> + <description>Clicks on 'Clear Filters' on an Admin Grid page.</description> + </annotations> + + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/ResetAdminDataGridToDefaultViewActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/ResetAdminDataGridToDefaultViewActionGroup.xml new file mode 100644 index 0000000000000..a07e3c80623de --- /dev/null +++ b/app/code/Magento/Ui/Test/Mftf/ActionGroup/ResetAdminDataGridToDefaultViewActionGroup.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="ResetAdminDataGridToDefaultViewActionGroup"> + <annotations> + <description>Resets an Admin Grid page to the 'Default View'.</description> + </annotations> + + <click selector="{{AdminDataGridHeaderSection.bookmarkToggle}}" stepKey="openViewBookmarks"/> + <click selector="{{AdminDataGridHeaderSection.bookmarkOption('Default View')}}" stepKey="selectDefaultGridView"/> + <see selector="{{AdminDataGridHeaderSection.bookmarkToggle}}" userInput="Default View" stepKey="seeDefaultViewSelected"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/SearchAdminDataGridByKeywordActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/SearchAdminDataGridByKeywordActionGroup.xml new file mode 100644 index 0000000000000..4a59b1baa70d2 --- /dev/null +++ b/app/code/Magento/Ui/Test/Mftf/ActionGroup/SearchAdminDataGridByKeywordActionGroup.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="SearchAdminDataGridByKeywordActionGroup"> + <annotations> + <description>Fills 'Search by keyword' on an Admin Grid page. Clicks on Submit Search.</description> + </annotations> + <arguments> + <argument name="keyword"/> + </arguments> + + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <fillField selector="{{AdminDataGridHeaderSection.search}}" userInput="{{keyword}}" stepKey="fillKeywordSearchField"/> + <click selector="{{AdminDataGridHeaderSection.submitSearch}}" stepKey="clickKeywordSearch"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest.xml index 121fd7c736dcc..69954a2f60480 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest.xml @@ -45,12 +45,12 @@ <actionGroup ref="AdminDeleteStoreViewIfExistsActionGroup" stepKey="deleteStoreViewNl"> <argument name="storeViewName" value="{{customStoreNLNotUnique.name}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearStoreFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearStoreFilters"/> <actionGroup ref="deleteProductByName" stepKey="deleteImportedProduct"> <argument name="sku" value="productformagetwo68980"/> <argument name="name" value="productformagetwo68980"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFiltersIfSet"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFiltersIfSet"/> <actionGroup ref="logout" stepKey="logout"/> </after> <actionGroup ref="switchCategoryStoreView" stepKey="switchToStoreViewEn"> @@ -169,12 +169,12 @@ <actionGroup ref="AdminDeleteStoreViewIfExistsActionGroup" stepKey="deleteStoreViewNl"> <argument name="storeViewName" value="{{customStoreNLNotUnique.name}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearStoreGridFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearStoreGridFilters"/> <actionGroup ref="deleteProductByName" stepKey="deleteImportedProduct"> <argument name="sku" value="productformagetwo68980"/> <argument name="name" value="productformagetwo68980"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFiltersIfSet"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFiltersIfSet"/> <actionGroup ref="logout" stepKey="logout"/> <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 1" stepKey="resetConfigurationSetting"/> <!--Flush cache--> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml index aeb1d134d8e22..82021e75e0983 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml @@ -42,11 +42,11 @@ <actionGroup ref="DeleteCustomStoreActionGroup" stepKey="deleteCustomStoreGroup"> <argument name="storeGroupName" value="$$storeGroup.group[name]$$"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearWebsitesGridFilter"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearWebsitesGridFilter"/> <!--Clear products filter--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsFilters"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsFilters"/> <!--Logout everywhere--> <actionGroup ref="logout" stepKey="adminLogout"/> <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> From 9b4c9c01ecbd439af8f3a7aef577f41de89c19b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 14:43:37 +0100 Subject: [PATCH 308/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...thOnlinePaymentIncludingTaxAndDiscount.xml | 2 +- .../Test/StorefrontCustomerCheckoutTest.xml | 4 +- ...StorefrontCheckTaxAddingValidVATIdTest.xml | 12 +- ...ValueWithFullDiscountUsingCartRuleTest.xml | 2 +- .../AddCustomTaxRateActionGroup.xml | 21 ++ .../AddNewTaxRateNoZipActionGroup.xml | 32 +++ .../ActionGroup/AddNewTaxRuleActionGroup.xml | 21 ++ .../AddProductTaxClassActionGroup.xml | 28 ++ .../AdminCustomerTaxClassActionGroup.xml | 25 +- .../Mftf/ActionGroup/AdminTaxActionGroup.xml | 264 ------------------ .../ChangeShippingTaxClassActionGroup.xml | 45 +++ ...ToDefaultTaxConfigurationUIActionGroup.xml | 55 ++++ .../DeleteCustomerTaxClassActionGroup.xml | 30 ++ .../DeleteProductTaxClassActionGroup.xml | 30 ++ .../EditTaxConfigurationByUIActionGroup.xml | 62 ++++ .../SetDefaultShippingTaxClassActionGroup.xml | 43 +++ .../Test/Mftf/Test/AdminTaxReportGridTest.xml | 12 +- .../Mftf/Test/CheckCreditMemoTotalsTest.xml | 2 +- .../Mftf/Test/StorefrontTaxQuoteCartTest.xml | 32 +-- .../Test/StorefrontTaxQuoteCheckoutTest.xml | 32 +-- 20 files changed, 418 insertions(+), 336 deletions(-) create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/AddCustomTaxRateActionGroup.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/AddNewTaxRateNoZipActionGroup.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/AddNewTaxRuleActionGroup.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/AddProductTaxClassActionGroup.xml delete mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/ChangeShippingTaxClassActionGroup.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/ChangeToDefaultTaxConfigurationUIActionGroup.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/DeleteCustomerTaxClassActionGroup.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/DeleteProductTaxClassActionGroup.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/EditTaxConfigurationByUIActionGroup.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/SetDefaultShippingTaxClassActionGroup.xml diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml index 8f0ce4918b978..db87c727a3fee 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml @@ -90,7 +90,7 @@ <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> <!--Set Taxable Goods for Shipping Tax Class--> - <actionGroup ref="changeShippingTaxClass" stepKey="changeShippingTaxClass"/> + <actionGroup ref="ChangeShippingTaxClassActionGroup" stepKey="changeShippingTaxClass"/> <!--Adding Special price to product--> <amOnPage url="{{AdminProductEditPage.url($$simpleProduct.id$$)}}" stepKey="openAdminProductEditPage"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest.xml index 218ff959750d6..917a4ac58464f 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest.xml @@ -116,11 +116,11 @@ <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="SampleRule"/> <!-- Add NY and CA tax rules --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addNYTaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate"> <argument name="taxCode" value="SimpleTaxNY"/> </actionGroup> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addCATaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addCATaxRate"> <argument name="taxCode" value="SimpleTaxCA"/> </actionGroup> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml index 8469126547eb1..4c35cdbdb7cbb 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml @@ -30,23 +30,23 @@ </before> <!--Add new tax rates. Go to tax rule page --> - <actionGroup ref="addNewTaxRuleActionGroup" stepKey="addFirstTaxRuleActionGroup"/> + <actionGroup ref="AddNewTaxRuleActionGroup" stepKey="addFirstTaxRuleActionGroup"/> <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="{{TaxRule.name}}"/> <!-- Add NY and CA tax rules --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addSimpleTaxUK"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addSimpleTaxUK"> <argument name="taxCode" value="SimpleTaxUK"/> </actionGroup> <click stepKey="clickSave" selector="{{AdminStoresMainActionsSection.saveButton}}"/> <waitForPageLoad stepKey="waitForNewTaxRuleCreated"/> <!-- Go to tax rule page to create second Tax Rule--> - <actionGroup ref="addNewTaxRuleActionGroup" stepKey="addSecondTaxRuleActionGroup"/> + <actionGroup ref="AddNewTaxRuleActionGroup" stepKey="addSecondTaxRuleActionGroup"/> <fillField stepKey="fillSecondRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="{{TaxRuleZeroRate.name}}"/> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addSimpleTaxUKZeroRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addSimpleTaxUKZeroRate"> <argument name="taxCode" value="SimpleTaxUKZeroRate"/> </actionGroup> - <actionGroup ref="addCustomerTaxClass" stepKey="addCustomerTaxClass"> + <actionGroup ref="AddCustomerTaxClassActionGroup" stepKey="addCustomerTaxClass"> <argument name="customerTaxClassName" value="UK_zero"/> </actionGroup> <click stepKey="disableDefaultProdTaxClass" selector="{{AdminTaxRulesSection.defaultCustomerTaxClass}}"/> @@ -138,7 +138,7 @@ <deleteData createDataKey="createProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategoryFirst"/> - <actionGroup ref="deleteProductTaxClass" stepKey="deleteFirstProductTaxClass"> + <actionGroup ref="DeleteProductTaxClassActionGroup" stepKey="deleteFirstProductTaxClass"> <argument name="taxClassName" value="UK_zero"/> </actionGroup> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartTotalValueWithFullDiscountUsingCartRuleTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartTotalValueWithFullDiscountUsingCartRuleTest.xml index 903e79b2328bc..f12b8ea7ca331 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartTotalValueWithFullDiscountUsingCartRuleTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartTotalValueWithFullDiscountUsingCartRuleTest.xml @@ -39,7 +39,7 @@ <click stepKey="addNewTaxRate" selector="{{AdminGridMainControls.add}}"/> <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="SampleRule"/> <!-- Add tax rule with 20% tax rate --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addNYTaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate"> <argument name="taxCode" value="SimpleTaxNYRate"/> </actionGroup> <click stepKey="clickSave" selector="{{AdminStoresMainActionsSection.saveButton}}"/> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddCustomTaxRateActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddCustomTaxRateActionGroup.xml new file mode 100644 index 0000000000000..97d59a51bb68e --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddCustomTaxRateActionGroup.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="AddCustomTaxRateActionGroup" extends="addNewTaxRateNoZip"> + <annotations> + <description>EXTENDS: addNewTaxRateNoZip. Removes 'fillZipCode' and 'fillRate'. Fills in the Zip Code and Rate. PLEASE NOTE: The values are Hardcoded.</description> + </annotations> + + <remove keyForRemoval="fillZipCode"/> + <remove keyForRemoval="fillRate"/> + <fillField stepKey="fillZipCode" selector="{{AdminTaxRulesSection.zipCode}}" userInput="US-NY-*-Rate 2" after="fillTaxIdentifier"/> + <fillField stepKey="fillRate" selector="{{AdminTaxRulesSection.rate}}" userInput="0" after="selectCountry"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddNewTaxRateNoZipActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddNewTaxRateNoZipActionGroup.xml new file mode 100644 index 0000000000000..8a2945130c925 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddNewTaxRateNoZipActionGroup.xml @@ -0,0 +1,32 @@ +<?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="AddNewTaxRateNoZipActionGroup"> + <annotations> + <description>Goes to the Admin Tax Rules grid page. Adds the provided Tax Code.</description> + </annotations> + <arguments> + <argument name="taxCode"/> + </arguments> + + <!-- Go to the tax rate page --> + <click stepKey="addNewTaxRate" selector="{{AdminTaxRulesSection.addNewTaxRate}}"/> + + <!-- Fill out a new tax rate --> + <fillField stepKey="fillTaxIdentifier" selector="{{AdminTaxRulesSection.taxIdentifier}}" userInput="{{taxCode.state}}-{{taxCode.rate}}"/> + <fillField stepKey="fillZipCode" selector="{{AdminTaxRulesSection.zipCode}}" userInput="{{taxCode.zip}}"/> + <selectOption stepKey="selectState" selector="{{AdminTaxRulesSection.state}}" userInput="{{taxCode.state}}"/> + <selectOption stepKey="selectCountry" selector="{{AdminTaxRulesSection.country}}" userInput="{{taxCode.country}}"/> + <fillField stepKey="fillRate" selector="{{AdminTaxRulesSection.rate}}" userInput="{{taxCode.rate}}"/> + + <!-- Save the tax rate --> + <click stepKey="saveTaxRate" selector="{{AdminTaxRulesSection.save}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddNewTaxRuleActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddNewTaxRuleActionGroup.xml new file mode 100644 index 0000000000000..6bc7ef6f540c3 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddNewTaxRuleActionGroup.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="AddNewTaxRuleActionGroup"> + <annotations> + <description>Goes to the Admin Tax Rules grid page. Clicks on the Add New Tax Rule button.</description> + </annotations> + + <!-- Go to tax rule page --> + <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> + <waitForPageLoad stepKey="waitForTaxRatePage"/> + <click stepKey="addNewTaxRate" selector="{{AdminGridMainControls.add}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddProductTaxClassActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddProductTaxClassActionGroup.xml new file mode 100644 index 0000000000000..943d05ee37504 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddProductTaxClassActionGroup.xml @@ -0,0 +1,28 @@ +<?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="AddProductTaxClassActionGroup"> + <annotations> + <description>Adds the provided Product Tax Class to a Tax Rule. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="prodTaxClassName" type="string"/> + </arguments> + + <!--Click Additional Settings--> + <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> + <!--Click Product Add New Tax Class Button--> + <click stepKey="clickProdAddNewTaxClassBtn" selector="{{AdminTaxRulesSection.productAddNewTaxClass}}"/> + <!--Fill field--> + <fillField stepKey="fillProdNewTaxClass" selector="{{AdminTaxRulesSection.fieldProdNewTaxClass}}" userInput="{{prodTaxClassName}}"/> + <!-- Save Product tax rate --> + <click stepKey="saveProdTaxRate" selector="{{AdminTaxRulesSection.saveProdNewTaxClass}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminCustomerTaxClassActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminCustomerTaxClassActionGroup.xml index f711633e1e00b..d627448edf730 100644 --- a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminCustomerTaxClassActionGroup.xml +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminCustomerTaxClassActionGroup.xml @@ -9,14 +9,14 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <!--Add Customer Tax Class--> - <actionGroup name="addCustomerTaxClass"> + <actionGroup name="AddCustomerTaxClassActionGroup"> <annotations> <description>Adds the provided Customer Tax Class on the Admin Tax Rule creation/edit page.</description> </annotations> <arguments> <argument name="customerTaxClassName" type="string"/> </arguments> - + <!--Click Additional Settings--> <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> <!--Click Product Add New Tax Class Button--> @@ -26,25 +26,4 @@ <!-- Save Product tax rate --> <click stepKey="saveProdTaxRate" selector="{{AdminTaxRulesSection.saveCustomerNewTaxClass}}"/> </actionGroup> - - <!--Delete Product Tax Class--> - <actionGroup name="deleteCustomerTaxClass"> - <annotations> - <description>Goes to the Admin New Tax Rule page. Deletes the provided Tax Class Name.</description> - </annotations> - <arguments> - <argument name="taxClassName" type="string"/> - </arguments> - - <!-- Go to tax rule page --> - <amOnPage url="{{AdminNewTaxRulePage.url}}" stepKey="goToNewTaxRulePage"/> - <waitForPageLoad stepKey="waitForTaxRatePage"/> - <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> - <scrollTo stepKey="scrollToAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> - <moveMouseOver stepKey="hoverDeleteElement" selector="{{AdminTaxRulesSection.deleteTaxClassName(taxClassName)}}"/> - <click stepKey="deleteFirstTaxClass" selector="{{AdminTaxRulesSection.deleteTaxClass(taxClassName)}}"/> - <waitForElementVisible selector="{{AdminTaxRulesSection.popUpDialogOK}}" stepKey="waitForElementBecomeVisible"/> - <click stepKey="acceptPopUpDialog" selector="{{AdminTaxRulesSection.popUpDialogOK}}"/> - <waitForPageLoad stepKey="waitForProductTaxClassDeleted"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml deleted file mode 100644 index e1674481b8bb9..0000000000000 --- a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml +++ /dev/null @@ -1,264 +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"> - <!-- Change the tax configuration to display in cart and checkout flow --> - <actionGroup name="editTaxConfigurationByUI"> - <annotations> - <description>Goes to the 'Configuration' page for 'Tax'. Enables the display of Taxes in the Storefront Shopping Cart and Checkout page.</description> - </annotations> - - <!-- navigate to the tax configuration page --> - <amOnPage url="{{AdminTaxConfigurationPage.url}}" stepKey="goToAdminTaxPage"/> - <waitForPageLoad stepKey="waitForTaxConfigLoad"/> - - <!-- change the default state to California --> - <scrollTo selector="#tax_defaults-head" x="0" y="-80" stepKey="scrollToTaxDefaults"/> - - <!-- conditionalClick twice to fix some flaky behavior --> - <conditionalClick stepKey="clickCalculationSettings" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="#tax_defaults" visible="false"/> - <conditionalClick stepKey="clickCalculationSettingsAgain" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="#tax_defaults" visible="false"/> - <uncheckOption stepKey="clickDefaultState" selector="{{AdminConfigureTaxSection.systemValueDefaultState}}"/> - <selectOption stepKey="selectDefaultState" selector="{{AdminConfigureTaxSection.dropdownDefaultState}}" userInput="California"/> - <fillField stepKey="fillDefaultPostCode" selector="{{AdminConfigureTaxSection.defaultPostCode}}" userInput="*"/> - - <!-- change the options for shopping cart display to show tax --> - <scrollTo selector="#tax_cart_display-head" x="0" y="-80" stepKey="scrollToTaxShoppingCartDisplay"/> - - <!-- conditionalClick twice to fix some flaky behavior --> - <conditionalClick stepKey="clickShoppingCartDisplaySettings" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="#tax_cart_display" visible="false"/> - <conditionalClick stepKey="clickShoppingCartDisplaySettingsAgain" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="#tax_cart_display" visible="false"/> - <uncheckOption stepKey="clickTaxTotalCart" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}"/> - <selectOption stepKey="selectTaxTotalCart" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalCart}}" userInput="Yes"/> - <uncheckOption stepKey="clickDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummaryCart}}"/> - <selectOption stepKey="selectDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummaryCart}}" userInput="Yes"/> - <uncheckOption stepKey="clickDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxCart}}"/> - <selectOption stepKey="selectDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxCart}}" userInput="Yes"/> - - <!-- change the options for orders, invoices, credit memos display to show tax --> - <scrollTo selector="#tax_sales_display-head" x="0" y="-80" stepKey="scrollToTaxSalesDisplay"/> - - <!-- conditionalClick twice to fix some flaky behavior --> - <conditionalClick stepKey="clickOrdersInvoicesCreditSales" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="#tax_sales_display" visible="false"/> - <conditionalClick stepKey="clickOrdersInvoicesCreditSalesAgain" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="#tax_sales_display" visible="false"/> - <uncheckOption stepKey="clickTaxTotalSales" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}"/> - <selectOption stepKey="selectTaxTotalSales" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalSales}}" userInput="Yes"/> - <uncheckOption stepKey="clickDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummarySales}}"/> - <selectOption stepKey="selectDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummarySales}}" userInput="Yes"/> - <uncheckOption stepKey="clickDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxSales}}"/> - <selectOption stepKey="selectDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxSales}}" userInput="Yes"/> - - <!-- Save the settings --> - <scrollToTopOfPage stepKey="scrollToTop"/> - <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> - <waitForPageLoad stepKey="waitForTaxSaved"/> - <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> - </actionGroup> - - <actionGroup name="changeToDefaultTaxConfigurationUI"> - <annotations> - <description>Goes to the 'Configuration' page for 'Tax'. Set the Tax Configuration Settings to the Default values. Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - - <!-- navigate to the tax configuration page --> - <amOnPage url="{{AdminTaxConfigurationPage.url}}" stepKey="goToAdminTaxPage"/> - <waitForPageLoad stepKey="waitForTaxConfigLoad"/> - - <!-- change the default state to none --> - <!-- conditionalClick twice to fix some flaky behavior --> - <conditionalClick stepKey="clickCalculationSettings" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="{{AdminConfigureTaxSection.systemValueDefaultState}}" visible="false"/> - <conditionalClick stepKey="clickCalculationSettingsAgain" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="{{AdminConfigureTaxSection.systemValueDefaultState}}" visible="false"/> - <checkOption stepKey="clickDefaultState" selector="{{AdminConfigureTaxSection.systemValueDefaultState}}"/> - <selectOption stepKey="selectDefaultState" selector="{{AdminConfigureTaxSection.dropdownDefaultState}}" userInput="California"/> - <fillField stepKey="fillDefaultPostCode" selector="{{AdminConfigureTaxSection.defaultPostCode}}" userInput=""/> - - <!-- change the options for shopping cart display to not show tax --> - <!-- conditionalClick twice to fix some flaky behavior --> - <conditionalClick stepKey="clickShoppingCartDisplaySettings" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}" visible="false"/> - <conditionalClick stepKey="clickShoppingCartDisplaySettingsAgain" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}" visible="false"/> - <checkOption stepKey="clickTaxTotalCart" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}"/> - <selectOption stepKey="selectTaxTotalCart" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalCart}}" userInput="Yes"/> - <checkOption stepKey="clickDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummaryCart}}"/> - <selectOption stepKey="selectDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummaryCart}}" userInput="Yes"/> - <checkOption stepKey="clickDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxCart}}"/> - <selectOption stepKey="selectDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxCart}}" userInput="Yes"/> - - <!-- change the options for orders, invoices, credit memos display to not show tax --> - <!-- conditionalClick twice to fix some flaky behavior --> - <conditionalClick stepKey="clickOrdersInvoicesCreditSales" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}" visible="false"/> - <conditionalClick stepKey="clickOrdersInvoicesCreditSalesAgain" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}" visible="false"/> - <checkOption stepKey="clickTaxTotalSales" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}"/> - <selectOption stepKey="selectTaxTotalSales" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalSales}}" userInput="Yes"/> - <checkOption stepKey="clickDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummarySales}}"/> - <selectOption stepKey="selectDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummarySales}}" userInput="Yes"/> - <checkOption stepKey="clickDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxSales}}"/> - <selectOption stepKey="selectDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxSales}}" userInput="Yes"/> - - <!-- Save the settings --> - <scrollToTopOfPage stepKey="scrollToTop"/> - <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> - <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> - </actionGroup> - - <actionGroup name="addCustomTaxRate" extends="addNewTaxRateNoZip"> - <annotations> - <description>EXTENDS: addNewTaxRateNoZip. Removes 'fillZipCode' and 'fillRate'. Fills in the Zip Code and Rate. PLEASE NOTE: The values are Hardcoded.</description> - </annotations> - - <remove keyForRemoval="fillZipCode"/> - <remove keyForRemoval="fillRate"/> - <fillField stepKey="fillZipCode" selector="{{AdminTaxRulesSection.zipCode}}" userInput="US-NY-*-Rate 2" after="fillTaxIdentifier"/> - <fillField stepKey="fillRate" selector="{{AdminTaxRulesSection.rate}}" userInput="0" after="selectCountry"/> - </actionGroup> - - <!-- Action group to add a tax rate when on a tax rule configuration page --> - <!-- Must already be on a tax rule configuration page or a new tax rule page --> - <actionGroup name="addNewTaxRateNoZip"> - <annotations> - <description>Goes to the Admin Tax Rules grid page. Adds the provided Tax Code.</description> - </annotations> - <arguments> - <argument name="taxCode"/> - </arguments> - - <!-- Go to the tax rate page --> - <click stepKey="addNewTaxRate" selector="{{AdminTaxRulesSection.addNewTaxRate}}"/> - - <!-- Fill out a new tax rate --> - <fillField stepKey="fillTaxIdentifier" selector="{{AdminTaxRulesSection.taxIdentifier}}" userInput="{{taxCode.state}}-{{taxCode.rate}}"/> - <fillField stepKey="fillZipCode" selector="{{AdminTaxRulesSection.zipCode}}" userInput="{{taxCode.zip}}"/> - <selectOption stepKey="selectState" selector="{{AdminTaxRulesSection.state}}" userInput="{{taxCode.state}}"/> - <selectOption stepKey="selectCountry" selector="{{AdminTaxRulesSection.country}}" userInput="{{taxCode.country}}"/> - <fillField stepKey="fillRate" selector="{{AdminTaxRulesSection.rate}}" userInput="{{taxCode.rate}}"/> - - <!-- Save the tax rate --> - <click stepKey="saveTaxRate" selector="{{AdminTaxRulesSection.save}}"/> - </actionGroup> - - <!--Set Tax Class for Shipping--> - <actionGroup name="changeShippingTaxClass"> - <annotations> - <description>Goes to the 'Configuration' page for 'Tax'. Sets the 'Tax Class for Shipping' configuration setting to 'Taxable Goods'. Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - - <!--Select Configuration menu from Store--> - <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES"/> - <waitForPageLoad stepKey="waitForConfiguration"/> - <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations"/> - <waitForPageLoad stepKey="waitForSales"/> - - <!--Double click the same to fix flaky issue with redirection to Dashboard--> - <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES1"/> - <waitForPageLoad stepKey="waitForConfiguration1"/> - <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations1"/> - <waitForPageLoad stepKey="waitForSales1" time="5"/> - - <!--Change default tax class for Shipping on Taxable Goods--> - <click selector="{{ConfigurationListSection.sales}}" stepKey="clickOnSales"/> - <waitForPageLoad stepKey="waitForPaymentMethods"/> - <click selector="{{AdminConfigureTaxSection.salesTax}}" stepKey="clickOnTax"/> - <waitForPageLoad stepKey="waitForTax"/> - <seeInCurrentUrl url="{{AdminTaxConfigurationPage.url}}" stepKey="adminTaxConfiguration"/> - <seeElement selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="taxClassSectionC"/> - <click selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="openTaxClassSection"/> - <click selector="{{AdminConfigureTaxSection.taxShippingClassSystem}}" stepKey="uncheckSystemValue"/> - <selectOption selector="{{AdminConfigureTaxSection.taxClassShipping}}" userInput="Taxable Goods" stepKey="setTaxClassForShipping"/> - - <!-- Save the settings --> - <scrollToTopOfPage stepKey="scrollToTop"/> - <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> - <waitForPageLoad stepKey="waitForTaxSaved"/> - <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> - </actionGroup> - - <actionGroup name="setDefaultShippingTaxClass"> - <annotations> - <description>Goes to the 'Configuration' page via the Admin Side Menu. Sets the 'Tax Class for Shipping' to the System Default. Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - - <!--Select Configuration menu from Store--> - <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES"/> - <waitForPageLoad stepKey="waitForConfiguration"/> - <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations"/> - <waitForPageLoad stepKey="waitForSales"/> - - <!--Double click the same to fix flaky issue with redirection to Dashboard--> - <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES1"/> - <waitForPageLoad stepKey="waitForConfiguration1"/> - <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations1"/> - <waitForPageLoad stepKey="waitForSales1"/> - - <!--Change default tax class for Shipping on Taxable Goods--> - <click selector="{{ConfigurationListSection.sales}}" stepKey="clickOnSales"/> - <waitForPageLoad stepKey="waitForPaymentMethods"/> - <click selector="{{AdminConfigureTaxSection.salesTax}}" stepKey="clickOnTax"/> - <waitForPageLoad stepKey="waitForTax"/> - <seeElement selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="taxClassSectionC"/> - <click selector="{{AdminConfigureTaxSection.taxShippingClassSystem}}" stepKey="checkSystemDefaultValue"/> - <click selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="closeTaxClassSection"/> - - <!-- Save the settings --> - <scrollToTopOfPage stepKey="scrollToTop"/> - <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> - <waitForPageLoad stepKey="waitForTaxSaved"/> - <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> - </actionGroup> - - <!--Add Product Tax Class--> - <actionGroup name="addProductTaxClass"> - <annotations> - <description>Adds the provided Product Tax Class to a Tax Rule. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="prodTaxClassName" type="string"/> - </arguments> - - <!--Click Additional Settings--> - <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> - <!--Click Product Add New Tax Class Button--> - <click stepKey="clickProdAddNewTaxClassBtn" selector="{{AdminTaxRulesSection.productAddNewTaxClass}}"/> - <!--Fill field--> - <fillField stepKey="fillProdNewTaxClass" selector="{{AdminTaxRulesSection.fieldProdNewTaxClass}}" userInput="{{prodTaxClassName}}"/> - <!-- Save Product tax rate --> - <click stepKey="saveProdTaxRate" selector="{{AdminTaxRulesSection.saveProdNewTaxClass}}"/> - </actionGroup> - - <!--Add New Tax Rule --> - <actionGroup name="addNewTaxRuleActionGroup"> - <annotations> - <description>Goes to the Admin Tax Rules grid page. Clicks on the Add New Tax Rule button.</description> - </annotations> - - <!-- Go to tax rule page --> - <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> - <waitForPageLoad stepKey="waitForTaxRatePage"/> - <click stepKey="addNewTaxRate" selector="{{AdminGridMainControls.add}}"/> - </actionGroup> - - <!--Delete Product Tax Class--> - <actionGroup name="deleteProductTaxClass"> - <annotations> - <description>Goes to the Admin Tax Rule creation page. Deletes the provided Tax Class.</description> - </annotations> - <arguments> - <argument name="taxClassName" type="string"/> - </arguments> - - <!-- Go to tax rule page --> - <amOnPage url="{{AdminNewTaxRulePage.url}}" stepKey="goToNewTaxRulePage"/> - <waitForPageLoad stepKey="waitForTaxRatePage"/> - <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> - <scrollTo stepKey="scrollToAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> - <moveMouseOver stepKey="hoverDeleteElement" selector="{{AdminTaxRulesSection.deleteTaxClassName(taxClassName)}}"/> - <click stepKey="deleteFirstTaxClass" selector="{{AdminTaxRulesSection.deleteTaxClass(taxClassName)}}"/> - <waitForElementVisible selector="{{AdminTaxRulesSection.popUpDialogOK}}" stepKey="waitForElementBecomeVisible"/> - <click stepKey="acceptPopUpDialog" selector="{{AdminTaxRulesSection.popUpDialogOK}}"/> - <waitForPageLoad stepKey="waitForProductTaxClassDeleted"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/ChangeShippingTaxClassActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/ChangeShippingTaxClassActionGroup.xml new file mode 100644 index 0000000000000..8bd9136831890 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/ChangeShippingTaxClassActionGroup.xml @@ -0,0 +1,45 @@ +<?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="ChangeShippingTaxClassActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Tax'. Sets the 'Tax Class for Shipping' configuration setting to 'Taxable Goods'. Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + + <!--Select Configuration menu from Store--> + <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES"/> + <waitForPageLoad stepKey="waitForConfiguration"/> + <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations"/> + <waitForPageLoad stepKey="waitForSales"/> + + <!--Double click the same to fix flaky issue with redirection to Dashboard--> + <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES1"/> + <waitForPageLoad stepKey="waitForConfiguration1"/> + <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations1"/> + <waitForPageLoad stepKey="waitForSales1" time="5"/> + + <!--Change default tax class for Shipping on Taxable Goods--> + <click selector="{{ConfigurationListSection.sales}}" stepKey="clickOnSales"/> + <waitForPageLoad stepKey="waitForPaymentMethods"/> + <click selector="{{AdminConfigureTaxSection.salesTax}}" stepKey="clickOnTax"/> + <waitForPageLoad stepKey="waitForTax"/> + <seeInCurrentUrl url="{{AdminTaxConfigurationPage.url}}" stepKey="adminTaxConfiguration"/> + <seeElement selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="taxClassSectionC"/> + <click selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="openTaxClassSection"/> + <click selector="{{AdminConfigureTaxSection.taxShippingClassSystem}}" stepKey="uncheckSystemValue"/> + <selectOption selector="{{AdminConfigureTaxSection.taxClassShipping}}" userInput="Taxable Goods" stepKey="setTaxClassForShipping"/> + + <!-- Save the settings --> + <scrollToTopOfPage stepKey="scrollToTop"/> + <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> + <waitForPageLoad stepKey="waitForTaxSaved"/> + <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/ChangeToDefaultTaxConfigurationUIActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/ChangeToDefaultTaxConfigurationUIActionGroup.xml new file mode 100644 index 0000000000000..c93d4187cafa6 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/ChangeToDefaultTaxConfigurationUIActionGroup.xml @@ -0,0 +1,55 @@ +<?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="ChangeToDefaultTaxConfigurationUIActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Tax'. Set the Tax Configuration Settings to the Default values. Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + + <!-- navigate to the tax configuration page --> + <amOnPage url="{{AdminTaxConfigurationPage.url}}" stepKey="goToAdminTaxPage"/> + <waitForPageLoad stepKey="waitForTaxConfigLoad"/> + + <!-- change the default state to none --> + <!-- conditionalClick twice to fix some flaky behavior --> + <conditionalClick stepKey="clickCalculationSettings" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="{{AdminConfigureTaxSection.systemValueDefaultState}}" visible="false"/> + <conditionalClick stepKey="clickCalculationSettingsAgain" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="{{AdminConfigureTaxSection.systemValueDefaultState}}" visible="false"/> + <checkOption stepKey="clickDefaultState" selector="{{AdminConfigureTaxSection.systemValueDefaultState}}"/> + <selectOption stepKey="selectDefaultState" selector="{{AdminConfigureTaxSection.dropdownDefaultState}}" userInput="California"/> + <fillField stepKey="fillDefaultPostCode" selector="{{AdminConfigureTaxSection.defaultPostCode}}" userInput=""/> + + <!-- change the options for shopping cart display to not show tax --> + <!-- conditionalClick twice to fix some flaky behavior --> + <conditionalClick stepKey="clickShoppingCartDisplaySettings" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}" visible="false"/> + <conditionalClick stepKey="clickShoppingCartDisplaySettingsAgain" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}" visible="false"/> + <checkOption stepKey="clickTaxTotalCart" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}"/> + <selectOption stepKey="selectTaxTotalCart" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalCart}}" userInput="Yes"/> + <checkOption stepKey="clickDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummaryCart}}"/> + <selectOption stepKey="selectDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummaryCart}}" userInput="Yes"/> + <checkOption stepKey="clickDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxCart}}"/> + <selectOption stepKey="selectDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxCart}}" userInput="Yes"/> + + <!-- change the options for orders, invoices, credit memos display to not show tax --> + <!-- conditionalClick twice to fix some flaky behavior --> + <conditionalClick stepKey="clickOrdersInvoicesCreditSales" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}" visible="false"/> + <conditionalClick stepKey="clickOrdersInvoicesCreditSalesAgain" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}" visible="false"/> + <checkOption stepKey="clickTaxTotalSales" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}"/> + <selectOption stepKey="selectTaxTotalSales" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalSales}}" userInput="Yes"/> + <checkOption stepKey="clickDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummarySales}}"/> + <selectOption stepKey="selectDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummarySales}}" userInput="Yes"/> + <checkOption stepKey="clickDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxSales}}"/> + <selectOption stepKey="selectDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxSales}}" userInput="Yes"/> + + <!-- Save the settings --> + <scrollToTopOfPage stepKey="scrollToTop"/> + <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> + <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/DeleteCustomerTaxClassActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/DeleteCustomerTaxClassActionGroup.xml new file mode 100644 index 0000000000000..4507265cab1d0 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/DeleteCustomerTaxClassActionGroup.xml @@ -0,0 +1,30 @@ +<?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="DeleteCustomerTaxClassActionGroup"> + <annotations> + <description>Goes to the Admin New Tax Rule page. Deletes the provided Tax Class Name.</description> + </annotations> + <arguments> + <argument name="taxClassName" type="string"/> + </arguments> + + <!-- Go to tax rule page --> + <amOnPage url="{{AdminNewTaxRulePage.url}}" stepKey="goToNewTaxRulePage"/> + <waitForPageLoad stepKey="waitForTaxRatePage"/> + <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> + <scrollTo stepKey="scrollToAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> + <moveMouseOver stepKey="hoverDeleteElement" selector="{{AdminTaxRulesSection.deleteTaxClassName(taxClassName)}}"/> + <click stepKey="deleteFirstTaxClass" selector="{{AdminTaxRulesSection.deleteTaxClass(taxClassName)}}"/> + <waitForElementVisible selector="{{AdminTaxRulesSection.popUpDialogOK}}" stepKey="waitForElementBecomeVisible"/> + <click stepKey="acceptPopUpDialog" selector="{{AdminTaxRulesSection.popUpDialogOK}}"/> + <waitForPageLoad stepKey="waitForProductTaxClassDeleted"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/DeleteProductTaxClassActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/DeleteProductTaxClassActionGroup.xml new file mode 100644 index 0000000000000..b365f68318101 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/DeleteProductTaxClassActionGroup.xml @@ -0,0 +1,30 @@ +<?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="DeleteProductTaxClassActionGroup"> + <annotations> + <description>Goes to the Admin Tax Rule creation page. Deletes the provided Tax Class.</description> + </annotations> + <arguments> + <argument name="taxClassName" type="string"/> + </arguments> + + <!-- Go to tax rule page --> + <amOnPage url="{{AdminNewTaxRulePage.url}}" stepKey="goToNewTaxRulePage"/> + <waitForPageLoad stepKey="waitForTaxRatePage"/> + <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> + <scrollTo stepKey="scrollToAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> + <moveMouseOver stepKey="hoverDeleteElement" selector="{{AdminTaxRulesSection.deleteTaxClassName(taxClassName)}}"/> + <click stepKey="deleteFirstTaxClass" selector="{{AdminTaxRulesSection.deleteTaxClass(taxClassName)}}"/> + <waitForElementVisible selector="{{AdminTaxRulesSection.popUpDialogOK}}" stepKey="waitForElementBecomeVisible"/> + <click stepKey="acceptPopUpDialog" selector="{{AdminTaxRulesSection.popUpDialogOK}}"/> + <waitForPageLoad stepKey="waitForProductTaxClassDeleted"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/EditTaxConfigurationByUIActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/EditTaxConfigurationByUIActionGroup.xml new file mode 100644 index 0000000000000..da56a305d0e94 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/EditTaxConfigurationByUIActionGroup.xml @@ -0,0 +1,62 @@ +<?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="EditTaxConfigurationByUIActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Tax'. Enables the display of Taxes in the Storefront Shopping Cart and Checkout page.</description> + </annotations> + + <!-- navigate to the tax configuration page --> + <amOnPage url="{{AdminTaxConfigurationPage.url}}" stepKey="goToAdminTaxPage"/> + <waitForPageLoad stepKey="waitForTaxConfigLoad"/> + + <!-- change the default state to California --> + <scrollTo selector="#tax_defaults-head" x="0" y="-80" stepKey="scrollToTaxDefaults"/> + + <!-- conditionalClick twice to fix some flaky behavior --> + <conditionalClick stepKey="clickCalculationSettings" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="#tax_defaults" visible="false"/> + <conditionalClick stepKey="clickCalculationSettingsAgain" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="#tax_defaults" visible="false"/> + <uncheckOption stepKey="clickDefaultState" selector="{{AdminConfigureTaxSection.systemValueDefaultState}}"/> + <selectOption stepKey="selectDefaultState" selector="{{AdminConfigureTaxSection.dropdownDefaultState}}" userInput="California"/> + <fillField stepKey="fillDefaultPostCode" selector="{{AdminConfigureTaxSection.defaultPostCode}}" userInput="*"/> + + <!-- change the options for shopping cart display to show tax --> + <scrollTo selector="#tax_cart_display-head" x="0" y="-80" stepKey="scrollToTaxShoppingCartDisplay"/> + + <!-- conditionalClick twice to fix some flaky behavior --> + <conditionalClick stepKey="clickShoppingCartDisplaySettings" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="#tax_cart_display" visible="false"/> + <conditionalClick stepKey="clickShoppingCartDisplaySettingsAgain" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="#tax_cart_display" visible="false"/> + <uncheckOption stepKey="clickTaxTotalCart" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}"/> + <selectOption stepKey="selectTaxTotalCart" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalCart}}" userInput="Yes"/> + <uncheckOption stepKey="clickDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummaryCart}}"/> + <selectOption stepKey="selectDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummaryCart}}" userInput="Yes"/> + <uncheckOption stepKey="clickDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxCart}}"/> + <selectOption stepKey="selectDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxCart}}" userInput="Yes"/> + + <!-- change the options for orders, invoices, credit memos display to show tax --> + <scrollTo selector="#tax_sales_display-head" x="0" y="-80" stepKey="scrollToTaxSalesDisplay"/> + + <!-- conditionalClick twice to fix some flaky behavior --> + <conditionalClick stepKey="clickOrdersInvoicesCreditSales" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="#tax_sales_display" visible="false"/> + <conditionalClick stepKey="clickOrdersInvoicesCreditSalesAgain" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="#tax_sales_display" visible="false"/> + <uncheckOption stepKey="clickTaxTotalSales" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}"/> + <selectOption stepKey="selectTaxTotalSales" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalSales}}" userInput="Yes"/> + <uncheckOption stepKey="clickDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummarySales}}"/> + <selectOption stepKey="selectDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummarySales}}" userInput="Yes"/> + <uncheckOption stepKey="clickDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxSales}}"/> + <selectOption stepKey="selectDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxSales}}" userInput="Yes"/> + + <!-- Save the settings --> + <scrollToTopOfPage stepKey="scrollToTop"/> + <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> + <waitForPageLoad stepKey="waitForTaxSaved"/> + <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/SetDefaultShippingTaxClassActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/SetDefaultShippingTaxClassActionGroup.xml new file mode 100644 index 0000000000000..25e2b2d376151 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/SetDefaultShippingTaxClassActionGroup.xml @@ -0,0 +1,43 @@ +<?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="SetDefaultShippingTaxClassActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page via the Admin Side Menu. Sets the 'Tax Class for Shipping' to the System Default. Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + + <!--Select Configuration menu from Store--> + <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES"/> + <waitForPageLoad stepKey="waitForConfiguration"/> + <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations"/> + <waitForPageLoad stepKey="waitForSales"/> + + <!--Double click the same to fix flaky issue with redirection to Dashboard--> + <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES1"/> + <waitForPageLoad stepKey="waitForConfiguration1"/> + <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations1"/> + <waitForPageLoad stepKey="waitForSales1"/> + + <!--Change default tax class for Shipping on Taxable Goods--> + <click selector="{{ConfigurationListSection.sales}}" stepKey="clickOnSales"/> + <waitForPageLoad stepKey="waitForPaymentMethods"/> + <click selector="{{AdminConfigureTaxSection.salesTax}}" stepKey="clickOnTax"/> + <waitForPageLoad stepKey="waitForTax"/> + <seeElement selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="taxClassSectionC"/> + <click selector="{{AdminConfigureTaxSection.taxShippingClassSystem}}" stepKey="checkSystemDefaultValue"/> + <click selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="closeTaxClassSection"/> + + <!-- Save the settings --> + <scrollToTopOfPage stepKey="scrollToTop"/> + <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> + <waitForPageLoad stepKey="waitForTaxSaved"/> + <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml index 628d189823a52..98f5401066063 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml @@ -25,11 +25,11 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Go to tax rule page --> - <actionGroup ref="addNewTaxRuleActionGroup" stepKey="addFirstTaxRuleActionGroup"/> + <actionGroup ref="AddNewTaxRuleActionGroup" stepKey="addFirstTaxRuleActionGroup"/> <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="TaxRule1"/> <!-- Add NY and CA tax rules --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addNYTaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate"> <argument name="taxCode" value="SimpleTaxWithZipCode"/> </actionGroup> @@ -43,10 +43,10 @@ <waitForPageLoad stepKey="waitForNewTaxRuleCreated"/> <!-- Go to tax rule page to create second Tax Rule--> - <actionGroup ref="addNewTaxRuleActionGroup" stepKey="addSecondTaxRuleActionGroup"/> + <actionGroup ref="AddNewTaxRuleActionGroup" stepKey="addSecondTaxRuleActionGroup"/> <fillField stepKey="fillSecondRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="TaxRule2"/> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addCATaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addCATaxRate"> <argument name="taxCode" value="SimpleSecondTaxWithZipCode"/> </actionGroup> @@ -211,11 +211,11 @@ <deleteData createDataKey="secondProduct" stepKey="deleteSecondProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <actionGroup ref="deleteProductTaxClass" stepKey="deleteFirstProductTaxClass"> + <actionGroup ref="DeleteProductTaxClassActionGroup" stepKey="deleteFirstProductTaxClass"> <argument name="taxClassName" value="TaxClasses1"/> </actionGroup> - <actionGroup ref="deleteProductTaxClass" stepKey="deleteSecondProductTaxClass"> + <actionGroup ref="DeleteProductTaxClassActionGroup" stepKey="deleteSecondProductTaxClass"> <argument name="taxClassName" value="TaxClasses2"/> </actionGroup> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml index 38cc687ff53a4..1bc1134f58163 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml @@ -95,7 +95,7 @@ <argument name="name" value="{{SimpleTaxNY.state}}"/> <argument name="searchInput" value="{{AdminSecondaryGridSection.taxIdentifierSearch}}"/> </actionGroup> - <actionGroup ref="deleteProductTaxClass" stepKey="deleteFirstProductTaxClass"> + <actionGroup ref="DeleteProductTaxClassActionGroup" stepKey="deleteFirstProductTaxClass"> <argument name="taxClassName" value="NewTaxClass"/> </actionGroup> <!--logout--> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml index 05ced7e61b3b7..33b82b3d0464f 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml @@ -23,7 +23,7 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <!-- Fill in rules to display tax in the cart --> - <actionGroup ref="editTaxConfigurationByUI" stepKey="fillDefaultTaxForms"/> + <actionGroup ref="EditTaxConfigurationByUIActionGroup" stepKey="fillDefaultTaxForms"/> <!-- Go to tax rule page --> <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> @@ -32,11 +32,11 @@ <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="SampleRule"/> <!-- Add NY and CA tax rules --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addNYTaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate"> <argument name="taxCode" value="SimpleTaxNY"/> </actionGroup> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addCATaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addCATaxRate"> <argument name="taxCode" value="SimpleTaxCA"/> </actionGroup> @@ -76,7 +76,7 @@ </actionGroup> <!-- Ensure tax won't be shown in the cart --> - <actionGroup ref="changeToDefaultTaxConfigurationUI" stepKey="changeToDefaultTaxConfiguration"/> + <actionGroup ref="ChangeToDefaultTaxConfigurationUIActionGroup" stepKey="changeToDefaultTaxConfiguration"/> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> @@ -141,7 +141,7 @@ <createData entity="VirtualProduct" stepKey="virtualProduct1"/> <!-- Fill in rules to display tax in the cart --> - <actionGroup ref="editTaxConfigurationByUI" stepKey="fillDefaultTaxForms"/> + <actionGroup ref="EditTaxConfigurationByUIActionGroup" stepKey="fillDefaultTaxForms"/> <!-- Go to tax rule page --> <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> @@ -150,11 +150,11 @@ <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="SampleRule"/> <!-- Add NY and CA tax rules --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addNYTaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate"> <argument name="taxCode" value="SimpleTaxNY"/> </actionGroup> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addCATaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addCATaxRate"> <argument name="taxCode" value="SimpleTaxCA"/> </actionGroup> @@ -194,7 +194,7 @@ </actionGroup> <!-- Ensure tax won't be shown in the cart --> - <actionGroup ref="changeToDefaultTaxConfigurationUI" stepKey="changeToDefaultTaxConfiguration"/> + <actionGroup ref="ChangeToDefaultTaxConfigurationUIActionGroup" stepKey="changeToDefaultTaxConfiguration"/> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> <deleteData createDataKey="virtualProduct1" stepKey="deleteVirtualProduct1"/> @@ -257,7 +257,7 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <!-- Fill in rules to display tax in the cart --> - <actionGroup ref="editTaxConfigurationByUI" stepKey="fillDefaultTaxForms"/> + <actionGroup ref="EditTaxConfigurationByUIActionGroup" stepKey="fillDefaultTaxForms"/> <!-- Go to tax rule page --> <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> @@ -266,11 +266,11 @@ <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="SampleRule"/> <!-- Add NY and CA tax rules --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addNYTaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate"> <argument name="taxCode" value="SimpleTaxNY"/> </actionGroup> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addCATaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addCATaxRate"> <argument name="taxCode" value="SimpleTaxCA"/> </actionGroup> @@ -301,7 +301,7 @@ </actionGroup> <!-- Ensure tax won't be shown in the cart --> - <actionGroup ref="changeToDefaultTaxConfigurationUI" stepKey="changeToDefaultTaxConfiguration"/> + <actionGroup ref="ChangeToDefaultTaxConfigurationUIActionGroup" stepKey="changeToDefaultTaxConfiguration"/> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> @@ -367,7 +367,7 @@ <createData entity="VirtualProduct" stepKey="virtualProduct1"/> <!-- Fill in rules to display tax in the cart --> - <actionGroup ref="editTaxConfigurationByUI" stepKey="fillDefaultTaxForms"/> + <actionGroup ref="EditTaxConfigurationByUIActionGroup" stepKey="fillDefaultTaxForms"/> <!-- Go to tax rule page --> <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> @@ -376,11 +376,11 @@ <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="SampleRule"/> <!-- Add NY and CA tax rules --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addNYTaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate"> <argument name="taxCode" value="SimpleTaxNY"/> </actionGroup> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addCATaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addCATaxRate"> <argument name="taxCode" value="SimpleTaxCA"/> </actionGroup> @@ -411,7 +411,7 @@ </actionGroup> <!-- Ensure tax won't be shown in the cart --> - <actionGroup ref="changeToDefaultTaxConfigurationUI" stepKey="changeToDefaultTaxConfiguration"/> + <actionGroup ref="ChangeToDefaultTaxConfigurationUIActionGroup" stepKey="changeToDefaultTaxConfiguration"/> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> <deleteData createDataKey="virtualProduct1" stepKey="deleteVirtualProduct1"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest.xml index e7bf08257ea69..e0e411a04d484 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCheckoutTest.xml @@ -23,7 +23,7 @@ <createData entity="VirtualProduct" stepKey="virtualProduct1"/> <!-- Fill in rules to display tax in the cart --> - <actionGroup ref="editTaxConfigurationByUI" stepKey="fillDefaultTaxForms"/> + <actionGroup ref="EditTaxConfigurationByUIActionGroup" stepKey="fillDefaultTaxForms"/> <!-- Go to tax rule page --> <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> @@ -32,11 +32,11 @@ <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="SampleRule"/> <!-- Add NY and CA tax rules --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addNYTaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate"> <argument name="taxCode" value="SimpleTaxNY"/> </actionGroup> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addCATaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addCATaxRate"> <argument name="taxCode" value="SimpleTaxCA"/> </actionGroup> @@ -67,7 +67,7 @@ </actionGroup> <!-- Ensure tax won't be shown in the cart --> - <actionGroup ref="changeToDefaultTaxConfigurationUI" stepKey="changeToDefaultTaxConfiguration"/> + <actionGroup ref="ChangeToDefaultTaxConfigurationUIActionGroup" stepKey="changeToDefaultTaxConfiguration"/> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> <deleteData createDataKey="virtualProduct1" stepKey="deleteVirtualProduct1"/> @@ -127,7 +127,7 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <!-- Fill in rules to display tax in the cart --> - <actionGroup ref="editTaxConfigurationByUI" stepKey="fillDefaultTaxForms"/> + <actionGroup ref="EditTaxConfigurationByUIActionGroup" stepKey="fillDefaultTaxForms"/> <!-- Go to tax rule page --> <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> @@ -136,11 +136,11 @@ <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="SampleRule"/> <!-- Add NY and CA tax rules --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addNYTaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate"> <argument name="taxCode" value="SimpleTaxNY"/> </actionGroup> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addCATaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addCATaxRate"> <argument name="taxCode" value="SimpleTaxCA"/> </actionGroup> @@ -180,7 +180,7 @@ </actionGroup> <!-- Ensure tax won't be shown in the cart --> - <actionGroup ref="changeToDefaultTaxConfigurationUI" stepKey="changeToDefaultTaxConfiguration"/> + <actionGroup ref="ChangeToDefaultTaxConfigurationUIActionGroup" stepKey="changeToDefaultTaxConfiguration"/> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> @@ -247,7 +247,7 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <!-- Fill in rules to display tax in the cart --> - <actionGroup ref="editTaxConfigurationByUI" stepKey="fillDefaultTaxForms"/> + <actionGroup ref="EditTaxConfigurationByUIActionGroup" stepKey="fillDefaultTaxForms"/> <!-- Go to tax rule page --> <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> @@ -256,11 +256,11 @@ <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="SampleRule"/> <!-- Add NY and CA tax rules --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addNYTaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate"> <argument name="taxCode" value="SimpleTaxNY"/> </actionGroup> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addCATaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addCATaxRate"> <argument name="taxCode" value="SimpleTaxCA"/> </actionGroup> @@ -291,7 +291,7 @@ </actionGroup> <!-- Ensure tax won't be shown in the cart --> - <actionGroup ref="changeToDefaultTaxConfigurationUI" stepKey="changeToDefaultTaxConfiguration"/> + <actionGroup ref="ChangeToDefaultTaxConfigurationUIActionGroup" stepKey="changeToDefaultTaxConfiguration"/> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> @@ -362,7 +362,7 @@ <createData entity="VirtualProduct" stepKey="virtualProduct1"/> <!-- Fill in rules to display tax in the cart --> - <actionGroup ref="editTaxConfigurationByUI" stepKey="fillDefaultTaxForms"/> + <actionGroup ref="EditTaxConfigurationByUIActionGroup" stepKey="fillDefaultTaxForms"/> <!-- Go to tax rule page --> <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> @@ -371,11 +371,11 @@ <fillField stepKey="fillRuleName" selector="{{AdminTaxRulesSection.ruleName}}" userInput="SampleRule"/> <!-- Add NY and CA tax rules --> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addNYTaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addNYTaxRate"> <argument name="taxCode" value="SimpleTaxNY"/> </actionGroup> - <actionGroup ref="addNewTaxRateNoZip" stepKey="addCATaxRate"> + <actionGroup ref="AddNewTaxRateNoZipActionGroup" stepKey="addCATaxRate"> <argument name="taxCode" value="SimpleTaxCA"/> </actionGroup> @@ -415,7 +415,7 @@ </actionGroup> <!-- Ensure tax won't be shown in the cart --> - <actionGroup ref="changeToDefaultTaxConfigurationUI" stepKey="changeToDefaultTaxConfiguration"/> + <actionGroup ref="ChangeToDefaultTaxConfigurationUIActionGroup" stepKey="changeToDefaultTaxConfiguration"/> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> <deleteData createDataKey="virtualProduct1" stepKey="deleteVirtualProduct1"/> From f15a22068807efd413de7826fd38ea0e8da2a8f2 Mon Sep 17 00:00:00 2001 From: Subash Natarajan <subash.natarajan@ziffity.com> Date: Thu, 28 Nov 2019 19:15:51 +0530 Subject: [PATCH 309/595] PHPDoc block updates & reverted observer fix --- .../Magento/Customer/Controller/Adminhtml/Group/Delete.php | 4 +++- .../Magento/Customer/Observer/AfterAddressSaveObserver.php | 6 +++--- .../Test/Unit/Observer/AfterAddressSaveObserverTest.php | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Group/Delete.php b/app/code/Magento/Customer/Controller/Adminhtml/Group/Delete.php index 819a49178a24d..661ef1cace69b 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Group/Delete.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Group/Delete.php @@ -1,6 +1,5 @@ <?php /** - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ @@ -9,6 +8,9 @@ use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Framework\Exception\NoSuchEntityException; +/** + * Class Delete + */ class Delete extends \Magento\Customer\Controller\Adminhtml\Group implements HttpPostActionInterface { /** diff --git a/app/code/Magento/Customer/Observer/AfterAddressSaveObserver.php b/app/code/Magento/Customer/Observer/AfterAddressSaveObserver.php index 8677abfa89904..41311abee5da8 100644 --- a/app/code/Magento/Customer/Observer/AfterAddressSaveObserver.php +++ b/app/code/Magento/Customer/Observer/AfterAddressSaveObserver.php @@ -255,7 +255,7 @@ protected function addValidMessage($customerAddress, $validationResult) : (string)__('You will not be charged tax.'); } - $this->messageManager->addSuccessMessage(implode(' ', $message)); + $this->messageManager->addSuccess(implode(' ', $message)); return $this; } @@ -280,7 +280,7 @@ protected function addInvalidMessage($customerAddress) $message[] = (string)__('You will be charged tax.'); } - $this->messageManager->addErrorMessage(implode(' ', $message)); + $this->messageManager->addError(implode(' ', $message)); return $this; } @@ -307,7 +307,7 @@ protected function addErrorMessage($customerAddress) $email = $this->scopeConfig->getValue('trans_email/ident_support/email', ScopeInterface::SCOPE_STORE); $message[] = (string)__('If you believe this is an error, please contact us at %1', $email); - $this->messageManager->addErrorMessage(implode(' ', $message)); + $this->messageManager->addError(implode(' ', $message)); return $this; } diff --git a/app/code/Magento/Customer/Test/Unit/Observer/AfterAddressSaveObserverTest.php b/app/code/Magento/Customer/Test/Unit/Observer/AfterAddressSaveObserverTest.php index 4501b611aa11f..8592d1bda66c1 100644 --- a/app/code/Magento/Customer/Test/Unit/Observer/AfterAddressSaveObserverTest.php +++ b/app/code/Magento/Customer/Test/Unit/Observer/AfterAddressSaveObserverTest.php @@ -575,7 +575,7 @@ public function testAfterAddressSaveNewGroup( if ($resultValidMessage) { $this->messageManager->expects($this->once()) - ->method('addSuccessMessage') + ->method('addSuccess') ->with($resultValidMessage) ->willReturnSelf(); } @@ -585,7 +585,7 @@ public function testAfterAddressSaveNewGroup( ->with($vatId) ->willReturn($vatId); $this->messageManager->expects($this->once()) - ->method('addErrorMessage') + ->method('addError') ->with($resultInvalidMessage) ->willReturnSelf(); } @@ -595,7 +595,7 @@ public function testAfterAddressSaveNewGroup( ->with('trans_email/ident_support/email', ScopeInterface::SCOPE_STORE) ->willReturn('admin@example.com'); $this->messageManager->expects($this->once()) - ->method('addErrorMessage') + ->method('addError') ->with($resultErrorMessage) ->willReturnSelf(); } From 31a2890341cce1c66ace8d808288a5ca309129c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 14:59:57 +0100 Subject: [PATCH 310/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../AddSwatchToProductActionGroup.xml | 132 ------------------ .../AddTextSwatchToProductActionGroup.xml | 46 ++++++ .../AddVisualSwatchToProductActionGroup.xml | 66 +++++++++ ...ProductWithStorefrontConfigActionGroup.xml | 31 ++++ ...torefrontPreviewImageConfigActionGroup.xml | 19 +++ ...dSwatchOptionAndFillFieldsActionGroup.xml} | 10 -- ...inUpdateProductPreviewImageActionGroup.xml | 17 +++ ...AssertStorefrontSwatchColorActionGroup.xml | 26 ++++ .../AssertSwatchColorActionGroup.xml | 26 ++++ .../ActionGroup/ColorPickerActionGroup.xml | 68 --------- .../OpenSwatchMenuByIndexActionGroup.xml | 22 +++ .../SetColorPickerByHexActionGroup.xml | 24 ++++ ...roductWithSwatchesToTheCartActionGroup.xml | 21 +++ ...rontAssertSwatchOptionPriceActionGroup.xml | 19 +++ .../StorefrontProductActionGroup.xml | 34 ----- ...ctSwatchOptionOnProductPageActionGroup.xml | 18 +++ ...nOnProductPageAndCheckImageActionGroup.xml | 17 +++ ...gurableProductWithSwatchesActionGroup.xml} | 18 +-- .../Mftf/Test/AdminCreateImageSwatchTest.xml | 6 +- .../Mftf/Test/AdminCreateVisualSwatchTest.xml | 24 ++-- ...ateVisualSwatchWithNonValidOptionsTest.xml | 14 +- .../Test/AdminDisablingSwatchTooltipsTest.xml | 8 +- ...uctWithAttributesImagesAndSwatchesTest.xml | 6 +- ...figurableProductSwatchMinimumPriceTest.xml | 6 +- ...nChangeProductOptionsUsingSwatchesTest.xml | 2 +- .../StorefrontFilterByImageSwatchTest.xml | 4 +- .../StorefrontFilterByVisualSwatchTest.xml | 8 +- ...oductImagesMatchingProductSwatchesTest.xml | 4 +- 28 files changed, 396 insertions(+), 300 deletions(-) delete mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddSwatchToProductActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddTextSwatchToProductActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchToProductActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchToProductWithStorefrontConfigActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchWithProductWithStorefrontPreviewImageConfigActionGroup.xml rename app/code/Magento/Swatches/Test/Mftf/ActionGroup/{AdminEditPropertiesTabForSwatchProductAtributeActionGroup.xml => AdminAddSwatchOptionAndFillFieldsActionGroup.xml} (72%) create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/AdminUpdateProductPreviewImageActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/AssertStorefrontSwatchColorActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/AssertSwatchColorActionGroup.xml delete mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/ColorPickerActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/OpenSwatchMenuByIndexActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/SetColorPickerByHexActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAddProductWithSwatchesToTheCartActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAssertSwatchOptionPriceActionGroup.xml delete mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontSelectSwatchOptionOnProductPageActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontSelectSwatchOptionOnProductPageAndCheckImageActionGroup.xml rename app/code/Magento/Swatches/Test/Mftf/ActionGroup/{StorefrontAddProductWithSwatchAttributeToTheCartActionGroup.xml => StorefrontUpdateCartConfigurableProductWithSwatchesActionGroup.xml} (54%) diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddSwatchToProductActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddSwatchToProductActionGroup.xml deleted file mode 100644 index 4a67c0dfbe8e4..0000000000000 --- a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddSwatchToProductActionGroup.xml +++ /dev/null @@ -1,132 +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="AddVisualSwatchToProductActionGroup"> - <annotations> - <description>Adds the provided Visual Swatch Attribute and Options (2) to a Product on the Admin Product creation/edit page. Clicks on Save. Validates that the Success Message is present.</description> - </annotations> - <arguments> - <argument name="attribute" defaultValue="visualSwatchAttribute"/> - <argument name="option1" defaultValue="visualSwatchOption1"/> - <argument name="option2" defaultValue="visualSwatchOption2"/> - </arguments> - - <seeInCurrentUrl url="{{ProductCatalogPage.url}}" stepKey="seeOnProductEditPage"/> - <conditionalClick selector="{{AdminProductFormConfigurationsSection.sectionHeader}}" dependentSelector="{{AdminProductFormConfigurationsSection.createConfigurations}}" visible="false" stepKey="openConfigurationSection"/> - <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="openConfigurationPanel"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="waitForSlideOut"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickCreateNewAttribute"/> - <waitForPageLoad stepKey="waitForIFrame"/> - - <switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/> - <fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{attribute.default_label}}" stepKey="fillDefaultLabel"/> - <selectOption selector="{{AdminNewAttributePanel.inputType}}" userInput="{{attribute.input_type}}" stepKey="selectInputType"/> - <!--Add swatch options--> - <click selector="{{AdminNewAttributePanel.addVisualSwatchOption}}" stepKey="clickAddSwatch1"/> - <waitForElementVisible selector="{{AdminNewAttributePanel.visualSwatchOptionAdminValue('0')}}" stepKey="waitForOption1Row"/> - <fillField selector="{{AdminNewAttributePanel.visualSwatchOptionAdminValue('0')}}" userInput="{{option1.admin_label}}" stepKey="fillAdminLabel1"/> - <fillField selector="{{AdminNewAttributePanel.visualSwatchOptionDefaultStoreValue('0')}}" userInput="{{option1.default_label}}" stepKey="fillDefaultStoreLabel1"/> - <click selector="{{AdminNewAttributePanel.addVisualSwatchOption}}" stepKey="clickAddSwatch2"/> - <waitForElementVisible selector="{{AdminNewAttributePanel.visualSwatchOptionAdminValue('1')}}" stepKey="waitForOption2Row"/> - <fillField selector="{{AdminNewAttributePanel.visualSwatchOptionAdminValue('1')}}" userInput="{{option2.admin_label}}" stepKey="fillAdminLabel2"/> - <fillField selector="{{AdminNewAttributePanel.visualSwatchOptionDefaultStoreValue('1')}}" userInput="{{option2.default_label}}" stepKey="fillDefaultStoreLabel2"/> - - <!--Save attribute--> - <click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/> - <waitForPageLoad stepKey="waitForSaveAttribute"/> - <switchToIFrame stepKey="switchOutOfIFrame"/> - - <!--Find attribute in grid and select--> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> - <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="clickOnFilters"/> - <fillField selector="{{AdminDataGridHeaderSection.attributeCodeFilterInput}}" userInput="{{attribute.default_label}}" stepKey="fillFilterAttributeCodeField"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <click selector="{{AdminDataGridTableSection.rowCheckbox('1')}}" stepKey="clickOnFirstCheckbox"/> - - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep1"/> - - <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attribute.default_label)}}" stepKey="clickSelectAll"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep2"/> - - <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="100" stepKey="enterAttributeQuantity"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextStep3"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="generateProducts"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> - <seeElement selector="{{AdminMessagesSection.success}}" stepKey="seeSaveProductMessage"/> - </actionGroup> - - <actionGroup name="AddVisualSwatchToProductWithStorefrontConfigActionGroup" extends="AddVisualSwatchToProductActionGroup"> - <annotations> - <description>EXTENDS: AddVisualSwatchToProductActionGroup. Add the provided Visual Swatch Attribute and Options (2) to a Product with Storefront Configurations.</description> - </annotations> - <arguments> - <argument name="attribute" defaultValue="visualSwatchAttribute"/> - <argument name="option1" defaultValue="visualSwatchOption1"/> - <argument name="option2" defaultValue="visualSwatchOption2"/> - </arguments> - - <!-- Go to Storefront Properties tab --> - <click selector="{{AdminNewAttributePanel.storefrontPropertiesTab}}" stepKey="goToStorefrontPropertiesTab" after="fillDefaultStoreLabel2"/> - <waitForElementVisible selector="{{AdminNewAttributePanel.storefrontPropertiesTitle}}" stepKey="waitTabLoad" after="goToStorefrontPropertiesTab"/> - <selectOption selector="{{AdminNewAttributePanel.useInSearch}}" stepKey="switchOnUsInSearch" userInput="Yes" after="waitTabLoad"/> - <selectOption selector="{{AdminNewAttributePanel.visibleInAdvancedSearch}}" stepKey="switchOnVisibleInAdvancedSearch" userInput="Yes" after="switchOnUsInSearch"/> - <selectOption selector="{{AdminNewAttributePanel.comparableOnStorefront}}" stepKey="switchOnComparableOnStorefront" userInput="Yes" after="switchOnVisibleInAdvancedSearch"/> - <selectOption selector="{{AdminNewAttributePanel.useInLayeredNavigation}}" stepKey="selectUseInLayer" userInput="Filterable (with results)" after="switchOnComparableOnStorefront"/> - <selectOption selector="{{AdminNewAttributePanel.visibleOnCatalogPagesOnStorefront}}" stepKey="switchOnVisibleOnCatalogPagesOnStorefront" userInput="Yes" after="selectUseInLayer"/> - <selectOption selector="{{AdminNewAttributePanel.useInProductListing}}" stepKey="switchOnUsedInProductListing" userInput="Yes" after="switchOnVisibleOnCatalogPagesOnStorefront"/> - </actionGroup> - - <actionGroup name="AddVisualSwatchWithProductWithStorefrontPreviewImageConfigActionGroup" extends="AddVisualSwatchToProductActionGroup"> - <selectOption selector="{{AdminNewAttributePanel.updateProductPreviewImage}}" userInput="Yes" stepKey="selectUpdatePreviewImage" after="selectInputType"/> - <click selector="{{AdminNewAttributePanel.storefrontPropertiesTab}}" stepKey="goToStorefrontPropertiesTab" after="fillDefaultStoreLabel2"/> - <waitForElementVisible selector="{{AdminNewAttributePanel.storefrontPropertiesTitle}}" after="goToStorefrontPropertiesTab" stepKey="waitTabLoad"/> - <selectOption selector="{{AdminNewAttributePanel.useInLayeredNavigation}}" userInput="Filterable (with results)" stepKey="selectUseInLayer" after="waitTabLoad"/> - <selectOption selector="{{AdminNewAttributePanel.useInProductListing}}" userInput="Yes" stepKey="switchOnUsedInProductListing" after="selectUseInLayer"/> - <selectOption selector="{{AdminNewAttributePanel.usedForStoringInProductListing}}" userInput="Yes" stepKey="switchOnUsedForStoringInProductListing" after="switchOnUsedInProductListing"/> - </actionGroup> - - <actionGroup name="AddTextSwatchToProductActionGroup"> - <annotations> - <description>Add text swatch property attribute.</description> - </annotations> - <arguments> - <argument name="attributeName" defaultValue="{{textSwatchAttribute.default_label}}" type="string"/> - <argument name="attributeCode" defaultValue="{{textSwatchAttribute.attribute_code}}" type="string"/> - <argument name="option1" defaultValue="textSwatchOption1" type="string"/> - <argument name="option2" defaultValue="textSwatchOption2" type="string"/> - <argument name="option3" defaultValue="textSwatchOption3" type="string"/> - <argument name="usedInProductListing" defaultValue="No" type="string"/> - </arguments> - - <amOnPage url="{{ProductAttributePage.url}}" stepKey="goToNewProductAttributePage"/> - <waitForPageLoad stepKey="waitForNewProductAttributePage"/> - <fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{attributeName}}" stepKey="fillDefaultLabel"/> - <selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="{{textSwatchAttribute.input_type}}" stepKey="selectInputType"/> - <click selector="{{AdminManageSwatchSection.addSwatchText}}" stepKey="clickAddSwatch1"/> - <fillField selector="{{AdminManageSwatchSection.swatchTextByIndex('0')}}" userInput="{{option1}}" stepKey="fillSwatch1"/> - <fillField selector="{{AdminManageSwatchSection.swatchAdminDescriptionByIndex('0')}}" userInput="{{option1}}" stepKey="fillSwatch1Description"/> - <click selector="{{AdminManageSwatchSection.addSwatchText}}" stepKey="clickAddSwatch2"/> - <fillField selector="{{AdminManageSwatchSection.swatchTextByIndex('1')}}" userInput="{{option2}}" stepKey="fillSwatch2"/> - <fillField selector="{{AdminManageSwatchSection.swatchAdminDescriptionByIndex('1')}}" userInput="{{option2}}" stepKey="fillSwatch2Description"/> - <click selector="{{AdminManageSwatchSection.addSwatchText}}" stepKey="clickAddSwatch3"/> - <fillField selector="{{AdminManageSwatchSection.swatchTextByIndex('2')}}" userInput="{{option3}}" stepKey="fillSwatch3"/> - <fillField selector="{{AdminManageSwatchSection.swatchAdminDescriptionByIndex('2')}}" userInput="{{option3}}" stepKey="fillSwatch3Description"/> - <click selector="{{AttributePropertiesSection.AdvancedProperties}}" stepKey="expandAdvancedProperties"/> - <selectOption selector="{{AttributePropertiesSection.Scope}}" userInput="1" stepKey="selectGlobalScope"/> - <fillField selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attributeCode}}" stepKey="fillAttributeCodeField"/> - <scrollToTopOfPage stepKey="scrollToTabs"/> - <click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStorefrontPropertiesTab"/> - <waitForElementVisible selector="{{AdvancedAttributePropertiesSection.UseInProductListing}}" stepKey="waitForTabSwitch"/> - <selectOption selector="{{AdvancedAttributePropertiesSection.UseInProductListing}}" userInput="{{usedInProductListing}}" stepKey="useInProductListing"/> - <click selector="{{AttributePropertiesSection.SaveAndEdit}}" stepKey="clickSave"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddTextSwatchToProductActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddTextSwatchToProductActionGroup.xml new file mode 100644 index 0000000000000..97a391137d8e3 --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddTextSwatchToProductActionGroup.xml @@ -0,0 +1,46 @@ +<?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="AddTextSwatchToProductActionGroup"> + <annotations> + <description>Add text swatch property attribute.</description> + </annotations> + <arguments> + <argument name="attributeName" defaultValue="{{textSwatchAttribute.default_label}}" type="string"/> + <argument name="attributeCode" defaultValue="{{textSwatchAttribute.attribute_code}}" type="string"/> + <argument name="option1" defaultValue="textSwatchOption1" type="string"/> + <argument name="option2" defaultValue="textSwatchOption2" type="string"/> + <argument name="option3" defaultValue="textSwatchOption3" type="string"/> + <argument name="usedInProductListing" defaultValue="No" type="string"/> + </arguments> + + <amOnPage url="{{ProductAttributePage.url}}" stepKey="goToNewProductAttributePage"/> + <waitForPageLoad stepKey="waitForNewProductAttributePage"/> + <fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{attributeName}}" stepKey="fillDefaultLabel"/> + <selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="{{textSwatchAttribute.input_type}}" stepKey="selectInputType"/> + <click selector="{{AdminManageSwatchSection.addSwatchText}}" stepKey="clickAddSwatch1"/> + <fillField selector="{{AdminManageSwatchSection.swatchTextByIndex('0')}}" userInput="{{option1}}" stepKey="fillSwatch1"/> + <fillField selector="{{AdminManageSwatchSection.swatchAdminDescriptionByIndex('0')}}" userInput="{{option1}}" stepKey="fillSwatch1Description"/> + <click selector="{{AdminManageSwatchSection.addSwatchText}}" stepKey="clickAddSwatch2"/> + <fillField selector="{{AdminManageSwatchSection.swatchTextByIndex('1')}}" userInput="{{option2}}" stepKey="fillSwatch2"/> + <fillField selector="{{AdminManageSwatchSection.swatchAdminDescriptionByIndex('1')}}" userInput="{{option2}}" stepKey="fillSwatch2Description"/> + <click selector="{{AdminManageSwatchSection.addSwatchText}}" stepKey="clickAddSwatch3"/> + <fillField selector="{{AdminManageSwatchSection.swatchTextByIndex('2')}}" userInput="{{option3}}" stepKey="fillSwatch3"/> + <fillField selector="{{AdminManageSwatchSection.swatchAdminDescriptionByIndex('2')}}" userInput="{{option3}}" stepKey="fillSwatch3Description"/> + <click selector="{{AttributePropertiesSection.AdvancedProperties}}" stepKey="expandAdvancedProperties"/> + <selectOption selector="{{AttributePropertiesSection.Scope}}" userInput="1" stepKey="selectGlobalScope"/> + <fillField selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attributeCode}}" stepKey="fillAttributeCodeField"/> + <scrollToTopOfPage stepKey="scrollToTabs"/> + <click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStorefrontPropertiesTab"/> + <waitForElementVisible selector="{{AdvancedAttributePropertiesSection.UseInProductListing}}" stepKey="waitForTabSwitch"/> + <selectOption selector="{{AdvancedAttributePropertiesSection.UseInProductListing}}" userInput="{{usedInProductListing}}" stepKey="useInProductListing"/> + <click selector="{{AttributePropertiesSection.SaveAndEdit}}" stepKey="clickSave"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchToProductActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchToProductActionGroup.xml new file mode 100644 index 0000000000000..670c343b609cf --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchToProductActionGroup.xml @@ -0,0 +1,66 @@ +<?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="AddVisualSwatchToProductActionGroup"> + <annotations> + <description>Adds the provided Visual Swatch Attribute and Options (2) to a Product on the Admin Product creation/edit page. Clicks on Save. Validates that the Success Message is present.</description> + </annotations> + <arguments> + <argument name="attribute" defaultValue="visualSwatchAttribute"/> + <argument name="option1" defaultValue="visualSwatchOption1"/> + <argument name="option2" defaultValue="visualSwatchOption2"/> + </arguments> + + <seeInCurrentUrl url="{{ProductCatalogPage.url}}" stepKey="seeOnProductEditPage"/> + <conditionalClick selector="{{AdminProductFormConfigurationsSection.sectionHeader}}" dependentSelector="{{AdminProductFormConfigurationsSection.createConfigurations}}" visible="false" stepKey="openConfigurationSection"/> + <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="openConfigurationPanel"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="waitForSlideOut"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickCreateNewAttribute"/> + <waitForPageLoad stepKey="waitForIFrame"/> + + <switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/> + <fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{attribute.default_label}}" stepKey="fillDefaultLabel"/> + <selectOption selector="{{AdminNewAttributePanel.inputType}}" userInput="{{attribute.input_type}}" stepKey="selectInputType"/> + <!--Add swatch options--> + <click selector="{{AdminNewAttributePanel.addVisualSwatchOption}}" stepKey="clickAddSwatch1"/> + <waitForElementVisible selector="{{AdminNewAttributePanel.visualSwatchOptionAdminValue('0')}}" stepKey="waitForOption1Row"/> + <fillField selector="{{AdminNewAttributePanel.visualSwatchOptionAdminValue('0')}}" userInput="{{option1.admin_label}}" stepKey="fillAdminLabel1"/> + <fillField selector="{{AdminNewAttributePanel.visualSwatchOptionDefaultStoreValue('0')}}" userInput="{{option1.default_label}}" stepKey="fillDefaultStoreLabel1"/> + <click selector="{{AdminNewAttributePanel.addVisualSwatchOption}}" stepKey="clickAddSwatch2"/> + <waitForElementVisible selector="{{AdminNewAttributePanel.visualSwatchOptionAdminValue('1')}}" stepKey="waitForOption2Row"/> + <fillField selector="{{AdminNewAttributePanel.visualSwatchOptionAdminValue('1')}}" userInput="{{option2.admin_label}}" stepKey="fillAdminLabel2"/> + <fillField selector="{{AdminNewAttributePanel.visualSwatchOptionDefaultStoreValue('1')}}" userInput="{{option2.default_label}}" stepKey="fillDefaultStoreLabel2"/> + + <!--Save attribute--> + <click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/> + <waitForPageLoad stepKey="waitForSaveAttribute"/> + <switchToIFrame stepKey="switchOutOfIFrame"/> + + <!--Find attribute in grid and select--> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="clickOnFilters"/> + <fillField selector="{{AdminDataGridHeaderSection.attributeCodeFilterInput}}" userInput="{{attribute.default_label}}" stepKey="fillFilterAttributeCodeField"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <click selector="{{AdminDataGridTableSection.rowCheckbox('1')}}" stepKey="clickOnFirstCheckbox"/> + + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep1"/> + + <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attribute.default_label)}}" stepKey="clickSelectAll"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep2"/> + + <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="100" stepKey="enterAttributeQuantity"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextStep3"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="generateProducts"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> + <seeElement selector="{{AdminMessagesSection.success}}" stepKey="seeSaveProductMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchToProductWithStorefrontConfigActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchToProductWithStorefrontConfigActionGroup.xml new file mode 100644 index 0000000000000..71ce5ebd7df30 --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchToProductWithStorefrontConfigActionGroup.xml @@ -0,0 +1,31 @@ +<?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="AddVisualSwatchToProductWithStorefrontConfigActionGroup" extends="AddVisualSwatchToProductActionGroup"> + <annotations> + <description>EXTENDS: AddVisualSwatchToProductActionGroup. Add the provided Visual Swatch Attribute and Options (2) to a Product with Storefront Configurations.</description> + </annotations> + <arguments> + <argument name="attribute" defaultValue="visualSwatchAttribute"/> + <argument name="option1" defaultValue="visualSwatchOption1"/> + <argument name="option2" defaultValue="visualSwatchOption2"/> + </arguments> + + <!-- Go to Storefront Properties tab --> + <click selector="{{AdminNewAttributePanel.storefrontPropertiesTab}}" stepKey="goToStorefrontPropertiesTab" after="fillDefaultStoreLabel2"/> + <waitForElementVisible selector="{{AdminNewAttributePanel.storefrontPropertiesTitle}}" stepKey="waitTabLoad" after="goToStorefrontPropertiesTab"/> + <selectOption selector="{{AdminNewAttributePanel.useInSearch}}" stepKey="switchOnUsInSearch" userInput="Yes" after="waitTabLoad"/> + <selectOption selector="{{AdminNewAttributePanel.visibleInAdvancedSearch}}" stepKey="switchOnVisibleInAdvancedSearch" userInput="Yes" after="switchOnUsInSearch"/> + <selectOption selector="{{AdminNewAttributePanel.comparableOnStorefront}}" stepKey="switchOnComparableOnStorefront" userInput="Yes" after="switchOnVisibleInAdvancedSearch"/> + <selectOption selector="{{AdminNewAttributePanel.useInLayeredNavigation}}" stepKey="selectUseInLayer" userInput="Filterable (with results)" after="switchOnComparableOnStorefront"/> + <selectOption selector="{{AdminNewAttributePanel.visibleOnCatalogPagesOnStorefront}}" stepKey="switchOnVisibleOnCatalogPagesOnStorefront" userInput="Yes" after="selectUseInLayer"/> + <selectOption selector="{{AdminNewAttributePanel.useInProductListing}}" stepKey="switchOnUsedInProductListing" userInput="Yes" after="switchOnVisibleOnCatalogPagesOnStorefront"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchWithProductWithStorefrontPreviewImageConfigActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchWithProductWithStorefrontPreviewImageConfigActionGroup.xml new file mode 100644 index 0000000000000..64c298bdcb16c --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddVisualSwatchWithProductWithStorefrontPreviewImageConfigActionGroup.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="AddVisualSwatchWithProductWithStorefrontPreviewImageConfigActionGroup" extends="AddVisualSwatchToProductActionGroup"> + <selectOption selector="{{AdminNewAttributePanel.updateProductPreviewImage}}" userInput="Yes" stepKey="selectUpdatePreviewImage" after="selectInputType"/> + <click selector="{{AdminNewAttributePanel.storefrontPropertiesTab}}" stepKey="goToStorefrontPropertiesTab" after="fillDefaultStoreLabel2"/> + <waitForElementVisible selector="{{AdminNewAttributePanel.storefrontPropertiesTitle}}" after="goToStorefrontPropertiesTab" stepKey="waitTabLoad"/> + <selectOption selector="{{AdminNewAttributePanel.useInLayeredNavigation}}" userInput="Filterable (with results)" stepKey="selectUseInLayer" after="waitTabLoad"/> + <selectOption selector="{{AdminNewAttributePanel.useInProductListing}}" userInput="Yes" stepKey="switchOnUsedInProductListing" after="selectUseInLayer"/> + <selectOption selector="{{AdminNewAttributePanel.usedForStoringInProductListing}}" userInput="Yes" stepKey="switchOnUsedForStoringInProductListing" after="switchOnUsedInProductListing"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AdminEditPropertiesTabForSwatchProductAtributeActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AdminAddSwatchOptionAndFillFieldsActionGroup.xml similarity index 72% rename from app/code/Magento/Swatches/Test/Mftf/ActionGroup/AdminEditPropertiesTabForSwatchProductAtributeActionGroup.xml rename to app/code/Magento/Swatches/Test/Mftf/ActionGroup/AdminAddSwatchOptionAndFillFieldsActionGroup.xml index 05ab5a53468a2..f31753438569c 100644 --- a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AdminEditPropertiesTabForSwatchProductAtributeActionGroup.xml +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AdminAddSwatchOptionAndFillFieldsActionGroup.xml @@ -8,7 +8,6 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!--You are on ProductAttributePage--> <!--Add new swatch options and fill fields for product attribute --> <actionGroup name="AdminAddSwatchOptionAndFillFieldsActionGroup"> @@ -20,13 +19,4 @@ <fillField selector="{{AdminNewAttributePanel.lastVisualSwatchOptionAdminValue}}" userInput="{{swatchOption.admin_label}}" stepKey="fillAdminLabel"/> <fillField selector="{{AdminNewAttributePanel.lastVisualSwatchOptionDefaultStoreValue}}" userInput="{{swatchOption.default_label}}" stepKey="fillDefaultStoreLabel"/> </actionGroup> - - <!--You are on ProductAttributePage--> - <!--Select value for option "Update Product Preview Image"--> - <actionGroup name="AdminUpdateProductPreviewImageActionGroup"> - <arguments> - <argument name="value" type="string" defaultValue="Yes"/> - </arguments> - <selectOption selector="{{AttributePropertiesSection.UpdateProductPreviewImage}}" userInput="{{value}}" stepKey="setUpdateProductPreviewImage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AdminUpdateProductPreviewImageActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AdminUpdateProductPreviewImageActionGroup.xml new file mode 100644 index 0000000000000..34d053a47a00f --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AdminUpdateProductPreviewImageActionGroup.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="AdminUpdateProductPreviewImageActionGroup"> + <arguments> + <argument name="value" type="string" defaultValue="Yes"/> + </arguments> + <selectOption selector="{{AttributePropertiesSection.UpdateProductPreviewImage}}" userInput="{{value}}" stepKey="setUpdateProductPreviewImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AssertStorefrontSwatchColorActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AssertStorefrontSwatchColorActionGroup.xml new file mode 100644 index 0000000000000..b48494a85ae2c --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AssertStorefrontSwatchColorActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AssertStorefrontSwatchColorActionGroup"> + <annotations> + <description>Validates that the Storefront Product has the provided Swatch with the provided Color.</description> + </annotations> + <arguments> + <argument name="nthSwatch" type="string" defaultValue="1"/> + <argument name="expectedRgb" type="string" defaultValue="rgb(231, 77, 60)"/> + </arguments> + + <grabAttributeFrom selector="{{StorefrontProductInfoMainSection.nthSwatchOption(nthSwatch)}}" userInput="style" stepKey="grabStyle1"/> + <assertEquals stepKey="assertStyle1"> + <actualResult type="string">{$grabStyle1}</actualResult> + <expectedResult type="string">background: center center no-repeat {{expectedRgb}};</expectedResult> + </assertEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AssertSwatchColorActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AssertSwatchColorActionGroup.xml new file mode 100644 index 0000000000000..f978afd7d2ca0 --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AssertSwatchColorActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AssertSwatchColorActionGroup"> + <annotations> + <description>Validates that the provided Color Picker contains the provided Style.</description> + </annotations> + <arguments> + <argument name="nthSwatch" type="string" defaultValue="1"/> + <argument name="expectedStyle" type="string" defaultValue="background: rgb(0, 0, 0);"/> + </arguments> + + <grabAttributeFrom selector="{{AdminManageSwatchSection.nthSwatch(nthSwatch)}}" userInput="style" stepKey="grabStyle1"/> + <assertEquals stepKey="assertStyle1"> + <actualResult type="string">{$grabStyle1}</actualResult> + <expectedResult type="string">{{expectedStyle}}</expectedResult> + </assertEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/ColorPickerActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/ColorPickerActionGroup.xml deleted file mode 100644 index 7cad0048261eb..0000000000000 --- a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/ColorPickerActionGroup.xml +++ /dev/null @@ -1,68 +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="setColorPickerByHex"> - <annotations> - <description>Sets the provided HEX value in the provided Color Picker.</description> - </annotations> - <arguments> - <argument name="nthColorPicker" type="string" defaultValue="1"/> - <argument name="hexColor" type="string" defaultValue="e74c3c"/> - </arguments> - - <!-- This 6x backspace stuff is some magic that is necessary to interact with this field correctly --> - <pressKey selector="{{AdminColorPickerSection.hexByIndex(nthColorPicker)}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,'{{hexColor}}']" stepKey="fillHex1"/> - <click selector="{{AdminColorPickerSection.submitByIndex(nthColorPicker)}}" stepKey="submitColor1"/> - </actionGroup> - - <actionGroup name="assertSwatchColor"> - <annotations> - <description>Validates that the provided Color Picker contains the provided Style.</description> - </annotations> - <arguments> - <argument name="nthSwatch" type="string" defaultValue="1"/> - <argument name="expectedStyle" type="string" defaultValue="background: rgb(0, 0, 0);"/> - </arguments> - - <grabAttributeFrom selector="{{AdminManageSwatchSection.nthSwatch(nthSwatch)}}" userInput="style" stepKey="grabStyle1"/> - <assertEquals stepKey="assertStyle1"> - <actualResult type="string">{$grabStyle1}</actualResult> - <expectedResult type="string">{{expectedStyle}}</expectedResult> - </assertEquals> - </actionGroup> - - <actionGroup name="assertStorefrontSwatchColor"> - <annotations> - <description>Validates that the Storefront Product has the provided Swatch with the provided Color.</description> - </annotations> - <arguments> - <argument name="nthSwatch" type="string" defaultValue="1"/> - <argument name="expectedRgb" type="string" defaultValue="rgb(231, 77, 60)"/> - </arguments> - - <grabAttributeFrom selector="{{StorefrontProductInfoMainSection.nthSwatchOption(nthSwatch)}}" userInput="style" stepKey="grabStyle1"/> - <assertEquals stepKey="assertStyle1"> - <actualResult type="string">{$grabStyle1}</actualResult> - <expectedResult type="string">background: center center no-repeat {{expectedRgb}};</expectedResult> - </assertEquals> - </actionGroup> - - <actionGroup name="openSwatchMenuByIndex"> - <annotations> - <description>Options the Swatch Menu based on the provided Index.</description> - </annotations> - <arguments> - <argument name="index" type="string" defaultValue="0"/> - </arguments> - - <!-- I had to use executeJS to perform the click to get around the use of CSS ::before and ::after --> - <executeJS function="jQuery('#swatch_window_option_option_{{index}}').click()" stepKey="clickSwatch1"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/OpenSwatchMenuByIndexActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/OpenSwatchMenuByIndexActionGroup.xml new file mode 100644 index 0000000000000..b721596789f92 --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/OpenSwatchMenuByIndexActionGroup.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="OpenSwatchMenuByIndexActionGroup"> + <annotations> + <description>Options the Swatch Menu based on the provided Index.</description> + </annotations> + <arguments> + <argument name="index" type="string" defaultValue="0"/> + </arguments> + + <!-- I had to use executeJS to perform the click to get around the use of CSS ::before and ::after --> + <executeJS function="jQuery('#swatch_window_option_option_{{index}}').click()" stepKey="clickSwatch1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/SetColorPickerByHexActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/SetColorPickerByHexActionGroup.xml new file mode 100644 index 0000000000000..396c1cc87c5c4 --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/SetColorPickerByHexActionGroup.xml @@ -0,0 +1,24 @@ +<?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="SetColorPickerByHexActionGroup"> + <annotations> + <description>Sets the provided HEX value in the provided Color Picker.</description> + </annotations> + <arguments> + <argument name="nthColorPicker" type="string" defaultValue="1"/> + <argument name="hexColor" type="string" defaultValue="e74c3c"/> + </arguments> + + <!-- This 6x backspace stuff is some magic that is necessary to interact with this field correctly --> + <pressKey selector="{{AdminColorPickerSection.hexByIndex(nthColorPicker)}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,'{{hexColor}}']" stepKey="fillHex1"/> + <click selector="{{AdminColorPickerSection.submitByIndex(nthColorPicker)}}" stepKey="submitColor1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAddProductWithSwatchesToTheCartActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAddProductWithSwatchesToTheCartActionGroup.xml new file mode 100644 index 0000000000000..64933e184a86d --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAddProductWithSwatchesToTheCartActionGroup.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"> + <!-- Add Configurable Product with Swatch attribute to the cart --> + <actionGroup name="StorefrontAddProductWithSwatchesToTheCartActionGroup" extends="StorefrontAddProductToCartWithQtyActionGroup"> + <arguments> + <argument name="product"/> + <argument name="productOption" type="string"/> + </arguments> + <remove keyForRemoval="seeSuccessSaveMessage"/> + <click selector="{{StorefrontProductInfoMainSection.visualSwatchOption(productOption)}}" after="waitForStorefrontProductPageLoad" stepKey="clickSelectOption"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{product.name}} to your shopping cart." after="waitForSuccessMessage" stepKey="seeAddToCartSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAssertSwatchOptionPriceActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAssertSwatchOptionPriceActionGroup.xml new file mode 100644 index 0000000000000..b4a3708c15659 --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAssertSwatchOptionPriceActionGroup.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="StorefrontAssertSwatchOptionPriceActionGroup"> + <arguments> + <argument name="optionName" type="string"/> + <argument name="optionPrice" type="string"/> + </arguments> + <click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(optionName)}}" stepKey="clickOnOption"/> + <see userInput="{{optionPrice}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeOptionPrice"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml deleted file mode 100644 index 6ca0c220778d6..0000000000000 --- a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml +++ /dev/null @@ -1,34 +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"> - <!--Click a swatch option on product page--> - <actionGroup name="StorefrontSelectSwatchOptionOnProductPage"> - <arguments> - <argument name="optionName" type="string"/> - </arguments> - <click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(optionName)}}" stepKey="clickSwatchOption"/> - </actionGroup> - <actionGroup name="StorefrontAssertSwatchOptionPrice"> - <arguments> - <argument name="optionName" type="string"/> - <argument name="optionPrice" type="string"/> - </arguments> - <click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(optionName)}}" stepKey="clickOnOption"/> - <see userInput="{{optionPrice}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeOptionPrice"/> - </actionGroup> - - <!--Click a swatch option on product page and check active image--> - <actionGroup name="StorefrontSelectSwatchOptionOnProductPageAndCheckImage" extends="StorefrontSelectSwatchOptionOnProductPage"> - <arguments> - <argument name="fileName" type="string" defaultValue="magento-logo"/> - </arguments> - <seeElement selector="{{StorefrontProductMediaSection.productImageActive(fileName)}}" stepKey="seeActiveImageDefault"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontSelectSwatchOptionOnProductPageActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontSelectSwatchOptionOnProductPageActionGroup.xml new file mode 100644 index 0000000000000..53c4adb5e1ab3 --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontSelectSwatchOptionOnProductPageActionGroup.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"> + <!--Click a swatch option on product page--> + <actionGroup name="StorefrontSelectSwatchOptionOnProductPageActionGroup"> + <arguments> + <argument name="optionName" type="string"/> + </arguments> + <click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(optionName)}}" stepKey="clickSwatchOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontSelectSwatchOptionOnProductPageAndCheckImageActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontSelectSwatchOptionOnProductPageAndCheckImageActionGroup.xml new file mode 100644 index 0000000000000..67fd0178be9fa --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontSelectSwatchOptionOnProductPageAndCheckImageActionGroup.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="StorefrontSelectSwatchOptionOnProductPageAndCheckImageActionGroup" extends="StorefrontSelectSwatchOptionOnProductPageActionGroup"> + <arguments> + <argument name="fileName" type="string" defaultValue="magento-logo"/> + </arguments> + <seeElement selector="{{StorefrontProductMediaSection.productImageActive(fileName)}}" stepKey="seeActiveImageDefault"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAddProductWithSwatchAttributeToTheCartActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontUpdateCartConfigurableProductWithSwatchesActionGroup.xml similarity index 54% rename from app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAddProductWithSwatchAttributeToTheCartActionGroup.xml rename to app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontUpdateCartConfigurableProductWithSwatchesActionGroup.xml index 9bd58bff69e5a..2a4f7fd2db62d 100644 --- a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAddProductWithSwatchAttributeToTheCartActionGroup.xml +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontUpdateCartConfigurableProductWithSwatchesActionGroup.xml @@ -7,20 +7,8 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <!-- Add Configurable Product with Swatch attribute to the cart --> - <actionGroup name="StorefrontAddProductWithSwatchesToTheCartActionGroup" extends="StorefrontAddProductToCartWithQtyActionGroup"> - <arguments> - <argument name="product"/> - <argument name="productOption" type="string"/> - </arguments> - <remove keyForRemoval="seeSuccessSaveMessage"/> - <click selector="{{StorefrontProductInfoMainSection.visualSwatchOption(productOption)}}" after="waitForStorefrontProductPageLoad" stepKey="clickSelectOption"/> - <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{product.name}} to your shopping cart." after="waitForSuccessMessage" stepKey="seeAddToCartSuccessMessage"/> - </actionGroup> - - <!-- Update Configurable Product with Swatch attribute in the cart --> - <actionGroup name="StorefrontUpdateCartConfigurableProductWithSwatches"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontUpdateCartConfigurableProductWithSwatchesActionGroup"> <arguments> <argument name="product"/> <argument name="productOption" type="string"/> @@ -32,4 +20,4 @@ <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> <see selector="{{StorefrontMessagesSection.success}}" userInput="{{product.name}} was updated in your shopping cart." stepKey="assertSuccessMessage"/> </actionGroup> -</actionGroups> \ No newline at end of file +</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateImageSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateImageSwatchTest.xml index 0e294153e881e..97d8b9075c014 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateImageSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateImageSwatchTest.xml @@ -40,7 +40,7 @@ <!-- Set swatch image #1 --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch1"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch1"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch1"> <argument name="index" value="0"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthUploadFile('1')}}" stepKey="clickUploadFile1"/> @@ -49,7 +49,7 @@ <!-- Set swatch image #2 --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch2"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch2"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch2"> <argument name="index" value="1"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthUploadFile('2')}}" stepKey="clickUploadFile2"/> @@ -58,7 +58,7 @@ <!-- Set swatch image #3 --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch3"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch3"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch3"> <argument name="index" value="2"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthUploadFile('3')}}" stepKey="clickUploadFile3"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchTest.xml index 65f0e2b09b82a..1c8e86b3765d4 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchTest.xml @@ -50,33 +50,33 @@ <!-- Set swatch #1 using the color picker --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch1"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch1"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch1"> <argument name="index" value="0"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthChooseColor('1')}}" stepKey="clickChooseColor1"/> - <actionGroup ref="setColorPickerByHex" stepKey="fillHex1"> + <actionGroup ref="SetColorPickerByHexActionGroup" stepKey="fillHex1"> <argument name="nthColorPicker" value="1"/> <argument name="hexColor" value="e74c3c"/> </actionGroup> <fillField selector="{{AdminManageSwatchSection.adminInputByIndex('0')}}" userInput="red" stepKey="fillAdmin1"/> <!-- Set swatch #2 using the color picker --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch2"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch2"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch2"> <argument name="index" value="1"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthChooseColor('2')}}" stepKey="clickChooseColor2"/> - <actionGroup ref="setColorPickerByHex" stepKey="fillHex2"> + <actionGroup ref="SetColorPickerByHexActionGroup" stepKey="fillHex2"> <argument name="nthColorPicker" value="2"/> <argument name="hexColor" value="2ecc71"/> </actionGroup> <fillField selector="{{AdminManageSwatchSection.adminInputByIndex('1')}}" userInput="green" stepKey="fillAdmin2"/> <!-- Set swatch #3 using the color picker --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch3"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch3"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch3"> <argument name="index" value="2"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthChooseColor('3')}}" stepKey="clickChooseColor3"/> - <actionGroup ref="setColorPickerByHex" stepKey="fillHex3"> + <actionGroup ref="SetColorPickerByHexActionGroup" stepKey="fillHex3"> <argument name="nthColorPicker" value="3"/> <argument name="hexColor" value="3498db"/> </actionGroup> @@ -88,15 +88,15 @@ <waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccess"/> <!-- Assert that the Save was successful after round trip to server --> - <actionGroup ref="assertSwatchColor" stepKey="assertSwatch1"> + <actionGroup ref="AssertSwatchColorActionGroup" stepKey="assertSwatch1"> <argument name="nthSwatch" value="1"/> <argument name="expectedStyle" value="background: rgb(231, 77, 60);"/> </actionGroup> - <actionGroup ref="assertSwatchColor" stepKey="assertSwatch2"> + <actionGroup ref="AssertSwatchColorActionGroup" stepKey="assertSwatch2"> <argument name="nthSwatch" value="2"/> <argument name="expectedStyle" value="background: rgb(46, 204, 112);"/> </actionGroup> - <actionGroup ref="assertSwatchColor" stepKey="assertSwatch3"> + <actionGroup ref="AssertSwatchColorActionGroup" stepKey="assertSwatch3"> <argument name="nthSwatch" value="3"/> <argument name="expectedStyle" value="background: rgb(52, 152, 219);"/> </actionGroup> @@ -143,15 +143,15 @@ <waitForPageLoad stepKey="waitForProductPage"/> <!-- Verify that the storefront shows the swatches too --> - <actionGroup ref="assertStorefrontSwatchColor" stepKey="assertSwatch4"> + <actionGroup ref="AssertStorefrontSwatchColorActionGroup" stepKey="assertSwatch4"> <argument name="nthSwatch" value="1"/> <argument name="expectedRgb" value="rgb(231, 77, 60)"/> </actionGroup> - <actionGroup ref="assertStorefrontSwatchColor" stepKey="assertSwatch5"> + <actionGroup ref="AssertStorefrontSwatchColorActionGroup" stepKey="assertSwatch5"> <argument name="nthSwatch" value="2"/> <argument name="expectedRgb" value="rgb(46, 204, 112)"/> </actionGroup> - <actionGroup ref="assertStorefrontSwatchColor" stepKey="assertSwatch6"> + <actionGroup ref="AssertStorefrontSwatchColorActionGroup" stepKey="assertSwatch6"> <argument name="nthSwatch" value="3"/> <argument name="expectedRgb" value="rgb(52, 152, 219)"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchWithNonValidOptionsTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchWithNonValidOptionsTest.xml index b03f771875957..b69d48384aed8 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchWithNonValidOptionsTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchWithNonValidOptionsTest.xml @@ -47,11 +47,11 @@ <!-- Add new swatch option without label --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch1"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch1"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch1"> <argument name="index" value="0"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthChooseColor('1')}}" stepKey="clickChooseColor1"/> - <actionGroup ref="setColorPickerByHex" stepKey="fillHex1"> + <actionGroup ref="SetColorPickerByHexActionGroup" stepKey="fillHex1"> <argument name="nthColorPicker" value="1"/> <argument name="hexColor" value="ff0000"/> </actionGroup> @@ -66,11 +66,11 @@ <!-- Add 2 additional new swatch options --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch2"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch2"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch2"> <argument name="index" value="1"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthChooseColor('2')}}" stepKey="clickChooseColor2"/> - <actionGroup ref="setColorPickerByHex" stepKey="fillHex2"> + <actionGroup ref="SetColorPickerByHexActionGroup" stepKey="fillHex2"> <argument name="nthColorPicker" value="2"/> <argument name="hexColor" value="00ff00"/> </actionGroup> @@ -78,11 +78,11 @@ userInput="green" stepKey="fillAdmin2"/> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch3"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch3"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch3"> <argument name="index" value="2"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthChooseColor('3')}}" stepKey="clickChooseColor3"/> - <actionGroup ref="setColorPickerByHex" stepKey="fillHex3"> + <actionGroup ref="SetColorPickerByHexActionGroup" stepKey="fillHex3"> <argument name="nthColorPicker" value="3"/> <argument name="hexColor" value="0000ff"/> </actionGroup> @@ -109,4 +109,4 @@ <!-- Check attribute data --> <seeCheckboxIsChecked selector="{{AdminManageSwatchSection.nthIsDefault('2')}}" stepKey="CheckDefaultOption"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminDisablingSwatchTooltipsTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminDisablingSwatchTooltipsTest.xml index 2ffc61614bd1d..b44c04d2c1b46 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminDisablingSwatchTooltipsTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminDisablingSwatchTooltipsTest.xml @@ -61,11 +61,11 @@ <!-- Set swatch using the color picker --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch1"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch1"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch1"> <argument name="index" value="0"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthChooseColor('1')}}" stepKey="clickChooseColor1"/> - <actionGroup ref="setColorPickerByHex" stepKey="fillHex1"> + <actionGroup ref="SetColorPickerByHexActionGroup" stepKey="fillHex1"> <argument name="nthColorPicker" value="1"/> <argument name="hexColor" value="e74c3c"/> </actionGroup> @@ -77,7 +77,7 @@ <waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccess"/> <!-- Assert that the Save was successful after round trip to server --> - <actionGroup ref="assertSwatchColor" stepKey="assertSwatchAdmin"> + <actionGroup ref="AssertSwatchColorActionGroup" stepKey="assertSwatchAdmin"> <argument name="nthSwatch" value="1"/> <argument name="expectedStyle" value="background: rgb(231, 77, 60);"/> </actionGroup> @@ -137,7 +137,7 @@ <waitForPageLoad stepKey="waitForProductPage"/> <!-- Verify that the storefront shows the swatches too --> - <actionGroup ref="assertStorefrontSwatchColor" stepKey="assertSwatchStorefront"> + <actionGroup ref="AssertStorefrontSwatchColorActionGroup" stepKey="assertSwatchStorefront"> <argument name="nthSwatch" value="1"/> <argument name="expectedRgb" value="rgb(231, 77, 60)"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml index f94314fe94806..cb66b811abad5 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml @@ -33,18 +33,18 @@ <!-- Add a few Swatches and add images to Manage Swatch (Values of Your Attribute) 1. Set swatch #1 using the color picker --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddFirstSwatch"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickFirstSwatch"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickFirstSwatch"> <argument name="index" value="0"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthChooseColor('1')}}" stepKey="clickChooseColor"/> - <actionGroup ref="setColorPickerByHex" stepKey="fillFirstHex"> + <actionGroup ref="SetColorPickerByHexActionGroup" stepKey="fillFirstHex"> <argument name="nthColorPicker" value="1"/> <argument name="hexColor" value="e74c3c"/> </actionGroup> <fillField selector="{{AdminManageSwatchSection.adminInputByIndex('0')}}" userInput="red" stepKey="fillFirstAdminField"/> <!-- Set swatch #2 using upload file --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSecondSwatch"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch2"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch2"> <argument name="index" value="1"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthUploadFile('2')}}" stepKey="clickUploadFile2"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml index 0a98e7a721c17..085aa89210c08 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml @@ -126,19 +126,19 @@ </actionGroup> <!--Verify that Black option's minimum price is 16--> - <actionGroup ref="StorefrontAssertSwatchOptionPrice" stepKey="assertMinimumPriceForBlackOption"> + <actionGroup ref="StorefrontAssertSwatchOptionPriceActionGroup" stepKey="assertMinimumPriceForBlackOption"> <argument name="optionName" value="Black"/> <argument name="optionPrice" value="10.00"/> </actionGroup> <!--Verify that White option's minimum price is 16--> - <actionGroup ref="StorefrontAssertSwatchOptionPrice" stepKey="assertMinimumPriceForWhiteOption"> + <actionGroup ref="StorefrontAssertSwatchOptionPriceActionGroup" stepKey="assertMinimumPriceForWhiteOption"> <argument name="optionName" value="White"/> <argument name="optionPrice" value="13.00"/> </actionGroup> <!--Verify that Blue option's minimum price is 16--> - <actionGroup ref="StorefrontAssertSwatchOptionPrice" stepKey="assertMinimumPriceForBlueOption"> + <actionGroup ref="StorefrontAssertSwatchOptionPriceActionGroup" stepKey="assertMinimumPriceForBlueOption"> <argument name="optionName" value="Blue"/> <argument name="optionPrice" value="16.00"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml index f5bcccd4aa9b2..32e447f6463c0 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml @@ -45,7 +45,7 @@ <!-- Go to shopping cart and update option of configurable product --> <amOnPage url="{{CheckoutCartPage.url}}" stepKey="openShoppingCartPage"/> - <actionGroup ref="StorefrontUpdateCartConfigurableProductWithSwatches" stepKey="updateConfigurableProductInTheCart"> + <actionGroup ref="StorefrontUpdateCartConfigurableProductWithSwatchesActionGroup" stepKey="updateConfigurableProductInTheCart"> <argument name="product" value="_defaultProduct"/> <argument name="productOption" value="e74d3c"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml index c9602ddcd127c..adc230335576a 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml @@ -49,7 +49,7 @@ <!-- Set swatch #1 image using file upload --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch1"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch1"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch1"> <argument name="index" value="0"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthUploadFile('1')}}" stepKey="clickUploadFile1"/> @@ -58,7 +58,7 @@ <!-- Set swatch #2 image using the file upload --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch2"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch2"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch2"> <argument name="index" value="1"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthUploadFile('2')}}" stepKey="clickUploadFile2"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml index fd38c48919416..2467935795724 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml @@ -43,11 +43,11 @@ <!-- Set swatch #1 using the color picker --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch1"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch1"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch1"> <argument name="index" value="0"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthChooseColor('1')}}" stepKey="clickChooseColor1"/> - <actionGroup ref="setColorPickerByHex" stepKey="fillHex1"> + <actionGroup ref="SetColorPickerByHexActionGroup" stepKey="fillHex1"> <argument name="nthColorPicker" value="1"/> <argument name="hexColor" value="e74c3c"/> </actionGroup> @@ -55,11 +55,11 @@ <!-- Set swatch #2 using the color picker --> <click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSwatch2"/> - <actionGroup ref="openSwatchMenuByIndex" stepKey="clickSwatch2"> + <actionGroup ref="OpenSwatchMenuByIndexActionGroup" stepKey="clickSwatch2"> <argument name="index" value="1"/> </actionGroup> <click selector="{{AdminManageSwatchSection.nthChooseColor('2')}}" stepKey="clickChooseColor2"/> - <actionGroup ref="setColorPickerByHex" stepKey="fillHex2"> + <actionGroup ref="SetColorPickerByHexActionGroup" stepKey="fillHex2"> <argument name="nthColorPicker" value="2"/> <argument name="hexColor" value="3498db"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml index 1717b424e4597..8700cb34a8cdb 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml @@ -100,7 +100,7 @@ <actionGroup ref="StorefrontAssertActiveProductImage" stepKey="StorefrontAssertActiveProductImage"/> <!--Click a swatch and expect to see the image from the swatch from the configurable product --> - <actionGroup ref="StorefrontSelectSwatchOptionOnProductPageAndCheckImage" stepKey="clickSwatchOption"> + <actionGroup ref="StorefrontSelectSwatchOptionOnProductPageAndCheckImageActionGroup" stepKey="clickSwatchOption"> <argument name="optionName" value="{{visualSwatchOption1.default_label}}"/> <argument name="fileName" value="{{TestImageAdobe.filename}}"/> </actionGroup> @@ -109,7 +109,7 @@ <argument name="fileName" value="{{TestImageNew.filename}}"/> </actionGroup> - <actionGroup ref="StorefrontSelectSwatchOptionOnProductPageAndCheckImage" stepKey="clickOnSwatchOption2"> + <actionGroup ref="StorefrontSelectSwatchOptionOnProductPageAndCheckImageActionGroup" stepKey="clickOnSwatchOption2"> <argument name="optionName" value="{{visualSwatchOption2.default_label}}"/> <argument name="fileName" value="{{ImageUpload3.filename}}"/> </actionGroup> From 50be43cb0bb17729998f7af113473163751d56ed Mon Sep 17 00:00:00 2001 From: Subash Natarajan <subash.natarajan@ziffity.com> Date: Thu, 28 Nov 2019 19:40:43 +0530 Subject: [PATCH 311/595] Static test issue fix --- .../Customer/Controller/Adminhtml/Index/AbstractMassAction.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/AbstractMassAction.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/AbstractMassAction.php index 08c6e5148ade5..8ba3c4416f8a7 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/AbstractMassAction.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/AbstractMassAction.php @@ -73,6 +73,7 @@ public function execute() /** * Return component referer url + * * TODO: Technical dept referer url should be implement as a part of Action configuration in appropriate way * * @return null|string From bde67879529a3e5a543658b3c1b16fbac3bc79e1 Mon Sep 17 00:00:00 2001 From: Ajith <ajithkumar.maragathavel@ziffity.com> Date: Thu, 28 Nov 2019 19:46:18 +0530 Subject: [PATCH 312/595] No marginal white space validation added --- .../Magento/Cms/view/adminhtml/ui_component/cms_block_form.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_form.xml b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_form.xml index ad0f33df59d4e..a2ce0ec1b8740 100644 --- a/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_form.xml +++ b/app/code/Magento/Cms/view/adminhtml/ui_component/cms_block_form.xml @@ -105,6 +105,7 @@ <settings> <validation> <rule name="required-entry" xsi:type="boolean">true</rule> + <rule name="no-marginal-whitespace" xsi:type="boolean">true</rule> </validation> <dataType>text</dataType> <label translate="true">Identifier</label> From a3b18e16acc2baf30e6576bc1c08e84a74192bdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 15:24:57 +0100 Subject: [PATCH 313/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...iveFlatCategoryAndUpdateAsInactiveTest.xml | 4 +- .../AdminCreateInactiveFlatCategoryTest.xml | 4 +- ...inCreateInactiveInMenuFlatCategoryTest.xml | 4 +- ...inUpdateFlatCategoryAndAddProductsTest.xml | 6 +- ...ateFlatCategoryIncludeInNavigationTest.xml | 6 +- ...dateFlatCategoryNameAndDescriptionTest.xml | 6 +- ...rifyDataOverridingOnStoreViewLevelTest.xml | 2 +- ...rifyDataOverridingOnStoreViewLevelTest.xml | 2 +- ...ddCustomWebSiteToStoreGroupActionGroup.xml | 34 ++++++ .../AdminCreateNewStoreGroupActionGroup.xml | 102 ------------------ .../AdminCreateStoreViewActionGroup.xml | 58 ---------- .../AdminCreateStoreViewSaveActionGroup.xml | 20 ++++ ...CreateStoreViewWithoutCheckActionGroup.xml | 19 ++++ .../AdminCreateWebsiteActionGroup.xml | 52 --------- .../AdminDeleteStoreViewActionGroup.xml | 79 -------------- ...dminDeleteStoreViewIfExistsActionGroup.xml | 34 ++++++ .../AdminGetWebsiteIdActionGroup.xml | 28 +++++ .../AdminSearchStoreViewByNameActionGroup.xml | 24 +++++ .../AdminStoreGroupCreateActionGroup.xml | 24 ----- .../AdminSwitchStoreViewActionGroup.xml | 11 +- .../AdminSwitchToAllStoreViewActionGroup.xml | 19 ++++ .../AssertDefaultStoreViewActionGroup.xml | 20 ++++ .../AssertStoreNotInGridActionGroup.xml | 27 +++++ .../AssertStoreViewNotInGridActionGroup.xml | 27 +++++ .../AssertWebsiteFormActionGroup.xml | 27 +++++ .../AssertWebsiteInGridActionGroup.xml | 27 +++++ .../ChangeDefaultStoreViewActionGroup.xml | 26 +++++ .../CreateCustomStoreActionGroup.xml | 32 ++++++ .../CreateCustomStoreViewActionGroup.xml | 22 ---- .../CreateStoreViewActionGroup.xml | 32 ++++++ .../DeleteCustomStoreActionGroup.xml | 39 ------- ...CustomStoreBackupEnabledYesActionGroup.xml | 32 ++++++ ...omStoreViewBackupEnabledYesActionGroup.xml | 34 ++++++ ...reGroupAcceptWarningMessageActionGroup.xml | 2 +- .../ActionGroup/EditStoreGroupActionGroup.xml | 28 +++++ ...oAdminContentManagementPageActionGroup.xml | 19 ++++ .../SaveStoreConfigurationActionGroup.xml | 21 ++++ ...rationAndValidateFieldErrorActionGroup.xml | 28 +++++ ...frontSwitchDefaultStoreViewActionGroup.xml | 19 ++++ .../StorefrontSwitchStoreViewActionGroup.xml | 11 +- ...EnabledVerifyAbsenceOfDeleteButtonTest.xml | 4 +- ...tusEnabledVerifyBackendAndFrontendTest.xml | 4 +- ...NewLocalizedStoreViewStatusEnabledTest.xml | 4 +- ...ithCustomWebsiteAndDefaultCategoryTest.xml | 8 +- ...upWithCustomWebsiteAndRootCategoryTest.xml | 8 +- ...thDefaultWebsiteAndDefaultCategoryTest.xml | 6 +- ...usDisabledVerifyBackendAndFrontendTest.xml | 6 +- ...tusEnabledVerifyBackendAndFrontendTest.xml | 4 +- .../Test/Mftf/Test/AdminCreateWebsiteTest.xml | 4 +- .../Mftf/Test/AdminDeleteStoreGroupTest.xml | 4 +- .../Mftf/Test/AdminDeleteStoreViewTest.xml | 2 +- ...inMoveStoreToOtherGroupSameWebsiteTest.xml | 4 +- ...pAcceptAlertAndVerifyStoreViewFormTest.xml | 4 +- ...teStoreGroupAndVerifyStoreViewFormTest.xml | 4 +- .../Mftf/Test/AdminUpdateStoreViewTest.xml | 4 +- .../Test/Mftf/Test/AdminUpdateWebsiteTest.xml | 8 +- ...dFilterDeleteAndVerifyErrorMessageTest.xml | 4 +- ...SeveralWebsitesAndCheckURLRewritesTest.xml | 4 +- 58 files changed, 640 insertions(+), 457 deletions(-) create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AdminAddCustomWebSiteToStoreGroupActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewSaveActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewWithoutCheckActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AdminDeleteStoreViewIfExistsActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AdminGetWebsiteIdActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSearchStoreViewByNameActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSwitchToAllStoreViewActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AssertDefaultStoreViewActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreNotInGridActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreViewNotInGridActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AssertWebsiteFormActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/AssertWebsiteInGridActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/ChangeDefaultStoreViewActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/CreateCustomStoreActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/CreateStoreViewActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreBackupEnabledYesActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreViewBackupEnabledYesActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/EditStoreGroupActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/NavigateToAdminContentManagementPageActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/SaveStoreConfigurationActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/SaveStoreConfigurationAndValidateFieldErrorActionGroup.xml create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/StorefrontSwitchDefaultStoreViewActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml index 21b3dba7140c0..b0e6fe87be918 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryAndUpdateAsInactiveTest.xml @@ -23,11 +23,11 @@ <!--Create category--> <createData entity="CatNotActive" stepKey="createCategory"/> <!-- Create First StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewEn"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewEn"> <argument name="storeView" value="customStoreEN"/> </actionGroup> <!-- Create Second StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewFr"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> <!--Run full reindex and clear caches --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml index aa3dba85dfadf..7de37b9cb77ef 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveFlatCategoryTest.xml @@ -23,11 +23,11 @@ <!--Create category--> <createData entity="SimpleSubCategory" stepKey="createCategory"/> <!-- Create First StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewEn"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewEn"> <argument name="storeView" value="customStoreEN"/> </actionGroup> <!-- Create Second StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewFr"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> <!--Run full reindex and clear caches --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml index 37417cd7fdb85..c7aba1fe8376f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateInactiveInMenuFlatCategoryTest.xml @@ -23,11 +23,11 @@ <!--Create category--> <createData entity="SimpleSubCategory" stepKey="category"/> <!-- Create First StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewEn"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewEn"> <argument name="storeView" value="customStoreEN"/> </actionGroup> <!-- Create Second StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewFr"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> <!--Run full reindex and clear caches --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml index 8872ea98eb504..cebf67ae2ebcf 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml @@ -24,11 +24,11 @@ <!-- Create category --> <createData entity="defaultSimpleProduct" stepKey="createSimpleProduct"/> <!-- Create First StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewEn"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewEn"> <argument name="storeView" value="customStoreEN"/> </actionGroup> <!-- Create Second StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewFr"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> <!--Run full reindex and clear caches --> @@ -100,4 +100,4 @@ <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$category.name$$)}}" stepKey="seeCategoryOnNavigation1"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{defaultSimpleProduct.name}}" stepKey="seeProductName"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml index 5527303370623..d7ce22bdc0097 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryIncludeInNavigationTest.xml @@ -22,11 +22,11 @@ <!--Create category--> <createData entity="CatNotIncludeInMenu" stepKey="createCategory"/> <!-- Create First StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewEn"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewEn"> <argument name="storeView" value="customStoreEN"/> </actionGroup> <!-- Create Second StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewFr"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> <!--Run full reindex and clear caches --> @@ -88,4 +88,4 @@ <waitForPageLoad stepKey="waitForSecondstoreView"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="seeCategoryOnNavigation1"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml index fcbc0cb205268..2b14973d6ce32 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryNameAndDescriptionTest.xml @@ -23,11 +23,11 @@ <!--Create category--> <createData entity="_defaultCategory" stepKey="createCategory"/> <!-- Create First StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewEn"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewEn"> <argument name="storeView" value="customStoreEN"/> </actionGroup> <!-- Create Second StoreView --> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewFr"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> <!--Run full reindex and clear caches --> @@ -99,4 +99,4 @@ <click selector="{{AdminCategoryContentSection.sectionHeader}}" stepKey="selectContent1"/> <seeInField selector="{{AdminCategoryContentSection.description}}" userInput="Updated category Description Fields" stepKey="seeUpdatedDescription"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml index 80f0c8ad10ede..6f84ab06c407e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewFr"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> <createData entity="SimpleSubCategory" stepKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml index f698b3d89ffe9..f65ee96c94b40 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="CreateStoreView" stepKey="createCustomStoreViewFr"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr"> <argument name="storeView" value="customStoreFR"/> </actionGroup> <createData entity="SimpleSubCategory" stepKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminAddCustomWebSiteToStoreGroupActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminAddCustomWebSiteToStoreGroupActionGroup.xml new file mode 100644 index 0000000000000..cee37d22e7970 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminAddCustomWebSiteToStoreGroupActionGroup.xml @@ -0,0 +1,34 @@ +<?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="AdminAddCustomWebSiteToStoreGroupActionGroup"> + <annotations> + <description>Goes to the Admin Stores grid page. Searches the grid for the provided Store Group. Edits the Store. Adds the provided Website to the Store. Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="storeGroup" defaultValue="customStoreGroup"/> + <argument name="website" defaultValue="customWebsite"/> + </arguments> + + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <fillField userInput="{{storeGroup.name}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <see userInput="{{storeGroup.name}}" selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="verifyThatCorrectStoreGroupFound"/> + <click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickEditExistingStoreRow"/> + <waitForPageLoad stepKey="waitForStoreGroupPageLoad"/> + <selectOption selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" userInput="{{website.name}}" stepKey="selectWebsite"/> + <selectOption selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" userInput="Default Category" stepKey="chooseRootCategory"/> + <click selector="{{AdminNewStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup"/> + <conditionalClick selector="{{AdminNewStoreGroupSection.acceptNewStoreGroupCreation}}" dependentSelector="{{AdminNewStoreGroupSection.acceptNewStoreGroupCreation}}" visible="true" stepKey="clickAcceptNewStoreGroupCreationButton"/> + <waitForElementVisible selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="waitForPageReload"/> + <see userInput="You saved the store." stepKey="seeSavedMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateNewStoreGroupActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateNewStoreGroupActionGroup.xml index 4c00071da6b61..f1071f2743683 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateNewStoreGroupActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateNewStoreGroupActionGroup.xml @@ -31,106 +31,4 @@ <waitForElementVisible selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="waitForStoreGridReload"/> <see userInput="You saved the store." stepKey="seeSavedMessage"/> </actionGroup> - - <actionGroup name="CreateCustomStore"> - <annotations> - <description>Goes to the Admin Stores grid page. Clicks on 'Create Store'. Fills in the provided Details (Website, Store Group Name and Store Group Code). Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="website" type="string"/> - <argument name="store" type="string"/> - <argument name="rootCategory" type="string"/> - </arguments> - - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <waitForPageLoad stepKey="waitForSystemStorePage"/> - <click selector="{{AdminStoresMainActionsSection.createStoreButton}}" stepKey="selectCreateStore"/> - <selectOption userInput="{{website}}" selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" stepKey="selectMainWebsite"/> - <fillField userInput="{{store}}" selector="{{AdminNewStoreGroupSection.storeGrpNameTextField}}" stepKey="fillStoreName"/> - <fillField userInput="{{store}}" selector="{{AdminNewStoreGroupSection.storeGrpCodeTextField}}" stepKey="fillStoreCode"/> - <selectOption userInput="{{rootCategory}}" selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" stepKey="selectStoreStatus"/> - <click selector="{{AdminStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup"/> - <waitForElementVisible selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="waitForStoreGridReload"/> - <see userInput="You saved the store." stepKey="seeSavedMessage"/> - </actionGroup> - - <actionGroup name="AssertStoreGroupInGrid"> - <annotations> - <description>Goes to the Admin Stores grid page. Searches for the provided Store Group Name. Validates that the provided Store Group Name is present in the grid.</description> - </annotations> - <arguments> - <argument name="storeGroupName" type="string"/> - </arguments> - - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForStoreToLoad"/> - <see selector="{{AdminStoresGridSection.nthRow('1')}}" userInput="{{storeGroupName}}" stepKey="seeAssertStoreGroupInGridMessage"/> - </actionGroup> - - <actionGroup name="EditStoreGroupActionGroup"> - <annotations> - <description>Edit store group.</description> - </annotations> - <arguments> - <argument name="storeGroupName" type="string"/> - </arguments> - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <waitForPageLoad stepKey="waitForResetResult"/> - <fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillStoreGroupFilter"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForSearchResult"/> - <click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clicksStoreGroupName"/> - <waitForPageLoad stepKey="waitForStorePageToLoad"/> - </actionGroup> - - <actionGroup name="ChangeDefaultStoreViewActionGroup" extends="EditStoreGroupActionGroup"> - <annotations> - <description>Change the default store view for provided store group.</description> - </annotations> - <arguments> - <argument name="storeViewName" type="string"/> - </arguments> - <selectOption selector="{{AdminEditStoreGroupSection.defaultStoreView}}" userInput="{{storeViewName}}" stepKey="changeDefaultStoreView" after="waitForStorePageToLoad"/> - <click selector="{{AdminStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup"/> - <waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForModal"/> - <see selector="{{AdminConfirmationModalSection.title}}" userInput="Warning message" stepKey="seeWarningAboutTakingALongTimeToComplete"/> - <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmModal"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="seeForSuccessMessage"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You saved the store." stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="AssertDefaultStoreViewActionGroup" extends="EditStoreGroupActionGroup"> - <annotations> - <description>Asserts that the provided store view is default in provided store group.</description> - </annotations> - <arguments> - <argument name="storeViewName" type="string"/> - </arguments> - <seeOptionIsSelected selector="{{AdminEditStoreGroupSection.defaultStoreView}}" userInput="{{storeViewName}}" stepKey="assertDefaultStoreView" after="waitForStorePageToLoad"/> - </actionGroup> - - <actionGroup name="AssertStoreGroupForm"> - <annotations> - <description>Clicks on the 1st Store in the 'Stores' grid. Validates that the provided Details (Website, Store Group Name, Store Group Code and Root Category) are present and correct.</description> - </annotations> - <arguments> - <argument name="website" type="string"/> - <argument name="storeGroupName" type="string"/> - <argument name="storeGroupCode" type="string"/> - <argument name="rootCategory" type="string"/> - </arguments> - - <click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickEditExistingStoreRow"/> - <waitForPageLoad stepKey="waitTillAdminSystemStoreGroupPage"/> - <seeInField selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" userInput="{{website}}" stepKey="seeAssertWebsite"/> - <seeInField selector="{{AdminNewStoreGroupSection.storeGrpNameTextField}}" userInput="{{storeGroupName}}" stepKey="seeAssertStoreGroupName"/> - <seeInField selector="{{AdminNewStoreGroupSection.storeGrpCodeTextField}}" userInput="{{storeGroupCode}}" stepKey="seeAssertStoreGroupCode"/> - <seeInField selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" userInput="{{rootCategory}}" stepKey="seeAssertRootCategory"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewActionGroup.xml index 0faf93d4bde14..7df225368779b 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewActionGroup.xml @@ -33,62 +33,4 @@ <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForPageReload"/> <see selector="{{AdminMessagesSection.success}}" userInput="You saved the store view." stepKey="seeSavedMessage"/> </actionGroup> - - <actionGroup name="AdminCreateStoreViewWithoutCheckActionGroup" extends="AdminCreateStoreViewActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateStoreViewActionGroup. Removes 'waitForPageReload' and 'seeSavedMessage'.</description> - </annotations> - - <remove keyForRemoval="waitForPageReload"/> - <remove keyForRemoval="seeSavedMessage"/> - </actionGroup> - - <!--Save the Store view--> - <actionGroup name="AdminCreateStoreViewActionSaveGroup"> - <annotations> - <description>Validates that the Success Message is present and correct.</description> - </annotations> - - <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> - <waitForElementVisible selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="waitForStoreGridToReload2"/> - <see userInput="You saved the store view." stepKey="seeSavedMessage"/> - </actionGroup> - - <actionGroup name="navigateToAdminContentManagementPage"> - <annotations> - <description>Goes to the 'Configuration' page for 'Content Management'.</description> - </annotations> - - <amOnPage url="{{AdminContentManagementPage.url}}" stepKey="navigateToConfigurationPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - </actionGroup> - - <actionGroup name="saveStoreConfiguration"> - <annotations> - <description>Clicks on the Save button.</description> - </annotations> - - <comment userInput="saveStoreConfiguration" stepKey="comment"/> - <waitForElementVisible selector="{{StoreConfigSection.Save}}" stepKey="waitForSaveButton"/> - <click selector="{{StoreConfigSection.Save}}" stepKey="clickSaveButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <actionGroup name="saveStoreConfigurationAndValidateFieldError"> - <annotations> - <description>Clicks on Save. Validates that the fields are required.</description> - </annotations> - <arguments> - <argument name="inputFieldError" type="string"/> - <argument name="errorMessageSelector" type="string"/> - <argument name="errorMessage" type="string"/> - </arguments> - - <comment userInput="saveStoreConfigurationAndValidateFieldError" stepKey="comment"/> - <waitForElementVisible selector="{{StoreConfigSection.Save}}" stepKey="waitForSaveButton"/> - <click selector="{{StoreConfigSection.Save}}" stepKey="clickSaveButton"/> - <waitForElement selector="{{inputFieldError}}" stepKey="waitForErrorField"/> - <waitForElementVisible selector="{{errorMessageSelector}}" stepKey="waitForErrorMessage"/> - <see selector="{{errorMessageSelector}}" userInput="{{errorMessage}}" stepKey="seeErrorMessage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewSaveActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewSaveActionGroup.xml new file mode 100644 index 0000000000000..0d1a2bd5319df --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewSaveActionGroup.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="AdminCreateStoreViewSaveActionGroup"> + <annotations> + <description>Validates that the Success Message is present and correct.</description> + </annotations> + + <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> + <waitForElementVisible selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="waitForStoreGridToReload2"/> + <see userInput="You saved the store view." stepKey="seeSavedMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewWithoutCheckActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewWithoutCheckActionGroup.xml new file mode 100644 index 0000000000000..c6837dc55b34e --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewWithoutCheckActionGroup.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="AdminCreateStoreViewWithoutCheckActionGroup" extends="AdminCreateStoreViewActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateStoreViewActionGroup. Removes 'waitForPageReload' and 'seeSavedMessage'.</description> + </annotations> + + <remove keyForRemoval="waitForPageReload"/> + <remove keyForRemoval="seeSavedMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateWebsiteActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateWebsiteActionGroup.xml index 6a2f601754c41..19be38d130ace 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateWebsiteActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateWebsiteActionGroup.xml @@ -28,56 +28,4 @@ <waitForElementVisible selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="waitForStoreGridToReload"/> <see userInput="You saved the website." stepKey="seeSavedMessage"/> </actionGroup> - - <actionGroup name="AdminGetWebsiteIdActionGroup"> - <!--Get Website_id--> - <annotations> - <description>Goes to the Admin Stores grid page. Filters the grid for the provided Website. Grabs the Website ID from the URL.</description> - </annotations> - <arguments> - <argument name="website"/> - </arguments> - - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnTheStorePage"/> - <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters"/> - <fillField selector="{{AdminStoresGridSection.websiteFilterTextField}}" userInput="{{website.name}}" stepKey="fillSearchWebsiteField"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> - <see selector="{{AdminStoresGridSection.websiteNameInFirstRow}}" userInput="{{website.name}}" stepKey="verifyThatCorrectWebsiteFound"/> - <click selector="{{AdminStoresGridSection.websiteNameInFirstRow}}" stepKey="clickEditExistingWebsite"/> - <grabFromCurrentUrl regex="~(\d+)/~" stepKey="grabFromCurrentUrl"/> - </actionGroup> - - <actionGroup name="AssertWebsiteInGrid"> - <annotations> - <description>Goes to the Admin Stores grid page. Searches the grid for the provided Website Name. Validates that the Website appears in the grid.</description> - </annotations> - <arguments> - <argument name="websiteName" type="string"/> - </arguments> - - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{websiteName}}" selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="fillWebsiteField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForStoreToLoad"/> - <seeElement selector="{{AdminStoresGridSection.websiteName(websiteName)}}" stepKey="seeAssertWebsiteInGrid"/> - </actionGroup> - - <actionGroup name="AssertWebsiteForm"> - <annotations> - <description>Clicks on the provided Website Name in the Admin Stores grid. Validates that the URL, Website Name/Code are present and correct.</description> - </annotations> - <arguments> - <argument name="websiteName" type="string"/> - <argument name="websiteCode" type="string"/> - </arguments> - - <click selector="{{AdminStoresGridSection.websiteName(websiteName)}}" stepKey="clickWebsiteFirstRowInGrid"/> - <waitForPageLoad stepKey="waitTillWebsiteFormPageIsOpened"/> - <grabFromCurrentUrl regex="~(\d+)/~" stepKey="grabWebsiteIdFromCurrentUrl"/> - <seeInCurrentUrl url="/system_store/editWebsite/website_id/{$grabWebsiteIdFromCurrentUrl}" stepKey="seeWebsiteId"/> - <seeInField selector="{{AdminNewWebsiteSection.name}}" userInput="{{websiteName}}" stepKey="seeAssertWebsiteName"/> - <seeInField selector="{{AdminNewWebsiteSection.code}}" userInput="{{websiteCode}}" stepKey="seeAssertWebsiteCode"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminDeleteStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminDeleteStoreViewActionGroup.xml index 7ac300e3ab804..520a80bcbc328 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminDeleteStoreViewActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminDeleteStoreViewActionGroup.xml @@ -32,83 +32,4 @@ <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitSuccessMessageAppears"/> <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the store view." stepKey="seeDeleteMessage"/> </actionGroup> - - <actionGroup name="DeleteCustomStoreViewBackupEnabledYesActionGroup"> - <annotations> - <description>Goes to the Admin Stores grid page. Deleted the provided Store while creating a Backup. Validates that the Success Messages (Delete/Backup) are present and correct.</description> - </annotations> - <arguments> - <argument name="storeViewName" type="string"/> - </arguments> - - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{storeViewName}}" selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="fillSearchStoreViewField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <click selector="{{AdminStoresGridSection.storeNameInFirstRow}}" stepKey="clickEditExistingStoreViewRow"/> - <waitForPageLoad stepKey="waitForStoreToLoad"/> - <click selector="{{AdminNewStoreViewActionsSection.delete}}" stepKey="clickDeleteStoreViewButtonOnEditStorePage"/> - <selectOption userInput="Yes" selector="{{AdminStoreBackupOptionsSection.createBackupSelect}}" stepKey="setCreateDbBackupToYes"/> - <click selector="{{AdminNewStoreViewActionsSection.delete}}" stepKey="clickDeleteStoreViewButtonOnDeleteStorePage"/> - <waitForElementVisible selector="{{AdminConfirmationModalSection.title}}" stepKey="waitingForWarningModal"/> - <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmStoreViewDelete"/> - <waitForPageLoad stepKey="waitForSuccessMessage"/> - <see selector="{{AdminStoresGridSection.successMessage}}" userInput="The database was backed up." stepKey="seeAssertDatabaseBackedUpMessage"/> - <see selector="{{AdminStoresGridSection.successMessage}}" userInput="You deleted the store view." stepKey="seeAssertSuccessDeleteStoreViewMessage"/> - </actionGroup> - - <actionGroup name="AssertStoreViewNotInGrid"> - <annotations> - <description>Goes to the Admin Stores grid page. Searches the grid for the provided Store View name. Validates that it does NOT appear in the grid.</description> - </annotations> - <arguments> - <argument name="storeViewName" type="string"/> - </arguments> - - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{storeViewName}}" selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="fillSearchStoreViewField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForStoreToLoad"/> - <see selector="{{AdminStoresGridSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertStoreViewNotInGridMessage"/> - </actionGroup> - - <actionGroup name="AdminSearchStoreViewByNameActionGroup"> - <annotations> - <description>Goes to the Admin Stores grid page. Clears filters and search by store view name.</description> - </annotations> - <arguments> - <argument name="storeViewName" type="string"/> - </arguments> - - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="resetSearchFilter"/> - <fillField selector="{{AdminStoresGridSection.storeFilterTextField}}" userInput="{{storeViewName}}" stepKey="fillSearchStoreViewField"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearchButton"/> - </actionGroup> - - <actionGroup name="AdminDeleteStoreViewIfExistsActionGroup" extends="AdminSearchStoreViewByNameActionGroup"> - <annotations> - <description>EXTENDS: AdminSearchStoreViewByNameActionGroup. Goes to the Admin Stores grid page. Deletes the provided Store (if exists) without creating a Backup. Validates that the Success Message is present and correct.</description> - </annotations> - - <executeInSelenium function="function($webdriver) use ($I) { - $items = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::cssSelector('.col-store_title>a')); - if(!empty($items)) { - $I->click('.col-store_title>a'); - $I->waitForPageLoad(10); - $I->click('#delete'); - $I->waitForPageLoad(30); - $I->selectOption('select#store_create_backup', 'No'); - $I->click('#delete'); - $I->waitForPageLoad(30); - $I->waitForElementVisible('aside.confirm .modal-title', 10); - $I->click('aside.confirm .modal-footer button.action-accept'); - $I->waitForPageLoad(60); - $I->waitForElementVisible('#messages div.message-success', 10); - $I->see('You deleted the store view.', '#messages div.message-success'); - } - }" after="clickSearchButton" stepKey="deleteStoreViewIfExists"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminDeleteStoreViewIfExistsActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminDeleteStoreViewIfExistsActionGroup.xml new file mode 100644 index 0000000000000..6ebf72a893c04 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminDeleteStoreViewIfExistsActionGroup.xml @@ -0,0 +1,34 @@ +<?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="AdminDeleteStoreViewIfExistsActionGroup" extends="AdminSearchStoreViewByNameActionGroup"> + <annotations> + <description>EXTENDS: AdminSearchStoreViewByNameActionGroup. Goes to the Admin Stores grid page. Deletes the provided Store (if exists) without creating a Backup. Validates that the Success Message is present and correct.</description> + </annotations> + + <executeInSelenium function="function($webdriver) use ($I) { + $items = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::cssSelector('.col-store_title>a')); + if(!empty($items)) { + $I->click('.col-store_title>a'); + $I->waitForPageLoad(10); + $I->click('#delete'); + $I->waitForPageLoad(30); + $I->selectOption('select#store_create_backup', 'No'); + $I->click('#delete'); + $I->waitForPageLoad(30); + $I->waitForElementVisible('aside.confirm .modal-title', 10); + $I->click('aside.confirm .modal-footer button.action-accept'); + $I->waitForPageLoad(60); + $I->waitForElementVisible('#messages div.message-success', 10); + $I->see('You deleted the store view.', '#messages div.message-success'); + } + }" after="clickSearchButton" stepKey="deleteStoreViewIfExists"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminGetWebsiteIdActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminGetWebsiteIdActionGroup.xml new file mode 100644 index 0000000000000..9e58643981506 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminGetWebsiteIdActionGroup.xml @@ -0,0 +1,28 @@ +<?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="AdminGetWebsiteIdActionGroup"> + <!--Get Website_id--> + <annotations> + <description>Goes to the Admin Stores grid page. Filters the grid for the provided Website. Grabs the Website ID from the URL.</description> + </annotations> + <arguments> + <argument name="website"/> + </arguments> + + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnTheStorePage"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters"/> + <fillField selector="{{AdminStoresGridSection.websiteFilterTextField}}" userInput="{{website.name}}" stepKey="fillSearchWebsiteField"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> + <see selector="{{AdminStoresGridSection.websiteNameInFirstRow}}" userInput="{{website.name}}" stepKey="verifyThatCorrectWebsiteFound"/> + <click selector="{{AdminStoresGridSection.websiteNameInFirstRow}}" stepKey="clickEditExistingWebsite"/> + <grabFromCurrentUrl regex="~(\d+)/~" stepKey="grabFromCurrentUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSearchStoreViewByNameActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSearchStoreViewByNameActionGroup.xml new file mode 100644 index 0000000000000..cb8c798a7eaed --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSearchStoreViewByNameActionGroup.xml @@ -0,0 +1,24 @@ +<?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="AdminSearchStoreViewByNameActionGroup"> + <annotations> + <description>Goes to the Admin Stores grid page. Clears filters and search by store view name.</description> + </annotations> + <arguments> + <argument name="storeViewName" type="string"/> + </arguments> + + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="resetSearchFilter"/> + <fillField selector="{{AdminStoresGridSection.storeFilterTextField}}" userInput="{{storeViewName}}" stepKey="fillSearchStoreViewField"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearchButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminStoreGroupCreateActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminStoreGroupCreateActionGroup.xml index 8afa8df4a5e3d..4da1208717f90 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminStoreGroupCreateActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminStoreGroupCreateActionGroup.xml @@ -28,28 +28,4 @@ <waitForElementVisible selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="waitForPageReload"/> <see userInput="You saved the store." stepKey="seeSavedMessage"/> </actionGroup> - - <actionGroup name="AdminAddCustomWebSiteToStoreGroup"> - <annotations> - <description>Goes to the Admin Stores grid page. Searches the grid for the provided Store Group. Edits the Store. Adds the provided Website to the Store. Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="storeGroup" defaultValue="customStoreGroup"/> - <argument name="website" defaultValue="customWebsite"/> - </arguments> - - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{storeGroup.name}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <see userInput="{{storeGroup.name}}" selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="verifyThatCorrectStoreGroupFound"/> - <click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickEditExistingStoreRow"/> - <waitForPageLoad stepKey="waitForStoreGroupPageLoad"/> - <selectOption selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" userInput="{{website.name}}" stepKey="selectWebsite"/> - <selectOption selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" userInput="Default Category" stepKey="chooseRootCategory"/> - <click selector="{{AdminNewStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup"/> - <conditionalClick selector="{{AdminNewStoreGroupSection.acceptNewStoreGroupCreation}}" dependentSelector="{{AdminNewStoreGroupSection.acceptNewStoreGroupCreation}}" visible="true" stepKey="clickAcceptNewStoreGroupCreationButton"/> - <waitForElementVisible selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="waitForPageReload"/> - <see userInput="You saved the store." stepKey="seeSavedMessage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSwitchStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSwitchStoreViewActionGroup.xml index 22b5d22c2fcc9..13e9beff9745b 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSwitchStoreViewActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSwitchStoreViewActionGroup.xml @@ -15,7 +15,7 @@ <arguments> <argument name="storeView" defaultValue="customStore.name"/> </arguments> - + <click selector="{{AdminMainActionsSection.storeViewDropdown}}" stepKey="clickStoreViewSwitchDropdown"/> <waitForElementVisible selector="{{AdminMainActionsSection.storeViewByName('Default Store View')}}" stepKey="waitForStoreViewsAreVisible"/> <click selector="{{AdminMainActionsSection.storeViewByName(storeView)}}" stepKey="clickStoreViewByName"/> @@ -25,13 +25,4 @@ <scrollToTopOfPage stepKey="scrollToStoreSwitcher"/> <see userInput="{{storeView}}" selector="{{AdminMainActionsSection.storeSwitcher}}" stepKey="seeNewStoreViewName"/> </actionGroup> - - <actionGroup name="AdminSwitchToAllStoreViewActionGroup" extends="AdminSwitchStoreViewActionGroup"> - <annotations> - <description>EXTENDS: AdminSwitchStoreViewActionGroup. Clicks on the 'All Store Views' drop down menu. Validates that the 'All Store Views' options is present and correct.</description> - </annotations> - - <click selector="{{AdminMainActionsSection.allStoreViews}}" stepKey="clickStoreViewByName" after="waitForStoreViewsAreVisible"/> - <see selector="{{AdminMainActionsSection.storeSwitcher}}" userInput="All Store Views" stepKey="seeNewStoreViewName" after="waitForStoreViewSwitched"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSwitchToAllStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSwitchToAllStoreViewActionGroup.xml new file mode 100644 index 0000000000000..fe56aa128dd7e --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSwitchToAllStoreViewActionGroup.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="AdminSwitchToAllStoreViewActionGroup" extends="AdminSwitchStoreViewActionGroup"> + <annotations> + <description>EXTENDS: AdminSwitchStoreViewActionGroup. Clicks on the 'All Store Views' drop down menu. Validates that the 'All Store Views' options is present and correct.</description> + </annotations> + + <click selector="{{AdminMainActionsSection.allStoreViews}}" stepKey="clickStoreViewByName" after="waitForStoreViewsAreVisible"/> + <see selector="{{AdminMainActionsSection.storeSwitcher}}" userInput="All Store Views" stepKey="seeNewStoreViewName" after="waitForStoreViewSwitched"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertDefaultStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertDefaultStoreViewActionGroup.xml new file mode 100644 index 0000000000000..e899241cfdd1f --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertDefaultStoreViewActionGroup.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="AssertDefaultStoreViewActionGroup" extends="EditStoreGroupActionGroup"> + <annotations> + <description>Asserts that the provided store view is default in provided store group.</description> + </annotations> + <arguments> + <argument name="storeViewName" type="string"/> + </arguments> + <seeOptionIsSelected selector="{{AdminEditStoreGroupSection.defaultStoreView}}" userInput="{{storeViewName}}" stepKey="assertDefaultStoreView" after="waitForStorePageToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreNotInGridActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreNotInGridActionGroup.xml new file mode 100644 index 0000000000000..3c9ebe0daa14e --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreNotInGridActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AssertStoreNotInGridActionGroup"> + <annotations> + <description>Goes to the Admin Stores grid page. Validates that the provided Store Group Name is NOT present in the grid.</description> + </annotations> + <arguments> + <argument name="storeGroupName" type="string"/> + </arguments> + + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForStoreToLoad"/> + <see selector="{{AdminStoresGridSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertStoreGroupNotInGridMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreViewNotInGridActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreViewNotInGridActionGroup.xml new file mode 100644 index 0000000000000..b258f2e826200 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreViewNotInGridActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AssertStoreViewNotInGridActionGroup"> + <annotations> + <description>Goes to the Admin Stores grid page. Searches the grid for the provided Store View name. Validates that it does NOT appear in the grid.</description> + </annotations> + <arguments> + <argument name="storeViewName" type="string"/> + </arguments> + + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <fillField userInput="{{storeViewName}}" selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="fillSearchStoreViewField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForStoreToLoad"/> + <see selector="{{AdminStoresGridSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertStoreViewNotInGridMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertWebsiteFormActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertWebsiteFormActionGroup.xml new file mode 100644 index 0000000000000..3738d975e5131 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertWebsiteFormActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AssertWebsiteFormActionGroup"> + <annotations> + <description>Clicks on the provided Website Name in the Admin Stores grid. Validates that the URL, Website Name/Code are present and correct.</description> + </annotations> + <arguments> + <argument name="websiteName" type="string"/> + <argument name="websiteCode" type="string"/> + </arguments> + + <click selector="{{AdminStoresGridSection.websiteName(websiteName)}}" stepKey="clickWebsiteFirstRowInGrid"/> + <waitForPageLoad stepKey="waitTillWebsiteFormPageIsOpened"/> + <grabFromCurrentUrl regex="~(\d+)/~" stepKey="grabWebsiteIdFromCurrentUrl"/> + <seeInCurrentUrl url="/system_store/editWebsite/website_id/{$grabWebsiteIdFromCurrentUrl}" stepKey="seeWebsiteId"/> + <seeInField selector="{{AdminNewWebsiteSection.name}}" userInput="{{websiteName}}" stepKey="seeAssertWebsiteName"/> + <seeInField selector="{{AdminNewWebsiteSection.code}}" userInput="{{websiteCode}}" stepKey="seeAssertWebsiteCode"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertWebsiteInGridActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertWebsiteInGridActionGroup.xml new file mode 100644 index 0000000000000..0835e3bc330b0 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertWebsiteInGridActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AssertWebsiteInGridActionGroup"> + <annotations> + <description>Goes to the Admin Stores grid page. Searches the grid for the provided Website Name. Validates that the Website appears in the grid.</description> + </annotations> + <arguments> + <argument name="websiteName" type="string"/> + </arguments> + + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <fillField userInput="{{websiteName}}" selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="fillWebsiteField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForStoreToLoad"/> + <seeElement selector="{{AdminStoresGridSection.websiteName(websiteName)}}" stepKey="seeAssertWebsiteInGrid"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/ChangeDefaultStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/ChangeDefaultStoreViewActionGroup.xml new file mode 100644 index 0000000000000..40ebb95e9cdb2 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/ChangeDefaultStoreViewActionGroup.xml @@ -0,0 +1,26 @@ +<?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="ChangeDefaultStoreViewActionGroup" extends="EditStoreGroupActionGroup"> + <annotations> + <description>Change the default store view for provided store group.</description> + </annotations> + <arguments> + <argument name="storeViewName" type="string"/> + </arguments> + <selectOption selector="{{AdminEditStoreGroupSection.defaultStoreView}}" userInput="{{storeViewName}}" stepKey="changeDefaultStoreView" after="waitForStorePageToLoad"/> + <click selector="{{AdminStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup"/> + <waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForModal"/> + <see selector="{{AdminConfirmationModalSection.title}}" userInput="Warning message" stepKey="seeWarningAboutTakingALongTimeToComplete"/> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmModal"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="seeForSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the store." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateCustomStoreActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateCustomStoreActionGroup.xml new file mode 100644 index 0000000000000..627b8f0b096a1 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateCustomStoreActionGroup.xml @@ -0,0 +1,32 @@ +<?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="CreateCustomStoreActionGroup"> + <annotations> + <description>Goes to the Admin Stores grid page. Clicks on 'Create Store'. Fills in the provided Details (Website, Store Group Name and Store Group Code). Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="website" type="string"/> + <argument name="store" type="string"/> + <argument name="rootCategory" type="string"/> + </arguments> + + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <waitForPageLoad stepKey="waitForSystemStorePage"/> + <click selector="{{AdminStoresMainActionsSection.createStoreButton}}" stepKey="selectCreateStore"/> + <selectOption userInput="{{website}}" selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" stepKey="selectMainWebsite"/> + <fillField userInput="{{store}}" selector="{{AdminNewStoreGroupSection.storeGrpNameTextField}}" stepKey="fillStoreName"/> + <fillField userInput="{{store}}" selector="{{AdminNewStoreGroupSection.storeGrpCodeTextField}}" stepKey="fillStoreCode"/> + <selectOption userInput="{{rootCategory}}" selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" stepKey="selectStoreStatus"/> + <click selector="{{AdminStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup"/> + <waitForElementVisible selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="waitForStoreGridReload"/> + <see userInput="You saved the store." stepKey="seeSavedMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateCustomStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateCustomStoreViewActionGroup.xml index 290d0ad623bad..cf57afc5f7439 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateCustomStoreViewActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateCustomStoreViewActionGroup.xml @@ -26,26 +26,4 @@ <waitForPageLoad stepKey="waitForPageLoad2"/> <conditionalClick selector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" dependentSelector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" visible="true" stepKey="clickAcceptNewStoreViewCreationButton"/> </actionGroup> - - <actionGroup name="CreateStoreView"> - <annotations> - <description>Goes to the Admin Store Views creation page. Fills in the provided Store View, Store Group Name and Store View Status. Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="storeView" defaultValue="customStore"/> - <argument name="storeGroupName" defaultValue="_defaultStoreGroup.name"/> - <argument name="storeViewStatus" defaultValue="_defaultStore.is_active"/> - </arguments> - - <amOnPage url="{{AdminSystemStoreViewPage.url}}" stepKey="amOnAdminSystemStoreViewPage"/> - <waitForPageLoad stepKey="waitForProductPageLoad"/> - <selectOption userInput="{{storeGroupName}}" selector="{{AdminNewStoreSection.storeGrpDropdown}}" stepKey="selectStoreGroup"/> - <fillField userInput="{{storeView.name}}" selector="{{AdminNewStoreSection.storeNameTextField}}" stepKey="fillStoreViewName"/> - <fillField userInput="{{storeView.code}}" selector="{{AdminNewStoreSection.storeCodeTextField}}" stepKey="fillStoreViewCode"/> - <selectOption userInput="{{storeViewStatus}}" selector="{{AdminNewStoreSection.statusDropdown}}" stepKey="selectStoreViewStatus"/> - <click selector="{{AdminStoresMainActionsSection.saveButton}}" stepKey="clickSaveStoreViewButton"/> - <waitForElementVisible selector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" stepKey="waitForAcceptNewStoreViewCreationButton"/> - <conditionalClick selector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" dependentSelector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" visible="true" stepKey="clickAcceptNewStoreViewCreationButton"/> - <see userInput="You saved the store view." stepKey="seeSavedMessage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateStoreViewActionGroup.xml new file mode 100644 index 0000000000000..916048e33ea44 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateStoreViewActionGroup.xml @@ -0,0 +1,32 @@ +<?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="CreateStoreViewActionGroup"> + <annotations> + <description>Goes to the Admin Store Views creation page. Fills in the provided Store View, Store Group Name and Store View Status. Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="storeView" defaultValue="customStore"/> + <argument name="storeGroupName" defaultValue="_defaultStoreGroup.name"/> + <argument name="storeViewStatus" defaultValue="_defaultStore.is_active"/> + </arguments> + + <amOnPage url="{{AdminSystemStoreViewPage.url}}" stepKey="amOnAdminSystemStoreViewPage"/> + <waitForPageLoad stepKey="waitForProductPageLoad"/> + <selectOption userInput="{{storeGroupName}}" selector="{{AdminNewStoreSection.storeGrpDropdown}}" stepKey="selectStoreGroup"/> + <fillField userInput="{{storeView.name}}" selector="{{AdminNewStoreSection.storeNameTextField}}" stepKey="fillStoreViewName"/> + <fillField userInput="{{storeView.code}}" selector="{{AdminNewStoreSection.storeCodeTextField}}" stepKey="fillStoreViewCode"/> + <selectOption userInput="{{storeViewStatus}}" selector="{{AdminNewStoreSection.statusDropdown}}" stepKey="selectStoreViewStatus"/> + <click selector="{{AdminStoresMainActionsSection.saveButton}}" stepKey="clickSaveStoreViewButton"/> + <waitForElementVisible selector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" stepKey="waitForAcceptNewStoreViewCreationButton"/> + <conditionalClick selector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" dependentSelector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" visible="true" stepKey="clickAcceptNewStoreViewCreationButton"/> + <see userInput="You saved the store view." stepKey="seeSavedMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreActionGroup.xml index a4d4374704291..848fd5cf49d07 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreActionGroup.xml @@ -29,43 +29,4 @@ <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the store." stepKey="seeSuccessMessage"/> </actionGroup> - - <actionGroup name="DeleteCustomStoreBackupEnabledYesActionGroup"> - <annotations> - <description>Goes to the Admin Stores grid page. Deletes the provided Store Group Name while creating a DB backup. Validates that the Success Messages are present and correct.</description> - </annotations> - <arguments> - <argument name="storeGroupName" type="string"/> - </arguments> - - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <see userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="verifyThatCorrectStoreGroupFound"/> - <click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickEditExistingStoreRow"/> - <waitForPageLoad stepKey="waitForStoreToLoad"/> - <click selector="{{AdminStoresMainActionsSection.deleteButton}}" stepKey="clickDeleteStoreGroupButtonOnEditStorePage"/> - <selectOption userInput="Yes" selector="{{AdminStoresDeleteStoreGroupSection.createDbBackup}}" stepKey="setCreateDbBackupToNo"/> - <click selector="{{AdminStoresDeleteStoreGroupSection.deleteStoreGroupButton}}" stepKey="clickDeleteStoreGroupButtonOnDeleteStorePage"/> - <see selector="{{AdminStoresGridSection.successMessage}}" userInput="The database was backed up." stepKey="seeAssertDatabaseBackedUpMessage"/> - <see selector="{{AdminStoresGridSection.successMessage}}" userInput="You deleted the store." stepKey="seeAssertSuccessDeleteStoreGroupMessage"/> - </actionGroup> - - <actionGroup name="AssertStoreNotInGrid"> - <annotations> - <description>Goes to the Admin Stores grid page. Validates that the provided Store Group Name is NOT present in the grid.</description> - </annotations> - <arguments> - <argument name="storeGroupName" type="string"/> - </arguments> - - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForStoreToLoad"/> - <see selector="{{AdminStoresGridSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertStoreGroupNotInGridMessage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreBackupEnabledYesActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreBackupEnabledYesActionGroup.xml new file mode 100644 index 0000000000000..97fb6a83ab06f --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreBackupEnabledYesActionGroup.xml @@ -0,0 +1,32 @@ +<?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="DeleteCustomStoreBackupEnabledYesActionGroup"> + <annotations> + <description>Goes to the Admin Stores grid page. Deletes the provided Store Group Name while creating a DB backup. Validates that the Success Messages are present and correct.</description> + </annotations> + <arguments> + <argument name="storeGroupName" type="string"/> + </arguments> + + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <see userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="verifyThatCorrectStoreGroupFound"/> + <click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickEditExistingStoreRow"/> + <waitForPageLoad stepKey="waitForStoreToLoad"/> + <click selector="{{AdminStoresMainActionsSection.deleteButton}}" stepKey="clickDeleteStoreGroupButtonOnEditStorePage"/> + <selectOption userInput="Yes" selector="{{AdminStoresDeleteStoreGroupSection.createDbBackup}}" stepKey="setCreateDbBackupToNo"/> + <click selector="{{AdminStoresDeleteStoreGroupSection.deleteStoreGroupButton}}" stepKey="clickDeleteStoreGroupButtonOnDeleteStorePage"/> + <see selector="{{AdminStoresGridSection.successMessage}}" userInput="The database was backed up." stepKey="seeAssertDatabaseBackedUpMessage"/> + <see selector="{{AdminStoresGridSection.successMessage}}" userInput="You deleted the store." stepKey="seeAssertSuccessDeleteStoreGroupMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreViewBackupEnabledYesActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreViewBackupEnabledYesActionGroup.xml new file mode 100644 index 0000000000000..f670a4771ca5c --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreViewBackupEnabledYesActionGroup.xml @@ -0,0 +1,34 @@ +<?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="DeleteCustomStoreViewBackupEnabledYesActionGroup"> + <annotations> + <description>Goes to the Admin Stores grid page. Deleted the provided Store while creating a Backup. Validates that the Success Messages (Delete/Backup) are present and correct.</description> + </annotations> + <arguments> + <argument name="storeViewName" type="string"/> + </arguments> + + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <fillField userInput="{{storeViewName}}" selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="fillSearchStoreViewField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <click selector="{{AdminStoresGridSection.storeNameInFirstRow}}" stepKey="clickEditExistingStoreViewRow"/> + <waitForPageLoad stepKey="waitForStoreToLoad"/> + <click selector="{{AdminNewStoreViewActionsSection.delete}}" stepKey="clickDeleteStoreViewButtonOnEditStorePage"/> + <selectOption userInput="Yes" selector="{{AdminStoreBackupOptionsSection.createBackupSelect}}" stepKey="setCreateDbBackupToYes"/> + <click selector="{{AdminNewStoreViewActionsSection.delete}}" stepKey="clickDeleteStoreViewButtonOnDeleteStorePage"/> + <waitForElementVisible selector="{{AdminConfirmationModalSection.title}}" stepKey="waitingForWarningModal"/> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmStoreViewDelete"/> + <waitForPageLoad stepKey="waitForSuccessMessage"/> + <see selector="{{AdminStoresGridSection.successMessage}}" userInput="The database was backed up." stepKey="seeAssertDatabaseBackedUpMessage"/> + <see selector="{{AdminStoresGridSection.successMessage}}" userInput="You deleted the store view." stepKey="seeAssertSuccessDeleteStoreViewMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/EditCustomStoreGroupAcceptWarningMessageActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/EditCustomStoreGroupAcceptWarningMessageActionGroup.xml index 5493ae7399ddd..1c2ae675573a8 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/EditCustomStoreGroupAcceptWarningMessageActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/EditCustomStoreGroupAcceptWarningMessageActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="EditCustomStoreGroupAcceptWarningMessageActionGroup" extends="CreateCustomStore"> + <actionGroup name="EditCustomStoreGroupAcceptWarningMessageActionGroup" extends="CreateCustomStoreActionGroup"> <!-- Admin creates new Store group --> <annotations> <description>EXTENDS: CreateCustomStore. Removes 'selectCreateStore'. Clicks on the 1st row. Clicks on Ok.</description> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/EditStoreGroupActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/EditStoreGroupActionGroup.xml new file mode 100644 index 0000000000000..7e2a0ac443d51 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/EditStoreGroupActionGroup.xml @@ -0,0 +1,28 @@ +<?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="EditStoreGroupActionGroup"> + <annotations> + <description>Edit store group.</description> + </annotations> + <arguments> + <argument name="storeGroupName" type="string"/> + </arguments> + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <waitForPageLoad stepKey="waitForResetResult"/> + <fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillStoreGroupFilter"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForSearchResult"/> + <click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clicksStoreGroupName"/> + <waitForPageLoad stepKey="waitForStorePageToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/NavigateToAdminContentManagementPageActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/NavigateToAdminContentManagementPageActionGroup.xml new file mode 100644 index 0000000000000..bf3a3b2f8509e --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/NavigateToAdminContentManagementPageActionGroup.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="NavigateToAdminContentManagementPageActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Content Management'.</description> + </annotations> + + <amOnPage url="{{AdminContentManagementPage.url}}" stepKey="navigateToConfigurationPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/SaveStoreConfigurationActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/SaveStoreConfigurationActionGroup.xml new file mode 100644 index 0000000000000..ce68b7a05b8d2 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/SaveStoreConfigurationActionGroup.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="SaveStoreConfigurationActionGroup"> + <annotations> + <description>Clicks on the Save button.</description> + </annotations> + + <comment userInput="saveStoreConfiguration" stepKey="comment"/> + <waitForElementVisible selector="{{StoreConfigSection.Save}}" stepKey="waitForSaveButton"/> + <click selector="{{StoreConfigSection.Save}}" stepKey="clickSaveButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/SaveStoreConfigurationAndValidateFieldErrorActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/SaveStoreConfigurationAndValidateFieldErrorActionGroup.xml new file mode 100644 index 0000000000000..82b591e8f92dc --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/SaveStoreConfigurationAndValidateFieldErrorActionGroup.xml @@ -0,0 +1,28 @@ +<?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="SaveStoreConfigurationAndValidateFieldErrorActionGroup"> + <annotations> + <description>Clicks on Save. Validates that the fields are required.</description> + </annotations> + <arguments> + <argument name="inputFieldError" type="string"/> + <argument name="errorMessageSelector" type="string"/> + <argument name="errorMessage" type="string"/> + </arguments> + + <comment userInput="saveStoreConfigurationAndValidateFieldError" stepKey="comment"/> + <waitForElementVisible selector="{{StoreConfigSection.Save}}" stepKey="waitForSaveButton"/> + <click selector="{{StoreConfigSection.Save}}" stepKey="clickSaveButton"/> + <waitForElement selector="{{inputFieldError}}" stepKey="waitForErrorField"/> + <waitForElementVisible selector="{{errorMessageSelector}}" stepKey="waitForErrorMessage"/> + <see selector="{{errorMessageSelector}}" userInput="{{errorMessage}}" stepKey="seeErrorMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/StorefrontSwitchDefaultStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/StorefrontSwitchDefaultStoreViewActionGroup.xml new file mode 100644 index 0000000000000..e3b3cc7c1a9ff --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/StorefrontSwitchDefaultStoreViewActionGroup.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="StorefrontSwitchDefaultStoreViewActionGroup" extends="StorefrontSwitchStoreViewActionGroup"> + <annotations> + <description>EXTENDS: StorefrontSwitchStoreViewActionGroup. Clicks on the Default Store View.</description> + </annotations> + + <remove keyForRemoval="clickSelectStoreView"/> + <click selector="{{StorefrontHeaderSection.storeViewOption('default')}}" stepKey="clickSelectDefaultStoreView" after="waitForStoreViewDropdown"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/StorefrontSwitchStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/StorefrontSwitchStoreViewActionGroup.xml index 62ebdb6e8e9eb..9d8fb267910e1 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/StorefrontSwitchStoreViewActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/StorefrontSwitchStoreViewActionGroup.xml @@ -15,19 +15,10 @@ <arguments> <argument name="storeView" defaultValue="customStore"/> </arguments> - + <click selector="{{StorefrontHeaderSection.storeViewSwitcher}}" stepKey="clickStoreViewSwitcher"/> <waitForElementVisible selector="{{StorefrontHeaderSection.storeViewDropdown}}" stepKey="waitForStoreViewDropdown"/> <click selector="{{StorefrontHeaderSection.storeViewOption(storeView.code)}}" stepKey="clickSelectStoreView"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> - - <actionGroup name="StorefrontSwitchDefaultStoreViewActionGroup" extends="StorefrontSwitchStoreViewActionGroup"> - <annotations> - <description>EXTENDS: StorefrontSwitchStoreViewActionGroup. Clicks on the Default Store View.</description> - </annotations> - - <remove keyForRemoval="clickSelectStoreView"/> - <click selector="{{StorefrontHeaderSection.storeViewOption('default')}}" stepKey="clickSelectDefaultStoreView" after="waitForStoreViewDropdown"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateCustomStoreViewStatusEnabledVerifyAbsenceOfDeleteButtonTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateCustomStoreViewStatusEnabledVerifyAbsenceOfDeleteButtonTest.xml index 7cd44d4d0ae88..5d4ac8de74680 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateCustomStoreViewStatusEnabledVerifyAbsenceOfDeleteButtonTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateCustomStoreViewStatusEnabledVerifyAbsenceOfDeleteButtonTest.xml @@ -39,7 +39,7 @@ </actionGroup> <!--Save the above store view and verify AssertStoreViewSuccessSaveMessage--> - <actionGroup ref="AdminCreateStoreViewActionSaveGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> + <actionGroup ref="AdminCreateStoreViewSaveActionGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> <!--Search store view(from above step) in grid--> <actionGroup ref="AssertStoreViewInGridActionGroup" stepKey="searchStoreViewInGrid"> @@ -56,4 +56,4 @@ <!--Go to store view form page and verify AssertStoreNoDeleteButton--> <dontSee selector="{{AdminNewStoreViewActionsSection.delete}}" stepKey="AssertStoreNoDeleteButton"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateCustomStoreViewStatusEnabledVerifyBackendAndFrontendTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateCustomStoreViewStatusEnabledVerifyBackendAndFrontendTest.xml index 18485abadc008..2ba8c675b3b2a 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateCustomStoreViewStatusEnabledVerifyBackendAndFrontendTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateCustomStoreViewStatusEnabledVerifyBackendAndFrontendTest.xml @@ -39,7 +39,7 @@ </actionGroup> <!--Save the above store view and verify AssertStoreViewSuccessSaveMessage--> - <actionGroup ref="AdminCreateStoreViewActionSaveGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> + <actionGroup ref="AdminCreateStoreViewSaveActionGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> <!--Search store view(from above step) in grid and verify AssertStoreInGrid--> <actionGroup ref="AssertStoreViewInGridActionGroup" stepKey="searchStoreViewInGrid"> @@ -66,4 +66,4 @@ <argument name="customStore" value="{{customStore.name}}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateNewLocalizedStoreViewStatusEnabledTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateNewLocalizedStoreViewStatusEnabledTest.xml index 8e9fe1e71ceb4..6c60445107b28 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateNewLocalizedStoreViewStatusEnabledTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateNewLocalizedStoreViewStatusEnabledTest.xml @@ -33,11 +33,11 @@ </actionGroup> <!--Save the above store view and verify AssertStoreViewSuccessSaveMessage--> - <actionGroup ref="AdminCreateStoreViewActionSaveGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> + <actionGroup ref="AdminCreateStoreViewSaveActionGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> <!--Search store view(from above step) in grid and verify AssertStoreInGrid--> <actionGroup ref="AssertStoreViewInGridActionGroup" stepKey="searchStoreViewInGrid"> <argument name="storeViewName" value="{{storeViewGermany.name}}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithCustomWebsiteAndDefaultCategoryTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithCustomWebsiteAndDefaultCategoryTest.xml index 8e8f31eaca865..4892556929f80 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithCustomWebsiteAndDefaultCategoryTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithCustomWebsiteAndDefaultCategoryTest.xml @@ -34,19 +34,19 @@ </after> <!--Create custom store group with custom website and default category and verify AssertStoreGroupSuccessSaveMessage--> - <actionGroup ref="CreateCustomStore" stepKey="createCustomStoreGroup"> + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createCustomStoreGroup"> <argument name="website" value="{{customWebsite.name}}"/> <argument name="store" value="{{customStoreGroup.name}}"/> <argument name="rootCategory" value="Default Category"/> </actionGroup> <!--Search created store group(from above step) in grid and verify AssertStoreGroupInGrid message--> - <actionGroup ref="AssertStoreGroupInGrid" stepKey="seeCreatedStoreGroupInGrid"> + <actionGroup ref="AssertStoreGroupInGridActionGroup" stepKey="seeCreatedStoreGroupInGrid"> <argument name="storeGroupName" value="{{customStoreGroup.name}}"/> </actionGroup> <!--Go to store group form page and verify AssertStoreGroupForm--> - <actionGroup ref="AssertStoreGroupForm" stepKey="seeCreatedStoreGroupForm"> + <actionGroup ref="AssertStoreGroupFormActionGroup" stepKey="seeCreatedStoreGroupForm"> <argument name="website" value="{{customWebsite.name}}"/> <argument name="storeGroupName" value="{{customStoreGroup.name}}"/> <argument name="storeGroupCode" value="{{customStoreGroup.code}}"/> @@ -55,4 +55,4 @@ <!--Also verify absence of delete button on store group form page(AssertStoreGroupNoDeleteButton)--> <dontSee selector="{{AdminStoresMainActionsSection.deleteButton}}" stepKey="AssertStoreGroupNoDeleteButton"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithCustomWebsiteAndRootCategoryTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithCustomWebsiteAndRootCategoryTest.xml index 18f9822145dec..27037f45f3835 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithCustomWebsiteAndRootCategoryTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithCustomWebsiteAndRootCategoryTest.xml @@ -42,23 +42,23 @@ </after> <!--Create custom store group with custom website and root category and verify AssertStoreGroupSuccessSaveMessage--> - <actionGroup ref="CreateCustomStore" stepKey="createCustomStoreGroup"> + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createCustomStoreGroup"> <argument name="website" value="{{customWebsite.name}}"/> <argument name="store" value="{{customStoreGroup.name}}"/> <argument name="rootCategory" value="$$rootCategory.name$$"/> </actionGroup> <!--Search created store group(from above step) in grid and verify AssertStoreGroupInGrid--> - <actionGroup ref="AssertStoreGroupInGrid" stepKey="seeCreatedStoreGroupInGrid"> + <actionGroup ref="AssertStoreGroupInGridActionGroup" stepKey="seeCreatedStoreGroupInGrid"> <argument name="storeGroupName" value="{{customStoreGroup.name}}"/> </actionGroup> <!--Go to store group form page and verify AssertStoreGroupForm and AssertStoreGroupOnStoreViewForm--> - <actionGroup ref="AssertStoreGroupForm" stepKey="seeCreatedStoreGroupInForm"> + <actionGroup ref="AssertStoreGroupFormActionGroup" stepKey="seeCreatedStoreGroupInForm"> <argument name="website" value="{{customWebsite.name}}"/> <argument name="storeGroupName" value="{{customStoreGroup.name}}"/> <argument name="storeGroupCode" value="{{customStoreGroup.code}}"/> <argument name="rootCategory" value="$$rootCategory.name$$"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithDefaultWebsiteAndDefaultCategoryTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithDefaultWebsiteAndDefaultCategoryTest.xml index ddc5d061c1db2..0db65501b4112 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithDefaultWebsiteAndDefaultCategoryTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithDefaultWebsiteAndDefaultCategoryTest.xml @@ -36,16 +36,16 @@ </actionGroup> <!--Search created store group(from above step) in grid and verify AssertStoreGroupInGrid--> - <actionGroup ref="AssertStoreGroupInGrid" stepKey="seeCreatedStoreGroupInGrid"> + <actionGroup ref="AssertStoreGroupInGridActionGroup" stepKey="seeCreatedStoreGroupInGrid"> <argument name="storeGroupName" value="{{SecondStoreGroupUnique.name}}"/> </actionGroup> <!--Go to store group form page and verify AssertStoreGroupForm and AssertStoreGroupOnStoreViewForm--> - <actionGroup ref="AssertStoreGroupForm" stepKey="seeCreatedStoreGroupForm"> + <actionGroup ref="AssertStoreGroupFormActionGroup" stepKey="seeCreatedStoreGroupForm"> <argument name="website" value="{{_defaultWebsite.name}}"/> <argument name="storeGroupName" value="{{SecondStoreGroupUnique.name}}"/> <argument name="storeGroupCode" value="{{SecondStoreGroupUnique.code}}"/> <argument name="rootCategory" value="Default Category"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreViewStatusDisabledVerifyBackendAndFrontendTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreViewStatusDisabledVerifyBackendAndFrontendTest.xml index 6ccab965b7727..2d8fbc72263d4 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreViewStatusDisabledVerifyBackendAndFrontendTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreViewStatusDisabledVerifyBackendAndFrontendTest.xml @@ -27,14 +27,14 @@ </after> <!--Create store view--> - <actionGroup ref="CreateStoreView" stepKey="createStoreView"> + <actionGroup ref="CreateStoreViewActionGroup" stepKey="createStoreView"> <argument name="storeView" value="storeViewDataDisabled"/> <argument name="storeGroupName" value="_defaultStoreGroup.name"/> <argument name="storeViewStatus" value="storeViewDataDisabled.is_active"/> </actionGroup> <!--Save the above store view and verify AssertStoreViewSuccessSaveMessage--> - <actionGroup ref="AdminCreateStoreViewActionSaveGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> + <actionGroup ref="AdminCreateStoreViewSaveActionGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> <!--Go to store configuration page and verify AssertStoreBackend--> <actionGroup ref="AssertStoreConfigurationBackendActionGroup" stepKey="verifyValuesOnStoreBackend"> @@ -46,4 +46,4 @@ <argument name="store" value="{{storeViewDataDisabled.name}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreViewStatusEnabledVerifyBackendAndFrontendTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreViewStatusEnabledVerifyBackendAndFrontendTest.xml index c2f12bd2673f7..150e1082352cf 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreViewStatusEnabledVerifyBackendAndFrontendTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreViewStatusEnabledVerifyBackendAndFrontendTest.xml @@ -33,7 +33,7 @@ </actionGroup> <!--Save the above store view and verify AssertStoreViewSuccessSaveMessage--> - <actionGroup ref="AdminCreateStoreViewActionSaveGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> + <actionGroup ref="AdminCreateStoreViewSaveActionGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> <!--Go to store configuration page and verify AssertStoreBackend--> <actionGroup ref="AssertStoreConfigurationBackendActionGroup" stepKey="verifyValuesOnStoreBackend"> @@ -45,4 +45,4 @@ <argument name="store" value="{{storeViewData.name}}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateWebsiteTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateWebsiteTest.xml index 29d96c3cb94c2..a8782acb1eb07 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateWebsiteTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateWebsiteTest.xml @@ -35,12 +35,12 @@ </actionGroup> <!--Search created website in grid and verify AssertWebsiteInGrid--> - <actionGroup ref="AssertWebsiteInGrid" stepKey="seeWebsiteInGrid"> + <actionGroup ref="AssertWebsiteInGridActionGroup" stepKey="seeWebsiteInGrid"> <argument name="websiteName" value="{{customWebsite.name}}"/> </actionGroup> <!--Verify website name and websitecode on website form (AssertWebsiteForm and AssertWebsiteOnStoreForm)--> - <actionGroup ref="AssertWebsiteForm" stepKey="seeWebsiteForm"> + <actionGroup ref="AssertWebsiteFormActionGroup" stepKey="seeWebsiteForm"> <argument name="websiteName" value="{{customWebsite.name}}"/> <argument name="websiteCode" value="{{customWebsite.code}}"/> </actionGroup> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminDeleteStoreGroupTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminDeleteStoreGroupTest.xml index 652537f7864cd..185cf87531d9a 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminDeleteStoreGroupTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminDeleteStoreGroupTest.xml @@ -39,7 +39,7 @@ </actionGroup> <!--Verify deleted Store group is not present in grid and verify AssertStoreGroupNotInGrid message--> - <actionGroup ref="AssertStoreNotInGrid" stepKey="verifyDeletedStoreGroupNotInGrid"> + <actionGroup ref="AssertStoreNotInGridActionGroup" stepKey="verifyDeletedStoreGroupNotInGrid"> <argument name="storeGroupName" value="{{customStore.name}}"/> </actionGroup> @@ -52,4 +52,4 @@ <argument name="backup" value="WebSetupWizardBackup"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminDeleteStoreViewTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminDeleteStoreViewTest.xml index fc1dcb5ee1a24..df6fc391b2972 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminDeleteStoreViewTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminDeleteStoreViewTest.xml @@ -37,7 +37,7 @@ </actionGroup> <!--Verify deleted store view not present in grid and verify AssertStoreNotInGrid Message--> - <actionGroup ref="AssertStoreViewNotInGrid" stepKey="verifyDeletedStoreViewNotInGrid"> + <actionGroup ref="AssertStoreViewNotInGridActionGroup" stepKey="verifyDeletedStoreViewNotInGrid"> <argument name="storeViewName" value="{{storeViewData.name}}"/> </actionGroup> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminMoveStoreToOtherGroupSameWebsiteTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminMoveStoreToOtherGroupSameWebsiteTest.xml index b86b99936dbe2..f1983dca53bf7 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminMoveStoreToOtherGroupSameWebsiteTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminMoveStoreToOtherGroupSameWebsiteTest.xml @@ -62,7 +62,7 @@ <argument name="storeDropdown" value="{{customStore.name}}"/> </actionGroup> <!--Save the above store view and verify AssertStoreViewSuccessSaveMessage--> - <actionGroup ref="AdminCreateStoreViewActionSaveGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> + <actionGroup ref="AdminCreateStoreViewSaveActionGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"/> <!--Search moved store view(from above step) in grid and verify AssertStoreInGrid--> <actionGroup ref="AssertStoreViewInGridActionGroup" stepKey="searchMovedStoreViewInGrid"> @@ -92,4 +92,4 @@ <argument name="storeView2" value="{{storeViewData2.name}}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreGroupAcceptAlertAndVerifyStoreViewFormTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreGroupAcceptAlertAndVerifyStoreViewFormTest.xml index 9c84388d86f99..16f830224f7f4 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreGroupAcceptAlertAndVerifyStoreViewFormTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreGroupAcceptAlertAndVerifyStoreViewFormTest.xml @@ -31,7 +31,7 @@ <argument name="websiteCode" value="{{customWebsite.code}}"/> </actionGroup> <!--Create custom store group--> - <actionGroup ref="CreateCustomStore" stepKey="createCustomStoreGroup"> + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createCustomStoreGroup"> <argument name="website" value="{{_defaultWebsite.name}}"/> <argument name="store" value="{{staticStoreGroup.name}}"/> <argument name="rootCategory" value="Default Category"/> @@ -73,4 +73,4 @@ <argument name="rootCategory" value="$$rootCategory.name$$"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreGroupAndVerifyStoreViewFormTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreGroupAndVerifyStoreViewFormTest.xml index 3d85a34901434..ab204560f11c6 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreGroupAndVerifyStoreViewFormTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreGroupAndVerifyStoreViewFormTest.xml @@ -44,7 +44,7 @@ <click selector="{{AdminStoresGridSection.firstRow}}" stepKey="clickFirstRow"/> <waitForPageLoad stepKey="AdminSystemStoreGroupPageToOpen"/> <!--Update created Store group as per requirement--> - <actionGroup ref="CreateCustomStore" stepKey="createNewCustomStoreGroup"> + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createNewCustomStoreGroup"> <argument name="website" value="{{_defaultWebsite.name}}"/> <argument name="store" value="{{customStoreGroup.name}}"/> <argument name="rootCategory" value="Default Category"/> @@ -63,4 +63,4 @@ <argument name="rootCategory" value="Default Category"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreViewTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreViewTest.xml index 054ee789fbdc5..26dee6c632928 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreViewTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreViewTest.xml @@ -47,7 +47,7 @@ <argument name="customStore" value="SecondStoreUnique"/> </actionGroup> <!--Save the updated Store view and verify AssertStoreViewSuccessSaveMessage--> - <actionGroup ref="AdminCreateStoreViewActionSaveGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"> + <actionGroup ref="AdminCreateStoreViewSaveActionGroup" stepKey="verifyAssertStoreViewSuccessSaveMessage"> </actionGroup> <!--Search updated store view in grid and verify AssertStoreViewInGridMessage--> @@ -78,4 +78,4 @@ <see selector="{{StorefrontHeaderSection.storeViewDropdown}}" userInput="{{storeViewData.name}}" stepKey="seeAssertStoreViewOnStorefront"/> <see selector="{{StorefrontHeaderSection.storeViewDropdown}}" userInput="{{SecondStoreUnique.name}}" stepKey="seeAssertUpdatedStoreViewOnStorefront"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateWebsiteTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateWebsiteTest.xml index 6b666126569ae..5c4ecb87dda53 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateWebsiteTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateWebsiteTest.xml @@ -34,7 +34,7 @@ </after> <!--Search created custom website in grid--> - <actionGroup ref="AssertWebsiteInGrid" stepKey="seeWebsiteInGrid"> + <actionGroup ref="AssertWebsiteInGridActionGroup" stepKey="seeWebsiteInGrid"> <argument name="websiteName" value="{{customWebsite.name}}"/> </actionGroup> <click selector="{{AdminStoresGridSection.websiteName(customWebsite.name)}}" stepKey="clickWebsiteFirstRowInGrid"/> @@ -46,14 +46,14 @@ </actionGroup> <!--Search updated custom website(from above step) in grid and verify AssertWebsiteInGrid--> - <actionGroup ref="AssertWebsiteInGrid" stepKey="seeUpdatedWebsiteInGrid"> + <actionGroup ref="AssertWebsiteInGridActionGroup" stepKey="seeUpdatedWebsiteInGrid"> <argument name="websiteName" value="{{updateCustomWebsite.name}}"/> </actionGroup> <!--Verify updated website name and updated websitecode on website form (AssertWebsiteForm and AssertWebsiteOnStoreForm)--> - <actionGroup ref="AssertWebsiteForm" stepKey="seeUpdatedWebsiteForm"> + <actionGroup ref="AssertWebsiteFormActionGroup" stepKey="seeUpdatedWebsiteForm"> <argument name="websiteName" value="{{updateCustomWebsite.name}}"/> <argument name="websiteCode" value="{{updateCustomWebsite.code}}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterDeleteAndVerifyErrorMessageTest.xml b/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterDeleteAndVerifyErrorMessageTest.xml index e2c3b157c1059..b22618f40e5a8 100644 --- a/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterDeleteAndVerifyErrorMessageTest.xml +++ b/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterDeleteAndVerifyErrorMessageTest.xml @@ -32,7 +32,7 @@ <argument name="websiteCode" value="{{customWebsite.code}}"/> </actionGroup> <!-- Create second store --> - <actionGroup ref="CreateCustomStore" stepKey="createCustomStore"> + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createCustomStore"> <argument name="website" value="{{customWebsite.name}}"/> <argument name="store" value="{{customStoreGroup.name}}"/> <argument name="rootCategory" value="$$rootCategory.name$$"/> @@ -78,4 +78,4 @@ <argument name="errorMessage" value="Something went wrong with processing the default view and we have restored the filter to its original state."/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml index 4dc5c85830076..b2f63dbc39eab 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml @@ -51,7 +51,7 @@ </actionGroup> <!-- Create second store --> - <actionGroup ref="CreateCustomStore" stepKey="createCustomStore"> + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createCustomStore"> <argument name="website" value="{{_defaultWebsite.name}}"/> <argument name="store" value="{{customStoreGroup.name}}"/> <argument name="rootCategory" value="$$rootCategory.name$$"/> @@ -112,4 +112,4 @@ <see selector="{{AdminUrlRewriteIndexSection.storeView('1')}}" userInput="{{customStore.name}}" stepKey="seeStoreValueForProductId"/> <see selector="{{AdminUrlRewriteIndexSection.storeView('1')}}" userInput="{{storeViewData.name}}" stepKey="seeStoreViewValueForProductId"/> </test> -</tests> \ No newline at end of file +</tests> From 598ab813e77f347d5bd44b2ed53795278737ffc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 15:28:47 +0100 Subject: [PATCH 314/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...leRatesShippingMethodStatusActionGroup.xml | 10 --------- ...ileTableRatesShippingMethodActionGroup.xml | 21 +++++++++++++++++++ 2 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 app/code/Magento/Shipping/Test/Mftf/ActionGroup/AdminImportFileTableRatesShippingMethodActionGroup.xml diff --git a/app/code/Magento/Shipping/Test/Mftf/ActionGroup/AdminChangeTableRatesShippingMethodStatusActionGroup.xml b/app/code/Magento/Shipping/Test/Mftf/ActionGroup/AdminChangeTableRatesShippingMethodStatusActionGroup.xml index e0fec2a6dc4d2..e506ca3a7662f 100644 --- a/app/code/Magento/Shipping/Test/Mftf/ActionGroup/AdminChangeTableRatesShippingMethodStatusActionGroup.xml +++ b/app/code/Magento/Shipping/Test/Mftf/ActionGroup/AdminChangeTableRatesShippingMethodStatusActionGroup.xml @@ -17,14 +17,4 @@ <uncheckOption selector="{{AdminShippingMethodTableRatesSection.enabledUseSystemValue}}" stepKey="uncheckUseSystemValue"/> <selectOption selector="{{AdminShippingMethodTableRatesSection.carriersTableRateActive}}" userInput="{{status}}" stepKey="changeTableRatesMethodStatus"/> </actionGroup> - <actionGroup name="AdminImportFileTableRatesShippingMethodActionGroup"> - <annotations> - <description>Import a file in Table Rates tab in Shipping Method config page.</description> - </annotations> - <arguments> - <argument name="file" type="string" defaultValue="test_tablerates.csv"/> - </arguments> - <conditionalClick selector="{{AdminShippingMethodTableRatesSection.carriersTableRateTab}}" dependentSelector="{{AdminShippingMethodTableRatesSection.carriersTableRateActive}}" visible="false" stepKey="expandTab"/> - <attachFile selector="{{AdminShippingMethodTableRatesSection.importFile}}" userInput="{{file}}" stepKey="attachFileForImport"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Shipping/Test/Mftf/ActionGroup/AdminImportFileTableRatesShippingMethodActionGroup.xml b/app/code/Magento/Shipping/Test/Mftf/ActionGroup/AdminImportFileTableRatesShippingMethodActionGroup.xml new file mode 100644 index 0000000000000..bfae3d8b76f19 --- /dev/null +++ b/app/code/Magento/Shipping/Test/Mftf/ActionGroup/AdminImportFileTableRatesShippingMethodActionGroup.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="AdminImportFileTableRatesShippingMethodActionGroup"> + <annotations> + <description>Import a file in Table Rates tab in Shipping Method config page.</description> + </annotations> + <arguments> + <argument name="file" type="string" defaultValue="test_tablerates.csv"/> + </arguments> + <conditionalClick selector="{{AdminShippingMethodTableRatesSection.carriersTableRateTab}}" dependentSelector="{{AdminShippingMethodTableRatesSection.carriersTableRateActive}}" visible="false" stepKey="expandTab"/> + <attachFile selector="{{AdminShippingMethodTableRatesSection.importFile}}" userInput="{{file}}" stepKey="attachFileForImport"/> + </actionGroup> +</actionGroups> From 94c33b4e62ae6ddd4a23f94b097f41c5b1aa8138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 15:35:03 +0100 Subject: [PATCH 315/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../StorefrontUpdateSearchTermEntityTest.xml | 6 +-- .../AdminDeleteAllSearchTermsActionGroup.xml | 17 +++++++ .../AdminDeleteSearchTermActionGroup.xml | 21 +++++++++ .../AdminSearchTermActionGroup.xml | 47 ------------------- ...archTermFilterBySearchQueryActionGroup.xml | 27 +++++++++++ .../AdminMassDeleteSearchTermEntityTest.xml | 8 ++-- ...archSuggestionByProductDescriptionTest.xml | 8 ++-- ...erifySearchSuggestionByProductNameTest.xml | 4 +- ...uggestionByProductShortDescriptionTest.xml | 4 +- ...VerifySearchSuggestionByProductSkuTest.xml | 4 +- 10 files changed, 82 insertions(+), 64 deletions(-) create mode 100644 app/code/Magento/Search/Test/Mftf/ActionGroup/AdminDeleteAllSearchTermsActionGroup.xml create mode 100644 app/code/Magento/Search/Test/Mftf/ActionGroup/AdminDeleteSearchTermActionGroup.xml delete mode 100644 app/code/Magento/Search/Test/Mftf/ActionGroup/AdminSearchTermActionGroup.xml create mode 100644 app/code/Magento/Search/Test/Mftf/ActionGroup/AdminSearchTermFilterBySearchQueryActionGroup.xml diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontUpdateSearchTermEntityTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontUpdateSearchTermEntityTest.xml index 3ebb09f3c9c26..6c475ddc60a95 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontUpdateSearchTermEntityTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontUpdateSearchTermEntityTest.xml @@ -18,7 +18,7 @@ <group value="search"/> <group value="mtf_migrated"/> </annotations> - + <before> <createData entity="_defaultCategory" stepKey="createCategory1"/> <createData entity="SimpleProduct" stepKey="createProduct1"> @@ -44,7 +44,7 @@ <amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openAdminCatalogSearchTermIndexPage1"/> <waitForPageLoad stepKey="waitForPageLoad1"/> - <actionGroup ref="searchTermFilterBySearchQuery" stepKey="filterByFirstSearchQuery1"> + <actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterByFirstSearchQuery1"> <argument name="searchQuery" value="$$createProduct1.name$$"/> </actionGroup> @@ -58,7 +58,7 @@ <amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openAdminCatalogSearchTermIndexPage2"/> <waitForPageLoad stepKey="waitForPageLoad3"/> - <actionGroup ref="searchTermFilterBySearchQuery" stepKey="filterByFirstSearchQuery2"> + <actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterByFirstSearchQuery2"> <argument name="searchQuery" value="{{UpdatedSearchTermData1.query_text}}"/> </actionGroup> diff --git a/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminDeleteAllSearchTermsActionGroup.xml b/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminDeleteAllSearchTermsActionGroup.xml new file mode 100644 index 0000000000000..be01df1bcf5a7 --- /dev/null +++ b/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminDeleteAllSearchTermsActionGroup.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="AdminDeleteAllSearchTermsActionGroup"> + <selectOption userInput="selectAll" selector="{{AdminCatalogSearchTermIndexSection.selectMassActionCheckbox}}" stepKey="checkAllSearchTerms"/> + <selectOption selector="{{AdminCatalogSearchTermIndexSection.massActions}}" userInput="delete" stepKey="selectDeleteOption"/> + <click selector="{{AdminCatalogSearchTermIndexSection.submit}}" stepKey="clickSubmitButton"/> + <click selector="{{AdminCatalogSearchTermIndexSection.okButton}}" stepKey="clickOkButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminDeleteSearchTermActionGroup.xml b/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminDeleteSearchTermActionGroup.xml new file mode 100644 index 0000000000000..2013dfcf0e3b2 --- /dev/null +++ b/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminDeleteSearchTermActionGroup.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="AdminDeleteSearchTermActionGroup"> + <annotations> + <description>Deletes the Search Terms in the Admin Search Term grid.</description> + </annotations> + + <selectOption selector="{{AdminCatalogSearchTermIndexSection.massActions}}" userInput="delete" stepKey="selectDeleteOption"/> + <click selector="{{AdminCatalogSearchTermIndexSection.submit}}" stepKey="clickSubmitButton"/> + <click selector="{{AdminCatalogSearchTermIndexSection.okButton}}" stepKey="clickOkButton"/> + <waitForElementVisible selector="{{AdminCatalogSearchTermMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminSearchTermActionGroup.xml b/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminSearchTermActionGroup.xml deleted file mode 100644 index aeadf69050912..0000000000000 --- a/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminSearchTermActionGroup.xml +++ /dev/null @@ -1,47 +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"> - <!-- Filter by search query and select --> - <actionGroup name="searchTermFilterBySearchQuery"> - <annotations> - <description>Fills in the provided Search Query on the Admin Search Term grid page.</description> - </annotations> - <arguments> - <argument name="searchQuery" type="string"/> - </arguments> - - <click selector="{{AdminCatalogSearchTermIndexSection.resetFilterButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForResetFilter"/> - <fillField selector="{{AdminCatalogSearchTermIndexSection.searchQuery}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/> - <click selector="{{AdminCatalogSearchTermIndexSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForSearchResultLoad"/> - <checkOption selector="{{AdminCatalogSearchTermIndexSection.searchTermRowCheckboxBySearchQuery(searchQuery)}}" stepKey="checkCheckBox"/> - </actionGroup> - - <!-- Delete search term --> - <actionGroup name="deleteSearchTerm"> - <annotations> - <description>Deletes the Search Terms in the Admin Search Term grid.</description> - </annotations> - - <selectOption selector="{{AdminCatalogSearchTermIndexSection.massActions}}" userInput="delete" stepKey="selectDeleteOption"/> - <click selector="{{AdminCatalogSearchTermIndexSection.submit}}" stepKey="clickSubmitButton"/> - <click selector="{{AdminCatalogSearchTermIndexSection.okButton}}" stepKey="clickOkButton"/> - <waitForElementVisible selector="{{AdminCatalogSearchTermMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> - </actionGroup> - - <!-- Delete all existing search terms --> - <actionGroup name="DeleteAllSearchTerms"> - <selectOption userInput="selectAll" selector="{{AdminCatalogSearchTermIndexSection.selectMassActionCheckbox}}" stepKey="checkAllSearchTerms"/> - <selectOption selector="{{AdminCatalogSearchTermIndexSection.massActions}}" userInput="delete" stepKey="selectDeleteOption"/> - <click selector="{{AdminCatalogSearchTermIndexSection.submit}}" stepKey="clickSubmitButton"/> - <click selector="{{AdminCatalogSearchTermIndexSection.okButton}}" stepKey="clickOkButton"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminSearchTermFilterBySearchQueryActionGroup.xml b/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminSearchTermFilterBySearchQueryActionGroup.xml new file mode 100644 index 0000000000000..4536b0126b872 --- /dev/null +++ b/app/code/Magento/Search/Test/Mftf/ActionGroup/AdminSearchTermFilterBySearchQueryActionGroup.xml @@ -0,0 +1,27 @@ +<?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"> + <!-- Filter by search query and select --> + <actionGroup name="AdminSearchTermFilterBySearchQueryActionGroup"> + <annotations> + <description>Fills in the provided Search Query on the Admin Search Term grid page.</description> + </annotations> + <arguments> + <argument name="searchQuery" type="string"/> + </arguments> + + <click selector="{{AdminCatalogSearchTermIndexSection.resetFilterButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForResetFilter"/> + <fillField selector="{{AdminCatalogSearchTermIndexSection.searchQuery}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/> + <click selector="{{AdminCatalogSearchTermIndexSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForSearchResultLoad"/> + <checkOption selector="{{AdminCatalogSearchTermIndexSection.searchTermRowCheckboxBySearchQuery(searchQuery)}}" stepKey="checkCheckBox"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Search/Test/Mftf/Test/AdminMassDeleteSearchTermEntityTest.xml b/app/code/Magento/Search/Test/Mftf/Test/AdminMassDeleteSearchTermEntityTest.xml index 67ccb51bf401e..37be694522b17 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/AdminMassDeleteSearchTermEntityTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/AdminMassDeleteSearchTermEntityTest.xml @@ -38,18 +38,18 @@ <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> <!-- Select all created below search terms --> - <actionGroup ref="searchTermFilterBySearchQuery" stepKey="filterByFirstSearchQuery"> + <actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterByFirstSearchQuery"> <argument name="searchQuery" value="$$createFirstSearchTerm.query_text$$"/> </actionGroup> - <actionGroup ref="searchTermFilterBySearchQuery" stepKey="filterBySecondSearchQuery"> + <actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterBySecondSearchQuery"> <argument name="searchQuery" value="$$createSecondSearchTerm.query_text$$"/> </actionGroup> - <actionGroup ref="searchTermFilterBySearchQuery" stepKey="filterByThirdSearchQuery"> + <actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterByThirdSearchQuery"> <argument name="searchQuery" value="$$createThirdSearchTerm.query_text$$"/> </actionGroup> <!-- Delete created below search terms --> - <actionGroup ref="deleteSearchTerm" stepKey="deleteSearchTerms"/> + <actionGroup ref="AdminDeleteSearchTermActionGroup" stepKey="deleteSearchTerms"/> <!-- Assert search terms are absent on the search term page --> <actionGroup ref="AssertSearchTermNotInGrid" stepKey="assertFirstSearchTermNotInGrid"> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml index c5124ac9c74a1..261a029be995a 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml @@ -27,7 +27,7 @@ <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> <!-- Delete all search terms --> <comment userInput="Delete all search terms" stepKey="deleteAllSearchTermsComment"/> - <actionGroup ref="DeleteAllSearchTerms" stepKey="deleteAllSearchTerms"/> + <actionGroup ref="AdminDeleteAllSearchTermsActionGroup" stepKey="deleteAllSearchTerms"/> <actionGroup ref="deleteAllProductsUsingProductGrid" stepKey="deleteAllProducts"/> <!-- Create product with description --> <comment userInput="Create product with description" stepKey="createProductWithDescriptionComment"/> @@ -47,12 +47,12 @@ <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> <!-- Filter the search term --> <comment userInput="Filter search term" stepKey="filterSearchTermComment"/> - <actionGroup ref="searchTermFilterBySearchQuery" stepKey="filterByThirdSearchQuery"> + <actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterByThirdSearchQuery"> <argument name="searchQuery" value="{{ApiProductDescription.value}}"/> </actionGroup> <!-- Delete created below search terms --> <comment userInput="Delete created below search terms" stepKey="deleteCreatedBelowSearchTermsComment"/> - <actionGroup ref="deleteSearchTerm" stepKey="deleteSearchTerms"/> + <actionGroup ref="AdminDeleteSearchTermActionGroup" stepKey="deleteSearchTerms"/> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Go to storefront home page --> @@ -79,7 +79,7 @@ <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> <!-- Filter the search term --> <comment userInput="Filter search term" stepKey="filterSearchTermComment2"/> - <actionGroup ref="searchTermFilterBySearchQuery" stepKey="filterByThirdSearchQuery"> + <actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterByThirdSearchQuery"> <argument name="searchQuery" value="{{ApiProductDescription.value}}"/> </actionGroup> <!-- Assert Search Term in grid --> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductNameTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductNameTest.xml index e49db08954e14..fc933c90341f9 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductNameTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductNameTest.xml @@ -38,11 +38,11 @@ <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> <!--Filter the search term --> - <actionGroup ref="searchTermFilterBySearchQuery" stepKey="filterByThirdSearchQuery"> + <actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterByThirdSearchQuery"> <argument name="searchQuery" value="$$simpleProduct.name$$"/> </actionGroup> <!-- Delete created below search terms --> - <actionGroup ref="deleteSearchTerm" stepKey="deleteSearchTerms"/> + <actionGroup ref="AdminDeleteSearchTermActionGroup" stepKey="deleteSearchTerms"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductShortDescriptionTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductShortDescriptionTest.xml index a1aa8be999aea..65472b9e10282 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductShortDescriptionTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductShortDescriptionTest.xml @@ -39,12 +39,12 @@ <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> <!--Filter the search term --> - <actionGroup ref="searchTermFilterBySearchQuery" stepKey="filterByThirdSearchQuery"> + <actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterByThirdSearchQuery"> <argument name="searchQuery" value="{{ApiProductShortDescription.value}}"/> </actionGroup> <!-- Delete created below search terms --> - <actionGroup ref="deleteSearchTerm" stepKey="deleteSearchTerms"/> + <actionGroup ref="AdminDeleteSearchTermActionGroup" stepKey="deleteSearchTerms"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductSkuTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductSkuTest.xml index 3a8443706c9c7..6e80823b78e0f 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductSkuTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductSkuTest.xml @@ -39,12 +39,12 @@ <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> <!--Filter the search term --> - <actionGroup ref="searchTermFilterBySearchQuery" stepKey="filterByThirdSearchQuery"> + <actionGroup ref="AdminSearchTermFilterBySearchQueryActionGroup" stepKey="filterByThirdSearchQuery"> <argument name="searchQuery" value="$$simpleProduct.sku$$"/> </actionGroup> <!-- Delete created below search terms --> - <actionGroup ref="deleteSearchTerm" stepKey="deleteSearchTerms"/> + <actionGroup ref="AdminDeleteSearchTermActionGroup" stepKey="deleteSearchTerms"/> <actionGroup ref="logout" stepKey="logout"/> </after> From c22df930468840b4212821b26bdebc0911c7c44f Mon Sep 17 00:00:00 2001 From: Subash Natarajan <subash.natarajan@ziffity.com> Date: Thu, 28 Nov 2019 20:15:58 +0530 Subject: [PATCH 316/595] static test whitespace removed --- .../Customer/Controller/Adminhtml/Index/AbstractMassAction.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/AbstractMassAction.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/AbstractMassAction.php index 8ba3c4416f8a7..e2bde42351d45 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/AbstractMassAction.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/AbstractMassAction.php @@ -73,7 +73,7 @@ public function execute() /** * Return component referer url - * + * * TODO: Technical dept referer url should be implement as a part of Action configuration in appropriate way * * @return null|string From f2d3f07e423452964a55bc5038512241fa34bff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 15:52:16 +0100 Subject: [PATCH 317/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...thOnlinePaymentIncludingTaxAndDiscount.xml | 2 +- .../AdminApplyCatalogRuleByCategoryTest.xml | 2 +- .../Test/AdminCreateCatalogPriceRuleTest.xml | 4 +- .../Test/AdminDeleteCatalogPriceRuleTest.xml | 2 +- .../StorefrontInactiveCatalogRuleTest.xml | 2 +- ...eForConfigurableProductWithOptionsTest.xml | 6 +- ...gRecalculationAfterCouponCodeAddedTest.xml | 2 +- ...SubtotalOrdersWithProcessingStatusTest.xml | 2 +- ...ConfigurableWithCatalogRuleAppliedTest.xml | 2 +- ...editMemoTotalAfterShippingDiscountTest.xml | 2 +- .../AdminCartPriceRuleActionGroup.xml | 80 --------- ...AdminCartPriceRuleNotInGridActionGroup.xml | 20 +++ .../AdminCreateCartPriceRuleActionGroup.xml | 162 ------------------ ...tionsSectionDiscountFieldsActionGroup.xml} | 27 --- ...eActionsSectionFreeShippingActionGroup.xml | 21 +++ ...ctionsSectionShippingAmountActionGroup.xml | 18 ++ ...tionsSectionSubsequentRulesActionGroup.xml | 18 ++ ...riceRuleActionsWithSubtotalActionGroup.xml | 38 ++++ ...eCartPriceRuleAndStayOnEditActionGroup.xml | 18 ++ ...RuleWithConditionIsCategoryActionGroup.xml | 34 ++++ ...CartPriceRuleWithConditionsActionGroup.xml | 46 +++++ ...CartPriceRuleWithCouponCodeActionGroup.xml | 28 +++ ...teMultiWebsiteCartPriceRuleActionGroup.xml | 23 +++ ...eteCartPriceRuleForRetailerActionGroup.xml | 24 +++ .../AdminFilterCartPriceRuleActionGroup.xml | 12 +- .../AdminInactiveCartPriceRuleActionGroup.xml | 18 ++ ...eCartPriceRuleSecondWebsiteActionGroup.xml | 25 +++ ...ectNotLoggedInCustomerGroupActionGroup.xml | 19 ++ ...SelectRetailerCustomerGroupActionGroup.xml | 19 ++ ...teConditionForCartPriceRuleActionGroup.xml | 34 ++++ ...onForActionsInCartPriceRuleActionGroup.xml | 37 ++++ .../StorefrontApplyCouponActionGroup.xml | 27 +++ .../StorefrontCancelCouponActionGroup.xml | 21 +++ ...torefrontCheckCouponAppliedActionGroup.xml | 24 +++ .../StorefrontSalesRuleActionGroup.xml | 76 -------- .../VerifyDiscountAmountActionGroup.xml | 32 ++++ ...inCartRulesAppliedForProductInCartTest.xml | 2 +- .../Mftf/Test/AdminCreateBuyXGetYFreeTest.xml | 2 +- ...inCreateCartPriceRuleEmptyFromDateTest.xml | 2 +- .../AdminCreateFixedAmountDiscountTest.xml | 2 +- ...CreateFixedAmountWholeCartDiscountTest.xml | 2 +- .../AdminCreatePercentOfProductPriceTest.xml | 2 +- ...PercentPriceAndVerifyDeleteMessageTest.xml | 4 +- ...artPriceRuleForConfigurableProductTest.xml | 4 +- .../Test/StorefrontCartPriceRuleCountry.xml | 2 +- .../Test/StorefrontCartPriceRulePostcode.xml | 2 +- .../Test/StorefrontCartPriceRuleQuantity.xml | 2 +- .../Test/StorefrontCartPriceRuleState.xml | 2 +- .../Test/StorefrontCartPriceRuleSubtotal.xml | 2 +- 49 files changed, 573 insertions(+), 384 deletions(-) delete mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleNotInGridActionGroup.xml rename app/code/Magento/SalesRule/Test/Mftf/ActionGroup/{AdminCreateCartPriceRuleActionsSectionActionGroup.xml => AdminCreateCartPriceRuleActionsSectionDiscountFieldsActionGroup.xml} (55%) create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionFreeShippingActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionShippingAmountActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionSubsequentRulesActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsWithSubtotalActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleAndStayOnEditActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithConditionIsCategoryActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithConditionsActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithCouponCodeActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateMultiWebsiteCartPriceRuleActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminDeleteCartPriceRuleForRetailerActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminInactiveCartPriceRuleActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/CreateCartPriceRuleSecondWebsiteActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SelectRetailerCustomerGroupActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SetCartAttributeConditionForCartPriceRuleActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SetConditionForActionsInCartPriceRuleActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontApplyCouponActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontCancelCouponActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontCheckCouponAppliedActionGroup.xml delete mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontSalesRuleActionGroup.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/VerifyDiscountAmountActionGroup.xml diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml index 8f0ce4918b978..98e075809b441 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml @@ -81,7 +81,7 @@ <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{SimpleSalesRule.name}}" stepKey="fillRuleName"/> <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsites"/> - <actionGroup ref="selectRetailerCustomerGroup" stepKey="selectRetailerCustomerGroup"/> + <actionGroup ref="SelectRetailerCustomerGroupActionGroup" stepKey="selectRetailerCustomerGroup"/> <click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" stepKey="clickToExpandActions"/> <selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="Percent of product price discount" stepKey="selectActionType"/> <fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="10" stepKey="fillDiscountAmount"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleByCategoryTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleByCategoryTest.xml index ca534ec7f5375..d7d7da58c27fc 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleByCategoryTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleByCategoryTest.xml @@ -74,7 +74,7 @@ <selectOption selector="{{AdminNewCatalogPriceRuleActions.disregardRules}}" userInput="Yes" stepKey="discardSubsequentRules"/> <scrollToTopOfPage stepKey="scrollToTop"/> <waitForPageLoad stepKey="waitForApplied"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <!-- 3. Save and apply the new catalog price rule --> <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="saveAndApply"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest.xml index ee61af180d350..c8669f551c32e 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest.xml @@ -32,7 +32,7 @@ <!-- log in and create the price rule --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <actionGroup stepKey="createNewPriceRule" ref="newCatalogPriceRuleByUI"/> - <actionGroup stepKey="selectNotLoggedInCustomerGroup" ref="selectNotLoggedInCustomerGroup"/> + <actionGroup stepKey="selectNotLoggedInCustomerGroup" ref="SelectNotLoggedInCustomerGroupActionGroup"/> <click stepKey="saveAndApply" selector="{{AdminNewCatalogPriceRule.saveAndApply}}"/> <see stepKey="assertSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule."/> </before> @@ -173,7 +173,7 @@ <!-- Create a catalog rule for the NOT LOGGED IN customer group --> <actionGroup ref="newCatalogPriceRuleByUI" stepKey="createNewPriceRule"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="saveAndApply"/> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccess"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml index 16fbca2697702..bd36c55d38f01 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml @@ -48,7 +48,7 @@ <!-- Create a catalog price rule --> <actionGroup ref="newCatalogPriceRuleByUI" stepKey="createNewPriceRule"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="saveAndApply"/> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccess"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml index 08e59c6316411..7ff63fd11c194 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml @@ -25,7 +25,7 @@ <requiredEntity createDataKey="createCategory"/> </createData> <actionGroup stepKey="createNewPriceRule" ref="newCatalogPriceRuleByUI"/> - <actionGroup stepKey="selectLoggedInCustomers" ref="selectNotLoggedInCustomerGroup"/> + <actionGroup stepKey="selectLoggedInCustomers" ref="SelectNotLoggedInCustomerGroupActionGroup"/> <scrollToTopOfPage stepKey="scrollToTop"/> <click stepKey="setInactive" selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}"/> <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="saveAndApply"/> diff --git a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml index e53e51c626aa9..920d839a1f2a0 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml +++ b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml @@ -129,7 +129,7 @@ <actionGroup ref="newCatalogPriceRuleByUI" stepKey="createFirstPriceRule"> <argument name="catalogRule" value="CatalogRuleToFixed"/> </actionGroup> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroupForFirstPriceRule"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroupForFirstPriceRule"/> <actionGroup ref="CreateCatalogPriceRuleConditionWithAttributeAndOptionActionGroup" stepKey="createFirstCatalogPriceRuleCondition"> <argument name="attributeName" value="$$createConfigProductAttribute.attribute[frontend_labels][0][label]$$"/> <argument name="targetSelectValue" value="$$createConfigProductAttributeFirstOption.option[store_labels][1][label]$$"/> @@ -143,7 +143,7 @@ <actionGroup ref="newCatalogPriceRuleByUI" stepKey="createSecondPriceRule"> <argument name="catalogRule" value="_defaultCatalogRule"/> </actionGroup> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroupForSecondPriceRule"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroupForSecondPriceRule"/> <actionGroup ref="CreateCatalogPriceRuleConditionWithAttributeAndOptionActionGroup" stepKey="createSecondCatalogPriceRuleCondition"> <argument name="attributeName" value="$$createConfigProductAttribute.attribute[frontend_labels][0][label]$$"/> <argument name="targetSelectValue" value="$$createConfigProductAttributeSecondOption.option[store_labels][1][label]$$"/> @@ -157,7 +157,7 @@ <actionGroup ref="newCatalogPriceRuleByUI" stepKey="createThirdPriceRule"> <argument name="catalogRule" value="CatalogRuleWithoutDiscount"/> </actionGroup> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroupForThirdPriceRule"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroupForThirdPriceRule"/> <actionGroup ref="CreateCatalogPriceRuleConditionWithAttributeAndOptionActionGroup" stepKey="createThirdCatalogPriceRuleCondition"> <argument name="attributeName" value="$$createConfigProductAttribute.attribute[frontend_labels][0][label]$$"/> <argument name="targetSelectValue" value="$$createConfigProductAttributeThirdOption.option[store_labels][1][label]$$"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml index 330a026bb9426..8a2990c5869c9 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontFreeShippingRecalculationAfterCouponCodeAddedTest.xml @@ -34,7 +34,7 @@ <createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/> <createData entity="MinimumOrderAmount90" stepKey="minimumOrderAmount90"/> <magentoCLI command="cache:flush" stepKey="flushCache1"/> - <actionGroup ref="AdminCreateCartPriceRuleWithCouponCode" stepKey="createCartPriceRule"> + <actionGroup ref="AdminCreateCartPriceRuleWithCouponCodeActionGroup" stepKey="createCartPriceRule"> <argument name="ruleName" value="CatPriceRule"/> <argument name="couponCode" value="CatPriceRule.coupon_code"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml index 4b3e18fb31877..fe990c359b315 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml @@ -49,7 +49,7 @@ <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{ApiSalesRule.name}}" stepKey="fillRuleName"/> <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsite"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="chooseNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="chooseNotLoggedInCustomerGroup"/> <generateDate date="-1 day" format="m/d/Y" stepKey="yesterdayDate"/> <fillField selector="{{AdminCartPriceRulesFormSection.fromDate}}" userInput="{$yesterdayDate}" stepKey="fillFromDate"/> <selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="Specific Coupon" stepKey="selectCouponType"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml index bc8f3e49272b7..4dd8d03fa6ba3 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml @@ -136,7 +136,7 @@ <argument name="catalogRule" value="CatalogRuleByPercentWith96Amount" /> <argument name="productSku" value="$$createConfigChildProduct3.sku$$" /> </actionGroup> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="clickSaveAndApplyRules"/> <magentoCLI command="indexer:reindex" stepKey="reindex"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml index ec0f97e418c8c..edd5c9841fb6b 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml @@ -44,7 +44,7 @@ <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{ApiSalesRule.name}}" stepKey="fillRuleName"/> <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsite"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="chooseNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="chooseNotLoggedInCustomerGroup"/> <generateDate date="-1 day" format="m/d/Y" stepKey="yesterdayDate"/> <fillField selector="{{AdminCartPriceRulesFormSection.fromDate}}" userInput="{$yesterdayDate}" stepKey="fillFromDate"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml deleted file mode 100644 index 1bd4d743acdc5..0000000000000 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml +++ /dev/null @@ -1,80 +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="selectNotLoggedInCustomerGroup"> - <annotations> - <description>Selects 'NOT LOGGED IN' from the 'Customer Groups' list (Magento 2 B2B). PLEASE NOTE: The value is Hardcoded.</description> - </annotations> - - <!-- This actionGroup was created to be merged from B2B because B2B has a very different form control here --> - <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="NOT LOGGED IN" stepKey="selectCustomerGroup"/> - </actionGroup> - - <actionGroup name="selectRetailerCustomerGroup"> - <annotations> - <description>Selects 'Retailer' from the 'Customer Groups' list (Magento 2 B2B). PLEASE NOTE: The value is Hardcoded.</description> - </annotations> - - <!-- This actionGroup was created to be merged from B2B. Retailer Customer Group --> - <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="Retailer" stepKey="selectRetailerCustomerGroup"/> - </actionGroup> - - <!--Set Subtotal condition for Customer Segment--> - <actionGroup name="SetCartAttributeConditionForCartPriceRuleActionGroup"> - <annotations> - <description>Sets the provided Cart Attribute Condition (Attribute Name, Operator Type and Value) on the Admin Cart Price Rule creation/edit page.</description> - </annotations> - <arguments> - <argument name="attributeName" type="string"/> - <argument name="operatorType" defaultValue="is" type="string"/> - <argument name="value" type="string"/> - </arguments> - - <scrollTo selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" stepKey="scrollToActionTab"/> - <conditionalClick selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" dependentSelector="{{AdminCartPriceRulesFormSection.conditionsHeaderOpen}}" visible="false" stepKey="openActionTab"/> - <click selector="{{AdminCartPriceRulesFormSection.conditions}}" stepKey="applyRuleForConditions"/> - <waitForPageLoad stepKey="waitForDropDownOpened"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.childAttribute}}" userInput="{{attributeName}}" stepKey="selectAttribute"/> - <waitForPageLoad stepKey="waitForOperatorOpened"/> - <click selector="{{AdminCartPriceRulesFormSection.condition('is')}}" stepKey="clickToChooseOption"/> - <selectOption userInput="{{operatorType}}" selector="{{AdminCartPriceRulesFormSection.conditionsOperator}}" stepKey="setOperatorType"/> - <click selector="{{AdminCartPriceRulesFormSection.condition('...')}}" stepKey="clickToChooseOption1"/> - <fillField userInput="{{value}}" selector="{{AdminCartPriceRulesFormSection.conditionsValue}}" stepKey="fillActionValue"/> - <click selector="{{AdminMainActionsSection.saveAndContinue}}" stepKey="clickSaveButton"/> - <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="SetConditionForActionsInCartPriceRuleActionGroup"> - <annotations> - <description>Sets the provided Condition (Actions Aggregator/Value, Child Attribute and Action Value) for Actions on the Admin Cart Price Rule creation/edit page.</description> - </annotations> - <arguments> - <argument name="actionsAggregator" type="string" defaultValue="ANY"/> - <argument name="actionsValue" type="string" defaultValue="FALSE"/> - <argument name="childAttribute" type="string" defaultValue="Category"/> - <argument name="actionValue" type="string"/> - </arguments> - - <click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" stepKey="clickOnActionTab"/> - <click selector="{{AdminCartPriceRulesFormSection.condition('ALL')}}" stepKey="clickToChooseOption"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.actionsAggregator}}" userInput="{{actionsAggregator}}" stepKey="selectCondition"/> - <click selector="{{AdminCartPriceRulesFormSection.condition('TRUE')}}" stepKey="clickToChooseOption2"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.actionsValue}}" userInput="{{actionsValue}}" stepKey="selectCondition2"/> - <click selector="{{AdminCartPriceRulesFormSection.conditions}}" stepKey="selectActionConditions"/> - <waitForPageLoad stepKey="waitForDropDownOpened"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.childAttribute}}" userInput="{{childAttribute}}" stepKey="selectAttribute"/> - <waitForPageLoad stepKey="waitForOperatorOpened"/> - <click selector="{{AdminCartPriceRulesFormSection.condition('...')}}" stepKey="clickToChooseOption3"/> - <fillField selector="{{AdminCartPriceRulesFormSection.actionValue}}" userInput="{{actionValue}}" stepKey="fillActionValue"/> - <click selector="{{AdminCartPriceRulesFormSection.applyAction}}" stepKey="applyAction"/> - <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveButton"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleNotInGridActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleNotInGridActionGroup.xml new file mode 100644 index 0000000000000..23d7daf03e9c3 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleNotInGridActionGroup.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="AdminCartPriceRuleNotInGridActionGroup" extends="AdminFilterCartPriceRuleActionGroup"> + <annotations> + <description>EXTENDS: AdminFilterCartPriceRuleActionGroup. Removes 'goToEditRulePage'. Validates that the Empty Grid message is present and correct.</description> + </annotations> + + <remove keyForRemoval="goToEditRulePage"/> + <waitForPageLoad stepKey="waitForStoreToLoad"/> + <see selector="{{AdminCartPriceRulesSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertCartPriceRuleIsNotPresentedInGrid"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml index 91ecaff7f83a6..57a2c17419532 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml @@ -28,166 +28,4 @@ <click selector="{{AdminCartPriceRulesFormSection.save}}" stepKey="clickSaveButton"/> <see selector="{{AdminCartPriceRulesFormSection.successMessage}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> </actionGroup> - - <actionGroup name="AdminCreateCartPriceRuleAndStayOnEditActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Clicks on Save and Continue.</description> - </annotations> - - <click selector="{{AdminCartPriceRulesFormSection.saveAndContinue}}" stepKey="clickSaveButton"/> - </actionGroup> - - <actionGroup name="AdminCreateCartPriceRuleWithCouponCode" extends="AdminCreateCartPriceRuleActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'selectActionType' and 'fillDiscountAmount'. Adds the provided Coupon Code to a Cart Price Rule.</description> - </annotations> - <arguments> - <argument name="couponCode" defaultValue="_defaultCoupon.code"/> - </arguments> - - <remove keyForRemoval="selectActionType"/> - <remove keyForRemoval="fillDiscountAmount"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="Specific Coupon" stepKey="selectCouponType" after="fillRuleName"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.couponCode}}" stepKey="waitForElementVisible" after="selectCouponType"/> - <fillField selector="{{AdminCartPriceRulesFormSection.couponCode}}" userInput="{{couponCode}}" stepKey="fillCouponCode" after="waitForElementVisible"/> - <fillField selector="{{AdminCartPriceRulesFormSection.userPerCoupon}}" userInput="99" stepKey="fillUserPerCoupon" after="fillCouponCode"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="Fixed amount discount for whole cart" stepKey="selectActionTypeToFixed" after="clickToExpandActions"/> - <fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="1" stepKey="fillDiscountAmount" after="selectActionTypeToFixed"/> - </actionGroup> - - <!--Delete Cart price Rule for Retailer customer--> - <actionGroup name="AdminDeleteCartPriceRuleForRetailerActionGroup"> - <annotations> - <description>Goes to the Admin Cart Price Rules grid page. Removes the 1st Cart Price Rule in the Grid.</description> - </annotations> - - <amOnPage url="{{AdminCartPriceRulesPage.url}}" stepKey="goToCartPriceRules"/> - <waitForPageLoad stepKey="waitForCartPriceRules"/> - <fillField selector="{{AdminCartPriceRulesSection.filterByNameInput}}" userInput="{{SimpleSalesRule.name}}" stepKey="filterByName"/> - <click selector="{{AdminCartPriceRulesSection.searchButton}}" stepKey="doFilter"/> - <click selector="{{AdminCartPriceRulesSection.rowByIndex('1')}}" stepKey="goToEditRulePage"/> - <click selector="{{AdminCartPriceRulesFormSection.delete}}" stepKey="clickDeleteButton"/> - <click selector="{{AdminCartPriceRulesFormSection.modalAcceptButton}}" stepKey="confirmDelete"/> - </actionGroup> - - <actionGroup name="AdminCreateCartPriceRuleWithConditions" extends="AdminCreateCartPriceRuleActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'fillDiscountAmount'. Adds the 2 provided Conditions (Name, Rule, Rule to Change and Category Name) to a Cart Price Rule.</description> - </annotations> - <arguments> - <argument name="condition1" type="string" defaultValue="Products subselection"/> - <argument name="condition2" type="string" defaultValue="Category"/> - <argument name="ruleToChange1" type="string" defaultValue="is"/> - <argument name="rule1" type="string" defaultValue="equals or greater than"/> - <argument name="ruleToChange2" type="string" defaultValue="..."/> - <argument name="rule2" type="string" defaultValue="2"/> - <argument name="categoryName" type="string" defaultValue="_defaultCategory.name"/> - </arguments> - - <remove keyForRemoval="fillDiscountAmount"/> - - <!--Go to Conditions section--> - <click selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" stepKey="openConditionsSection" after="selectActionType"/> - <click selector="{{AdminCartPriceRulesFormSection.addCondition('1')}}" stepKey="addFirstCondition" after="openConditionsSection"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.ruleCondition('1')}}" userInput="{{condition1}}" stepKey="selectRule" after="addFirstCondition"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange1)}}" stepKey="waitForFirstRuleElement" after="selectRule"/> - <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange1)}}" stepKey="clickToChangeRule" after="waitForFirstRuleElement"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.ruleParameterSelect('1--1')}}" userInput="{{rule1}}" stepKey="selectRule1" after="clickToChangeRule"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="waitForSecondRuleElement" after="selectRule1"/> - <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="clickToChangeRule1" after="waitForSecondRuleElement"/> - <fillField selector="{{AdminCartPriceRulesFormSection.ruleParameterInput('1--1')}}" userInput="{{rule2}}" stepKey="fillRule" after="clickToChangeRule1"/> - <click selector="{{AdminCartPriceRulesFormSection.addCondition('1--1')}}" stepKey="addSecondCondition" after="fillRule"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.ruleCondition('1--1')}}" userInput="{{condition2}}" stepKey="selectSecondCondition" after="addSecondCondition"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="waitForThirdRuleElement" after="selectSecondCondition"/> - <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="addThirdCondition" after="waitForThirdRuleElement"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.openChooser('1--1--1')}}" stepKey="waitForForthRuleElement" after="addThirdCondition"/> - <click selector="{{AdminCartPriceRulesFormSection.openChooser('1--1--1')}}" stepKey="openChooser" after="waitForForthRuleElement"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.categoryCheckbox(categoryName)}}" stepKey="waitForCategoryVisible" after="openChooser"/> - <checkOption selector="{{AdminCartPriceRulesFormSection.categoryCheckbox(categoryName)}}" stepKey="checkCategoryName" after="waitForCategoryVisible"/> - </actionGroup> - <actionGroup name="AdminCreateCartPriceRuleActionsWithSubtotalActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'fillDiscountAmount'. Adds sub total conditions for free shipping to a Cart Price Rule.</description> - </annotations> - <arguments> - <argument name="ruleName"/> - </arguments> - <remove keyForRemoval="fillDiscountAmount"/> - <!-- Expand the conditions section --> - <grabTextFrom selector="{{AdminCartPriceRulesFormSection.ruleName}}" after="fillRuleName" stepKey="getSubtotalRule"/> - <click selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" stepKey="openConditionsSection" after="selectActionType"/> - <click selector="{{AdminCartPriceRulesFormSection.addCondition('1')}}" after="openConditionsSection" stepKey="addFirstCondition"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.conditionSelect}}" userInput="{{ruleName.condition1}}" after="addFirstCondition" stepKey="selectCondition1"/> - <waitForPageLoad after="selectCondition1" stepKey="waitForConditionLoad"/> - <click selector="{{AdminCartPriceRulesFormSection.condition(ruleName.ruleToChange1)}}" after="waitForConditionLoad" stepKey="clickToChooseOption"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.conditionsOperator}}" userInput="{{ruleName.rule1}}" after="clickToChooseOption" stepKey="setOperatorType"/> - <click selector="{{AdminCartPriceRulesFormSection.targetEllipsis}}" after="setOperatorType" stepKey="clickEllipsis"/> - <fillField selector="{{AdminCartPriceRulesFormSection.ruleFieldByIndex('1--1')}}" userInput="{{ruleName.subtotal}}" after="clickEllipsis" stepKey="fillSubtotalParameter"/> - <click selector="{{AdminCartPriceRulesFormSection.addNewCondition('1')}}" after="fillSubtotalParameter" stepKey="clickOnTheAddNewCondition"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.conditionSelectDropdown('1')}}" userInput="{{ruleName.condition2}}" after="clickOnTheAddNewCondition" stepKey="selectSecondCondition"/> - <waitForPageLoad after="selectSecondCondition" stepKey="waitForConditionLoad2"/> - <click selector="{{AdminCartPriceRulesFormSection.targetEllipsis}}" after="waitForConditionLoad2" stepKey="clickEllipsis2"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.ruleFieldByIndex('1--2')}}" userInput="{{ruleName.shippingMethod}}" after="clickEllipsis2" stepKey="selectShippingMethod"/> - <click selector="{{AdminCartPriceRulesFormSection.applyToShippingAmount}}" after="selectShippingMethod" stepKey="clickApplyToShipping"/> - <click selector="{{AdminCartPriceRulesFormSection.discardSubsequentRules}}" after="clickApplyToShipping" stepKey="clickDiscardSubsequentRules"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.freeShipping}}" userInput="{{ruleName.simple_free_shipping}}" after="clickDiscardSubsequentRules" stepKey="selectForMatchingItemsOnly"/> - </actionGroup> - <actionGroup name="AdminCreateMultiWebsiteCartPriceRuleActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'clickSaveButton' for the next data changing. Assign cart price rule to 2 websites instead of 1.</description> - </annotations> - <arguments> - <argument name="ruleName"/> - </arguments> - <remove keyForRemoval="clickSaveButton"/> - <remove keyForRemoval="seeSuccessMessage"/> - <remove keyForRemoval="selectWebsites"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" parameterArray="['FirstWebsite', 'SecondWebsite']" stepKey="selectWebsites" after="fillRuleName"/> - </actionGroup> - <actionGroup name="CreateCartPriceRuleSecondWebsiteActionGroup"> - <annotations> - <description>Goes to the Admin Cart Price Rule grid page. Clicks on Add New Rule. Fills the provided Rule (Name). Selects 'Second Website' from the 'Websites' menu.</description> - </annotations> - <arguments> - <argument name="ruleName"/> - </arguments> - - <amOnPage url="{{AdminCartPriceRulesPage.url}}" stepKey="amOnCartPriceList"/> - <waitForPageLoad stepKey="waitForPriceList"/> - <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> - <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{ruleName.name}}" stepKey="fillRuleName"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Second Website" stepKey="selectWebsites"/> - </actionGroup> - - <actionGroup name="AdminInactiveCartPriceRuleActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Clicks on 'Active'.</description> - </annotations> - - <click selector="{{AdminCartPriceRulesFormSection.active}}" stepKey="clickActiveToDisable" after="fillRuleName"/> - </actionGroup> - - <actionGroup name="AdminCreateCartPriceRuleWithConditionIsCategoryActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Sets the provide Condition (Actions Aggregator/Value, Child Attribute and Action Value) for Actions on the Admin Cart Price Rule creation/edit page.</description> - </annotations> - <arguments> - <argument name="actionsAggregator" type="string" defaultValue="ANY"/> - <argument name="actionsValue" type="string" defaultValue="FALSE"/> - <argument name="childAttribute" type="string" defaultValue="Category"/> - <argument name="actionValue" type="string" defaultValue="2"/> - </arguments> - <click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" after="fillDiscountAmount" stepKey="clickOnActionTab"/> - <click selector="{{AdminCartPriceRulesFormSection.condition('ALL')}}" after="clickOnActionTab" stepKey="clickToChooseFirstRuleConditionValue"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.actionsAggregator}}" userInput="{{actionsAggregator}}" after="clickToChooseFirstRuleConditionValue" stepKey="changeFirstRuleConditionValue"/> - <click selector="{{AdminCartPriceRulesFormSection.condition('TRUE')}}" after="changeFirstRuleConditionValue" stepKey="clickToChooseSecondRuleConditionValue"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.actionsValue}}" userInput="{{actionsValue}}" after="clickToChooseSecondRuleConditionValue" stepKey="changeSecondRuleConditionValue"/> - <click selector="{{AdminCartPriceRulesFormSection.conditions}}" after="changeSecondRuleConditionValue" stepKey="clickConditionDropDownMenu"/> - <waitForPageLoad stepKey="waitForDropDownOpened"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.childAttribute}}" userInput="{{childAttribute}}" after="clickConditionDropDownMenu" stepKey="selectConditionAttributeIsCategory"/> - <waitForPageLoad after="selectConditionAttributeIsCategory" stepKey="waitForOperatorOpened"/> - <click selector="{{AdminCartPriceRulesFormSection.condition('...')}}" after="waitForOperatorOpened" stepKey="clickToChooserIcon"/> - <fillField selector="{{AdminCartPriceRulesFormSection.actionValue}}" userInput="{{actionValue}}" after="clickToChooserIcon" stepKey="choseNeededCategoryFromCategoryGrid"/> - <click selector="{{AdminCartPriceRulesFormSection.applyAction}}" after="choseNeededCategoryFromCategoryGrid" stepKey="applyAction"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionDiscountFieldsActionGroup.xml similarity index 55% rename from app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionActionGroup.xml rename to app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionDiscountFieldsActionGroup.xml index b30d2cfbb9204..00edcfc6f19ed 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionActionGroup.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionDiscountFieldsActionGroup.xml @@ -22,31 +22,4 @@ <fillField selector="{{AdminCartPriceRulesFormSection.maximumQtyDiscount}}" userInput="{{rule.maximumQtyDiscount}}" stepKey="fillMaximumQtyDiscount"/> <fillField selector="{{AdminCartPriceRulesFormSection.discountStep}}" userInput="{{rule.discount_step}}" stepKey="fillDiscountStep"/> </actionGroup> - - <actionGroup name="AdminCreateCartPriceRuleActionsSectionShippingAmountActionGroup"> - <annotations> - <description>Clicks on the 'Apply to Shipping Amount' toggle.</description> - </annotations> - - <click selector="{{AdminCartPriceRulesFormSection.applyToShippingAmount}}" stepKey="clickApplyToShipping"/> - </actionGroup> - - <actionGroup name="AdminCreateCartPriceRuleActionsSectionSubsequentRulesActionGroup"> - <annotations> - <description>Clicks on the 'Discard subsequent rules' toggle.</description> - </annotations> - - <click selector="{{AdminCartPriceRulesFormSection.discardSubsequentRules}}" stepKey="clickApplyToShipping"/> - </actionGroup> - - <actionGroup name="AdminCreateCartPriceRuleActionsSectionFreeShippingActionGroup"> - <annotations> - <description>Selects the provided option in the 'Free Shipping' dropdown menu.</description> - </annotations> - <arguments> - <argument name="freeShippingOption" type="string"/> - </arguments> - - <selectOption selector="{{AdminCartPriceRulesFormSection.freeShipping}}" userInput="{{freeShippingOption}}" stepKey="selectForMatchingItemsOnly"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionFreeShippingActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionFreeShippingActionGroup.xml new file mode 100644 index 0000000000000..d90261bf44fa9 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionFreeShippingActionGroup.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="AdminCreateCartPriceRuleActionsSectionFreeShippingActionGroup"> + <annotations> + <description>Selects the provided option in the 'Free Shipping' dropdown menu.</description> + </annotations> + <arguments> + <argument name="freeShippingOption" type="string"/> + </arguments> + + <selectOption selector="{{AdminCartPriceRulesFormSection.freeShipping}}" userInput="{{freeShippingOption}}" stepKey="selectForMatchingItemsOnly"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionShippingAmountActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionShippingAmountActionGroup.xml new file mode 100644 index 0000000000000..3af8a82601a08 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionShippingAmountActionGroup.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="AdminCreateCartPriceRuleActionsSectionShippingAmountActionGroup"> + <annotations> + <description>Clicks on the 'Apply to Shipping Amount' toggle.</description> + </annotations> + + <click selector="{{AdminCartPriceRulesFormSection.applyToShippingAmount}}" stepKey="clickApplyToShipping"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionSubsequentRulesActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionSubsequentRulesActionGroup.xml new file mode 100644 index 0000000000000..15dc5af206572 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsSectionSubsequentRulesActionGroup.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="AdminCreateCartPriceRuleActionsSectionSubsequentRulesActionGroup"> + <annotations> + <description>Clicks on the 'Discard subsequent rules' toggle.</description> + </annotations> + + <click selector="{{AdminCartPriceRulesFormSection.discardSubsequentRules}}" stepKey="clickApplyToShipping"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsWithSubtotalActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsWithSubtotalActionGroup.xml new file mode 100644 index 0000000000000..b6836ab63fb10 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionsWithSubtotalActionGroup.xml @@ -0,0 +1,38 @@ +<?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="AdminCreateCartPriceRuleActionsWithSubtotalActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'fillDiscountAmount'. Adds sub total conditions for free shipping to a Cart Price Rule.</description> + </annotations> + <arguments> + <argument name="ruleName"/> + </arguments> + <remove keyForRemoval="fillDiscountAmount"/> + <!-- Expand the conditions section --> + <grabTextFrom selector="{{AdminCartPriceRulesFormSection.ruleName}}" after="fillRuleName" stepKey="getSubtotalRule"/> + <click selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" stepKey="openConditionsSection" after="selectActionType"/> + <click selector="{{AdminCartPriceRulesFormSection.addCondition('1')}}" after="openConditionsSection" stepKey="addFirstCondition"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.conditionSelect}}" userInput="{{ruleName.condition1}}" after="addFirstCondition" stepKey="selectCondition1"/> + <waitForPageLoad after="selectCondition1" stepKey="waitForConditionLoad"/> + <click selector="{{AdminCartPriceRulesFormSection.condition(ruleName.ruleToChange1)}}" after="waitForConditionLoad" stepKey="clickToChooseOption"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.conditionsOperator}}" userInput="{{ruleName.rule1}}" after="clickToChooseOption" stepKey="setOperatorType"/> + <click selector="{{AdminCartPriceRulesFormSection.targetEllipsis}}" after="setOperatorType" stepKey="clickEllipsis"/> + <fillField selector="{{AdminCartPriceRulesFormSection.ruleFieldByIndex('1--1')}}" userInput="{{ruleName.subtotal}}" after="clickEllipsis" stepKey="fillSubtotalParameter"/> + <click selector="{{AdminCartPriceRulesFormSection.addNewCondition('1')}}" after="fillSubtotalParameter" stepKey="clickOnTheAddNewCondition"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.conditionSelectDropdown('1')}}" userInput="{{ruleName.condition2}}" after="clickOnTheAddNewCondition" stepKey="selectSecondCondition"/> + <waitForPageLoad after="selectSecondCondition" stepKey="waitForConditionLoad2"/> + <click selector="{{AdminCartPriceRulesFormSection.targetEllipsis}}" after="waitForConditionLoad2" stepKey="clickEllipsis2"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.ruleFieldByIndex('1--2')}}" userInput="{{ruleName.shippingMethod}}" after="clickEllipsis2" stepKey="selectShippingMethod"/> + <click selector="{{AdminCartPriceRulesFormSection.applyToShippingAmount}}" after="selectShippingMethod" stepKey="clickApplyToShipping"/> + <click selector="{{AdminCartPriceRulesFormSection.discardSubsequentRules}}" after="clickApplyToShipping" stepKey="clickDiscardSubsequentRules"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.freeShipping}}" userInput="{{ruleName.simple_free_shipping}}" after="clickDiscardSubsequentRules" stepKey="selectForMatchingItemsOnly"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleAndStayOnEditActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleAndStayOnEditActionGroup.xml new file mode 100644 index 0000000000000..b61988b630f03 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleAndStayOnEditActionGroup.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="AdminCreateCartPriceRuleAndStayOnEditActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Clicks on Save and Continue.</description> + </annotations> + + <click selector="{{AdminCartPriceRulesFormSection.saveAndContinue}}" stepKey="clickSaveButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithConditionIsCategoryActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithConditionIsCategoryActionGroup.xml new file mode 100644 index 0000000000000..7181ef586b2d8 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithConditionIsCategoryActionGroup.xml @@ -0,0 +1,34 @@ +<?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="AdminCreateCartPriceRuleWithConditionIsCategoryActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Sets the provide Condition (Actions Aggregator/Value, Child Attribute and Action Value) for Actions on the Admin Cart Price Rule creation/edit page.</description> + </annotations> + <arguments> + <argument name="actionsAggregator" type="string" defaultValue="ANY"/> + <argument name="actionsValue" type="string" defaultValue="FALSE"/> + <argument name="childAttribute" type="string" defaultValue="Category"/> + <argument name="actionValue" type="string" defaultValue="2"/> + </arguments> + <click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" after="fillDiscountAmount" stepKey="clickOnActionTab"/> + <click selector="{{AdminCartPriceRulesFormSection.condition('ALL')}}" after="clickOnActionTab" stepKey="clickToChooseFirstRuleConditionValue"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.actionsAggregator}}" userInput="{{actionsAggregator}}" after="clickToChooseFirstRuleConditionValue" stepKey="changeFirstRuleConditionValue"/> + <click selector="{{AdminCartPriceRulesFormSection.condition('TRUE')}}" after="changeFirstRuleConditionValue" stepKey="clickToChooseSecondRuleConditionValue"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.actionsValue}}" userInput="{{actionsValue}}" after="clickToChooseSecondRuleConditionValue" stepKey="changeSecondRuleConditionValue"/> + <click selector="{{AdminCartPriceRulesFormSection.conditions}}" after="changeSecondRuleConditionValue" stepKey="clickConditionDropDownMenu"/> + <waitForPageLoad stepKey="waitForDropDownOpened"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.childAttribute}}" userInput="{{childAttribute}}" after="clickConditionDropDownMenu" stepKey="selectConditionAttributeIsCategory"/> + <waitForPageLoad after="selectConditionAttributeIsCategory" stepKey="waitForOperatorOpened"/> + <click selector="{{AdminCartPriceRulesFormSection.condition('...')}}" after="waitForOperatorOpened" stepKey="clickToChooserIcon"/> + <fillField selector="{{AdminCartPriceRulesFormSection.actionValue}}" userInput="{{actionValue}}" after="clickToChooserIcon" stepKey="choseNeededCategoryFromCategoryGrid"/> + <click selector="{{AdminCartPriceRulesFormSection.applyAction}}" after="choseNeededCategoryFromCategoryGrid" stepKey="applyAction"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithConditionsActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithConditionsActionGroup.xml new file mode 100644 index 0000000000000..db1bcde6677dc --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithConditionsActionGroup.xml @@ -0,0 +1,46 @@ +<?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="AdminCreateCartPriceRuleWithConditionsActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'fillDiscountAmount'. Adds the 2 provided Conditions (Name, Rule, Rule to Change and Category Name) to a Cart Price Rule.</description> + </annotations> + <arguments> + <argument name="condition1" type="string" defaultValue="Products subselection"/> + <argument name="condition2" type="string" defaultValue="Category"/> + <argument name="ruleToChange1" type="string" defaultValue="is"/> + <argument name="rule1" type="string" defaultValue="equals or greater than"/> + <argument name="ruleToChange2" type="string" defaultValue="..."/> + <argument name="rule2" type="string" defaultValue="2"/> + <argument name="categoryName" type="string" defaultValue="_defaultCategory.name"/> + </arguments> + + <remove keyForRemoval="fillDiscountAmount"/> + + <!--Go to Conditions section--> + <click selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" stepKey="openConditionsSection" after="selectActionType"/> + <click selector="{{AdminCartPriceRulesFormSection.addCondition('1')}}" stepKey="addFirstCondition" after="openConditionsSection"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.ruleCondition('1')}}" userInput="{{condition1}}" stepKey="selectRule" after="addFirstCondition"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange1)}}" stepKey="waitForFirstRuleElement" after="selectRule"/> + <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange1)}}" stepKey="clickToChangeRule" after="waitForFirstRuleElement"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.ruleParameterSelect('1--1')}}" userInput="{{rule1}}" stepKey="selectRule1" after="clickToChangeRule"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="waitForSecondRuleElement" after="selectRule1"/> + <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="clickToChangeRule1" after="waitForSecondRuleElement"/> + <fillField selector="{{AdminCartPriceRulesFormSection.ruleParameterInput('1--1')}}" userInput="{{rule2}}" stepKey="fillRule" after="clickToChangeRule1"/> + <click selector="{{AdminCartPriceRulesFormSection.addCondition('1--1')}}" stepKey="addSecondCondition" after="fillRule"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.ruleCondition('1--1')}}" userInput="{{condition2}}" stepKey="selectSecondCondition" after="addSecondCondition"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="waitForThirdRuleElement" after="selectSecondCondition"/> + <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="addThirdCondition" after="waitForThirdRuleElement"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.openChooser('1--1--1')}}" stepKey="waitForForthRuleElement" after="addThirdCondition"/> + <click selector="{{AdminCartPriceRulesFormSection.openChooser('1--1--1')}}" stepKey="openChooser" after="waitForForthRuleElement"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.categoryCheckbox(categoryName)}}" stepKey="waitForCategoryVisible" after="openChooser"/> + <checkOption selector="{{AdminCartPriceRulesFormSection.categoryCheckbox(categoryName)}}" stepKey="checkCategoryName" after="waitForCategoryVisible"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithCouponCodeActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithCouponCodeActionGroup.xml new file mode 100644 index 0000000000000..51a45cf24784b --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleWithCouponCodeActionGroup.xml @@ -0,0 +1,28 @@ +<?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="AdminCreateCartPriceRuleWithCouponCodeActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'selectActionType' and 'fillDiscountAmount'. Adds the provided Coupon Code to a Cart Price Rule.</description> + </annotations> + <arguments> + <argument name="couponCode" defaultValue="_defaultCoupon.code"/> + </arguments> + + <remove keyForRemoval="selectActionType"/> + <remove keyForRemoval="fillDiscountAmount"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="Specific Coupon" stepKey="selectCouponType" after="fillRuleName"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.couponCode}}" stepKey="waitForElementVisible" after="selectCouponType"/> + <fillField selector="{{AdminCartPriceRulesFormSection.couponCode}}" userInput="{{couponCode}}" stepKey="fillCouponCode" after="waitForElementVisible"/> + <fillField selector="{{AdminCartPriceRulesFormSection.userPerCoupon}}" userInput="99" stepKey="fillUserPerCoupon" after="fillCouponCode"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="Fixed amount discount for whole cart" stepKey="selectActionTypeToFixed" after="clickToExpandActions"/> + <fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="1" stepKey="fillDiscountAmount" after="selectActionTypeToFixed"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateMultiWebsiteCartPriceRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateMultiWebsiteCartPriceRuleActionGroup.xml new file mode 100644 index 0000000000000..f04c76c190b81 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateMultiWebsiteCartPriceRuleActionGroup.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="AdminCreateMultiWebsiteCartPriceRuleActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'clickSaveButton' for the next data changing. Assign cart price rule to 2 websites instead of 1.</description> + </annotations> + <arguments> + <argument name="ruleName"/> + </arguments> + <remove keyForRemoval="clickSaveButton"/> + <remove keyForRemoval="seeSuccessMessage"/> + <remove keyForRemoval="selectWebsites"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" parameterArray="['FirstWebsite', 'SecondWebsite']" stepKey="selectWebsites" after="fillRuleName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminDeleteCartPriceRuleForRetailerActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminDeleteCartPriceRuleForRetailerActionGroup.xml new file mode 100644 index 0000000000000..3f5d511ebfbe7 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminDeleteCartPriceRuleForRetailerActionGroup.xml @@ -0,0 +1,24 @@ +<?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="AdminDeleteCartPriceRuleForRetailerActionGroup"> + <annotations> + <description>Goes to the Admin Cart Price Rules grid page. Removes the 1st Cart Price Rule in the Grid.</description> + </annotations> + + <amOnPage url="{{AdminCartPriceRulesPage.url}}" stepKey="goToCartPriceRules"/> + <waitForPageLoad stepKey="waitForCartPriceRules"/> + <fillField selector="{{AdminCartPriceRulesSection.filterByNameInput}}" userInput="{{SimpleSalesRule.name}}" stepKey="filterByName"/> + <click selector="{{AdminCartPriceRulesSection.searchButton}}" stepKey="doFilter"/> + <click selector="{{AdminCartPriceRulesSection.rowByIndex('1')}}" stepKey="goToEditRulePage"/> + <click selector="{{AdminCartPriceRulesFormSection.delete}}" stepKey="clickDeleteButton"/> + <click selector="{{AdminCartPriceRulesFormSection.modalAcceptButton}}" stepKey="confirmDelete"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminFilterCartPriceRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminFilterCartPriceRuleActionGroup.xml index 0f307b2dfe591..f939f9b5a81be 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminFilterCartPriceRuleActionGroup.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminFilterCartPriceRuleActionGroup.xml @@ -16,20 +16,10 @@ <arguments> <argument name="ruleName"/> </arguments> - + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> <fillField selector="{{AdminCartPriceRulesSection.filterByNameInput}}" userInput="{{ruleName}}" stepKey="filterByName"/> <click selector="{{AdminCartPriceRulesSection.searchButton}}" stepKey="doFilter"/> <click selector="{{AdminCartPriceRulesSection.rowByIndex('1')}}" stepKey="goToEditRulePage"/> </actionGroup> - - <actionGroup name="AdminCartPriceRuleNotInGridActionGroup" extends="AdminFilterCartPriceRuleActionGroup"> - <annotations> - <description>EXTENDS: AdminFilterCartPriceRuleActionGroup. Removes 'goToEditRulePage'. Validates that the Empty Grid message is present and correct.</description> - </annotations> - - <remove keyForRemoval="goToEditRulePage"/> - <waitForPageLoad stepKey="waitForStoreToLoad"/> - <see selector="{{AdminCartPriceRulesSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertCartPriceRuleIsNotPresentedInGrid"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminInactiveCartPriceRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminInactiveCartPriceRuleActionGroup.xml new file mode 100644 index 0000000000000..dad1090d3af27 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminInactiveCartPriceRuleActionGroup.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="AdminInactiveCartPriceRuleActionGroup" extends="AdminCreateCartPriceRuleActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Clicks on 'Active'.</description> + </annotations> + + <click selector="{{AdminCartPriceRulesFormSection.active}}" stepKey="clickActiveToDisable" after="fillRuleName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/CreateCartPriceRuleSecondWebsiteActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/CreateCartPriceRuleSecondWebsiteActionGroup.xml new file mode 100644 index 0000000000000..d291f2fb4e63d --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/CreateCartPriceRuleSecondWebsiteActionGroup.xml @@ -0,0 +1,25 @@ +<?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="CreateCartPriceRuleSecondWebsiteActionGroup"> + <annotations> + <description>Goes to the Admin Cart Price Rule grid page. Clicks on Add New Rule. Fills the provided Rule (Name). Selects 'Second Website' from the 'Websites' menu.</description> + </annotations> + <arguments> + <argument name="ruleName"/> + </arguments> + + <amOnPage url="{{AdminCartPriceRulesPage.url}}" stepKey="amOnCartPriceList"/> + <waitForPageLoad stepKey="waitForPriceList"/> + <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> + <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{ruleName.name}}" stepKey="fillRuleName"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Second Website" stepKey="selectWebsites"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.xml new file mode 100644 index 0000000000000..4f5f50e128ae8 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.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="SelectNotLoggedInCustomerGroupActionGroup"> + <annotations> + <description>Selects 'NOT LOGGED IN' from the 'Customer Groups' list (Magento 2 B2B). PLEASE NOTE: The value is Hardcoded.</description> + </annotations> + + <!-- This actionGroup was created to be merged from B2B because B2B has a very different form control here --> + <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="NOT LOGGED IN" stepKey="selectCustomerGroup"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SelectRetailerCustomerGroupActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SelectRetailerCustomerGroupActionGroup.xml new file mode 100644 index 0000000000000..8552189807470 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SelectRetailerCustomerGroupActionGroup.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="SelectRetailerCustomerGroupActionGroup"> + <annotations> + <description>Selects 'Retailer' from the 'Customer Groups' list (Magento 2 B2B). PLEASE NOTE: The value is Hardcoded.</description> + </annotations> + + <!-- This actionGroup was created to be merged from B2B. Retailer Customer Group --> + <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="Retailer" stepKey="selectRetailerCustomerGroup"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SetCartAttributeConditionForCartPriceRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SetCartAttributeConditionForCartPriceRuleActionGroup.xml new file mode 100644 index 0000000000000..466a02e607911 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SetCartAttributeConditionForCartPriceRuleActionGroup.xml @@ -0,0 +1,34 @@ +<?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="SetCartAttributeConditionForCartPriceRuleActionGroup"> + <annotations> + <description>Sets the provided Cart Attribute Condition (Attribute Name, Operator Type and Value) on the Admin Cart Price Rule creation/edit page.</description> + </annotations> + <arguments> + <argument name="attributeName" type="string"/> + <argument name="operatorType" defaultValue="is" type="string"/> + <argument name="value" type="string"/> + </arguments> + + <scrollTo selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" stepKey="scrollToActionTab"/> + <conditionalClick selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" dependentSelector="{{AdminCartPriceRulesFormSection.conditionsHeaderOpen}}" visible="false" stepKey="openActionTab"/> + <click selector="{{AdminCartPriceRulesFormSection.conditions}}" stepKey="applyRuleForConditions"/> + <waitForPageLoad stepKey="waitForDropDownOpened"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.childAttribute}}" userInput="{{attributeName}}" stepKey="selectAttribute"/> + <waitForPageLoad stepKey="waitForOperatorOpened"/> + <click selector="{{AdminCartPriceRulesFormSection.condition('is')}}" stepKey="clickToChooseOption"/> + <selectOption userInput="{{operatorType}}" selector="{{AdminCartPriceRulesFormSection.conditionsOperator}}" stepKey="setOperatorType"/> + <click selector="{{AdminCartPriceRulesFormSection.condition('...')}}" stepKey="clickToChooseOption1"/> + <fillField userInput="{{value}}" selector="{{AdminCartPriceRulesFormSection.conditionsValue}}" stepKey="fillActionValue"/> + <click selector="{{AdminMainActionsSection.saveAndContinue}}" stepKey="clickSaveButton"/> + <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SetConditionForActionsInCartPriceRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SetConditionForActionsInCartPriceRuleActionGroup.xml new file mode 100644 index 0000000000000..118e9c9961ddb --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/SetConditionForActionsInCartPriceRuleActionGroup.xml @@ -0,0 +1,37 @@ +<?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="SetConditionForActionsInCartPriceRuleActionGroup"> + <annotations> + <description>Sets the provided Condition (Actions Aggregator/Value, Child Attribute and Action Value) for Actions on the Admin Cart Price Rule creation/edit page.</description> + </annotations> + <arguments> + <argument name="actionsAggregator" type="string" defaultValue="ANY"/> + <argument name="actionsValue" type="string" defaultValue="FALSE"/> + <argument name="childAttribute" type="string" defaultValue="Category"/> + <argument name="actionValue" type="string"/> + </arguments> + + <click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" stepKey="clickOnActionTab"/> + <click selector="{{AdminCartPriceRulesFormSection.condition('ALL')}}" stepKey="clickToChooseOption"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.actionsAggregator}}" userInput="{{actionsAggregator}}" stepKey="selectCondition"/> + <click selector="{{AdminCartPriceRulesFormSection.condition('TRUE')}}" stepKey="clickToChooseOption2"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.actionsValue}}" userInput="{{actionsValue}}" stepKey="selectCondition2"/> + <click selector="{{AdminCartPriceRulesFormSection.conditions}}" stepKey="selectActionConditions"/> + <waitForPageLoad stepKey="waitForDropDownOpened"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.childAttribute}}" userInput="{{childAttribute}}" stepKey="selectAttribute"/> + <waitForPageLoad stepKey="waitForOperatorOpened"/> + <click selector="{{AdminCartPriceRulesFormSection.condition('...')}}" stepKey="clickToChooseOption3"/> + <fillField selector="{{AdminCartPriceRulesFormSection.actionValue}}" userInput="{{actionValue}}" stepKey="fillActionValue"/> + <click selector="{{AdminCartPriceRulesFormSection.applyAction}}" stepKey="applyAction"/> + <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveButton"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontApplyCouponActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontApplyCouponActionGroup.xml new file mode 100644 index 0000000000000..72f2fb2a2a386 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontApplyCouponActionGroup.xml @@ -0,0 +1,27 @@ +<?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"> + <!-- Apply Sales Rule Coupon to the cart --> + <actionGroup name="StorefrontApplyCouponActionGroup"> + <annotations> + <description>Applies the provided Coupon Code to the Storefront Shopping Cart.</description> + </annotations> + <arguments> + <argument name="coupon"/> + </arguments> + + <waitForElement selector="{{StorefrontSalesRuleCartCouponSection.couponHeader}}" time="30" stepKey="waitForCouponHeader"/> + <conditionalClick selector="{{StorefrontSalesRuleCartCouponSection.couponHeader}}" dependentSelector="{{StorefrontSalesRuleCartCouponSection.discountBlockActive}}" visible="false" stepKey="clickCouponHeader"/> + <waitForElementVisible selector="{{StorefrontSalesRuleCartCouponSection.couponField}}" stepKey="waitForCouponField"/> + <fillField userInput="{{coupon.code}}" selector="{{StorefrontSalesRuleCartCouponSection.couponField}}" stepKey="fillCouponField"/> + <click selector="{{StorefrontSalesRuleCartCouponSection.applyButton}}" stepKey="clickApplyButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontCancelCouponActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontCancelCouponActionGroup.xml new file mode 100644 index 0000000000000..a97d9e8cd6300 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontCancelCouponActionGroup.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="StorefrontCancelCouponActionGroup"> + <annotations> + <description>Cancels the Coupon that is applied to the Storefront Shopping Cart.</description> + </annotations> + + <waitForElement selector="{{StorefrontSalesRuleCartCouponSection.couponHeader}}" time="30" stepKey="waitForCouponHeader"/> + <conditionalClick selector="{{StorefrontSalesRuleCartCouponSection.couponHeader}}" dependentSelector="{{StorefrontSalesRuleCartCouponSection.discountBlockActive}}" visible="false" stepKey="clickCouponHeader"/> + <waitForElementVisible selector="{{StorefrontSalesRuleCartCouponSection.couponField}}" stepKey="waitForCouponField"/> + <click selector="{{StorefrontSalesRuleCartCouponSection.cancelButton}}" stepKey="clickCancelButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontCheckCouponAppliedActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontCheckCouponAppliedActionGroup.xml new file mode 100644 index 0000000000000..84c2dd2121ae3 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontCheckCouponAppliedActionGroup.xml @@ -0,0 +1,24 @@ +<?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="StorefrontCheckCouponAppliedActionGroup"> + <annotations> + <description>Validates that the provided Rule and Discount Amount is present and correct on the Storefront Checkout page.</description> + </annotations> + <arguments> + <argument name="rule"/> + <argument name="discount" type="string"/> + </arguments> + + <waitForElementVisible selector="{{CheckoutCartSummarySection.discountTotal}}" stepKey="waitForDiscountTotal"/> + <see userInput="{{rule.store_labels[1][store_label]}}" selector="{{CheckoutCartSummarySection.discountLabel}}" stepKey="assertDiscountLabel"/> + <see userInput="-${{discount}}" selector="{{CheckoutCartSummarySection.discountTotal}}" stepKey="assertDiscountTotal"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontSalesRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontSalesRuleActionGroup.xml deleted file mode 100644 index f978c1e2a9262..0000000000000 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/StorefrontSalesRuleActionGroup.xml +++ /dev/null @@ -1,76 +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"> - <!-- Apply Sales Rule Coupon to the cart --> - <actionGroup name="StorefrontApplyCouponActionGroup"> - <annotations> - <description>Applies the provided Coupon Code to the Storefront Shopping Cart.</description> - </annotations> - <arguments> - <argument name="coupon"/> - </arguments> - - <waitForElement selector="{{StorefrontSalesRuleCartCouponSection.couponHeader}}" time="30" stepKey="waitForCouponHeader"/> - <conditionalClick selector="{{StorefrontSalesRuleCartCouponSection.couponHeader}}" dependentSelector="{{StorefrontSalesRuleCartCouponSection.discountBlockActive}}" visible="false" stepKey="clickCouponHeader"/> - <waitForElementVisible selector="{{StorefrontSalesRuleCartCouponSection.couponField}}" stepKey="waitForCouponField"/> - <fillField userInput="{{coupon.code}}" selector="{{StorefrontSalesRuleCartCouponSection.couponField}}" stepKey="fillCouponField"/> - <click selector="{{StorefrontSalesRuleCartCouponSection.applyButton}}" stepKey="clickApplyButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <!-- Cancel Sales Rule Coupon applied to the cart --> - <actionGroup name="StorefrontCancelCouponActionGroup"> - <annotations> - <description>Cancels the Coupon that is applied to the Storefront Shopping Cart.</description> - </annotations> - - <waitForElement selector="{{StorefrontSalesRuleCartCouponSection.couponHeader}}" time="30" stepKey="waitForCouponHeader"/> - <conditionalClick selector="{{StorefrontSalesRuleCartCouponSection.couponHeader}}" dependentSelector="{{StorefrontSalesRuleCartCouponSection.discountBlockActive}}" visible="false" stepKey="clickCouponHeader"/> - <waitForElementVisible selector="{{StorefrontSalesRuleCartCouponSection.couponField}}" stepKey="waitForCouponField"/> - <click selector="{{StorefrontSalesRuleCartCouponSection.cancelButton}}" stepKey="clickCancelButton"/> - </actionGroup> - - <!-- Check applied discount in cart summary --> - <actionGroup name="StorefrontCheckCouponAppliedActionGroup"> - <annotations> - <description>Validates that the provided Rule and Discount Amount is present and correct on the Storefront Checkout page.</description> - </annotations> - <arguments> - <argument name="rule"/> - <argument name="discount" type="string"/> - </arguments> - - <waitForElementVisible selector="{{CheckoutCartSummarySection.discountTotal}}" stepKey="waitForDiscountTotal"/> - <see userInput="{{rule.store_labels[1][store_label]}}" selector="{{CheckoutCartSummarySection.discountLabel}}" stepKey="assertDiscountLabel"/> - <see userInput="-${{discount}}" selector="{{CheckoutCartSummarySection.discountTotal}}" stepKey="assertDiscountTotal"/> - </actionGroup> - - <actionGroup name="VerifyDiscountAmount"> - <annotations> - <description>Goes to the provided Storefront Product URL. Fills in provided Quantity. Clicks Add to Cart. Goes to Checkout. Validates that the provided Discount Amount is present and correct.</description> - </annotations> - <arguments> - <argument name="productUrl" type="string"/> - <argument name="quantity" type="string"/> - <argument name="expectedDiscount" type="string"/> - </arguments> - - <amOnPage url="{{productUrl}}" stepKey="goToProductPage"/> - <waitForPageLoad stepKey="waitForProductPageLoad"/> - <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> - <click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addProductToCart"/> - <waitForPageLoad stepKey="waitForAddToCart"/> - <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> - <amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToCartPage"/> - <waitForPageLoad stepKey="waitForCartPage"/> - <waitForElementVisible selector="{{CheckoutCartSummarySection.discountAmount}}" stepKey="waitForDiscountElement"/> - <see selector="{{CheckoutCartSummarySection.discountAmount}}" userInput="{{expectedDiscount}}" stepKey="seeDiscountTotal"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/VerifyDiscountAmountActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/VerifyDiscountAmountActionGroup.xml new file mode 100644 index 0000000000000..c4e8f9f6ce32e --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/VerifyDiscountAmountActionGroup.xml @@ -0,0 +1,32 @@ +<?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="VerifyDiscountAmountActionGroup"> + <annotations> + <description>Goes to the provided Storefront Product URL. Fills in provided Quantity. Clicks Add to Cart. Goes to Checkout. Validates that the provided Discount Amount is present and correct.</description> + </annotations> + <arguments> + <argument name="productUrl" type="string"/> + <argument name="quantity" type="string"/> + <argument name="expectedDiscount" type="string"/> + </arguments> + + <amOnPage url="{{productUrl}}" stepKey="goToProductPage"/> + <waitForPageLoad stepKey="waitForProductPageLoad"/> + <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> + <click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addProductToCart"/> + <waitForPageLoad stepKey="waitForAddToCart"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToCartPage"/> + <waitForPageLoad stepKey="waitForCartPage"/> + <waitForElementVisible selector="{{CheckoutCartSummarySection.discountAmount}}" stepKey="waitForDiscountElement"/> + <see selector="{{CheckoutCartSummarySection.discountAmount}}" userInput="{{expectedDiscount}}" stepKey="seeDiscountTotal"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml index ab085dc5ae137..b516e102fc928 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml @@ -86,7 +86,7 @@ <actionGroup ref="saveProductForm" stepKey="saveProduct"/> <!--Create cart price rule--> - <actionGroup ref="AdminCreateCartPriceRuleWithConditions" stepKey="createRule"> + <actionGroup ref="AdminCreateCartPriceRuleWithConditionsActionGroup" stepKey="createRule"> <argument name="ruleName" value="PriceRuleWithCondition"/> <argument name="condition1" value="Products subselection"/> <argument name="condition2" value="Category"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml index 02078ff15ecc2..d6bb25fec6ff0 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml @@ -56,7 +56,7 @@ </actionGroup> <!-- Spot check the storefront --> - <actionGroup ref="VerifyDiscountAmount" stepKey="verifyStorefront"> + <actionGroup ref="VerifyDiscountAmountActionGroup" stepKey="verifyStorefront"> <argument name="productUrl" value="{{_defaultProduct.urlKey}}.html"/> <argument name="quantity" value="2"/> <argument name="expectedDiscount" value="-$123.00"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleEmptyFromDateTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleEmptyFromDateTest.xml index f5b285f2f0286..f0075a92a2b82 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleEmptyFromDateTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleEmptyFromDateTest.xml @@ -53,7 +53,7 @@ <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{_defaultCoupon.code}}" stepKey="fillRuleName"/> <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsites"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectCustomerGroup"/> <selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="Specific Coupon" stepKey="selectCouponType"/> <fillField selector="{{AdminCartPriceRulesFormSection.couponCode}}" userInput="{{_defaultCoupon.code}}" stepKey="fillCouponCode"/> <click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" stepKey="clickToExpandActions"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml index 1681d910ccdb0..1b5361a7f1d4d 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml @@ -55,7 +55,7 @@ </actionGroup> <!-- Spot check the storefront --> - <actionGroup ref="VerifyDiscountAmount" stepKey="verifyStorefront"> + <actionGroup ref="VerifyDiscountAmountActionGroup" stepKey="verifyStorefront"> <argument name="productUrl" value="{{_defaultProduct.urlKey}}.html"/> <argument name="quantity" value="2"/> <argument name="expectedDiscount" value="-$20.00"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml index 69918bda8c426..f4acb93c54572 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml @@ -55,7 +55,7 @@ </actionGroup> <!-- Spot check the storefront --> - <actionGroup ref="VerifyDiscountAmount" stepKey="verifyStorefront"> + <actionGroup ref="VerifyDiscountAmountActionGroup" stepKey="verifyStorefront"> <argument name="productUrl" value="{{_defaultProduct.urlKey}}.html"/> <argument name="quantity" value="2"/> <argument name="expectedDiscount" value="-$19.99"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml index 898e5a07304b6..e859d4ffc2b98 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml @@ -55,7 +55,7 @@ </actionGroup> <!-- Spot check the storefront --> - <actionGroup ref="VerifyDiscountAmount" stepKey="verifyStorefront"> + <actionGroup ref="VerifyDiscountAmountActionGroup" stepKey="verifyStorefront"> <argument name="productUrl" value="{{_defaultProduct.urlKey}}.html"/> <argument name="quantity" value="1"/> <argument name="expectedDiscount" value="-$61.50"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteActiveSalesRuleWithPercentPriceAndVerifyDeleteMessageTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteActiveSalesRuleWithPercentPriceAndVerifyDeleteMessageTest.xml index 41e4221a2c37f..34b8363e8b5ce 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteActiveSalesRuleWithPercentPriceAndVerifyDeleteMessageTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteActiveSalesRuleWithPercentPriceAndVerifyDeleteMessageTest.xml @@ -22,7 +22,7 @@ <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!--Create active cart price rule--> - <actionGroup ref="AdminCreateCartPriceRuleWithCouponCode" stepKey="createActiveCartPriceRule"> + <actionGroup ref="AdminCreateCartPriceRuleWithCouponCodeActionGroup" stepKey="createActiveCartPriceRule"> <argument name="ruleName" value="ActiveSalesRuleWithPercentPriceDiscountCoupon"/> <argument name="couponCode" value="ActiveSalesRuleWithPercentPriceDiscountCoupon.coupon_code"/> </actionGroup> @@ -41,4 +41,4 @@ <argument name="ruleName" value="ActiveSalesRuleWithPercentPriceDiscountCoupon.name"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml index 1eba06126ff6f..83625acf69822 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml @@ -88,14 +88,14 @@ <deleteData createDataKey="createCategory" stepKey="deleteApiCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> - + <!-- Create the rule --> <amOnPage url="{{AdminCartPriceRulesPage.url}}" stepKey="amOnCartPriceList"/> <waitForPageLoad stepKey="waitForRulesPage"/> <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{SimpleSalesRule.name}}" stepKey="fillRuleName"/> <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsites"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <generateDate date="-1 day" format="m/d/Y" stepKey="yesterdayDate"/> <fillField selector="{{AdminCartPriceRulesFormSection.fromDate}}" userInput="{$yesterdayDate}" stepKey="fillFromDate"/> <selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="Specific Coupon" stepKey="selectCouponType"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountry.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountry.xml index ffd50e43a2344..832b9ef8bd4b4 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountry.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleCountry.xml @@ -42,7 +42,7 @@ <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{SimpleSalesRule.name}}" stepKey="fillRuleName"/> <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsites"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <generateDate date="-1 day" format="m/d/Y" stepKey="yesterdayDate"/> <fillField selector="{{AdminCartPriceRulesFormSection.fromDate}}" userInput="{$yesterdayDate}" stepKey="fillFromDate"/> <click selector="{{PriceRuleConditionsSection.conditionsTab}}" stepKey="expandConditions"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcode.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcode.xml index 765f10e44d81b..9882b04bdc956 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcode.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRulePostcode.xml @@ -42,7 +42,7 @@ <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{SimpleSalesRule.name}}" stepKey="fillRuleName"/> <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsites"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <generateDate date="-1 day" format="m/d/Y" stepKey="yesterdayDate"/> <fillField selector="{{AdminCartPriceRulesFormSection.fromDate}}" userInput="{$yesterdayDate}" stepKey="fillFromDate"/> <click selector="{{PriceRuleConditionsSection.conditionsTab}}" stepKey="expandConditions"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantity.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantity.xml index cde5e351e1b70..ad060c1412c8c 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantity.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleQuantity.xml @@ -42,7 +42,7 @@ <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{SimpleSalesRule.name}}" stepKey="fillRuleName"/> <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsites"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <generateDate date="-1 day" format="m/d/Y" stepKey="yesterdayDate"/> <fillField selector="{{AdminCartPriceRulesFormSection.fromDate}}" userInput="{$yesterdayDate}" stepKey="fillFromDate"/> <click selector="{{PriceRuleConditionsSection.conditionsTab}}" stepKey="expandConditions"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleState.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleState.xml index d6806e2a2966b..19ffb7c36f992 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleState.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleState.xml @@ -42,7 +42,7 @@ <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{SimpleSalesRule.name}}" stepKey="fillRuleName"/> <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsites"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <generateDate date="-1 day" format="m/d/Y" stepKey="yesterdayDate"/> <fillField selector="{{AdminCartPriceRulesFormSection.fromDate}}" userInput="{$yesterdayDate}" stepKey="fillFromDate"/> <click selector="{{PriceRuleConditionsSection.conditionsTab}}" stepKey="expandConditions"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotal.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotal.xml index 8ff747607ea30..510bfabf303f5 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotal.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartPriceRuleSubtotal.xml @@ -42,7 +42,7 @@ <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{SimpleSalesRule.name}}" stepKey="fillRuleName"/> <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsites"/> - <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <generateDate date="-1 day" format="m/d/Y" stepKey="yesterdayDate"/> <fillField selector="{{AdminCartPriceRulesFormSection.fromDate}}" userInput="{$yesterdayDate}" stepKey="fillFromDate"/> <click selector="{{PriceRuleConditionsSection.conditionsTab}}" stepKey="expandConditions"/> From 665c525d26b4f53a81888271b4f4712599673a8e Mon Sep 17 00:00:00 2001 From: Kostiantyn Lozhkin <k@kml.email> Date: Thu, 28 Nov 2019 16:03:32 +0100 Subject: [PATCH 318/595] magento/adobe-stock-integration#584: DataExtractor unit tests --- .../Test/Unit/Model/DataExtractorTest.php | 195 ++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100644 app/code/Magento/MediaGallery/Test/Unit/Model/DataExtractorTest.php diff --git a/app/code/Magento/MediaGallery/Test/Unit/Model/DataExtractorTest.php b/app/code/Magento/MediaGallery/Test/Unit/Model/DataExtractorTest.php new file mode 100644 index 0000000000000..b64834e5decee --- /dev/null +++ b/app/code/Magento/MediaGallery/Test/Unit/Model/DataExtractorTest.php @@ -0,0 +1,195 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\MediaGallery\Test\Unit\Model; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\MediaGallery\Model\Asset; +use Magento\MediaGallery\Model\Keyword; +use Magento\MediaGalleryApi\Api\Data\AssetInterface; +use Magento\MediaGalleryApi\Api\Data\KeywordInterface; +use Magento\MediaGallery\Model\DataExtractor; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class DataExtractorTest extends TestCase +{ + /** + * @var DataExtractor|MockObject + */ + private $dataExtractor; + + /** + * Initialize basic test class mocks + */ + protected function setUp(): void + { + $this->dataExtractor = new DataExtractor(); + } + + /** + * Test extract object data by interface + * + * @dataProvider assetProvider + * + * @param string $class + * @param string|null $interfaceClass + * @param array $expectedData + * + * @throws \ReflectionException + */ + public function testExtractData(string $class, $interfaceClass, array $expectedData): void + { + $data = []; + foreach ($expectedData as $expectedDataKey => $expectedDataItem) { + $data[$expectedDataKey] = $expectedDataItem['value']; + } + $model = (new ObjectManager($this))->getObject( + $class, + [ + 'data' => $data, + ] + ); + $receivedData = $this->dataExtractor->extract($model, $interfaceClass); + $this->checkValues($expectedData, $receivedData, $model); + } + + /** + * @param array $expectedData + * @param array $data + * @param object $model + */ + protected function checkValues(array $expectedData, array $data, $model) + { + foreach ($expectedData as $expectedDataKey => $expectedDataItem) { + $this->assertEquals($data[$expectedDataKey] ?? null, $model->{$expectedDataItem['method']}()); + $this->assertEquals($data[$expectedDataKey] ?? null, $expectedDataItem['value']); + } + $this->assertEquals(array_keys($expectedData), array_keys($expectedData)); + } + + /** + * @return array + */ + public function assetProvider() + { + return [ + 'Test case asset 1' => [ + Asset::class, + null, + [ + 'id' => [ + 'value' => 1, + 'method' => 'getId', + ], + 'path' => [ + 'value' => 'path', + 'method' => 'getPath', + ], + 'title' => [ + 'value' => 'title', + 'method' => 'getTitle', + ], + 'source' => [ + 'value' => 'source', + 'method' => 'getSource', + ], + 'content_type' => [ + 'value' => 'content_type', + 'method' => 'getContentType', + ], + 'width' => [ + 'value' => 1, + 'method' => 'getWidth', + ], + 'height' => [ + 'value' => 2, + 'method' => 'getHeight', + ], + 'created_at' => [ + 'value' => '2019-11-28 10:40:09', + 'method' => 'getCreatedAt', + ], + 'updated_at' => [ + 'value' => '2019-11-28 10:41:08', + 'method' => 'getUpdatedAt', + ], + ], + ], + 'Test case asset 2' => [ + Asset::class, + AssetInterface::class, + [ + 'id' => [ + 'value' => 2, + 'method' => 'getId', + ], + 'path' => [ + 'value' => 'path', + 'method' => 'getPath', + ], + 'title' => [ + 'value' => 'title', + 'method' => 'getTitle', + ], + 'source' => [ + 'value' => 'source', + 'method' => 'getSource', + ], + 'content_type' => [ + 'value' => 'content_type', + 'method' => 'getContentType', + ], + 'width' => [ + 'value' => 3, + 'method' => 'getWidth', + ], + 'height' => [ + 'value' => 4, + 'method' => 'getHeight', + ], + 'created_at' => [ + 'value' => '2019-11-28 10:40:09', + 'method' => 'getCreatedAt', + ], + 'updated_at' => [ + 'value' => '2019-11-28 10:41:08', + 'method' => 'getUpdatedAt', + ], + ], + ], + 'Test case keyword 1' => [ + Keyword::class, + null, + [ + 'id' => [ + 'value' => 2, + 'method' => 'getId', + ], + 'keyword' => [ + 'value' => 'keyword', + 'method' => 'getKeyword', + ], + ], + ], + 'Test case keyword 2' => [ + Keyword::class, + KeywordInterface::class, + [ + 'id' => [ + 'value' => 3, + 'method' => 'getId', + ], + 'keyword' => [ + 'value' => 'keyword2', + 'method' => 'getKeyword', + ], + ], + ], + ]; + } +} From 4c9c7bfb7c28cdd29e7b5f16944d81a3a9b99be5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 17:00:15 +0100 Subject: [PATCH 319/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../Test/AdminDashboardWithChartsChart.xml | 2 +- ...AnAdminOrderUsingBraintreePaymentTest1.xml | 8 +- ...thOnlinePaymentIncludingTaxAndDiscount.xml | 8 +- ...ProductWithZeroPriceToShoppingCartTest.xml | 2 +- .../Test/CheckTierPricingOfProductsTest.xml | 2 +- ...ctCustomOptionsDifferentStoreViewsTest.xml | 2 +- ...ntPurchaseProductWithCustomOptionsTest.xml | 2 +- ...ckoutAsCustomerUsingDefaultAddressTest.xml | 2 +- ...eCheckoutAsCustomerUsingNewAddressTest.xml | 2 +- ...utAsCustomerUsingNonDefaultAddressTest.xml | 2 +- .../OnePageCheckoutUsingSignInLinkTest.xml | 2 +- ...OnePageCheckoutWithAllProductTypesTest.xml | 2 +- ...efrontApplyPromoCodeDuringCheckoutTest.xml | 2 +- ...ingAddressAndProductWithTierPricesTest.xml | 4 +- ...ssAndRegisterCustomerAfterCheckoutTest.xml | 4 +- ...ntCheckoutWithSpecialPriceProductsTest.xml | 4 +- ...OnLoginWhenGuestCheckoutIsDisabledTest.xml | 4 +- ...egistrationAndDisableGuestCheckoutTest.xml | 4 +- ...tCheckoutUsingFreeShippingAndTaxesTest.xml | 4 +- ...tCheckoutWithCouponAndZeroSubtotalTest.xml | 4 +- ...ngesInBackendAfterCustomerCheckoutTest.xml | 4 +- ...efrontUKCustomerCheckoutWithCouponTest.xml | 2 +- ...uctQuantityEqualsToOrderedQuantityTest.xml | 4 +- ...CouponAndBankTransferPaymentMethodTest.xml | 4 +- ...SubtotalOrdersWithProcessingStatusTest.xml | 2 +- ...vailableToConfigureDisabledProductTest.xml | 4 +- .../ProductsQtyReturnAfterOrderCancelTest.xml | 4 +- ...ayWhenChooseThreeAllowedCurrenciesTest.xml | 2 +- .../AdminOrderRateDisplayedInOneLineTest.xml | 2 +- ...fStorefrontIsOpenedViaCustomerViewTest.xml | 12 +- ...oreFrontMyAccountWithMultishipmentTest.xml | 4 +- .../CancelOrdersInOrderSalesReportTest.xml | 2 +- .../AddBundleProductToOrderActionGroup.xml | 32 + ...tToOrderAndCheckPriceInGridActionGroup.xml | 25 + ...dConfigurableProductToOrderActionGroup.xml | 33 ++ ...ableProductToOrderFromAdminActionGroup.xml | 19 + ...dDownloadableProductToOrderActionGroup.xml | 29 + ...GroupedProductOptionToOrderActionGroup.xml | 33 ++ .../AddSimpleProductToOrderActionGroup.xml | 30 + ...SimpleProductWithQtyToOrderActionGroup.xml | 18 + .../AdminCreateInvoiceActionGroup.xml | 12 - ...nCreateInvoiceAndCreditMemoActionGroup.xml | 19 + ...minCreateInvoiceAndShipmentActionGroup.xml | 15 + .../AdminCreditMemoActionGroup.xml | 32 +- .../AdminFastCreateInvoiceActionGroup.xml | 26 + .../ActionGroup/AdminInvoiceActionGroup.xml | 130 ---- ...OpenAndFillCreditMemoRefundActionGroup.xml | 11 +- ...ditMemoRefundAndBackToStockActionGroup.xml | 18 + .../ActionGroup/AdminOrderActionGroup.xml | 557 ------------------ .../ActionGroup/AdminOrderGridActionGroup.xml | 113 ---- ...AdminOrdersGridClearFiltersActionGroup.xml | 20 + ...sertOrderAddressInformationActionGroup.xml | 20 + .../CancelPendingOrderActionGroup.xml | 26 + .../ChangeShippingMethodActionGroup.xml | 26 + ...kRequiredFieldsNewOrderFormActionGroup.xml | 39 ++ .../ClearInvoicesGridFiltersActionGroup.xml | 21 + ...eOrderedConfigurableProductActionGroup.xml | 28 + .../ActionGroup/CreateOrderActionGroup.xml | 38 ++ ...derFilteringCustomerByEmailActionGroup.xml | 14 + .../CreateOrderInStoreActionGroup.xml | 39 ++ ...nStoreChoosingPaymentMethodActionGroup.xml | 40 ++ .../CreateOrderToPrintPageActionGroup.xml | 9 - ...geWithSelectedPaymentMethodActionGroup.xml | 19 + ...ontSeeProductInItemsOrderedActionGroup.xml | 17 + ...illOrderCustomerInformationActionGroup.xml | 29 + .../FilterInvoiceGridByOrderIdActionGroup.xml | 25 + ...idByOrderIdWithCleanFiltersActionGroup.xml | 17 + ...erOrderGridByBaseTotalRangeActionGroup.xml | 26 + ...ilterOrderGridByBillingNameActionGroup.xml | 26 + .../FilterOrderGridByIdActionGroup.xml | 30 + ...lterOrderGridByPurchaseDateActionGroup.xml | 26 + .../FilterOrderGridByStatusActionGroup.xml | 24 + .../GoToInvoiceIntoOrderActionGroup.xml | 20 + ...ewOrderPageExistingCustomerActionGroup.xml | 39 ++ ...ageExistingCustomerAndStoreActionGroup.xml | 22 + ...teToNewOrderPageNewCustomerActionGroup.xml | 29 + ...rPageNewCustomerSingleStoreActionGroup.xml | 26 + ...dConfigurableProductToOrderActionGroup.xml | 16 + .../ActionGroup/OpenOrderByIdActionGroup.xml | 19 + ...OrderSelectFlatRateShippingActionGroup.xml | 22 + .../OrderSelectFreeShippingActionGroup.xml | 22 + .../SeeProductInInvoiceItemsActionGroup.xml | 21 + .../SeeProductInItemsOrderedActionGroup.xml | 21 + .../SeeProductInItemsRefundedActionGroup.xml | 21 + ...ctBankTransferPaymentMethodActionGroup.xml | 15 + ...CashOnDeliveryPaymentMethodActionGroup.xml | 15 + ...lectCheckMoneyPaymentMethodActionGroup.xml | 19 + ...tPurchaseOrderPaymentMethodActionGroup.xml | 19 + ...tCreateInvoiceFromOrderPageActionGroup.xml | 20 + .../StartToCreateCreditMemoActionGroup.xml | 20 + .../SubmitCreditMemoActionGroup.xml | 19 + .../ActionGroup/SubmitInvoiceActionGroup.xml | 22 + .../UpdateCreditMemoTotalsActionGroup.xml | 15 + ...rifyBasicInvoiceInformationActionGroup.xml | 35 ++ ...VerifyBasicOrderInformationActionGroup.xml | 34 ++ ...rifyCreatedOrderInformationActionGroup.xml | 21 + ...vailabilityCreditMemoWithNoPaymentTest.xml | 12 +- ...OrderWithBankTransferPaymentMethodTest.xml | 8 +- ...derWithCashOnDeliveryPaymentMethodTest.xml | 8 +- ...erWithCheckMoneyOrderPaymentMethodTest.xml | 16 +- ...WithProductQtyWithoutStockDecreaseTest.xml | 14 +- ...rderWithPurchaseOrderPaymentMethodTest.xml | 10 +- ...eatedOrderWithZeroSubtotalCheckoutTest.xml | 10 +- .../AdminChangeCustomerGroupInNewOrder.xml | 4 +- ...dminCheckingCreditMemoUpdateTotalsTest.xml | 4 +- ...kingDateAfterChangeInterfaceLocaleTest.xml | 4 +- ...ectnessInvoicedItemInBundleProductTest.xml | 6 +- ...reateCreditMemoBankTransferPaymentTest.xml | 12 +- ...reateCreditMemoConfigurableProductTest.xml | 12 +- ...AdminCreateCreditMemoPartialRefundTest.xml | 14 +- ...CreateCreditMemoWithCashOnDeliveryTest.xml | 12 +- ...nCreateCreditMemoWithPurchaseOrderTest.xml | 12 +- ...AdminCreateOrderAddProductCheckboxTest.xml | 2 +- ...AdminCreateOrderAndCheckTheReorderTest.xml | 10 +- ...thTwoAddressesTaxableAndNonTaxableTest.xml | 8 +- .../AdminCreateOrderWithBundleProductTest.xml | 8 +- ...reateOrderWithMinimumAmountEnabledTest.xml | 14 +- ...OrderWithSelectedShoppingCartItemsTest.xml | 12 +- .../AdminCreateOrderWithSimpleProductTest.xml | 10 +- ...nimumOrderAmountNotMatchOrderTotalTest.xml | 4 +- .../Mftf/Test/AdminHoldCreatedOrderTest.xml | 10 +- ...rderCreationWithMultiWebsiteConfigTest.xml | 8 +- .../Test/AdminReorderWithCatalogPriceTest.xml | 2 +- ...dminSaveInAddressBookCheckboxStateTest.xml | 4 +- ...dminSubmitConfigurableProductOrderTest.xml | 12 +- ...ubmitsOrderPaymentMethodValidationTest.xml | 10 +- ...minSubmitsOrderWithAndWithoutEmailTest.xml | 12 +- ...rderWithAndWithoutFieldsValidationTest.xml | 12 +- ...mOrderStatusNotVisibleOnStorefrontTest.xml | 4 +- ...SSVulnerabilityDuringOrderCreationTest.xml | 2 +- .../CreateInvoiceAndCheckInvoiceOrderTest.xml | 6 +- ...iceWithCashOnDeliveryPaymentMethodTest.xml | 4 +- ...eWithShipmentAndCheckInvoicedOrderTest.xml | 10 +- ...ateInvoiceWithZeroSubtotalCheckoutTest.xml | 8 +- .../CreateOrderFromEditCustomerPageTest.xml | 8 +- .../Test/Mftf/Test/EndToEndB2CAdminTest.xml | 42 +- ...eredConfigurableProductOnOrderPageTest.xml | 4 +- .../Test/StorefrontPrintOrderGuestTest.xml | 6 +- ...ustomStoreShippingMethodTableRatesTest.xml | 6 +- .../AdminCreatePartialShipmentEntityTest.xml | 6 +- .../Test/AdminCreateShipmentEntityTest.xml | 6 +- .../AdminTaxCalcWithApplyTaxOnSettingTest.xml | 6 +- .../Test/Mftf/Test/AdminTaxReportGridTest.xml | 10 +- .../Mftf/Test/CheckCreditMemoTotalsTest.xml | 6 +- 144 files changed, 1652 insertions(+), 1133 deletions(-) create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AddBundleProductToOrderActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AddBundleProductToOrderAndCheckPriceInGridActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AddConfigurableProductToOrderActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AddConfigurableProductToOrderFromAdminActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AddDownloadableProductToOrderActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AddGroupedProductOptionToOrderActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductWithQtyToOrderActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceAndCreditMemoActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceAndShipmentActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFastCreateInvoiceActionGroup.xml delete mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenAndFillCreditMemoRefundAndBackToStockActionGroup.xml delete mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml delete mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderGridActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrdersGridClearFiltersActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderAddressInformationActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/CancelPendingOrderActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/ChangeShippingMethodActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/CheckRequiredFieldsNewOrderFormActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/ClearInvoicesGridFiltersActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/ConfigureOrderedConfigurableProductActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderFilteringCustomerByEmailActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderInStoreActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderInStoreChoosingPaymentMethodActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderToPrintPageWithSelectedPaymentMethodActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/DontSeeProductInItemsOrderedActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/FillOrderCustomerInformationActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterInvoiceGridByOrderIdActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterInvoiceGridByOrderIdWithCleanFiltersActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByBaseTotalRangeActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByBillingNameActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByIdActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByPurchaseDateActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByStatusActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/GoToInvoiceIntoOrderActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerAndStoreActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageNewCustomerActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageNewCustomerSingleStoreActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/NewAddConfigurableProductToOrderActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/OpenOrderByIdActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/OrderSelectFlatRateShippingActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/OrderSelectFreeShippingActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInInvoiceItemsActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInItemsOrderedActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInItemsRefundedActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectBankTransferPaymentMethodActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectCashOnDeliveryPaymentMethodActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectCheckMoneyPaymentMethodActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectPurchaseOrderPaymentMethodActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/StartCreateInvoiceFromOrderPageActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/StartToCreateCreditMemoActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/SubmitCreditMemoActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/SubmitInvoiceActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/UpdateCreditMemoTotalsActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyBasicInvoiceInformationActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyBasicOrderInformationActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyCreatedOrderInformationActionGroup.xml diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsChart.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsChart.xml index f48c7752efc7a..53d2081958b21 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsChart.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsChart.xml @@ -76,7 +76,7 @@ <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> <!-- Search for Order in the order grid --> <comment userInput="Search for Order in the order grid" stepKey="searchOrderInGrid"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> <waitForLoadingMaskToDisappear stepKey="waitForSearchingOrder"/> diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml index 2594d245f9ff0..5a332b3518256 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml @@ -59,23 +59,23 @@ <waitForPageLoad stepKey="waitForLogin" time="3"/> <!--Create New Order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrder"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrder"> <argument name="customer" value="Simple_US_Customer"/> </actionGroup> <!--Add Product to Order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addProduct"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> <!--Fill Order Customer Information--> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress"> <argument name="customer" value="Simple_US_Customer"/> <argument name="address" value="US_Address_TX"/> </actionGroup> <!--Select Shipping--> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRateShipping"/> <waitForPageLoad stepKey="waitForShippingToFinish"/> <!--Pay with Braintree --> diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml index 8f0ce4918b978..b2f13d6c8c56c 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml @@ -98,17 +98,17 @@ <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> <!--Create New Order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!--Add a product to order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProductToOrder"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> <!--Select FlatRate shipping method--> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShippingMethod"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="orderSelectFlatRateShippingMethod"/> <!--Select Braintree online Payment method --> <actionGroup ref="AdminOrderBraintreeFillActionGroup" stepKey="selectCreditCardPayment"/> @@ -119,7 +119,7 @@ <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeOrderSuccessMessage" after="waitForSubmitOrder"/> <!-- Create New invoice--> - <actionGroup ref="adminFastCreateInvoice" stepKey="createInvoice"/> + <actionGroup ref="AdminFastCreateInvoiceActionGroup" stepKey="createInvoice"/> <!--Get access to Credit Memo page from Invoice page--> <click selector="{{AdminInvoiceMainActionsSection.openNewCreditMemoFromInvoice}}" stepKey="clickCreateNewCreditMemo"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml index 33181d6e920eb..64b786ac4ed7c 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleProductWithZeroPriceToShoppingCartTest.xml @@ -67,7 +67,7 @@ <!--Check subtotal in created order--> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> <click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml index cee40241185b4..9e980784e1a7c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml @@ -149,7 +149,7 @@ <see userInput="You saved the rule." stepKey="RuleSaved"/> <!--Create new order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="CreateNewOrder"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="CreateNewOrder"> <argument name="customer" value="Simple_US_Customer"/> <argument name="storeView" value="customStoreView"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml index a0670bdee54c7..a96797f080a40 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductCustomOptionsDifferentStoreViewsTest.xml @@ -196,7 +196,7 @@ <!-- Open Order --> - <actionGroup ref="filterOrderGridById" stepKey="openOrdersGrid"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="openOrdersGrid"> <argument name="orderId" value="{$grabOrderNumber}"/> </actionGroup> <click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml index 12a465188aa85..c0653d9dbba7e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml @@ -130,7 +130,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> - <actionGroup ref="filterOrderGridById" stepKey="filterByOrderId"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterByOrderId"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> <click selector="{{AdminDataGridTableSection.firstRow}}" stepKey="clickOrderRow"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml index aa3665a81bbde..428b569046fa5 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml @@ -87,7 +87,7 @@ <!-- Open created order in backend --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> <waitForPageLoad stepKey="waitForOrdersPageLoad"/> - <actionGroup ref="OpenOrderById" stepKey="filterOrderGridById"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml index bafad6f28a680..8ae1bb83d852b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml @@ -100,7 +100,7 @@ <!-- Open created order in backend --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> <waitForPageLoad stepKey="waitForOrdersPageLoad"/> - <actionGroup ref="OpenOrderById" stepKey="filterOrderGridById"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml index 2c341a5c4c1ab..4d5443d8430d7 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml @@ -88,7 +88,7 @@ <!-- Open created order in backend --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> <waitForPageLoad stepKey="waitForOrdersPageLoad"/> - <actionGroup ref="OpenOrderById" stepKey="filterOrderGridById"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml index 990459d7c81b7..5b01246170a95 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml @@ -81,7 +81,7 @@ <!-- Open created order in backend --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> <waitForPageLoad stepKey="waitForOrdersPageLoad"/> - <actionGroup ref="OpenOrderById" stepKey="filterOrderGridById"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml index e85a47ab7a91d..72ca058f7efd9 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml @@ -197,7 +197,7 @@ <!-- Open created order --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> <waitForPageLoad stepKey="waitForOrderPageLoad"/> - <actionGroup ref="OpenOrderById" stepKey="filterOrderGridById"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontApplyPromoCodeDuringCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontApplyPromoCodeDuringCheckoutTest.xml index bdfdfceab53f9..6aa44d3c10499 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontApplyPromoCodeDuringCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontApplyPromoCodeDuringCheckoutTest.xml @@ -80,7 +80,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Verify total on order page --> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> <click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml index c5d1c34a93b32..e7ff46f049109 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml @@ -111,7 +111,7 @@ <waitForPageLoad stepKey="waitForOrderIndexPageToLoad"/> <!-- Filter Order using orderId and assert order--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/> @@ -127,4 +127,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml index 34dc6617d25d5..a943f928d9f18 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml @@ -81,7 +81,7 @@ <waitForPageLoad stepKey="waitForPageLoad5"/> <!-- Filter Order using orderId and assert order--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> @@ -98,4 +98,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml index 6ccb05bf4c4f7..255e9445e7948 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml @@ -151,7 +151,7 @@ <waitForPageLoad stepKey="waitForPageLoad5"/> <!-- Filter Order using orderId and assert order--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> @@ -168,4 +168,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml index b0b72515611e8..9b9c5044af0bd 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml @@ -81,7 +81,7 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <!-- Filter Order using orderId and assert order--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> @@ -91,4 +91,4 @@ <!-- Ship the order and assert the shipping status --> <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml index f7e54867b1ae4..931ee4e8ec59d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml @@ -119,7 +119,7 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <!-- Filter Order using orderId and assert order--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> @@ -129,4 +129,4 @@ <!-- Ship the order and assert the shipping status --> <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml index 2226e1ebc8292..961fc226d9d1e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml @@ -196,7 +196,7 @@ <waitForPageLoad stepKey="waitForPageLoad5"/> <!-- Filter Order using orderId and assert order--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/> @@ -220,4 +220,4 @@ <argument name="customerGroup" value=""/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml index 33ec099aa2ace..1fc6b7fc3eaf7 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml @@ -77,7 +77,7 @@ <waitForPageLoad stepKey="waitForPageLoad5"/> <!-- Filter Order using orderId and assert order--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/> @@ -90,4 +90,4 @@ <see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$0.00" stepKey="seeGrandTotal"/> <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderStatus"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml index 285dc28cb520e..d0d5600175556 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml @@ -71,7 +71,7 @@ <waitForPageLoad stepKey="waitForPageLoad5"/> <!-- Filter Order using orderId and assert order--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/> @@ -102,4 +102,4 @@ </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="Out Of Stock" stepKey="seeProductDisplayedAsOutOfStock"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml index 482e2fb6233a6..176bf2d0089c7 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml @@ -116,7 +116,7 @@ <waitForPageLoad stepKey="waitForPageLoad5"/> <!-- Filter Order using orderId and assert order--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> <see selector="{{AdminOrdersGridSection.firstRow}}" userInput="$$createCustomer.fullname$$" stepKey="seeCustomerNameInGrid"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml index deab32aede324..d9686d6784f39 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml @@ -66,7 +66,7 @@ <waitForPageLoad stepKey="waitForPageLoad5"/> <!-- Filter Order using orderId and assert order--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/> @@ -97,4 +97,4 @@ </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="Out Of Stock" stepKey="seeProductDisplayedAsOutOfStock"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml index 6d5f79f3aadf4..eb4633ee80c11 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml @@ -78,7 +78,7 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <!-- Filter Order using orderId and assert order--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/> @@ -94,4 +94,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml index 4b3e18fb31877..88dffc32377cc 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml @@ -90,7 +90,7 @@ <waitForPageLoad stepKey="waitForSalesOrderPageLoaded"/> <!-- Open Order --> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> <click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml index fd607d2203c66..21ffe1deef01c 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml @@ -118,7 +118,7 @@ <actionGroup ref="saveProductForm" stepKey="saveSecondProductForm"/> <!-- Go to created customer page --> <comment userInput="Go to created customer page" stepKey="goToCreatedCustomerPage"/> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="createNewOrder"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="createNewOrder"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickToAddProduct"/> @@ -133,7 +133,7 @@ <dontSee userInput="$$createConfigProductAttributeOption1.option[store_labels][1][label]$$" stepKey="dontSeeOption1"/> <!-- Go to created customer page again --> <comment userInput="Go to created customer page again" stepKey="goToCreatedCustomerPageAgain"/> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="createNewOrderAgain"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="createNewOrderAgain"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickToAddProductAgain"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml index c3459aec34492..80202396720bf 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml @@ -66,7 +66,7 @@ <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> @@ -83,7 +83,7 @@ <fillField selector="{{AdminShipmentItemsSection.itemQtyToShip('1')}}" userInput="1" stepKey="changeItemQtyToShip"/> <click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="clickSubmitShipment"/> <waitForPageLoad stepKey="waitShipmentSectionToLoad"/> - <actionGroup ref="cancelPendingOrder" stepKey="cancelPendingOption"> + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOption"> <argument name="orderStatus" value="Complete"/> </actionGroup> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml index 26fbfd394be68..6de2a46a5d3d9 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml @@ -61,7 +61,7 @@ </actionGroup> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabNewOrderNumber"/> <!--Open order and check rates display in one line--> - <actionGroup ref="OpenOrderById" stepKey="openNewOrderById"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openNewOrderById"> <argument name="orderId" value="$grabNewOrderNumber"/> </actionGroup> <see selector="{{AdminOrderDetailsInformationSection.orderInformationTable}}" userInput="EUR / USD rate" stepKey="seeUSDandEURRate"/> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayedInOneLineTest.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayedInOneLineTest.xml index dc6bdf3db542e..3e3d3f5d20f26 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayedInOneLineTest.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayedInOneLineTest.xml @@ -64,7 +64,7 @@ </actionGroup> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> <!--Open order and check rates display in one line--> - <actionGroup ref="OpenOrderById" stepKey="openOrderById"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrderById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> <see selector="{{AdminOrderDetailsInformationSection.orderInformationTable}}" userInput="EUR / USD rate" stepKey="seeEURandUSDRate"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml index d2d3343a3b8d3..ee32214435428 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminPanelIsFrozenIfStorefrontIsOpenedViaCustomerViewTest.xml @@ -30,22 +30,22 @@ <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderPage"> <argument name="customer" value="$simpleCustomer$"/> </actionGroup> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSecondProduct"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSecondProduct"> <argument name="product" value="$createSimpleProduct$"/> </actionGroup> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerInfo"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerInfo"> <argument name="customer" value="$simpleCustomer$"/> <argument name="address" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRate"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRate"/> <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId"/> - <actionGroup ref="StartCreateInvoiceFromOrderPage" stepKey="startCreateInvoice"/> - <actionGroup ref="SubmitInvoice" stepKey="submitInvoice"/> + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startCreateInvoice"/> + <actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/> <actionGroup ref="goToShipmentIntoOrder" stepKey="goToShipment"/> <actionGroup ref="submitShipmentIntoOrder" stepKey="submitShipment"/> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMyAccountWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMyAccountWithMultishipmentTest.xml index eec8a40877bb3..0af5be7dafb3c 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMyAccountWithMultishipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMyAccountWithMultishipmentTest.xml @@ -96,7 +96,7 @@ <waitForLoadingMaskToDisappear stepKey="waitForLoading"/> <!--Assert order in orders grid --> <!-- Go to order page --> - <actionGroup ref="OpenOrderById" stepKey="openFirstOrderPage"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openFirstOrderPage"> <argument name="orderId" value="{$getFirstOrderIdPlaceOrder}"/> </actionGroup> <!-- Check status --> @@ -106,7 +106,7 @@ <waitForPageLoad stepKey="waitForOrderPageLoad4"/> <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters2"/> <!-- Go to order page --> - <actionGroup ref="OpenOrderById" stepKey="openSecondOrderPage"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openSecondOrderPage"> <argument name="orderId" value="{$getSecondOrderIdPlaceOrder}"/> </actionGroup> <!-- Check status --> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml index 0412e945362e4..324b56757c516 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml @@ -62,7 +62,7 @@ </actionGroup> <!-- Cancel order --> - <actionGroup ref="cancelPendingOrder" stepKey="cancelOrder"/> + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelOrder"/> <!-- Generate Order report for statuses --> <amOnPage url="{{OrdersReportPage.url}}" stepKey="goToOrdersReportPage1"/> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddBundleProductToOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddBundleProductToOrderActionGroup.xml new file mode 100644 index 0000000000000..ee252990e0646 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddBundleProductToOrderActionGroup.xml @@ -0,0 +1,32 @@ +<?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="AddBundleProductToOrderActionGroup"> + <annotations> + <description>Adds the provided Bundled Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="quantity" type="string" defaultValue="1"/> + </arguments> + + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> + <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterBundle"/> + <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchBundle"/> + <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> + <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectBundleProduct"/> + <waitForElementVisible selector="{{AdminOrderFormBundleProductSection.quantity}}" stepKey="waitForBundleOptionLoad"/> + <wait time="2" stepKey="waitForOptionsToLoad"/> + <fillField selector="{{AdminOrderFormBundleProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/> + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddBundleProductToOrderAndCheckPriceInGridActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddBundleProductToOrderAndCheckPriceInGridActionGroup.xml new file mode 100644 index 0000000000000..71205ff9808d0 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddBundleProductToOrderAndCheckPriceInGridActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AddBundleProductToOrderAndCheckPriceInGridActionGroup" extends="AddBundleProductToOrderActionGroup"> + <annotations> + <description>EXTENDS: addBundleProductToOrder. Validates that the provided Product Price is present and correct in the 'Items Ordered' section.</description> + </annotations> + <arguments> + <argument name="price" type="string"/> + </arguments> + + <grabTextFrom selector="{{AdminOrderFormItemsSection.rowPrice('1')}}" stepKey="grabProductPriceFromGrid" after="clickOk"/> + <assertEquals stepKey="assertProductPriceInGrid" message="Bundle product price in grid should be equal {{price}}" after="grabProductPriceFromGrid"> + <expectedResult type="string">{{price}}</expectedResult> + <actualResult type="variable">grabProductPriceFromGrid</actualResult> + </assertEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddConfigurableProductToOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddConfigurableProductToOrderActionGroup.xml new file mode 100644 index 0000000000000..dee2af6cd4053 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddConfigurableProductToOrderActionGroup.xml @@ -0,0 +1,33 @@ +<?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="AddConfigurableProductToOrderActionGroup"> + <annotations> + <description>Adds the provided Configurable Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="attribute"/> + <argument name="option"/> + </arguments> + + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> + <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterConfigurable"/> + <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchConfigurable"/> + <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> + <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectConfigurableProduct"/> + <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_label)}}" stepKey="waitForConfigurablePopover"/> + <wait time="2" stepKey="waitForOptionsToLoad"/> + <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_label)}}" userInput="{{option.name}}" stepKey="selectionConfigurableOption"/> + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/> + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddConfigurableProductToOrderFromAdminActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddConfigurableProductToOrderFromAdminActionGroup.xml new file mode 100644 index 0000000000000..200568fe2c05a --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddConfigurableProductToOrderFromAdminActionGroup.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="AddConfigurableProductToOrderFromAdminActionGroup" extends="AddConfigurableProductToOrderActionGroup"> + <annotations> + <description>EXTENDS: addConfigurableProductToOrder. Selects the provided Option to the Configurable Product.</description> + </annotations> + + <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" stepKey="waitForConfigurablePopover"/> + <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" userInput="{{option.label}}" stepKey="selectionConfigurableOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddDownloadableProductToOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddDownloadableProductToOrderActionGroup.xml new file mode 100644 index 0000000000000..3018b4308b193 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddDownloadableProductToOrderActionGroup.xml @@ -0,0 +1,29 @@ +<?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="AddDownloadableProductToOrderActionGroup"> + <annotations> + <description>Adds a Downloadable Product to an Order. Clicks on 'Add Selected Product(s) to Order'.</description> + </annotations> + + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> + <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> + <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterDownloadable"/> + <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchDownloadable"/> + <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> + <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectDownloadableProduct"/> + <waitForElementVisible selector="{{AdminOrderFormDownloadableProductSection.optionSelect(link.title)}}" stepKey="waitForLinkLoad"/> + <click selector="{{AdminOrderFormDownloadableProductSection.optionSelect(link.title)}}" stepKey="selectLink"/> + <fillField selector="{{AdminOrderFormDownloadableProductSection.quantity}}" userInput="{{quantity}}" stepKey="setQuantity"/> + <click selector="{{AdminOrderFormDownloadableProductSection.ok}}" stepKey="confirmConfiguration"/> + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddGroupedProductOptionToOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddGroupedProductOptionToOrderActionGroup.xml new file mode 100644 index 0000000000000..228198527b911 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddGroupedProductOptionToOrderActionGroup.xml @@ -0,0 +1,33 @@ +<?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="AddGroupedProductOptionToOrderActionGroup"> + <annotations> + <description>Adds the provided Grouped Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="option"/> + <argument name="quantity" type="string" defaultValue="1"/> + </arguments> + + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> + <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterGrouped"/> + <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchGrouped"/> + <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> + <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectGroupedProduct"/> + <waitForElementVisible selector="{{AdminOrderFormGroupedProductSection.optionQty(option.sku)}}" stepKey="waitForGroupedOptionLoad"/> + <wait time="2" stepKey="waitForOptionsToLoad"/> + <fillField selector="{{AdminOrderFormGroupedProductSection.optionQty(option.sku)}}" userInput="{{quantity}}" stepKey="fillOptionQuantity"/> + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/> + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderActionGroup.xml new file mode 100644 index 0000000000000..8d5062c79f828 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductToOrderActionGroup.xml @@ -0,0 +1,30 @@ +<?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="AddSimpleProductToOrderActionGroup"> + <annotations> + <description>Adds the provided Simple Product to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct" type="entity"/> + <argument name="productQty" defaultValue="1" type="string"/> + </arguments> + + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> + <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilter"/> + <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearch"/> + <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> + <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectProduct"/> + <fillField selector="{{AdminOrderFormItemsSection.rowQty('1')}}" userInput="{{productQty}}" stepKey="fillProductQty"/> + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + <wait time="5" stepKey="waitForOptionsToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductWithQtyToOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductWithQtyToOrderActionGroup.xml new file mode 100644 index 0000000000000..e0d18fa9c2340 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AddSimpleProductWithQtyToOrderActionGroup.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="AddSimpleProductWithQtyToOrderActionGroup" extends="AddSimpleProductToOrderActionGroup"> + <arguments> + <argument name="product" defaultValue="_defaultProduct" type="entity"/> + <argument name="productQty" type="string"/> + </arguments> + <fillField selector="{{AdminOrderFormItemsSection.rowQty('1')}}" userInput="{{productQty}}" stepKey="fillProductQty"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceActionGroup.xml index 416d3f488dd1f..a90c16428ca03 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceActionGroup.xml @@ -15,16 +15,4 @@ <waitForPageLoad stepKey="waitForLoadPage"/> <see userInput="The invoice has been created." stepKey="seeMessage"/> </actionGroup> - <actionGroup name="AdminCreateInvoiceAndShipmentActionGroup" extends="AdminCreateInvoiceActionGroup"> - <checkOption selector="{{AdminInvoicePaymentShippingSection.CreateShipment}}" stepKey="checkCreateShipment" after="waitForInvoicePage"/> - <see userInput="You created the invoice and shipment." stepKey="seeMessage"/> - </actionGroup> - <actionGroup name="AdminCreateInvoiceAndCreditMemoActionGroup" extends="AdminCreateInvoiceActionGroup"> - <click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="pushButtonCreditMemo" after="seeMessage"/> - <waitForPageLoad stepKey="waitForLoadingCreditMemoPage" after="pushButtonCreditMemo"/> - <scrollTo selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="scrollToBottom" after="waitForLoadingCreditMemoPage"/> - <click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickSubmitRefund" after="scrollToBottom"/> - <waitForPageLoad stepKey="waitForMainOrderPageLoad" after="clickSubmitRefund"/> - <see userInput="You created the credit memo." stepKey="seeCreditMemoMessage" after="waitForMainOrderPageLoad"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceAndCreditMemoActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceAndCreditMemoActionGroup.xml new file mode 100644 index 0000000000000..a69cd8688c6c5 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceAndCreditMemoActionGroup.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="AdminCreateInvoiceAndCreditMemoActionGroup" extends="AdminCreateInvoiceActionGroup"> + <click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="pushButtonCreditMemo" after="seeMessage"/> + <waitForPageLoad stepKey="waitForLoadingCreditMemoPage" after="pushButtonCreditMemo"/> + <scrollTo selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="scrollToBottom" after="waitForLoadingCreditMemoPage"/> + <click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickSubmitRefund" after="scrollToBottom"/> + <waitForPageLoad stepKey="waitForMainOrderPageLoad" after="clickSubmitRefund"/> + <see userInput="You created the credit memo." stepKey="seeCreditMemoMessage" after="waitForMainOrderPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceAndShipmentActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceAndShipmentActionGroup.xml new file mode 100644 index 0000000000000..047b78a81c2cd --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreateInvoiceAndShipmentActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AdminCreateInvoiceAndShipmentActionGroup" extends="AdminCreateInvoiceActionGroup"> + <checkOption selector="{{AdminInvoicePaymentShippingSection.CreateShipment}}" stepKey="checkCreateShipment" after="waitForInvoicePage"/> + <see userInput="You created the invoice and shipment." stepKey="seeMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreditMemoActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreditMemoActionGroup.xml index 75d41d835bed2..04e4c40060d27 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreditMemoActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreditMemoActionGroup.xml @@ -9,7 +9,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <!--Check customer information is correct in credit memo--> - <actionGroup name="verifyBasicCreditMemoInformation"> + <actionGroup name="VerifyBasicCreditMemoInformationActionGroup"> <annotations> <description>Validates that the provided Customer, Shipping/Billing Address and Customer Group are present and correct on the Admin Credit Memo view page.</description> </annotations> @@ -35,36 +35,6 @@ <see selector="{{AdminCreditMemoAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> </actionGroup> - <actionGroup name="seeProductInItemsRefunded"> - <annotations> - <description>Validates that the provided Product appears in the 'Product' column on the Admin Credit Memo view page.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - <see selector="{{AdminCreditMemoItemsSection.skuColumn}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> - </actionGroup> - <actionGroup name="StartToCreateCreditMemoActionGroup"> - <arguments> - <argument name="orderId" type="string"/> - </arguments> - <amOnPage url="{{AdminOrderPage.url(orderId)}}" stepKey="navigateToOrderPage"/> - <click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickCreditMemo"/> - <waitForElementVisible selector="{{AdminHeaderSection.pageTitle}}" stepKey="waitForPageTitle"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Memo" stepKey="seeNewMemoPageTitle"/> - </actionGroup> - <actionGroup name="SubmitCreditMemoActionGroup"> - <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/> - <waitForElementVisible selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="waitButtonEnabled"/> - <click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickSubmitCreditMemo"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You created the credit memo." stepKey="seeCreditMemoCreateSuccess"/> - <seeInCurrentUrl url="{{AdminOrderDetailsPage.url}}$grabOrderId" stepKey="seeViewOrderPageCreditMemo"/> - </actionGroup> - <actionGroup name="UpdateCreditMemoTotalsActionGroup"> - <waitForElementVisible selector="{{AdminCreditMemoTotalSection.updateTotals}}" stepKey="waitUpdateTotalsButtonEnabled"/> - <click selector="{{AdminCreditMemoTotalSection.updateTotals}}" stepKey="clickUpdateTotals"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFastCreateInvoiceActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFastCreateInvoiceActionGroup.xml new file mode 100644 index 0000000000000..b5175b6c3002e --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFastCreateInvoiceActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AdminFastCreateInvoiceActionGroup"> + <annotations> + <description>Clicks on 'Invoice' on the Admin Orders view page. Clicks on 'Submit Invoice'. Clicks on 'View Invoice'.</description> + </annotations> + + <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceButton"/> + <waitForPageLoad stepKey="waitForNewInvoicePageLoad"/> + <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> + <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeSuccessMessage"/> + <click selector="{{AdminOrderDetailsOrderViewSection.invoices}}" stepKey="clickInvoices"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask5"/> + <conditionalClick selector="{{AdminOrderInvoicesTabSection.clearFilters}}" dependentSelector="{{AdminOrderInvoicesTabSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <click selector="{{AdminOrderInvoicesTabSection.viewInvoice}}" stepKey="openInvoicePage"/> + <waitForPageLoad stepKey="waitForInvoicePageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml deleted file mode 100644 index 8451f9de03293..0000000000000 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml +++ /dev/null @@ -1,130 +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"> - <!--Check customer information is correct in invoice--> - <actionGroup name="verifyBasicInvoiceInformation"> - <annotations> - <description>Validates that the provided Customer, Address and Customer Group details are present and correct on the Admin View Invoice page.</description> - </annotations> - <arguments> - <argument name="customer"/> - <argument name="shippingAddress"/> - <argument name="billingAddress"/> - <argument name="customerGroup" defaultValue="GeneralCustomerGroup"/> - </arguments> - - <see selector="{{AdminInvoiceOrderInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/> - <see selector="{{AdminInvoiceOrderInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/> - <see selector="{{AdminInvoiceOrderInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/> - <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.street[0]}}" stepKey="seeBillingAddressStreet"/> - <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.city}}" stepKey="seeBillingAddressCity"/> - <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country_id}}" stepKey="seeBillingAddressCountry"/> - <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.postcode}}" stepKey="seeBillingAddressPostcode"/> - <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.street[0]}}" stepKey="seeShippingAddressStreet"/> - <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.city}}" stepKey="seeShippingAddressCity"/> - <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/> - <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> - </actionGroup> - - <!--Check that product is in invoice items--> - <actionGroup name="seeProductInInvoiceItems"> - <annotations> - <description>Validates that the provided Product appears under the 'SKU' column in the Admin Invoices edit page.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <see selector="{{AdminInvoiceItemsSection.skuColumn}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> - </actionGroup> - - <!--Admin Fast Create Invoice--> - <actionGroup name="adminFastCreateInvoice"> - <annotations> - <description>Clicks on 'Invoice' on the Admin Orders view page. Clicks on 'Submit Invoice'. Clicks on 'View Invoice'.</description> - </annotations> - - <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceButton"/> - <waitForPageLoad stepKey="waitForNewInvoicePageLoad"/> - <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> - <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeSuccessMessage"/> - <click selector="{{AdminOrderDetailsOrderViewSection.invoices}}" stepKey="clickInvoices"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask5"/> - <conditionalClick selector="{{AdminOrderInvoicesTabSection.clearFilters}}" dependentSelector="{{AdminOrderInvoicesTabSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <click selector="{{AdminOrderInvoicesTabSection.viewInvoice}}" stepKey="openInvoicePage"/> - <waitForPageLoad stepKey="waitForInvoicePageLoad"/> - </actionGroup> - - <actionGroup name="clearInvoicesGridFilters"> - <annotations> - <description>Goes to the Admin Invoices grid page. Clicks on 'Clear Filters', if present.</description> - </annotations> - - <amOnPage url="{{AdminInvoicesPage.url}}" stepKey="goToInvoices"/> - <waitForPageLoad stepKey="waitInvoicesGridToLoad"/> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearFilters"/> - <waitForPageLoad stepKey="waitInvoicesGrid"/> - </actionGroup> - - <actionGroup name="goToInvoiceIntoOrder"> - <annotations> - <description>Clicks on 'Invoice' on the Admin Orders view page. Validates that the URL and Page Title are correct.</description> - </annotations> - - <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction"/> - <seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeOrderInvoiceUrl"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seePageNameNewInvoicePage"/> - </actionGroup> - - <actionGroup name="StartCreateInvoiceFromOrderPage"> - <annotations> - <description>Clicks on 'Invoice' on the Admin Orders view page. Validates that the URL and Page Title are correct.</description> - </annotations> - - <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction"/> - <seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeNewInvoiceUrl"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seeNewInvoicePageTitle"/> - </actionGroup> - - <actionGroup name="SubmitInvoice"> - <annotations> - <description>Clicks on 'Submit Invoice' on the Admin 'New Invoice' page. Validates that the Success Message is present and correct. Validates that the Order ID appears in the URL.</description> - </annotations> - - <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/> - <see selector="{{AdminMessagesSection.success}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/> - <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/> - <seeInCurrentUrl url="{{AdminOrderDetailsPage.url('$grabOrderId')}}" stepKey="seeViewOrderPageInvoice"/> - </actionGroup> - - <!--Filter invoices by order id --> - <actionGroup name="filterInvoiceGridByOrderId"> - <annotations> - <description>Goes to the Admin Invoices grid page. Filters the grid for the provided Order ID.</description> - </annotations> - <arguments> - <argument name="orderId" type="string"/> - </arguments> - - <amOnPage url="{{AdminInvoicesPage.url}}" stepKey="goToInvoices"/> - <click selector="{{AdminInvoicesGridSection.filter}}" stepKey="clickFilter"/> - <fillField selector="{{AdminInvoicesFiltersSection.orderNum}}" userInput="{{orderId}}" stepKey="fillOrderIdForFilter"/> - <click selector="{{AdminInvoicesFiltersSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForPageLoad stepKey="waitForFiltersApply"/> - </actionGroup> - - <actionGroup name="FilterInvoiceGridByOrderIdWithCleanFiltersActionGroup" extends="filterInvoiceGridByOrderId"> - <arguments> - <argument name="orderId" type="string"/> - </arguments> - <conditionalClick selector="{{AdminInvoicesGridSection.clearFilters}}" dependentSelector="{{AdminInvoicesGridSection.clearFilters}}" visible="true" stepKey="clearFilters" after="goToInvoices"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenAndFillCreditMemoRefundActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenAndFillCreditMemoRefundActionGroup.xml index da4c80bb28586..b11985fc8e7ef 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenAndFillCreditMemoRefundActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenAndFillCreditMemoRefundActionGroup.xml @@ -19,7 +19,7 @@ <argument name="adjustmentFee" type="string" defaultValue="0"/> <argument name="rowNumber" type="string" defaultValue="1"/> </arguments> - + <!-- Click 'Credit Memo' button --> <click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickCreateCreditMemo"/> <seeInCurrentUrl url="{{AdminCreditMemoNewPage.url}}" stepKey="seeNewCreditMemoPage"/> @@ -38,13 +38,4 @@ <click selector="{{AdminCreditMemoTotalSection.updateTotals}}" stepKey="clickUpdateTotals"/> <checkOption selector="{{AdminCreditMemoTotalSection.emailCopy}}" stepKey="checkSendEmailCopy"/> </actionGroup> - - <!-- Open and fill CreditMemo refund with back to stock --> - <actionGroup name="AdminOpenAndFillCreditMemoRefundAndBackToStockActionGroup" extends="AdminOpenAndFillCreditMemoRefundActionGroup"> - <annotations> - <description>EXTENDS: AdminOpenAndFillCreditMemoRefundActionGroup. Checks 'Return to Stock'.</description> - </annotations> - - <checkOption selector="{{AdminCreditMemoItemsSection.itemReturnToStock(rowNumber)}}" stepKey="backToStock" after="scrollToItemsToRefund"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenAndFillCreditMemoRefundAndBackToStockActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenAndFillCreditMemoRefundAndBackToStockActionGroup.xml new file mode 100644 index 0000000000000..0dc205df18249 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenAndFillCreditMemoRefundAndBackToStockActionGroup.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="AdminOpenAndFillCreditMemoRefundAndBackToStockActionGroup" extends="AdminOpenAndFillCreditMemoRefundActionGroup"> + <annotations> + <description>EXTENDS: AdminOpenAndFillCreditMemoRefundActionGroup. Checks 'Return to Stock'.</description> + </annotations> + + <checkOption selector="{{AdminCreditMemoItemsSection.itemReturnToStock(rowNumber)}}" stepKey="backToStock" after="scrollToItemsToRefund"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml deleted file mode 100644 index 90e2aa8e12527..0000000000000 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml +++ /dev/null @@ -1,557 +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"> - <!--Navigate to create order page (New Order -> Create New Customer)--> - <actionGroup name="navigateToNewOrderPageNewCustomer"> - <annotations> - <description>Goes to the Admin Orders grid page. Clicks on 'Create New Order'. Clicks on 'Create New Customer'. Select the provided Store View, if present. Validates that Page Title is present and correct.</description> - </annotations> - <arguments> - <argument name="storeView" defaultValue="_defaultStore"/> - </arguments> - - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> - <waitForPageLoad stepKey="waitForIndexPageLoad"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> - <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> - <click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/> - <conditionalClick selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" dependentSelector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" visible="true" stepKey="selectStoreViewIfAppears"/> - <waitForPageLoad stepKey="waitForCreateOrderPageLoadAfterStoreSelect"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> - </actionGroup> - - <!--Navigate to create order page (New Order -> Create New Customer)--> - <actionGroup name="navigateToNewOrderPageNewCustomerSingleStore"> - <annotations> - <description>Goes to the Admin Orders grid page. Clicks on 'Create New Order'. Clicks on 'Create New Customer'. Validates that Page Title is present and correct.</description> - </annotations> - <arguments> - <argument name="storeView" defaultValue="_defaultStore"/> - </arguments> - - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> - <waitForPageLoad stepKey="waitForIndexPageLoad"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> - <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> - <click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> - </actionGroup> - - <!--Navigate to create order page (New Order -> Select Customer)--> - <actionGroup name="navigateToNewOrderPageExistingCustomer"> - <annotations> - <description>Goes tot he Admin Orders grid page. Clicks on 'Create New Order'. Filters the grid for the provided Customer. Clicks on the Customer. Selects the provided Store View, if present. Validates that the Page Title is present and correct.</description> - </annotations> - <arguments> - <argument name="customer"/> - <argument name="storeView" defaultValue="_defaultStore"/> - </arguments> - - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> - <waitForPageLoad stepKey="waitForIndexPageLoad"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> - <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> - <waitForPageLoad stepKey="waitForCustomerGridLoad"/> - - <!--Clear grid filters--> - <conditionalClick selector="{{AdminOrderCustomersGridSection.resetButton}}" dependentSelector="{{AdminOrderCustomersGridSection.resetButton}}" visible="true" stepKey="clearExistingCustomerFilters"/> - <fillField userInput="{{customer.email}}" selector="{{AdminOrderCustomersGridSection.emailInput}}" stepKey="filterEmail"/> - <click selector="{{AdminOrderCustomersGridSection.apply}}" stepKey="applyFilter"/> - <waitForPageLoad stepKey="waitForFilteredCustomerGridLoad"/> - <click selector="{{AdminOrderCustomersGridSection.firstRow}}" stepKey="clickOnCustomer"/> - <waitForPageLoad stepKey="waitForCreateOrderPageLoad"/> - - <!-- Select store view if appears --> - <conditionalClick selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" dependentSelector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" visible="true" stepKey="selectStoreViewIfAppears"/> - <waitForPageLoad stepKey="waitForCreateOrderPageLoadAfterStoreSelect"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> - </actionGroup> - - <!--Navigate to New Order Page for existing Customer And Store--> - <actionGroup name="NavigateToNewOrderPageExistingCustomerAndStoreActionGroup" extends="navigateToNewOrderPageExistingCustomer"> - <annotations> - <description>EXTENDS: navigateToNewOrderPageExistingCustomer. Clicks on the provided Store View.</description> - </annotations> - <arguments> - <argument name="storeView" defaultValue="_defaultStore"/> - </arguments> - - <click selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" stepKey="selectStoreView" after="waitForCreateOrderPageLoad"/> - <waitForPageLoad stepKey="waitForLoad" after="selectStoreView"/> - </actionGroup> - - <!--Check the required fields are actually required--> - <actionGroup name="checkRequiredFieldsNewOrderForm"> - <annotations> - <description>Clears the Email, First Name, Last Name, Street Line 1, City, Postal Code and Phone fields when adding an Order and then verifies that they are required after attempting to Save.</description> - </annotations> - - <seeElement selector="{{AdminOrderFormAccountSection.requiredGroup}}" stepKey="seeCustomerGroupRequired"/> - <seeElement selector="{{AdminOrderFormAccountSection.requiredEmail}}" stepKey="seeEmailRequired"/> - <clearField selector="{{AdminOrderFormAccountSection.email}}" stepKey="clearEmailField"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.FirstName}}" stepKey="clearFirstNameField"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.LastName}}" stepKey="clearLastNameField"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.StreetLine1}}" stepKey="clearStreetField"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.City}}" stepKey="clearCityField"/> - <selectOption selector="{{AdminOrderFormBillingAddressSection.Country}}" userInput="United States" stepKey="selectUSCountry"/> - <selectOption selector="{{AdminOrderFormBillingAddressSection.State}}" userInput="Please select" stepKey="selectNoState"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.PostalCode}}" stepKey="clearPostalCodeField"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.Phone}}" stepKey="clearPhoneField"/> - <seeElement selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="seeShippingMethodNotSelected"/> - <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="trySubmitOrder"/> - <see selector="{{AdminOrderFormBillingAddressSection.emailError}}" userInput="This is a required field." stepKey="seeThatEmailIsRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.firstNameError}}" userInput="This is a required field." stepKey="seeFirstNameRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.lastNameError}}" userInput="This is a required field." stepKey="seeLastNameRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.streetAddressError}}" userInput="This is a required field." stepKey="seeStreetRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.cityError}}" userInput="This is a required field." stepKey="seeCityRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.stateError}}" userInput="This is a required field." stepKey="seeStateRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.postalCodeError}}" userInput="This is a required field." stepKey="seePostalCodeRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.phoneError}}" userInput="This is a required field." stepKey="seePhoneRequired"/> - <see selector="{{AdminOrderFormPaymentSection.shippingError}}" userInput="This is a required field." stepKey="seeShippingMethodRequired"/> - </actionGroup> - - <!--Add a simple product to order--> - <actionGroup name="addSimpleProductToOrder"> - <annotations> - <description>Adds the provided Simple Product to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct" type="entity"/> - <argument name="productQty" defaultValue="1" type="string"/> - </arguments> - - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> - <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilter"/> - <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearch"/> - <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> - <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectProduct"/> - <fillField selector="{{AdminOrderFormItemsSection.rowQty('1')}}" userInput="{{productQty}}" stepKey="fillProductQty"/> - <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> - <wait time="5" stepKey="waitForOptionsToLoad"/> - </actionGroup> - - <actionGroup name="AddSimpleProductWithQtyToOrderActionGroup" extends="addSimpleProductToOrder"> - <arguments> - <argument name="product" defaultValue="_defaultProduct" type="entity"/> - <argument name="productQty" type="string"/> - </arguments> - <fillField selector="{{AdminOrderFormItemsSection.rowQty('1')}}" userInput="{{productQty}}" stepKey="fillProductQty"/> - </actionGroup> - - <!--Add configurable product to order --> - <actionGroup name="addConfigurableProductToOrder"> - <annotations> - <description>Adds the provided Configurable Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="attribute"/> - <argument name="option"/> - </arguments> - - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> - <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterConfigurable"/> - <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchConfigurable"/> - <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> - <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectConfigurableProduct"/> - <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_label)}}" stepKey="waitForConfigurablePopover"/> - <wait time="2" stepKey="waitForOptionsToLoad"/> - <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_label)}}" userInput="{{option.name}}" stepKey="selectionConfigurableOption"/> - <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/> - <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> - </actionGroup> - - <actionGroup name="newAddConfigurableProductToOrder" extends="addConfigurableProductToOrder"> - <remove keyForRemoval="waitForConfigurablePopover"/> - <remove keyForRemoval="selectionConfigurableOption"/> - <selectOption selector="{{AdminOrderFormConfigureProductSection.selectOption}}" userInput="{{option.value}}" stepKey="selectOption" after="waitForOptionsToLoad"/> - </actionGroup> - - <!--Add configurable product to order --> - <actionGroup name="addConfigurableProductToOrderFromAdmin" extends="addConfigurableProductToOrder"> - <annotations> - <description>EXTENDS: addConfigurableProductToOrder. Selects the provided Option to the Configurable Product.</description> - </annotations> - - <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" stepKey="waitForConfigurablePopover"/> - <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" userInput="{{option.label}}" stepKey="selectionConfigurableOption"/> - </actionGroup> - - <actionGroup name="configureOrderedConfigurableProduct"> - <annotations> - <description>Clicks on 'Configure' for a Product in the 'Please select products' under the 'Create New Order for' page. Selects the provided Option and Attribute. Fills in the provided Qty. Clicks on Ok.</description> - </annotations> - <arguments> - <argument name="attribute"/> - <argument name="option"/> - <argument name="quantity" type="string"/> - </arguments> - - <click selector="{{AdminOrderFormItemsSection.configure}}" stepKey="clickConfigure"/> - <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" stepKey="waitForConfigurablePopover"/> - <wait time="2" stepKey="waitForOptionsToLoad"/> - <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" userInput="{{option.label}}" stepKey="selectionConfigurableOption"/> - <fillField selector="{{AdminOrderFormConfigureProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> - <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/> - </actionGroup> - - <!--Add bundle product to order --> - <actionGroup name="addBundleProductToOrder"> - <annotations> - <description>Adds the provided Bundled Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="quantity" type="string" defaultValue="1"/> - </arguments> - - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> - <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterBundle"/> - <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchBundle"/> - <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> - <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectBundleProduct"/> - <waitForElementVisible selector="{{AdminOrderFormBundleProductSection.quantity}}" stepKey="waitForBundleOptionLoad"/> - <wait time="2" stepKey="waitForOptionsToLoad"/> - <fillField selector="{{AdminOrderFormBundleProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> - <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/> - <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> - </actionGroup> - - <!--Add bundle product to order and check product price in the grid--> - <actionGroup name="addBundleProductToOrderAndCheckPriceInGrid" extends="addBundleProductToOrder"> - <annotations> - <description>EXTENDS: addBundleProductToOrder. Validates that the provided Product Price is present and correct in the 'Items Ordered' section.</description> - </annotations> - <arguments> - <argument name="price" type="string"/> - </arguments> - - <grabTextFrom selector="{{AdminOrderFormItemsSection.rowPrice('1')}}" stepKey="grabProductPriceFromGrid" after="clickOk"/> - <assertEquals stepKey="assertProductPriceInGrid" message="Bundle product price in grid should be equal {{price}}" after="grabProductPriceFromGrid"> - <expectedResult type="string">{{price}}</expectedResult> - <actualResult type="variable">grabProductPriceFromGrid</actualResult> - </assertEquals> - </actionGroup> - - <!--Add downloadable product to order --> - <actionGroup name="addDownloadableProductToOrder"> - <annotations> - <description>Adds a Downloadable Product to an Order. Clicks on 'Add Selected Product(s) to Order'.</description> - </annotations> - - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> - <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> - <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterDownloadable"/> - <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchDownloadable"/> - <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> - <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectDownloadableProduct"/> - <waitForElementVisible selector="{{AdminOrderFormDownloadableProductSection.optionSelect(link.title)}}" stepKey="waitForLinkLoad"/> - <click selector="{{AdminOrderFormDownloadableProductSection.optionSelect(link.title)}}" stepKey="selectLink"/> - <fillField selector="{{AdminOrderFormDownloadableProductSection.quantity}}" userInput="{{quantity}}" stepKey="setQuantity"/> - <click selector="{{AdminOrderFormDownloadableProductSection.ok}}" stepKey="confirmConfiguration"/> - <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> - </actionGroup> - - <!--Add grouped product option to order --> - <actionGroup name="addGroupedProductOptionToOrder"> - <annotations> - <description>Adds the provided Grouped Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="option"/> - <argument name="quantity" type="string" defaultValue="1"/> - </arguments> - - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> - <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterGrouped"/> - <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchGrouped"/> - <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> - <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectGroupedProduct"/> - <waitForElementVisible selector="{{AdminOrderFormGroupedProductSection.optionQty(option.sku)}}" stepKey="waitForGroupedOptionLoad"/> - <wait time="2" stepKey="waitForOptionsToLoad"/> - <fillField selector="{{AdminOrderFormGroupedProductSection.optionQty(option.sku)}}" userInput="{{quantity}}" stepKey="fillOptionQuantity"/> - <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/> - <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> - </actionGroup> - - <!--Fill customer billing address--> - <actionGroup name="fillOrderCustomerInformation"> - <annotations> - <description>Fills in the provided Customer and Address details on the Admin 'Create New Order for' page.</description> - </annotations> - <arguments> - <argument name="customer"/> - <argument name="address"/> - </arguments> - - <fillField selector="{{AdminOrderFormBillingAddressSection.FirstName}}" userInput="{{customer.firstname}}" stepKey="fillFirstName"/> - <fillField selector="{{AdminOrderFormBillingAddressSection.LastName}}" userInput="{{customer.lastname}}" stepKey="fillLastName"/> - <fillField selector="{{AdminOrderFormBillingAddressSection.StreetLine1}}" userInput="{{address.street[0]}}" stepKey="fillStreetLine1"/> - <fillField selector="{{AdminOrderFormBillingAddressSection.City}}" userInput="{{address.city}}" stepKey="fillCity"/> - <selectOption selector="{{AdminOrderFormBillingAddressSection.Country}}" userInput="{{address.country_id}}" stepKey="fillCountry"/> - <selectOption selector="{{AdminOrderFormBillingAddressSection.State}}" userInput="{{address.state}}" stepKey="fillState"/> - <fillField selector="{{AdminOrderFormBillingAddressSection.PostalCode}}" userInput="{{address.postcode}}" stepKey="fillPostalCode"/> - <fillField selector="{{AdminOrderFormBillingAddressSection.Phone}}" userInput="{{address.telephone}}" stepKey="fillPhone"/> - </actionGroup> - - <!--Select flat rate shipping method--> - <actionGroup name="orderSelectFlatRateShipping"> - <annotations> - <description>Selects the 'Flat Rate' Shipping Method on the Admin 'Create New Order for' page.</description> - </annotations> - - <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> - <waitForPageLoad stepKey="waitForJavascriptToFinish"/> - <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods"/> - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.flatRateOption}}" stepKey="waitForShippingOptions"/> - <selectOption selector="{{AdminOrderFormPaymentSection.flatRateOption}}" userInput="flatrate_flatrate" stepKey="checkFlatRate"/> - </actionGroup> - - <actionGroup name="changeShippingMethod"> - <annotations> - <description>Change Shipping Method on the Admin 'Create New Order for' page.</description> - </annotations> - <arguments> - <argument name="shippingMethod" defaultValue="flatrate_flatrate" type="string"/> - </arguments> - <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> - <waitForPageLoad stepKey="waitForJavascriptToFinish"/> - <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods1"/> - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="waitForChangeShippingMethod"/> - <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods2"/> - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.shippingMethod}}" stepKey="waitForShippingOptions2"/> - <selectOption selector="{{AdminOrderFormPaymentSection.shippingMethod}}" userInput="{{shippingMethod}}" stepKey="checkFlatRate"/> - </actionGroup> - - <!--Select free shipping method--> - <actionGroup name="orderSelectFreeShipping"> - <annotations> - <description>Selects the 'Free Shipping' Shipping Method on the Admin 'Create New Order for' page.</description> - </annotations> - - <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> - <waitForPageLoad stepKey="waitForJavascriptToFinish"/> - <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods"/> - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" stepKey="waitForShippingOptions"/> - <selectOption selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" userInput="freeshipping_freeshipping" stepKey="checkFreeShipping"/> - </actionGroup> - - <!--Check that customer information is correct in order--> - <actionGroup name="verifyBasicOrderInformation"> - <annotations> - <description>Validates that the provided Customer, Shipping/Billing Address and Customer Group are present and correct on the Admin Orders view page.</description> - </annotations> - <arguments> - <argument name="customer"/> - <argument name="shippingAddress"/> - <argument name="billingAddress"/> - <argument name="customerGroup" defaultValue="GeneralCustomerGroup"/> - </arguments> - - <see selector="{{AdminOrderDetailsInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/> - <see selector="{{AdminOrderDetailsInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/> - <see selector="{{AdminOrderDetailsInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/> - <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.street[0]}}" stepKey="seeBillingAddressStreet"/> - <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.city}}" stepKey="seeBillingAddressCity"/> - <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country_id}}" stepKey="seeBillingAddressCountry"/> - <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.postcode}}" stepKey="seeBillingAddressPostcode"/> - <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.street[0]}}" stepKey="seeShippingAddressStreet"/> - <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.city}}" stepKey="seeShippingAddressCity"/> - <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/> - <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> - </actionGroup> - <actionGroup name="AssertOrderAddressInformationActionGroup" extends="verifyBasicOrderInformation"> - <remove keyForRemoval="seeCustomerName"/> - <remove keyForRemoval="seeCustomerEmail"/> - <remove keyForRemoval="seeCustomerGroup"/> - <remove keyForRemoval="seeBillingAddressCountry"/> - <remove keyForRemoval="seeShippingAddressCountry"/> - <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country}}" stepKey="seeBillingCountry" after="seeBillingAddressCity"/> - <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country}}" stepKey="seeAddressCountry" after="seeShippingAddressCity"/> - </actionGroup> - - <!--Verify order information--> - <actionGroup name="verifyCreatedOrderInformation"> - <annotations> - <description>Validates that the Success Message, Order Status (Pending) and Order ID are present and correct.</description> - </annotations> - - <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeSuccessMessage"/> - <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderPendingStatus" after="seeSuccessMessage"/> - <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId" after="seeOrderPendingStatus"/> - <assertNotEmpty actual="$getOrderId" stepKey="assertOrderIdIsNotEmpty" after="getOrderId"/> - </actionGroup> - - <!--Check for product in order items list--> - <actionGroup name="seeProductInItemsOrdered"> - <annotations> - <description>Validates that the provided Product is present and correct in the 'Items Ordered' section on the Admin Orders view page.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <see selector="{{AdminOrderItemsOrderedSection.productSkuColumn}}" userInput="{{product.sku}}" stepKey="seeSkuInItemsOrdered"/> - </actionGroup> - - <actionGroup name="CreateOrderInStoreActionGroup"> - <annotations> - <description>Goes to the Admin Create Order page. Creates an Order based on the provided Customer, Store View and Product. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="customer"/> - <argument name="storeView"/> - </arguments> - - <amOnPage stepKey="navigateToNewOrderPage" url="{{AdminOrderCreatePage.url}}"/> - <click stepKey="chooseCustomer" selector="{{AdminOrdersGridSection.customerInOrdersSection(customer.firstname)}}"/> - <waitForPageLoad stepKey="waitForStoresPageOpened"/> - <click stepKey="chooseStore" selector="{{AdminOrderStoreScopeTreeSection.storeForOrder(storeView.name)}}"/> - <scrollToTopOfPage stepKey="scrollToTop"/> - <waitForPageLoad stepKey="waitForStoreToAppear"/> - <click selector="{{OrdersGridSection.addProducts}}" stepKey="clickOnAddProducts"/> - <waitForPageLoad stepKey="waitForProductsListForOrder"/> - <click selector="{{AdminOrdersGridSection.productForOrder(product.sku)}}" stepKey="chooseTheProduct"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="addSelectedProductToOrder"/> - <waitForPageLoad stepKey="waitForProductAddedInOrder"/> - <click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/> - <waitForPageLoad stepKey="waitForShippingMethods"/> - <click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/> - <waitForPageLoad stepKey="waitForShippingMethodsThickened"/> - <click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/> - <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/> - </actionGroup> - - <actionGroup name="CreateOrderInStoreChoosingPaymentMethodActionGroup"> - <annotations> - <description>Goes to the Admin Create Order page. Creates an Order based on the provided Customer, Store View and Product. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="customer"/> - <argument name="storeView"/> - </arguments> - - <amOnPage stepKey="navigateToNewOrderPage" url="{{AdminOrderCreatePage.url}}"/> - <click stepKey="chooseCustomer" selector="{{AdminOrdersGridSection.customerInOrdersSection(customer.firstname)}}"/> - <waitForPageLoad stepKey="waitForStoresPageOpened"/> - <click stepKey="chooseStore" selector="{{AdminOrderStoreScopeTreeSection.storeForOrder(storeView.name)}}"/> - <scrollToTopOfPage stepKey="scrollToTop"/> - <click selector="{{OrdersGridSection.addProducts}}" stepKey="clickOnAddProducts"/> - <waitForPageLoad stepKey="waitForProductsListForOrder"/> - <click selector="{{AdminOrdersGridSection.productForOrder(product.sku)}}" stepKey="chooseTheProduct"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="addSelectedProductToOrder"/> - <waitForPageLoad stepKey="waitForProductAddedInOrder"/> - <click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/> - <waitForPageLoad stepKey="waitForShippingMethods"/> - <click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/> - <waitForPageLoad stepKey="waitForShippingMethodsThickened"/> - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/> - <conditionalClick selector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" dependentSelector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" visible="true" stepKey="checkCheckMoneyOption"/> - <click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/> - <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/> - </actionGroup> - - <!--Cancel order that is in pending status--> - <actionGroup name="cancelPendingOrder"> - <annotations> - <description>Cancels the Pending Order on the Admin Orders view page. Validates that the provided Order Status is present and correct.</description> - </annotations> - <arguments> - <argument name="orderStatus" type="string" defaultValue="Canceled"/> - </arguments> - - <click selector="{{AdminOrderDetailsMainActionsSection.cancel}}" stepKey="clickCancelOrder"/> - <waitForElement selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForCancelConfirmation"/> - <see selector="{{AdminConfirmationModalSection.message}}" userInput="Are you sure you want to cancel this order?" stepKey="seeConfirmationMessage"/> - <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmOrderCancel"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You canceled the order." stepKey="seeCancelSuccessMessage"/> - <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="{{orderStatus}}" stepKey="seeOrderStatusCanceled"/> - </actionGroup> - - <!--Assert that the product is not in the order items list--> - <actionGroup name="dontSeeProductInItemsOrdered"> - <arguments> - <argument name="product"/> - </arguments> - <dontSee selector="{{AdminOrderItemsOrderedSection.productSkuColumn}}" userInput="{{product.sku}}" stepKey="dontseeSkuInItemsOrdered"/> - </actionGroup> - - <!--Select Check Money payment method--> - <actionGroup name="SelectCheckMoneyPaymentMethod"> - <annotations> - <description>Selects the 'Check / Money Order' Payment Method on the Admin Create New Order page.</description> - </annotations> - - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/> - <conditionalClick selector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" dependentSelector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" visible="true" stepKey="checkCheckMoneyOption"/> - </actionGroup> - - <!--Select Bank Transfer payment method--> - <actionGroup name="SelectBankTransferPaymentMethodActionGroup" extends="SelectCheckMoneyPaymentMethod"> - <remove keyForRemoval="checkCheckMoneyOption"/> - <conditionalClick selector="{{AdminOrderFormPaymentSection.checkBankTransfer}}" dependentSelector="{{AdminOrderFormPaymentSection.checkBankTransfer}}" visible="true" stepKey="checkBankTransferOption" after="waitForPaymentOptions"/> - </actionGroup> - - <!--Select Cash on Delivery payment method--> - <actionGroup name="SelectCashOnDeliveryPaymentMethodActionGroup" extends="SelectCheckMoneyPaymentMethod"> - <remove keyForRemoval="checkCheckMoneyOption"/> - <conditionalClick selector="{{AdminOrderFormPaymentSection.checkCashOnDelivery}}" dependentSelector="{{AdminOrderFormPaymentSection.checkCashOnDelivery}}" visible="true" stepKey="checkCashOnDeliveryOption" after="waitForPaymentOptions"/> - </actionGroup> - - <!--Select Purchase Order payment method--> - <actionGroup name="SelectPurchaseOrderPaymentMethodActionGroup" extends="SelectCheckMoneyPaymentMethod"> - <arguments> - <argument name="purchaseOrderNumber" type="string"/> - </arguments> - <remove keyForRemoval="checkCheckMoneyOption"/> - <conditionalClick selector="{{AdminOrderFormPaymentSection.checkPurchaseOrder}}" dependentSelector="{{AdminOrderFormPaymentSection.checkPurchaseOrder}}" visible="true" stepKey="checkPurchaseOrderOption" after="waitForPaymentOptions"/> - <fillField selector="{{AdminOrderFormPaymentSection.fieldPurchaseOrderNumber}}" userInput="{{purchaseOrderNumber}}" stepKey="fillPurchaseOrderNumber"/> - </actionGroup> - - <!-- Create Order --> - <actionGroup name="CreateOrderActionGroup"> - <annotations> - <description>Goes to the Admin Create New Order page. Selects the provided Customer. Adds the provided Product to the Order. Clicks on Submit Order. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="customer"/> - </arguments> - - <amOnPage stepKey="navigateToNewOrderPage" url="{{AdminOrderCreatePage.url}}"/> - <waitForPageLoad stepKey="waitForNewOrderPageOpened"/> - <click stepKey="chooseCustomer" selector="{{AdminOrdersGridSection.customerInOrdersSection(customer.firstname)}}"/> - <waitForPageLoad stepKey="waitForStoresPageOpened"/> - <click selector="{{OrdersGridSection.addProducts}}" stepKey="clickOnAddProducts"/> - <waitForPageLoad stepKey="waitForProductsListForOrder"/> - <click selector="{{AdminOrdersGridSection.productForOrder(product.sku)}}" stepKey="chooseTheProduct"/> - <waitForPageLoad stepKey="waitForClickProduct"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="addSelectedProductToOrder"/> - <waitForPageLoad stepKey="waitForProductAddedInOrder"/> - <click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/> - <waitForPageLoad stepKey="waitForShippingMethods"/> - <click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/> - <waitForPageLoad stepKey="waitForShippingMethodsThickened"/> - <click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/> - <waitForPageLoad stepKey="waitForSubmitOrder"/> - <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/> - </actionGroup> - <actionGroup name="CreateOrderFilteringCustomerByEmailActionGroup" extends="CreateOrderActionGroup"> - <click stepKey="chooseCustomer" selector="{{AdminOrdersGridSection.customerInOrdersSection(customer.email)}}"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderGridActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderGridActionGroup.xml deleted file mode 100644 index e8ed82148b007..0000000000000 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderGridActionGroup.xml +++ /dev/null @@ -1,113 +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"> - <!--Filter order grid by order id field--> - <actionGroup name="filterOrderGridById"> - <annotations> - <description>Goes to the Admin Orders page. Filters the grid based on the provided Order ID.</description> - </annotations> - <arguments> - <argument name="orderId" type="string"/> - </arguments> - - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderGridPage"/> - <waitForPageLoad stepKey="waitForOrdersPage"/> - <conditionalClick selector="{{AdminOrdersGridSection.clearFilters}}" dependentSelector="{{AdminOrdersGridSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <waitForPageLoad stepKey="waitForClearFilters"/> - <click selector="{{AdminOrdersGridSection.filters}}" stepKey="openOrderGridFilters"/> - <waitForPageLoad stepKey="waitForClickFilters"/> - <fillField selector="{{AdminOrdersGridSection.idFilter}}" userInput="{{orderId}}" stepKey="fillOrderIdFilter"/> - <click selector="{{AdminOrdersGridSection.applyFilters}}" stepKey="clickOrderApplyFilters"/> - <waitForPageLoad stepKey="waitForApplyFilters"/> - </actionGroup> - - <!--Filter order grid by the billing name field--> - <actionGroup name="filterOrderGridByBillingName"> - <annotations> - <description>Goes to the Admin Orders page. Filters the grid based on the provided Customer.</description> - </annotations> - <arguments> - <argument name="customer"/> - </arguments> - - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderGridPage"/> - <waitForPageLoad stepKey="waitForOrderGridLoad"/> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> - <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('billing_name')}}" userInput="{{customer.fullname}}" stepKey="fillBillToNameFilter"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters"/> - </actionGroup> - - <!--Filter order grid by order total range--> - <actionGroup name="filterOrderGridByBaseTotalRange"> - <annotations> - <description>Goes to the Admin Orders page. Filters the grid based on the provided Grand Total From/To values.</description> - </annotations> - <arguments> - <argument name="from"/> - <argument name="to"/> - </arguments> - - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> - <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('base_grand_total[from]')}}" userInput="{{from}}" stepKey="fillOrderTotalFrom"/> - <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('base_grand_total[to]')}}" userInput="{{to}}" stepKey="fillOrderTotalTo"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> - </actionGroup> - - <actionGroup name="filterOrderGridByPurchaseDate"> - <annotations> - <description>Goes to the Admin Orders page. Filters the grid based on the provided Purchased Date From/To values.</description> - </annotations> - <arguments> - <argument name="from"/> - <argument name="to"/> - </arguments> - - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> - <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[from]')}}" userInput="{{from}}" stepKey="fillOrderPurchaseDateFrom"/> - <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[to]')}}" userInput="{{to}}" stepKey="fillOrderPurchaseDateTo"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> - </actionGroup> - - <actionGroup name="filterOrderGridByStatus"> - <annotations> - <description>Filters the Admin Orders grid based on the provided Order Status.</description> - </annotations> - <arguments> - <argument name="status"/> - </arguments> - - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> - <selectOption selector="{{AdminDataGridHeaderSection.filterFieldSelect('status')}}" userInput="{{status}}" stepKey="fillOrderStatusFilter"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> - </actionGroup> - - <actionGroup name="AdminOrdersGridClearFiltersActionGroup"> - <annotations> - <description>Goes to the Admin Orders grid page. Clicks on 'Clear Filters', if present.</description> - </annotations> - - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToGridOrdersPage"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <conditionalClick selector="{{AdminOrdersGridSection.clearFilters}}" dependentSelector="{{AdminOrdersGridSection.enabledFilters}}" visible="true" stepKey="clickOnButtonToRemoveFiltersIfPresent"/> - </actionGroup> - - <actionGroup name="OpenOrderById" extends="filterOrderGridById"> - <annotations> - <description>EXTENDS: filterOrderGridById. Clicks on the 1st row of the Admin Orders grid.</description> - </annotations> - - <click selector="{{AdminDataGridTableSection.firstRow}}" after="clickOrderApplyFilters" stepKey="openOrderViewPage"/> - <waitForPageLoad after="openOrderViewPage" stepKey="waitForOrderViewPageOpened"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrdersGridClearFiltersActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrdersGridClearFiltersActionGroup.xml new file mode 100644 index 0000000000000..b301864212c8b --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrdersGridClearFiltersActionGroup.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="AdminOrdersGridClearFiltersActionGroup"> + <annotations> + <description>Goes to the Admin Orders grid page. Clicks on 'Clear Filters', if present.</description> + </annotations> + + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToGridOrdersPage"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <conditionalClick selector="{{AdminOrdersGridSection.clearFilters}}" dependentSelector="{{AdminOrdersGridSection.enabledFilters}}" visible="true" stepKey="clickOnButtonToRemoveFiltersIfPresent"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderAddressInformationActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderAddressInformationActionGroup.xml new file mode 100644 index 0000000000000..db3343794de01 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertOrderAddressInformationActionGroup.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="AssertOrderAddressInformationActionGroup" extends="VerifyBasicOrderInformationActionGroup"> + <remove keyForRemoval="seeCustomerName"/> + <remove keyForRemoval="seeCustomerEmail"/> + <remove keyForRemoval="seeCustomerGroup"/> + <remove keyForRemoval="seeBillingAddressCountry"/> + <remove keyForRemoval="seeShippingAddressCountry"/> + <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country}}" stepKey="seeBillingCountry" after="seeBillingAddressCity"/> + <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country}}" stepKey="seeAddressCountry" after="seeShippingAddressCity"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/CancelPendingOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CancelPendingOrderActionGroup.xml new file mode 100644 index 0000000000000..b440817dfd80e --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CancelPendingOrderActionGroup.xml @@ -0,0 +1,26 @@ +<?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="CancelPendingOrderActionGroup"> + <annotations> + <description>Cancels the Pending Order on the Admin Orders view page. Validates that the provided Order Status is present and correct.</description> + </annotations> + <arguments> + <argument name="orderStatus" type="string" defaultValue="Canceled"/> + </arguments> + + <click selector="{{AdminOrderDetailsMainActionsSection.cancel}}" stepKey="clickCancelOrder"/> + <waitForElement selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForCancelConfirmation"/> + <see selector="{{AdminConfirmationModalSection.message}}" userInput="Are you sure you want to cancel this order?" stepKey="seeConfirmationMessage"/> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmOrderCancel"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You canceled the order." stepKey="seeCancelSuccessMessage"/> + <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="{{orderStatus}}" stepKey="seeOrderStatusCanceled"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/ChangeShippingMethodActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/ChangeShippingMethodActionGroup.xml new file mode 100644 index 0000000000000..49ad1013f7b73 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/ChangeShippingMethodActionGroup.xml @@ -0,0 +1,26 @@ +<?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="ChangeShippingMethodActionGroup"> + <annotations> + <description>Change Shipping Method on the Admin 'Create New Order for' page.</description> + </annotations> + <arguments> + <argument name="shippingMethod" defaultValue="flatrate_flatrate" type="string"/> + </arguments> + <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> + <waitForPageLoad stepKey="waitForJavascriptToFinish"/> + <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods1"/> + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="waitForChangeShippingMethod"/> + <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods2"/> + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.shippingMethod}}" stepKey="waitForShippingOptions2"/> + <selectOption selector="{{AdminOrderFormPaymentSection.shippingMethod}}" userInput="{{shippingMethod}}" stepKey="checkFlatRate"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/CheckRequiredFieldsNewOrderFormActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CheckRequiredFieldsNewOrderFormActionGroup.xml new file mode 100644 index 0000000000000..25936ad3f6002 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CheckRequiredFieldsNewOrderFormActionGroup.xml @@ -0,0 +1,39 @@ +<?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="CheckRequiredFieldsNewOrderFormActionGroup"> + <annotations> + <description>Clears the Email, First Name, Last Name, Street Line 1, City, Postal Code and Phone fields when adding an Order and then verifies that they are required after attempting to Save.</description> + </annotations> + + <seeElement selector="{{AdminOrderFormAccountSection.requiredGroup}}" stepKey="seeCustomerGroupRequired"/> + <seeElement selector="{{AdminOrderFormAccountSection.requiredEmail}}" stepKey="seeEmailRequired"/> + <clearField selector="{{AdminOrderFormAccountSection.email}}" stepKey="clearEmailField"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.FirstName}}" stepKey="clearFirstNameField"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.LastName}}" stepKey="clearLastNameField"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.StreetLine1}}" stepKey="clearStreetField"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.City}}" stepKey="clearCityField"/> + <selectOption selector="{{AdminOrderFormBillingAddressSection.Country}}" userInput="United States" stepKey="selectUSCountry"/> + <selectOption selector="{{AdminOrderFormBillingAddressSection.State}}" userInput="Please select" stepKey="selectNoState"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.PostalCode}}" stepKey="clearPostalCodeField"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.Phone}}" stepKey="clearPhoneField"/> + <seeElement selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="seeShippingMethodNotSelected"/> + <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="trySubmitOrder"/> + <see selector="{{AdminOrderFormBillingAddressSection.emailError}}" userInput="This is a required field." stepKey="seeThatEmailIsRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.firstNameError}}" userInput="This is a required field." stepKey="seeFirstNameRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.lastNameError}}" userInput="This is a required field." stepKey="seeLastNameRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.streetAddressError}}" userInput="This is a required field." stepKey="seeStreetRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.cityError}}" userInput="This is a required field." stepKey="seeCityRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.stateError}}" userInput="This is a required field." stepKey="seeStateRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.postalCodeError}}" userInput="This is a required field." stepKey="seePostalCodeRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.phoneError}}" userInput="This is a required field." stepKey="seePhoneRequired"/> + <see selector="{{AdminOrderFormPaymentSection.shippingError}}" userInput="This is a required field." stepKey="seeShippingMethodRequired"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/ClearInvoicesGridFiltersActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/ClearInvoicesGridFiltersActionGroup.xml new file mode 100644 index 0000000000000..8b8f400fca928 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/ClearInvoicesGridFiltersActionGroup.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="ClearInvoicesGridFiltersActionGroup"> + <annotations> + <description>Goes to the Admin Invoices grid page. Clicks on 'Clear Filters', if present.</description> + </annotations> + + <amOnPage url="{{AdminInvoicesPage.url}}" stepKey="goToInvoices"/> + <waitForPageLoad stepKey="waitInvoicesGridToLoad"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearFilters"/> + <waitForPageLoad stepKey="waitInvoicesGrid"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/ConfigureOrderedConfigurableProductActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/ConfigureOrderedConfigurableProductActionGroup.xml new file mode 100644 index 0000000000000..1a0f1cb9689f1 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/ConfigureOrderedConfigurableProductActionGroup.xml @@ -0,0 +1,28 @@ +<?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="ConfigureOrderedConfigurableProductActionGroup"> + <annotations> + <description>Clicks on 'Configure' for a Product in the 'Please select products' under the 'Create New Order for' page. Selects the provided Option and Attribute. Fills in the provided Qty. Clicks on Ok.</description> + </annotations> + <arguments> + <argument name="attribute"/> + <argument name="option"/> + <argument name="quantity" type="string"/> + </arguments> + + <click selector="{{AdminOrderFormItemsSection.configure}}" stepKey="clickConfigure"/> + <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" stepKey="waitForConfigurablePopover"/> + <wait time="2" stepKey="waitForOptionsToLoad"/> + <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" userInput="{{option.label}}" stepKey="selectionConfigurableOption"/> + <fillField selector="{{AdminOrderFormConfigureProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderActionGroup.xml new file mode 100644 index 0000000000000..576735a9a36c5 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderActionGroup.xml @@ -0,0 +1,38 @@ +<?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="CreateOrderActionGroup"> + <annotations> + <description>Goes to the Admin Create New Order page. Selects the provided Customer. Adds the provided Product to the Order. Clicks on Submit Order. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="customer"/> + </arguments> + + <amOnPage stepKey="navigateToNewOrderPage" url="{{AdminOrderCreatePage.url}}"/> + <waitForPageLoad stepKey="waitForNewOrderPageOpened"/> + <click stepKey="chooseCustomer" selector="{{AdminOrdersGridSection.customerInOrdersSection(customer.firstname)}}"/> + <waitForPageLoad stepKey="waitForStoresPageOpened"/> + <click selector="{{OrdersGridSection.addProducts}}" stepKey="clickOnAddProducts"/> + <waitForPageLoad stepKey="waitForProductsListForOrder"/> + <click selector="{{AdminOrdersGridSection.productForOrder(product.sku)}}" stepKey="chooseTheProduct"/> + <waitForPageLoad stepKey="waitForClickProduct"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="addSelectedProductToOrder"/> + <waitForPageLoad stepKey="waitForProductAddedInOrder"/> + <click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/> + <waitForPageLoad stepKey="waitForShippingMethods"/> + <click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/> + <waitForPageLoad stepKey="waitForShippingMethodsThickened"/> + <click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/> + <waitForPageLoad stepKey="waitForSubmitOrder"/> + <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderFilteringCustomerByEmailActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderFilteringCustomerByEmailActionGroup.xml new file mode 100644 index 0000000000000..fb65531b14bfb --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderFilteringCustomerByEmailActionGroup.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="CreateOrderFilteringCustomerByEmailActionGroup" extends="CreateOrderActionGroup"> + <click stepKey="chooseCustomer" selector="{{AdminOrdersGridSection.customerInOrdersSection(customer.email)}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderInStoreActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderInStoreActionGroup.xml new file mode 100644 index 0000000000000..2349be636cfa7 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderInStoreActionGroup.xml @@ -0,0 +1,39 @@ +<?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="CreateOrderInStoreActionGroup"> + <annotations> + <description>Goes to the Admin Create Order page. Creates an Order based on the provided Customer, Store View and Product. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="customer"/> + <argument name="storeView"/> + </arguments> + + <amOnPage stepKey="navigateToNewOrderPage" url="{{AdminOrderCreatePage.url}}"/> + <click stepKey="chooseCustomer" selector="{{AdminOrdersGridSection.customerInOrdersSection(customer.firstname)}}"/> + <waitForPageLoad stepKey="waitForStoresPageOpened"/> + <click stepKey="chooseStore" selector="{{AdminOrderStoreScopeTreeSection.storeForOrder(storeView.name)}}"/> + <scrollToTopOfPage stepKey="scrollToTop"/> + <waitForPageLoad stepKey="waitForStoreToAppear"/> + <click selector="{{OrdersGridSection.addProducts}}" stepKey="clickOnAddProducts"/> + <waitForPageLoad stepKey="waitForProductsListForOrder"/> + <click selector="{{AdminOrdersGridSection.productForOrder(product.sku)}}" stepKey="chooseTheProduct"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="addSelectedProductToOrder"/> + <waitForPageLoad stepKey="waitForProductAddedInOrder"/> + <click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/> + <waitForPageLoad stepKey="waitForShippingMethods"/> + <click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/> + <waitForPageLoad stepKey="waitForShippingMethodsThickened"/> + <click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/> + <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderInStoreChoosingPaymentMethodActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderInStoreChoosingPaymentMethodActionGroup.xml new file mode 100644 index 0000000000000..7277a75c9bc73 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderInStoreChoosingPaymentMethodActionGroup.xml @@ -0,0 +1,40 @@ +<?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="CreateOrderInStoreChoosingPaymentMethodActionGroup"> + <annotations> + <description>Goes to the Admin Create Order page. Creates an Order based on the provided Customer, Store View and Product. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="customer"/> + <argument name="storeView"/> + </arguments> + + <amOnPage stepKey="navigateToNewOrderPage" url="{{AdminOrderCreatePage.url}}"/> + <click stepKey="chooseCustomer" selector="{{AdminOrdersGridSection.customerInOrdersSection(customer.firstname)}}"/> + <waitForPageLoad stepKey="waitForStoresPageOpened"/> + <click stepKey="chooseStore" selector="{{AdminOrderStoreScopeTreeSection.storeForOrder(storeView.name)}}"/> + <scrollToTopOfPage stepKey="scrollToTop"/> + <click selector="{{OrdersGridSection.addProducts}}" stepKey="clickOnAddProducts"/> + <waitForPageLoad stepKey="waitForProductsListForOrder"/> + <click selector="{{AdminOrdersGridSection.productForOrder(product.sku)}}" stepKey="chooseTheProduct"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="addSelectedProductToOrder"/> + <waitForPageLoad stepKey="waitForProductAddedInOrder"/> + <click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/> + <waitForPageLoad stepKey="waitForShippingMethods"/> + <click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/> + <waitForPageLoad stepKey="waitForShippingMethodsThickened"/> + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/> + <conditionalClick selector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" dependentSelector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" visible="true" stepKey="checkCheckMoneyOption"/> + <click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/> + <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderToPrintPageActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderToPrintPageActionGroup.xml index 7388eaa96f215..2b09048a7a11f 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderToPrintPageActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderToPrintPageActionGroup.xml @@ -34,13 +34,4 @@ <click selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="clickOrderLink"/> <click selector="{{StorefrontCustomerOrderViewSection.printOrderLink}}" stepKey="clickPrintOrderLink"/> </actionGroup> - - <actionGroup name="CreateOrderToPrintPageWithSelectedPaymentMethodActionGroup" extends="CreateOrderToPrintPageActionGroup"> - <annotations> - <description>EXTENDS: CreateOrderToPrintPageActionGroup. Clicks on 'Check / Money Order'.</description> - </annotations> - - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" after="clickNext" stepKey="waitForPaymentSectionLoaded"/> - <conditionalClick selector="{{CheckoutPaymentSection.checkMoneyOrderPayment}}" dependentSelector="{{CheckoutPaymentSection.billingAddress}}" visible="false" before="waitForPlaceOrderButton" stepKey="clickCheckMoneyOrderPayment"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderToPrintPageWithSelectedPaymentMethodActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderToPrintPageWithSelectedPaymentMethodActionGroup.xml new file mode 100644 index 0000000000000..289855aee7e18 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateOrderToPrintPageWithSelectedPaymentMethodActionGroup.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="CreateOrderToPrintPageWithSelectedPaymentMethodActionGroup" extends="CreateOrderToPrintPageActionGroup"> + <annotations> + <description>EXTENDS: CreateOrderToPrintPageActionGroup. Clicks on 'Check / Money Order'.</description> + </annotations> + + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" after="clickNext" stepKey="waitForPaymentSectionLoaded"/> + <conditionalClick selector="{{CheckoutPaymentSection.checkMoneyOrderPayment}}" dependentSelector="{{CheckoutPaymentSection.billingAddress}}" visible="false" before="waitForPlaceOrderButton" stepKey="clickCheckMoneyOrderPayment"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/DontSeeProductInItemsOrderedActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/DontSeeProductInItemsOrderedActionGroup.xml new file mode 100644 index 0000000000000..da0deb15f35c1 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/DontSeeProductInItemsOrderedActionGroup.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="DontSeeProductInItemsOrderedActionGroup"> + <arguments> + <argument name="product"/> + </arguments> + <dontSee selector="{{AdminOrderItemsOrderedSection.productSkuColumn}}" userInput="{{product.sku}}" stepKey="dontseeSkuInItemsOrdered"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/FillOrderCustomerInformationActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FillOrderCustomerInformationActionGroup.xml new file mode 100644 index 0000000000000..188e6856db186 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FillOrderCustomerInformationActionGroup.xml @@ -0,0 +1,29 @@ +<?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="FillOrderCustomerInformationActionGroup"> + <annotations> + <description>Fills in the provided Customer and Address details on the Admin 'Create New Order for' page.</description> + </annotations> + <arguments> + <argument name="customer"/> + <argument name="address"/> + </arguments> + + <fillField selector="{{AdminOrderFormBillingAddressSection.FirstName}}" userInput="{{customer.firstname}}" stepKey="fillFirstName"/> + <fillField selector="{{AdminOrderFormBillingAddressSection.LastName}}" userInput="{{customer.lastname}}" stepKey="fillLastName"/> + <fillField selector="{{AdminOrderFormBillingAddressSection.StreetLine1}}" userInput="{{address.street[0]}}" stepKey="fillStreetLine1"/> + <fillField selector="{{AdminOrderFormBillingAddressSection.City}}" userInput="{{address.city}}" stepKey="fillCity"/> + <selectOption selector="{{AdminOrderFormBillingAddressSection.Country}}" userInput="{{address.country_id}}" stepKey="fillCountry"/> + <selectOption selector="{{AdminOrderFormBillingAddressSection.State}}" userInput="{{address.state}}" stepKey="fillState"/> + <fillField selector="{{AdminOrderFormBillingAddressSection.PostalCode}}" userInput="{{address.postcode}}" stepKey="fillPostalCode"/> + <fillField selector="{{AdminOrderFormBillingAddressSection.Phone}}" userInput="{{address.telephone}}" stepKey="fillPhone"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterInvoiceGridByOrderIdActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterInvoiceGridByOrderIdActionGroup.xml new file mode 100644 index 0000000000000..5ad2b23089c76 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterInvoiceGridByOrderIdActionGroup.xml @@ -0,0 +1,25 @@ +<?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="FilterInvoiceGridByOrderIdActionGroup"> + <annotations> + <description>Goes to the Admin Invoices grid page. Filters the grid for the provided Order ID.</description> + </annotations> + <arguments> + <argument name="orderId" type="string"/> + </arguments> + + <amOnPage url="{{AdminInvoicesPage.url}}" stepKey="goToInvoices"/> + <click selector="{{AdminInvoicesGridSection.filter}}" stepKey="clickFilter"/> + <fillField selector="{{AdminInvoicesFiltersSection.orderNum}}" userInput="{{orderId}}" stepKey="fillOrderIdForFilter"/> + <click selector="{{AdminInvoicesFiltersSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForPageLoad stepKey="waitForFiltersApply"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterInvoiceGridByOrderIdWithCleanFiltersActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterInvoiceGridByOrderIdWithCleanFiltersActionGroup.xml new file mode 100644 index 0000000000000..88dfc1dc888c2 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterInvoiceGridByOrderIdWithCleanFiltersActionGroup.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="FilterInvoiceGridByOrderIdWithCleanFiltersActionGroup" extends="FilterInvoiceGridByOrderIdActionGroup"> + <arguments> + <argument name="orderId" type="string"/> + </arguments> + <conditionalClick selector="{{AdminInvoicesGridSection.clearFilters}}" dependentSelector="{{AdminInvoicesGridSection.clearFilters}}" visible="true" stepKey="clearFilters" after="goToInvoices"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByBaseTotalRangeActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByBaseTotalRangeActionGroup.xml new file mode 100644 index 0000000000000..cf200a99fc57c --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByBaseTotalRangeActionGroup.xml @@ -0,0 +1,26 @@ +<?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="FilterOrderGridByBaseTotalRangeActionGroup"> + <annotations> + <description>Goes to the Admin Orders page. Filters the grid based on the provided Grand Total From/To values.</description> + </annotations> + <arguments> + <argument name="from"/> + <argument name="to"/> + </arguments> + + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> + <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('base_grand_total[from]')}}" userInput="{{from}}" stepKey="fillOrderTotalFrom"/> + <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('base_grand_total[to]')}}" userInput="{{to}}" stepKey="fillOrderTotalTo"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByBillingNameActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByBillingNameActionGroup.xml new file mode 100644 index 0000000000000..8636bd823e744 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByBillingNameActionGroup.xml @@ -0,0 +1,26 @@ +<?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="FilterOrderGridByBillingNameActionGroup"> + <annotations> + <description>Goes to the Admin Orders page. Filters the grid based on the provided Customer.</description> + </annotations> + <arguments> + <argument name="customer"/> + </arguments> + + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderGridPage"/> + <waitForPageLoad stepKey="waitForOrderGridLoad"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> + <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('billing_name')}}" userInput="{{customer.fullname}}" stepKey="fillBillToNameFilter"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByIdActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByIdActionGroup.xml new file mode 100644 index 0000000000000..bbab664809cdd --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByIdActionGroup.xml @@ -0,0 +1,30 @@ +<?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"> + <!--Filter order grid by order id field--> + <actionGroup name="FilterOrderGridByIdActionGroup"> + <annotations> + <description>Goes to the Admin Orders page. Filters the grid based on the provided Order ID.</description> + </annotations> + <arguments> + <argument name="orderId" type="string"/> + </arguments> + + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderGridPage"/> + <waitForPageLoad stepKey="waitForOrdersPage"/> + <conditionalClick selector="{{AdminOrdersGridSection.clearFilters}}" dependentSelector="{{AdminOrdersGridSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <waitForPageLoad stepKey="waitForClearFilters"/> + <click selector="{{AdminOrdersGridSection.filters}}" stepKey="openOrderGridFilters"/> + <waitForPageLoad stepKey="waitForClickFilters"/> + <fillField selector="{{AdminOrdersGridSection.idFilter}}" userInput="{{orderId}}" stepKey="fillOrderIdFilter"/> + <click selector="{{AdminOrdersGridSection.applyFilters}}" stepKey="clickOrderApplyFilters"/> + <waitForPageLoad stepKey="waitForApplyFilters"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByPurchaseDateActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByPurchaseDateActionGroup.xml new file mode 100644 index 0000000000000..538faf1327b35 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByPurchaseDateActionGroup.xml @@ -0,0 +1,26 @@ +<?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="FilterOrderGridByPurchaseDateActionGroup"> + <annotations> + <description>Goes to the Admin Orders page. Filters the grid based on the provided Purchased Date From/To values.</description> + </annotations> + <arguments> + <argument name="from"/> + <argument name="to"/> + </arguments> + + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> + <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[from]')}}" userInput="{{from}}" stepKey="fillOrderPurchaseDateFrom"/> + <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[to]')}}" userInput="{{to}}" stepKey="fillOrderPurchaseDateTo"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByStatusActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByStatusActionGroup.xml new file mode 100644 index 0000000000000..05731e06c6228 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/FilterOrderGridByStatusActionGroup.xml @@ -0,0 +1,24 @@ +<?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="FilterOrderGridByStatusActionGroup"> + <annotations> + <description>Filters the Admin Orders grid based on the provided Order Status.</description> + </annotations> + <arguments> + <argument name="status"/> + </arguments> + + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> + <selectOption selector="{{AdminDataGridHeaderSection.filterFieldSelect('status')}}" userInput="{{status}}" stepKey="fillOrderStatusFilter"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/GoToInvoiceIntoOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/GoToInvoiceIntoOrderActionGroup.xml new file mode 100644 index 0000000000000..15c7f3e9a7022 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/GoToInvoiceIntoOrderActionGroup.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="GoToInvoiceIntoOrderActionGroup"> + <annotations> + <description>Clicks on 'Invoice' on the Admin Orders view page. Validates that the URL and Page Title are correct.</description> + </annotations> + + <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction"/> + <seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeOrderInvoiceUrl"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seePageNameNewInvoicePage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerActionGroup.xml new file mode 100644 index 0000000000000..a8f9d61ad6803 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerActionGroup.xml @@ -0,0 +1,39 @@ +<?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="NavigateToNewOrderPageExistingCustomerActionGroup"> + <annotations> + <description>Goes tot he Admin Orders grid page. Clicks on 'Create New Order'. Filters the grid for the provided Customer. Clicks on the Customer. Selects the provided Store View, if present. Validates that the Page Title is present and correct.</description> + </annotations> + <arguments> + <argument name="customer"/> + <argument name="storeView" defaultValue="_defaultStore"/> + </arguments> + + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> + <waitForPageLoad stepKey="waitForIndexPageLoad"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> + <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> + <waitForPageLoad stepKey="waitForCustomerGridLoad"/> + + <!--Clear grid filters--> + <conditionalClick selector="{{AdminOrderCustomersGridSection.resetButton}}" dependentSelector="{{AdminOrderCustomersGridSection.resetButton}}" visible="true" stepKey="clearExistingCustomerFilters"/> + <fillField userInput="{{customer.email}}" selector="{{AdminOrderCustomersGridSection.emailInput}}" stepKey="filterEmail"/> + <click selector="{{AdminOrderCustomersGridSection.apply}}" stepKey="applyFilter"/> + <waitForPageLoad stepKey="waitForFilteredCustomerGridLoad"/> + <click selector="{{AdminOrderCustomersGridSection.firstRow}}" stepKey="clickOnCustomer"/> + <waitForPageLoad stepKey="waitForCreateOrderPageLoad"/> + + <!-- Select store view if appears --> + <conditionalClick selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" dependentSelector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" visible="true" stepKey="selectStoreViewIfAppears"/> + <waitForPageLoad stepKey="waitForCreateOrderPageLoadAfterStoreSelect"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerAndStoreActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerAndStoreActionGroup.xml new file mode 100644 index 0000000000000..08f70f69013f3 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerAndStoreActionGroup.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="NavigateToNewOrderPageExistingCustomerAndStoreActionGroup" extends="navigateToNewOrderPageExistingCustomer"> + <annotations> + <description>EXTENDS: navigateToNewOrderPageExistingCustomer. Clicks on the provided Store View.</description> + </annotations> + <arguments> + <argument name="storeView" defaultValue="_defaultStore"/> + </arguments> + + <click selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" stepKey="selectStoreView" after="waitForCreateOrderPageLoad"/> + <waitForPageLoad stepKey="waitForLoad" after="selectStoreView"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageNewCustomerActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageNewCustomerActionGroup.xml new file mode 100644 index 0000000000000..73a4da42eb093 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageNewCustomerActionGroup.xml @@ -0,0 +1,29 @@ +<?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"> + <!--Navigate to create order page (New Order -> Create New Customer)--> + <actionGroup name="NavigateToNewOrderPageNewCustomerActionGroup"> + <annotations> + <description>Goes to the Admin Orders grid page. Clicks on 'Create New Order'. Clicks on 'Create New Customer'. Select the provided Store View, if present. Validates that Page Title is present and correct.</description> + </annotations> + <arguments> + <argument name="storeView" defaultValue="_defaultStore"/> + </arguments> + + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> + <waitForPageLoad stepKey="waitForIndexPageLoad"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> + <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> + <click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/> + <conditionalClick selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" dependentSelector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" visible="true" stepKey="selectStoreViewIfAppears"/> + <waitForPageLoad stepKey="waitForCreateOrderPageLoadAfterStoreSelect"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageNewCustomerSingleStoreActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageNewCustomerSingleStoreActionGroup.xml new file mode 100644 index 0000000000000..cd1be0ac34279 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageNewCustomerSingleStoreActionGroup.xml @@ -0,0 +1,26 @@ +<?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="NavigateToNewOrderPageNewCustomerSingleStoreActionGroup"> + <annotations> + <description>Goes to the Admin Orders grid page. Clicks on 'Create New Order'. Clicks on 'Create New Customer'. Validates that Page Title is present and correct.</description> + </annotations> + <arguments> + <argument name="storeView" defaultValue="_defaultStore"/> + </arguments> + + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> + <waitForPageLoad stepKey="waitForIndexPageLoad"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> + <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> + <click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/NewAddConfigurableProductToOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NewAddConfigurableProductToOrderActionGroup.xml new file mode 100644 index 0000000000000..20f2ab162688d --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NewAddConfigurableProductToOrderActionGroup.xml @@ -0,0 +1,16 @@ +<?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="NewAddConfigurableProductToOrderActionGroup" extends="AddConfigurableProductToOrderActionGroup"> + <remove keyForRemoval="waitForConfigurablePopover"/> + <remove keyForRemoval="selectionConfigurableOption"/> + <selectOption selector="{{AdminOrderFormConfigureProductSection.selectOption}}" userInput="{{option.value}}" stepKey="selectOption" after="waitForOptionsToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/OpenOrderByIdActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/OpenOrderByIdActionGroup.xml new file mode 100644 index 0000000000000..ca05041140f47 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/OpenOrderByIdActionGroup.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="OpenOrderByIdActionGroup" extends="FilterOrderGridByIdActionGroup"> + <annotations> + <description>EXTENDS: filterOrderGridById. Clicks on the 1st row of the Admin Orders grid.</description> + </annotations> + + <click selector="{{AdminDataGridTableSection.firstRow}}" after="clickOrderApplyFilters" stepKey="openOrderViewPage"/> + <waitForPageLoad after="openOrderViewPage" stepKey="waitForOrderViewPageOpened"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/OrderSelectFlatRateShippingActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/OrderSelectFlatRateShippingActionGroup.xml new file mode 100644 index 0000000000000..b85dc21e0b1b5 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/OrderSelectFlatRateShippingActionGroup.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="OrderSelectFlatRateShippingActionGroup"> + <annotations> + <description>Selects the 'Flat Rate' Shipping Method on the Admin 'Create New Order for' page.</description> + </annotations> + + <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> + <waitForPageLoad stepKey="waitForJavascriptToFinish"/> + <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods"/> + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.flatRateOption}}" stepKey="waitForShippingOptions"/> + <selectOption selector="{{AdminOrderFormPaymentSection.flatRateOption}}" userInput="flatrate_flatrate" stepKey="checkFlatRate"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/OrderSelectFreeShippingActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/OrderSelectFreeShippingActionGroup.xml new file mode 100644 index 0000000000000..ef78fe892e933 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/OrderSelectFreeShippingActionGroup.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="OrderSelectFreeShippingActionGroup"> + <annotations> + <description>Selects the 'Free Shipping' Shipping Method on the Admin 'Create New Order for' page.</description> + </annotations> + + <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> + <waitForPageLoad stepKey="waitForJavascriptToFinish"/> + <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods"/> + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" stepKey="waitForShippingOptions"/> + <selectOption selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" userInput="freeshipping_freeshipping" stepKey="checkFreeShipping"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInInvoiceItemsActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInInvoiceItemsActionGroup.xml new file mode 100644 index 0000000000000..0d35414617ff8 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInInvoiceItemsActionGroup.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="SeeProductInInvoiceItemsActionGroup"> + <annotations> + <description>Validates that the provided Product appears under the 'SKU' column in the Admin Invoices edit page.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <see selector="{{AdminInvoiceItemsSection.skuColumn}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInItemsOrderedActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInItemsOrderedActionGroup.xml new file mode 100644 index 0000000000000..05328ab046bf8 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInItemsOrderedActionGroup.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="SeeProductInItemsOrderedActionGroup"> + <annotations> + <description>Validates that the provided Product is present and correct in the 'Items Ordered' section on the Admin Orders view page.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <see selector="{{AdminOrderItemsOrderedSection.productSkuColumn}}" userInput="{{product.sku}}" stepKey="seeSkuInItemsOrdered"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInItemsRefundedActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInItemsRefundedActionGroup.xml new file mode 100644 index 0000000000000..0690a190d3f0f --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SeeProductInItemsRefundedActionGroup.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="SeeProductInItemsRefundedActionGroup"> + <annotations> + <description>Validates that the provided Product appears in the 'Product' column on the Admin Credit Memo view page.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <see selector="{{AdminCreditMemoItemsSection.skuColumn}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectBankTransferPaymentMethodActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectBankTransferPaymentMethodActionGroup.xml new file mode 100644 index 0000000000000..8c1ceeb97201d --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectBankTransferPaymentMethodActionGroup.xml @@ -0,0 +1,15 @@ +<?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="SelectBankTransferPaymentMethodActionGroup" extends="SelectCheckMoneyPaymentMethodActionGroup"> + <remove keyForRemoval="checkCheckMoneyOption"/> + <conditionalClick selector="{{AdminOrderFormPaymentSection.checkBankTransfer}}" dependentSelector="{{AdminOrderFormPaymentSection.checkBankTransfer}}" visible="true" stepKey="checkBankTransferOption" after="waitForPaymentOptions"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectCashOnDeliveryPaymentMethodActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectCashOnDeliveryPaymentMethodActionGroup.xml new file mode 100644 index 0000000000000..dc6d8d4a8ffaf --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectCashOnDeliveryPaymentMethodActionGroup.xml @@ -0,0 +1,15 @@ +<?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="SelectCashOnDeliveryPaymentMethodActionGroup" extends="SelectCheckMoneyPaymentMethodActionGroup"> + <remove keyForRemoval="checkCheckMoneyOption"/> + <conditionalClick selector="{{AdminOrderFormPaymentSection.checkCashOnDelivery}}" dependentSelector="{{AdminOrderFormPaymentSection.checkCashOnDelivery}}" visible="true" stepKey="checkCashOnDeliveryOption" after="waitForPaymentOptions"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectCheckMoneyPaymentMethodActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectCheckMoneyPaymentMethodActionGroup.xml new file mode 100644 index 0000000000000..044a7fa9f8b3b --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectCheckMoneyPaymentMethodActionGroup.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="SelectCheckMoneyPaymentMethodActionGroup"> + <annotations> + <description>Selects the 'Check / Money Order' Payment Method on the Admin Create New Order page.</description> + </annotations> + + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/> + <conditionalClick selector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" dependentSelector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" visible="true" stepKey="checkCheckMoneyOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectPurchaseOrderPaymentMethodActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectPurchaseOrderPaymentMethodActionGroup.xml new file mode 100644 index 0000000000000..c9502afb3777f --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SelectPurchaseOrderPaymentMethodActionGroup.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="SelectPurchaseOrderPaymentMethodActionGroup" extends="SelectCheckMoneyPaymentMethodActionGroup"> + <arguments> + <argument name="purchaseOrderNumber" type="string"/> + </arguments> + <remove keyForRemoval="checkCheckMoneyOption"/> + <conditionalClick selector="{{AdminOrderFormPaymentSection.checkPurchaseOrder}}" dependentSelector="{{AdminOrderFormPaymentSection.checkPurchaseOrder}}" visible="true" stepKey="checkPurchaseOrderOption" after="waitForPaymentOptions"/> + <fillField selector="{{AdminOrderFormPaymentSection.fieldPurchaseOrderNumber}}" userInput="{{purchaseOrderNumber}}" stepKey="fillPurchaseOrderNumber"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/StartCreateInvoiceFromOrderPageActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/StartCreateInvoiceFromOrderPageActionGroup.xml new file mode 100644 index 0000000000000..25906e895726d --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/StartCreateInvoiceFromOrderPageActionGroup.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="StartCreateInvoiceFromOrderPageActionGroup"> + <annotations> + <description>Clicks on 'Invoice' on the Admin Orders view page. Validates that the URL and Page Title are correct.</description> + </annotations> + + <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction"/> + <seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeNewInvoiceUrl"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seeNewInvoicePageTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/StartToCreateCreditMemoActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/StartToCreateCreditMemoActionGroup.xml new file mode 100644 index 0000000000000..fbfdf4979fda8 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/StartToCreateCreditMemoActionGroup.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="StartToCreateCreditMemoActionGroup"> + <arguments> + <argument name="orderId" type="string"/> + </arguments> + <amOnPage url="{{AdminOrderPage.url(orderId)}}" stepKey="navigateToOrderPage"/> + <click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickCreditMemo"/> + <waitForElementVisible selector="{{AdminHeaderSection.pageTitle}}" stepKey="waitForPageTitle"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Memo" stepKey="seeNewMemoPageTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/SubmitCreditMemoActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SubmitCreditMemoActionGroup.xml new file mode 100644 index 0000000000000..fbd2a0047d558 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SubmitCreditMemoActionGroup.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="SubmitCreditMemoActionGroup"> + <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/> + <waitForElementVisible selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="waitButtonEnabled"/> + <click selector="{{AdminCreditMemoTotalSection.submitRefundOffline}}" stepKey="clickSubmitCreditMemo"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You created the credit memo." stepKey="seeCreditMemoCreateSuccess"/> + <seeInCurrentUrl url="{{AdminOrderDetailsPage.url}}$grabOrderId" stepKey="seeViewOrderPageCreditMemo"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/SubmitInvoiceActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SubmitInvoiceActionGroup.xml new file mode 100644 index 0000000000000..2ff4dd210a187 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/SubmitInvoiceActionGroup.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="SubmitInvoiceActionGroup"> + <annotations> + <description>Clicks on 'Submit Invoice' on the Admin 'New Invoice' page. Validates that the Success Message is present and correct. Validates that the Order ID appears in the URL.</description> + </annotations> + + <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/> + <see selector="{{AdminMessagesSection.success}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/> + <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/> + <seeInCurrentUrl url="{{AdminOrderDetailsPage.url('$grabOrderId')}}" stepKey="seeViewOrderPageInvoice"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/UpdateCreditMemoTotalsActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/UpdateCreditMemoTotalsActionGroup.xml new file mode 100644 index 0000000000000..18707a39853a3 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/UpdateCreditMemoTotalsActionGroup.xml @@ -0,0 +1,15 @@ +<?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="UpdateCreditMemoTotalsActionGroup"> + <waitForElementVisible selector="{{AdminCreditMemoTotalSection.updateTotals}}" stepKey="waitUpdateTotalsButtonEnabled"/> + <click selector="{{AdminCreditMemoTotalSection.updateTotals}}" stepKey="clickUpdateTotals"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyBasicInvoiceInformationActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyBasicInvoiceInformationActionGroup.xml new file mode 100644 index 0000000000000..431e5e7dbfee1 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyBasicInvoiceInformationActionGroup.xml @@ -0,0 +1,35 @@ +<?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"> + <!--Check customer information is correct in invoice--> + <actionGroup name="VerifyBasicInvoiceInformationActionGroup"> + <annotations> + <description>Validates that the provided Customer, Address and Customer Group details are present and correct on the Admin View Invoice page.</description> + </annotations> + <arguments> + <argument name="customer"/> + <argument name="shippingAddress"/> + <argument name="billingAddress"/> + <argument name="customerGroup" defaultValue="GeneralCustomerGroup"/> + </arguments> + + <see selector="{{AdminInvoiceOrderInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/> + <see selector="{{AdminInvoiceOrderInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/> + <see selector="{{AdminInvoiceOrderInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/> + <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.street[0]}}" stepKey="seeBillingAddressStreet"/> + <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.city}}" stepKey="seeBillingAddressCity"/> + <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country_id}}" stepKey="seeBillingAddressCountry"/> + <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.postcode}}" stepKey="seeBillingAddressPostcode"/> + <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.street[0]}}" stepKey="seeShippingAddressStreet"/> + <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.city}}" stepKey="seeShippingAddressCity"/> + <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/> + <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyBasicOrderInformationActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyBasicOrderInformationActionGroup.xml new file mode 100644 index 0000000000000..412586739006b --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyBasicOrderInformationActionGroup.xml @@ -0,0 +1,34 @@ +<?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="VerifyBasicOrderInformationActionGroup"> + <annotations> + <description>Validates that the provided Customer, Shipping/Billing Address and Customer Group are present and correct on the Admin Orders view page.</description> + </annotations> + <arguments> + <argument name="customer"/> + <argument name="shippingAddress"/> + <argument name="billingAddress"/> + <argument name="customerGroup" defaultValue="GeneralCustomerGroup"/> + </arguments> + + <see selector="{{AdminOrderDetailsInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/> + <see selector="{{AdminOrderDetailsInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/> + <see selector="{{AdminOrderDetailsInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/> + <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.street[0]}}" stepKey="seeBillingAddressStreet"/> + <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.city}}" stepKey="seeBillingAddressCity"/> + <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country_id}}" stepKey="seeBillingAddressCountry"/> + <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.postcode}}" stepKey="seeBillingAddressPostcode"/> + <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.street[0]}}" stepKey="seeShippingAddressStreet"/> + <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.city}}" stepKey="seeShippingAddressCity"/> + <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/> + <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyCreatedOrderInformationActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyCreatedOrderInformationActionGroup.xml new file mode 100644 index 0000000000000..9a62771fb54cd --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyCreatedOrderInformationActionGroup.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="VerifyCreatedOrderInformationActionGroup"> + <annotations> + <description>Validates that the Success Message, Order Status (Pending) and Order ID are present and correct.</description> + </annotations> + + <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeSuccessMessage"/> + <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderPendingStatus" after="seeSuccessMessage"/> + <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId" after="seeOrderPendingStatus"/> + <assertNotEmpty actual="$getOrderId" stepKey="assertOrderIdIsNotEmpty" after="getOrderId"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml index e405173429b2c..ec518c79a0808 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml @@ -42,11 +42,11 @@ </after> <!--Proceed to Admin panel > SALES > Orders. Created order should be in Processing status--> - <actionGroup ref="navigateToNewOrderPageNewCustomer" stepKey="navigateToNewOrderPage"/> + <actionGroup ref="NavigateToNewOrderPageNewCustomerActionGroup" stepKey="navigateToNewOrderPage"/> <!--Check if order can be submitted without the required fields including email address--> <scrollToTopOfPage stepKey="scrollToTopOfOrderFormPage"/> - <actionGroup ref="addSimpleProductToOrder" stepKey="addFirstProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addFirstProductToOrder"> <argument name="product" value="$$createProduct$$"/> </actionGroup> @@ -61,20 +61,20 @@ <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail"/> <!--Fill customer address information--> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress"> <argument name="customer" value="Simple_US_Customer"/> <argument name="address" value="US_Address_TX"/> </actionGroup> <!-- Select Free shipping --> - <actionGroup ref="orderSelectFreeShipping" stepKey="selectFreeShippingOption"/> + <actionGroup ref="OrderSelectFreeShippingActionGroup" stepKey="selectFreeShippingOption"/> <!--Click *Submit Order* button--> <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="clickSubmitOrder"/> <!--Click *Invoice* button--> - <actionGroup ref="StartCreateInvoiceFromOrderPage" stepKey="startCreateInvoice"/> - <actionGroup ref="SubmitInvoice" stepKey="submitInvoice"/> + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startCreateInvoice"/> + <actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/> <!--Verify that *Credit Memo* button is displayed--> <seeElement selector="{{AdminOrderFormItemsSection.creditMemo}}" stepKey="seeCreditMemo"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithBankTransferPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithBankTransferPaymentMethodTest.xml index 74cf3e9dd6b7a..726b4a99cdec9 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithBankTransferPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithBankTransferPaymentMethodTest.xml @@ -44,12 +44,12 @@ </after> <!--Create new customer order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!--Add Simple product to order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToTheOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToTheOrder"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -64,11 +64,11 @@ <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> <!-- Verify order information --> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> <!-- Cancel the Order --> - <actionGroup ref="cancelPendingOrder" stepKey="cancelPendingOrder"/> + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOrder"/> <!--Log in to Storefront as Customer --> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCashOnDeliveryPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCashOnDeliveryPaymentMethodTest.xml index a412adee939d2..eb46621a458ab 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCashOnDeliveryPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCashOnDeliveryPaymentMethodTest.xml @@ -44,12 +44,12 @@ </after> <!-- Create new customer order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!-- Add Simple product to order --> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToTheOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToTheOrder"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -64,11 +64,11 @@ <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> <!--Verify order information--> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> <!-- Cancel the Order --> - <actionGroup ref="cancelPendingOrder" stepKey="cancelPendingOrder"/> + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOrder"/> <!--Log in to Storefront as Customer --> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml index 116b8e7d6ca71..f8bec3f450963 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml @@ -111,30 +111,30 @@ </after> <!-- Create new customer order --> <comment userInput="Create new customer order" stepKey="createNewCustomerOrderComment"/> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!-- Add bundle product to order and check product price in grid --> <comment userInput="Add bundle product to order and check product price in grid" stepKey="addBundleProductToOrderComment"/> - <actionGroup ref="addBundleProductToOrder" stepKey="addBundleProductToOrder"> + <actionGroup ref="AddBundleProductToOrderActionGroup" stepKey="addBundleProductToOrder"> <argument name="product" value="$$createBundleProduct$$"/> <argument name="quantity" value="1"/> </actionGroup> <!-- Add configurable product to order --> <comment userInput="Add configurable product to order" stepKey="addConfigurableProductToOrderComment"/> - <actionGroup ref="newAddConfigurableProductToOrder" stepKey="addConfigurableProductToOrder"> + <actionGroup ref="NewAddConfigurableProductToOrderActionGroup" stepKey="addConfigurableProductToOrder"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="attribute" value="$$createConfigProductAttribute$$"/> <argument name="option" value="$$getConfigAttributeOption1$$"/> </actionGroup> <!-- Add Simple product to order --> <comment userInput="Add Simple product to order" stepKey="addSimpleProductToOrderComment"/> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToTheOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToTheOrder"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> <!-- Add Virtual product to order --> <comment userInput="Add Virtual product to order" stepKey="addVirtualProductToOrderComment"/> - <actionGroup ref="addSimpleProductToOrder" stepKey="addVirtualProductToTheOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addVirtualProductToTheOrder"> <argument name="product" value="$$virtualProduct$$"/> </actionGroup> <!-- Select FlatRate shipping method --> @@ -145,11 +145,11 @@ <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> <!-- Verify order information --> <comment userInput="Verify order information" stepKey="verifyOrderInformationComment"/> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> <!-- Cancel the Order --> <comment userInput="Cancel the Order" stepKey="cancelTheOrder"/> - <actionGroup ref="cancelPendingOrder" stepKey="cancelPendingOrder"/> + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOrder"/> <!-- Assert Simple Product Quantity in backend after order Canceled --> <comment userInput="Assert Simple Product Quantity in backend after order Canceled" stepKey="assertSimpleProductQuantityAfterOrderCanceledComment"/> <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct"> @@ -216,7 +216,7 @@ <waitForPageLoad stepKey="waitForPageLoad5"/> <!-- Filter order using orderId --> <comment userInput="Filter order using orderId" stepKey="filterOrderUsingOrderIdComment"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> <see selector="{{AdminOrdersGridSection.firstRow}}" userInput="$orderId" stepKey="seeOrderIdInGrid"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithProductQtyWithoutStockDecreaseTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithProductQtyWithoutStockDecreaseTest.xml index 4300f22c3fb3a..1ab921ac2b09d 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithProductQtyWithoutStockDecreaseTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithProductQtyWithoutStockDecreaseTest.xml @@ -47,12 +47,12 @@ </after> <!--Create new customer order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!--Add Simple product to order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToTheOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToTheOrder"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -63,7 +63,7 @@ <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> <!--Verify order information--> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> <!-- Assert Simple Product Quantity in backend after order --> @@ -80,13 +80,13 @@ <waitForPageLoad stepKey="waitForPageLoad5"/> <!-- Filter Order using orderId --> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> <click selector="{{AdminOrdersGridSection.rowViewAction('1')}}" stepKey="clickOnViewAction"/> <!-- Cancel the Order --> - <actionGroup ref="cancelPendingOrder" stepKey="cancelPendingOrder"/> + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOrder"/> <!-- Assert Simple Product Quantity in backend after Cancelling the order --> <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct1"> @@ -102,7 +102,7 @@ <waitForPageLoad stepKey="waitForPageLoad6"/> <!-- Filter Order using orderId --> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById1"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById1"> <argument name="orderId" value="$orderId"/> </actionGroup> <click selector="{{AdminOrdersGridSection.rowViewAction('1')}}" stepKey="clickOnViewAction1"/> @@ -122,4 +122,4 @@ <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="10" stepKey="seeProductQuantityAfterReorder"/> <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="In Stock" stepKey="seeProductStockStatusAfterReorder"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml index d14987dd2e87b..c85a3fffc2c69 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithPurchaseOrderPaymentMethodTest.xml @@ -46,12 +46,12 @@ </after> <!--Create new customer order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!--Add Simple product to order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToTheOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToTheOrder"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -70,11 +70,11 @@ <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> <!--Verify order information--> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> <!-- Cancel the Order --> - <actionGroup ref="cancelPendingOrder" stepKey="cancelPendingOrder"/> + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOrder"/> <!--Log in to Storefront as Customer --> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp"> @@ -86,4 +86,4 @@ <waitForPageLoad stepKey="waitForOrderDetailsToLoad"/> <seeElement selector="{{StorefrontCustomerOrderViewSection.orderStatusInGrid('$orderId', 'Canceled')}}" stepKey="seeOrderStatusInGrid"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml index f8c5b46dc6ff9..a8014466c5773 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithZeroSubtotalCheckoutTest.xml @@ -49,12 +49,12 @@ </after> <!--Create new customer order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!--Add Simple product to order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToTheOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToTheOrder"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -65,11 +65,11 @@ <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> <!--Verify order information--> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> <!-- Cancel the Order --> - <actionGroup ref="cancelPendingOrder" stepKey="cancelPendingOrder"/> + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOrder"/> <!--Log in to Storefront as Customer --> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp"> @@ -81,4 +81,4 @@ <waitForPageLoad stepKey="waitForOrderDetailsToLoad"/> <seeElement selector="{{StorefrontCustomerOrderViewSection.orderStatusInGrid('$orderId', 'Canceled')}}" stepKey="seeOrderStatusInGrid"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminChangeCustomerGroupInNewOrder.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminChangeCustomerGroupInNewOrder.xml index 315a097eb2323..e19002d5ecb4c 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminChangeCustomerGroupInNewOrder.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminChangeCustomerGroupInNewOrder.xml @@ -25,8 +25,8 @@ <after> <actionGroup ref="logout" stepKey="logout"/> </after> - - <actionGroup ref="navigateToNewOrderPageNewCustomer" stepKey="openNewOrder"/> + + <actionGroup ref="NavigateToNewOrderPageNewCustomerActionGroup" stepKey="openNewOrder"/> <selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="Retailer" stepKey="selectCustomerGroup"/> <waitForPageLoad stepKey="waitForPageLoad"/> <grabValueFrom selector="{{AdminOrderFormAccountSection.group}}" stepKey="grabGroupValue"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml index 8cd2b8ee60edd..251d29df43dd1 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingCreditMemoUpdateTotalsTest.xml @@ -41,9 +41,9 @@ </actionGroup> <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/> <!--Create invoice--> - <actionGroup ref="StartCreateInvoiceFromOrderPage" stepKey="startCreateInvoice"/> + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startCreateInvoice"/> <!--Submit invoice--> - <actionGroup ref="SubmitInvoice" stepKey="submitInvoice"/> + <actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/> <!--Create Credit Memo--> <actionGroup ref="StartToCreateCreditMemoActionGroup" stepKey="startToCreateCreditMemo"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingDateAfterChangeInterfaceLocaleTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingDateAfterChangeInterfaceLocaleTest.xml index add8f7d2ae2c3..ad3b6cf45d5bb 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingDateAfterChangeInterfaceLocaleTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCheckingDateAfterChangeInterfaceLocaleTest.xml @@ -51,7 +51,7 @@ <grabTextFrom selector="{{AdminOrderDetailsInformationSection.orderId}}" stepKey="grabOrderId"/> <!--Filter orders grid by ID on Admin page--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="{$grabOrderId}"/> </actionGroup> @@ -73,7 +73,7 @@ </actionGroup> <!--Filter orders grid by ID on Admin page after changing "Interface Locale"--> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridByIdAfterSetFrenchLocale"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridByIdAfterSetFrenchLocale"> <argument name="orderId" value="{$grabOrderId}"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml index 4310d412d1c98..9fded54e73eb7 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml @@ -76,16 +76,16 @@ <!--Go to order page submit invoice--> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="onOrdersPage"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> <click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/> <waitForPageLoad stepKey="waitForCreatedOrderPageOpened"/> - <actionGroup ref="goToInvoiceIntoOrder" stepKey="goToInvoiceIntoOrderPage"/> + <actionGroup ref="GoToInvoiceIntoOrderActionGroup" stepKey="goToInvoiceIntoOrderPage"/> <fillField selector="{{AdminInvoiceItemsSection.qtyToInvoiceColumn}}" userInput="5" stepKey="ChangeQtyToInvoice"/> <click selector="{{AdminInvoiceItemsSection.updateQty}}" stepKey="updateQunatity"/> <waitForPageLoad stepKey="waitPageToBeLoaded"/> - <actionGroup ref="SubmitInvoice" stepKey="submitInvoice"/> + <actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/> <!--Verify invoiced items qty in ship tab--> <actionGroup ref="goToShipmentIntoOrder" stepKey="goToShipment"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoBankTransferPaymentTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoBankTransferPaymentTest.xml index 37a9b97fab064..4b582a09deacf 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoBankTransferPaymentTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoBankTransferPaymentTest.xml @@ -42,17 +42,17 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Create Order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderPage"> <argument name="customer" value="$createCustomer$"/> </actionGroup> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSecondProduct"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSecondProduct"> <argument name="product" value="$createProduct$"/> </actionGroup> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerInfo"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerInfo"> <argument name="customer" value="$createCustomer$"/> <argument name="address" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRate"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRate"/> <conditionalClick selector="{{AdminOrderFormPaymentSection.linkPaymentOptions}}" dependentSelector="{{AdminOrderFormPaymentSection.linkPaymentOptions}}" visible="true" stepKey="openMoneyOption"/> <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/> <checkOption selector="{{AdminOrderFormPaymentSection.checkBankTransfer}}" stepKey="checkBankTransfer"/> @@ -62,7 +62,7 @@ <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/> <!-- Create Invoice --> - <actionGroup ref="StartCreateInvoiceFromOrderPage" stepKey="startInvoice"/> + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/> <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/> <see selector="{{AdminMessagesSection.success}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/> @@ -70,7 +70,7 @@ <!-- Go to Sales > Orders > find out placed order and open --> <grabTextFrom selector="|Order # (\d+)|" stepKey="grabOrderId" /> <assertNotEmpty actual="$grabOrderId" stepKey="assertOrderIdIsNotEmpty" after="grabOrderId"/> - <actionGroup ref="OpenOrderById" stepKey="openOrder"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder"> <argument name="orderId" value="{$grabOrderId}"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoConfigurableProductTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoConfigurableProductTest.xml index 8a9369537f0a4..2a841b04bd647 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoConfigurableProductTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoConfigurableProductTest.xml @@ -100,28 +100,28 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Create Order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderPage"> <argument name="customer" value="$createCustomer$"/> </actionGroup> <!--Add configurable product to order--> - <actionGroup ref="addConfigurableProductToOrderFromAdmin" stepKey="addConfigurableProductToOrder"> + <actionGroup ref="AddConfigurableProductToOrderFromAdminActionGroup" stepKey="addConfigurableProductToOrder"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="attribute" value="$$createConfigProductAttribute$$"/> <argument name="option" value="$$getConfigAttributeOption1$$"/> </actionGroup> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerInfo"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerInfo"> <argument name="customer" value="$createCustomer$"/> <argument name="address" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRate"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRate"/> <click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/> <waitForPageLoad stepKey="waitForSubmitOrderPage"/> <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/> <!-- Create Invoice --> - <actionGroup ref="StartCreateInvoiceFromOrderPage" stepKey="startInvoice"/> + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/> <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/> <see selector="{{AdminMessagesSection.success}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/> @@ -129,7 +129,7 @@ <!-- Go to Sales > Orders > find out placed order and open --> <grabTextFrom selector="|Order # (\d+)|" stepKey="grabOrderId" /> <assertNotEmpty actual="$grabOrderId" stepKey="assertOrderIdIsNotEmpty" after="grabOrderId"/> - <actionGroup ref="OpenOrderById" stepKey="openOrder"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder"> <argument name="orderId" value="{$grabOrderId}"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoPartialRefundTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoPartialRefundTest.xml index 418c0e72dc1fc..acc119b53c9dc 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoPartialRefundTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoPartialRefundTest.xml @@ -40,24 +40,24 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Create Order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderPage"> <argument name="customer" value="$createCustomer$"/> </actionGroup> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSecondProduct"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSecondProduct"> <argument name="product" value="$createProduct$"/> <argument name="productQty" value="2"/> </actionGroup> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerInfo"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerInfo"> <argument name="customer" value="$createCustomer$"/> <argument name="address" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRate"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRate"/> <click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/> <waitForPageLoad stepKey="waitForSubmitOrderPage"/> <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/> <!-- Create Invoice --> - <actionGroup ref="StartCreateInvoiceFromOrderPage" stepKey="startInvoice"/> + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/> <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/> <see selector="{{AdminMessagesSection.success}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/> @@ -65,7 +65,7 @@ <!-- Go to Sales > Orders > find out placed order and open --> <grabTextFrom selector="|Order # (\d+)|" stepKey="grabOrderId" /> <assertNotEmpty actual="$grabOrderId" stepKey="assertOrderIdIsNotEmpty" after="grabOrderId"/> - <actionGroup ref="OpenOrderById" stepKey="openOrder"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder"> <argument name="orderId" value="{$grabOrderId}"/> </actionGroup> @@ -102,7 +102,7 @@ <see userInput="1" selector="{{AdminCreditMemoViewItemsSection.productQty}}" stepKey="seeQty"/> <!-- Go to order page --> - <actionGroup ref="OpenOrderById" stepKey="openOrderPage"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrderPage"> <argument name="orderId" value="{$grabOrderId}"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithCashOnDeliveryTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithCashOnDeliveryTest.xml index c552f93e62a4a..452c54d188c57 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithCashOnDeliveryTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithCashOnDeliveryTest.xml @@ -43,17 +43,17 @@ </after> <!-- Create Order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderPage"> <argument name="customer" value="$createCustomer$"/> </actionGroup> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSecondProduct"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSecondProduct"> <argument name="product" value="$createProduct$"/> </actionGroup> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerInfo"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerInfo"> <argument name="customer" value="$createCustomer$"/> <argument name="address" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRate"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRate"/> <conditionalClick selector="{{AdminOrderFormPaymentSection.linkPaymentOptions}}" dependentSelector="{{AdminOrderFormPaymentSection.linkPaymentOptions}}" visible="true" stepKey="openMoneyOption"/> <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/> <checkOption selector="{{AdminOrderFormPaymentSection.checkCashOnDelivery}}" stepKey="checkCashOnDelivery"/> @@ -63,7 +63,7 @@ <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/> <!-- Create Invoice --> - <actionGroup ref="StartCreateInvoiceFromOrderPage" stepKey="startInvoice"/> + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/> <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/> <see selector="{{AdminMessagesSection.success}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/> @@ -71,7 +71,7 @@ <!-- Go to Sales > Orders > find out placed order and open --> <grabTextFrom selector="|Order # (\d+)|" stepKey="grabOrderId" /> <assertNotEmpty actual="$grabOrderId" stepKey="assertOrderIdIsNotEmpty" after="grabOrderId"/> - <actionGroup ref="OpenOrderById" stepKey="openOrder"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder"> <argument name="orderId" value="{$grabOrderId}"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithPurchaseOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithPurchaseOrderTest.xml index 57d9222d85096..231ff78d7d8fb 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithPurchaseOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoWithPurchaseOrderTest.xml @@ -43,17 +43,17 @@ </after> <!-- Create Order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderPage"> <argument name="customer" value="$createCustomer$"/> </actionGroup> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSecondProduct"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSecondProduct"> <argument name="product" value="$createProduct$"/> </actionGroup> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerInfo"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerInfo"> <argument name="customer" value="$createCustomer$"/> <argument name="address" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRate"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRate"/> <conditionalClick selector="{{AdminOrderFormPaymentSection.linkPaymentOptions}}" dependentSelector="{{AdminOrderFormPaymentSection.linkPaymentOptions}}" visible="true" stepKey="openMoneyOption"/> <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/> <checkOption selector="{{AdminOrderFormPaymentSection.checkPurchaseOrder}}" stepKey="checkPurchaseOrder"/> @@ -66,7 +66,7 @@ <see stepKey="seeSuccessMessageForOrder" selector="{{AdminIndexManagementSection.successMessage}}" userInput="You created the order."/> <!-- Create Invoice --> - <actionGroup ref="StartCreateInvoiceFromOrderPage" stepKey="startInvoice"/> + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="startInvoice"/> <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/> <see selector="{{AdminMessagesSection.success}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/> @@ -74,7 +74,7 @@ <!-- Go to Sales > Orders > find out placed order and open --> <grabTextFrom selector="|Order # (\d+)|" stepKey="grabOrderId" /> <assertNotEmpty actual="$grabOrderId" stepKey="assertOrderIdIsNotEmpty" after="grabOrderId"/> - <actionGroup ref="OpenOrderById" stepKey="openOrder"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder"> <argument name="orderId" value="{$grabOrderId}"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml index bd13f7c847c34..8fe49558cf091 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAddProductCheckboxTest.xml @@ -30,7 +30,7 @@ </before> <!-- Initiate create new order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$createSimpleCustomer$$"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAndCheckTheReorderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAndCheckTheReorderTest.xml index 80697fd57736a..338765d650d13 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAndCheckTheReorderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderAndCheckTheReorderTest.xml @@ -28,19 +28,19 @@ </createData> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder"> <argument name="product" value="$$simpleProduct$$"/> <argument name="productQty" value="{{SimpleProduct_25.quantity}}"/> </actionGroup> <actionGroup ref="SelectCashOnDeliveryPaymentMethodActionGroup" stepKey="selectPaymentMethod"/> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShippingMethod"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="orderSelectFlatRateShippingMethod"/> <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId"/> - <actionGroup ref="OpenOrderById" stepKey="openOrder"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderForCustomerWithTwoAddressesTaxableAndNonTaxableTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderForCustomerWithTwoAddressesTaxableAndNonTaxableTest.xml index d6bf0eec301db..1c35a9e900a8a 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderForCustomerWithTwoAddressesTaxableAndNonTaxableTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderForCustomerWithTwoAddressesTaxableAndNonTaxableTest.xml @@ -36,23 +36,23 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <!--Step 1: Create new order for customer--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!--Step 2: Add product1 to the order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder"> <argument name="product" value="$$product1$$"/> </actionGroup> <!--Step 2: Select taxable address as billing address--> <selectOption selector="{{AdminOrderFormBillingAddressSection.selectAddress}}" userInput="{{US_Address_CA.state}}" stepKey="selectTaxableAddress" /> <!--Step 3: Select FlatRate shipping method--> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShippingMethod"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRateShippingMethod"/> <!--Step 4: Verify that tax is applied to the order--> <seeElement selector="{{AdminOrderFormTotalSection.total('Tax')}}" stepKey="seeTax" /> <!--Step 5: Select non taxable address as billing address--> <selectOption selector="{{AdminOrderFormBillingAddressSection.selectAddress}}" userInput="{{US_Address_TX.state}}" stepKey="selectNonTaxableAddress" /> <!--Step 6: Change shipping method to Free--> - <actionGroup ref="changeShippingMethod" stepKey="changeShippingMethod"> + <actionGroup ref="ChangeShippingMethodActionGroup" stepKey="changeShippingMethod"> <argument name="shippingMethod" value="freeshipping_freeshipping"/> </actionGroup> <!--Step 7: Verify that tax is not applied to the order--> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml index d087b291de87c..1749fcd6c218e 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml @@ -80,25 +80,25 @@ </before> <!--Create new customer order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!--Add bundle product to order and check product price in grid--> - <actionGroup ref="addBundleProductToOrderAndCheckPriceInGrid" stepKey="addBundleProductToOrder"> + <actionGroup ref="AddBundleProductToOrderAndCheckPriceInGridActionGroup" stepKey="addBundleProductToOrder"> <argument name="product" value="$$product$$"/> <argument name="quantity" value="1"/> <argument name="price" value="$738.00"/> </actionGroup> <!--Select FlatRate shipping method--> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShippingMethod"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="orderSelectFlatRateShippingMethod"/> <!--Submit order--> <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> <!--Verify order information--> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <after> <actionGroup ref="logout" stepKey="logout"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml index 40b26a6b46045..bfaf31007b10a 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithMinimumAmountEnabledTest.xml @@ -37,10 +37,10 @@ <!--Admin creates order--> <comment userInput="Admin creates order" stepKey="adminCreateOrder"/> - <actionGroup ref="navigateToNewOrderPageNewCustomerSingleStore" stepKey="navigateToNewOrderPage"/> + <actionGroup ref="NavigateToNewOrderPageNewCustomerSingleStoreActionGroup" stepKey="navigateToNewOrderPage"/> <conditionalClick selector="{{AdminOrderFormStoreSelectorSection.defaultStoreViewButton}}" dependentSelector="{{AdminOrderFormStoreSelectorSection.storeSelectorContainer}}" visible="true" stepKey="selectFirstStoreViewIfAppears"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappearedAfterStoreSelected"/> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder"> <argument name="product" value="SimpleProduct"/> </actionGroup> @@ -49,15 +49,15 @@ <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillEmail"/> <!--Fill customer address information--> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress"> <argument name="customer" value="Simple_US_Customer"/> <argument name="address" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRateShipping"/> <!-- Checkout select Check/Money Order payment --> - <actionGroup ref="SelectCheckMoneyPaymentMethod" stepKey="selectCheckMoneyPayment"/> + <actionGroup ref="SelectCheckMoneyPaymentMethodActionGroup" stepKey="selectCheckMoneyPayment"/> <!--Verify totals on Order page--> <see selector="{{AdminOrderFormTotalSection.total('Subtotal')}}" userInput="${{AdminOrderSimpleProduct.subtotal}}" stepKey="seeOrderSubTotal"/> @@ -72,12 +72,12 @@ <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderPendingStatus"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> <assertNotEmpty actual="$orderId" stepKey="assertOrderIdIsNotEmpty"/> - <actionGroup ref="verifyBasicOrderInformation" stepKey="verifyOrderInformation"> + <actionGroup ref="VerifyBasicOrderInformationActionGroup" stepKey="verifyOrderInformation"> <argument name="customer" value="Simple_US_Customer"/> <argument name="shippingAddress" value="US_Address_TX"/> <argument name="billingAddress" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="seeProductInItemsOrdered" stepKey="seeSimpleProductInItemsOrdered"> + <actionGroup ref="SeeProductInItemsOrderedActionGroup" stepKey="seeSimpleProductInItemsOrdered"> <argument name="product" value="SimpleProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSelectedShoppingCartItemsTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSelectedShoppingCartItemsTest.xml index 513fcd7fd2699..58a680ea61c87 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSelectedShoppingCartItemsTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSelectedShoppingCartItemsTest.xml @@ -53,12 +53,12 @@ </actionGroup> <!--Step 3: Create new customer order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!--Step 4: Add product2 to the order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder"> <argument name="product" value="$$product2$$"/> </actionGroup> @@ -66,21 +66,21 @@ <click selector="{{AdminOrderFormShoppingCartSection.addProduct($$product1.name$$)}}" stepKey="selectProduct1InTheShoppingCart"/> <!--Step 6: Select FlatRate shipping method--> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShippingMethod"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="orderSelectFlatRateShippingMethod"/> <!--Step 7: Submit order--> <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/> <!--Step 8: Verify order information--> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <!--Step 9: Check that product 2 is in the order items list --> - <actionGroup ref="seeProductInItemsOrdered" stepKey="seeProduct2InItemsOrdered"> + <actionGroup ref="SeeProductInItemsOrderedActionGroup" stepKey="seeProduct2InItemsOrdered"> <argument name="product" value="$$product2$$"/> </actionGroup> <!--Step 10: Check that product 1 is not in the order items list --> - <actionGroup ref="dontSeeProductInItemsOrdered" stepKey="dontSeeProduct1InItemsOrdered"> + <actionGroup ref="DontSeeProductInItemsOrderedActionGroup" stepKey="dontSeeProduct1InItemsOrdered"> <argument name="product" value="$$product1$$"/> </actionGroup> <after> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSimpleProductTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSimpleProductTest.xml index 85567374e36e4..76f916d55ee92 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSimpleProductTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithSimpleProductTest.xml @@ -28,19 +28,19 @@ </createData> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder"> <argument name="product" value="$$simpleProduct$$"/> <argument name="productQty" value="{{SimpleProduct_25.quantity}}"/> </actionGroup> <actionGroup ref="SelectCashOnDeliveryPaymentMethodActionGroup" stepKey="selectPaymentMethod"/> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShippingMethod"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="orderSelectFlatRateShippingMethod"/> <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId"/> - <actionGroup ref="OpenOrderById" stepKey="openOrder"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminFreeShippingNotAvailableIfMinimumOrderAmountNotMatchOrderTotalTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminFreeShippingNotAvailableIfMinimumOrderAmountNotMatchOrderTotalTest.xml index 8bfcaf67c4332..9ff6f3bdac985 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminFreeShippingNotAvailableIfMinimumOrderAmountNotMatchOrderTotalTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminFreeShippingNotAvailableIfMinimumOrderAmountNotMatchOrderTotalTest.xml @@ -41,11 +41,11 @@ <magentoCLI command="cache:flush" stepKey="flushCache2"/> </after> <!--Create new order with existing customer--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="goToCreateOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="goToCreateOrderPage"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> <!--Add product to order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProductToOrder"> <argument name="product" value="$$createProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminHoldCreatedOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminHoldCreatedOrderTest.xml index 9e8949c9ba600..5dc5dbf3ab79d 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminHoldCreatedOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminHoldCreatedOrderTest.xml @@ -44,17 +44,17 @@ </after> <!--Create new customer order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!--Add Simple product to order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToTheOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToTheOrder"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> <!--Add second product to order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSecondProductToTheOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSecondProductToTheOrder"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> @@ -65,7 +65,7 @@ <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> <!-- Verify order information --> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> <!-- Hold the Order --> @@ -93,4 +93,4 @@ <waitForPageLoad stepKey="waitForOrderDetailsToLoad"/> <seeElement selector="{{StorefrontCustomerOrderViewSection.orderStatusInGrid('$orderId', 'On Hold')}}" stepKey="seeOrderStatusInGrid"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml index b40e9d041a10e..0646fdc5e5090 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml @@ -74,7 +74,7 @@ <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addProductToCart"/> <!--Create new order for existing Customer And Store--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="createNewOrder"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="createNewOrder"> <argument name="customer" value="Simple_US_Customer"/> <argument name="storeView" value="customStore"/> </actionGroup> @@ -90,16 +90,16 @@ </actionGroup> <!--Fill customer address information--> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress"> <argument name="customer" value="Simple_US_Customer"/> <argument name="address" value="US_Address_TX"/> </actionGroup> <!--Select shipping method--> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRateShipping"/> <!--Checkout select Check/Money Order payment--> - <actionGroup ref="SelectCheckMoneyPaymentMethod" stepKey="selectCheckMoneyPayment"/> + <actionGroup ref="SelectCheckMoneyPaymentMethodActionGroup" stepKey="selectCheckMoneyPayment"/> <!--Submit Order and verify information--> <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml index 587b23e857c0c..fe29c1b63aa33 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml @@ -56,7 +56,7 @@ <!-- Login as admin --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!--Open order by Id--> - <actionGroup ref="OpenOrderById" stepKey="openOrderById"> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrderById"> <argument name="orderId" value="$createGuestCart.return$"/> </actionGroup> <!--Reorder--> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSaveInAddressBookCheckboxStateTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSaveInAddressBookCheckboxStateTest.xml index 650152a191d16..f2341278becba 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSaveInAddressBookCheckboxStateTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSaveInAddressBookCheckboxStateTest.xml @@ -39,12 +39,12 @@ </after> <!-- Create new order and choose an existing customer --> <comment userInput="Create new order and choose an existing customer" stepKey="createOrderAndAddCustomer"/> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderPage"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> <!-- Add simple product to order --> <comment userInput="Add simple product to order" stepKey="addSimpleProdToOrder"/> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <!-- Just in case uncheck and check 'Same as Billing Address checkbox' --> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml index 63607e59c41b2..65bba7512e228 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml @@ -91,35 +91,35 @@ </before> <!--Create new customer order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!--Add configurable product to order--> - <actionGroup ref="addConfigurableProductToOrderFromAdmin" stepKey="addConfigurableProductToOrder"> + <actionGroup ref="AddConfigurableProductToOrderFromAdminActionGroup" stepKey="addConfigurableProductToOrder"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="attribute" value="$$createConfigProductAttribute$$"/> <argument name="option" value="$$getConfigAttributeOption1$$"/> </actionGroup> <!--Configure ordered configurable product--> - <actionGroup ref="configureOrderedConfigurableProduct" stepKey="configureOrderedConfigurableProduct"> + <actionGroup ref="ConfigureOrderedConfigurableProductActionGroup" stepKey="configureOrderedConfigurableProduct"> <argument name="attribute" value="$$createConfigProductAttribute$$"/> <argument name="option" value="$$getConfigAttributeOption2$$"/> <argument name="quantity" value="2"/> </actionGroup> <!--Select FlatRate shipping method--> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShippingMethod"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="orderSelectFlatRateShippingMethod"/> <!-- Checkout select Check/Money Order payment --> - <actionGroup ref="SelectCheckMoneyPaymentMethod" stepKey="selectCheckMoneyPayment"/> + <actionGroup ref="SelectCheckMoneyPaymentMethodActionGroup" stepKey="selectCheckMoneyPayment"/> <!--Submit order--> <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> <!--Verify order information--> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <after> <actionGroup ref="logout" stepKey="logout"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml index 255a7a91f9b10..b2d424ca5d7d3 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml @@ -41,10 +41,10 @@ <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> <!--Check if order can be submitted without the required fields--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder" after="seeNewOrderPageTitle"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder" after="seeNewOrderPageTitle"> <argument name="product" value="_defaultProduct"/> </actionGroup> - <actionGroup ref="checkRequiredFieldsNewOrderForm" stepKey="checkRequiredFieldsNewOrder" after="addSimpleProductToOrder"/> + <actionGroup ref="CheckRequiredFieldsNewOrderFormActionGroup" stepKey="checkRequiredFieldsNewOrder" after="addSimpleProductToOrder"/> <see selector="{{AdminOrderFormPaymentSection.paymentError}}" userInput="Please select one of the options." stepKey="seePaymentMethodRequired" after="checkRequiredFieldsNewOrder"/> <scrollToTopOfPage stepKey="scrollToTopOfOrderFormPage" after="seePaymentMethodRequired"/> @@ -53,7 +53,7 @@ <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail" after="selectCustomerGroup"/> <!--Fill customer address information--> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress" after="fillCustomerEmail"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress" after="fillCustomerEmail"> <argument name="customer" value="Simple_US_Customer"/> <argument name="address" value="US_Address_TX"/> </actionGroup> @@ -61,7 +61,7 @@ <!-- Select payment and shipping --> <waitForElementVisible selector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" stepKey="waitForPaymentOptions"/> <selectOption selector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" userInput="checkmo" stepKey="checkPaymentOption"/> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping" after="fillCustomerAddress"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRateShipping" after="fillCustomerAddress"/> <!--Verify totals on Order page--> <see selector="{{AdminOrderFormTotalSection.total('Subtotal')}}" userInput="${{AdminOrderSimpleProduct.subtotal}}" stepKey="seeOrderSubTotal" after="selectFlatRateShipping"/> @@ -74,4 +74,4 @@ <seeInCurrentUrl url="{{AdminOrderDetailsPage.url}}" stepKey="seeViewOrderPage" after="clickSubmitOrder"/> <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeSuccessMessage" after="seeViewOrderPage"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml index 01021ad745f70..f2d0fffe9b4cf 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml @@ -31,7 +31,7 @@ <!--Create order via Admin--> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <comment userInput="Admin creates order" stepKey="adminCreateOrderComment"/> - <!--<actionGroup ref="navigateToNewOrderPageNewCustomer" stepKey="navigateToNewOrderPage"/>--> + <!--<actionGroup ref="NavigateToNewOrderPageNewCustomerActionGroup" stepKey="navigateToNewOrderPage"/>--> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> <waitForPageLoad stepKey="waitForIndexPageLoad"/> <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> @@ -40,9 +40,9 @@ <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> <!--Check if order can be submitted without the required fields including email address--> - <actionGroup ref="checkRequiredFieldsNewOrderForm" stepKey="checkRequiredFieldsNewOrder" after="seeNewOrderPageTitle"/> + <actionGroup ref="CheckRequiredFieldsNewOrderFormActionGroup" stepKey="checkRequiredFieldsNewOrder" after="seeNewOrderPageTitle"/> <scrollToTopOfPage stepKey="scrollToTopOfOrderFormPage" after="checkRequiredFieldsNewOrder"/> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder" after="scrollToTopOfOrderFormPage"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder" after="scrollToTopOfOrderFormPage"> <argument name="product" value="_defaultProduct"/> </actionGroup> @@ -51,15 +51,15 @@ <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail" after="selectCustomerGroup"/> <!--Fill customer address information--> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress" after="fillCustomerEmail"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress" after="fillCustomerEmail"> <argument name="customer" value="Simple_US_Customer"/> <argument name="address" value="US_Address_TX"/> </actionGroup> <!-- Select shipping --> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping" after="fillCustomerAddress"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRateShipping" after="fillCustomerAddress"/> <!-- Checkout select Check/Money Order payment --> - <actionGroup ref="SelectCheckMoneyPaymentMethod" stepKey="selectCheckMoneyPayment"/> + <actionGroup ref="SelectCheckMoneyPaymentMethodActionGroup" stepKey="selectCheckMoneyPayment"/> <!--Verify totals on Order page--> <see selector="{{AdminOrderFormTotalSection.total('Subtotal')}}" userInput="${{AdminOrderSimpleProduct.subtotal}}" stepKey="seeOrderSubTotal" after="selectFlatRateShipping"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml index 9268e9e728658..4dbd80a351ee7 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml @@ -30,7 +30,7 @@ <!--Create order via Admin--> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <comment userInput="Admin creates order" stepKey="adminCreateOrderComment"/> - <!--<actionGroup ref="navigateToNewOrderPageNewCustomer" stepKey="navigateToNewOrderPage"/>--> + <!--<actionGroup ref="NavigateToNewOrderPageNewCustomerActionGroup" stepKey="navigateToNewOrderPage"/>--> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> <waitForPageLoad stepKey="waitForIndexPageLoad"/> <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> @@ -39,9 +39,9 @@ <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> <!--Check if order can be submitted without the required fields including email address--> - <actionGroup ref="checkRequiredFieldsNewOrderForm" stepKey="checkRequiredFieldsNewOrder" after="seeNewOrderPageTitle"/> + <actionGroup ref="CheckRequiredFieldsNewOrderFormActionGroup" stepKey="checkRequiredFieldsNewOrder" after="seeNewOrderPageTitle"/> <scrollToTopOfPage stepKey="scrollToTopOfOrderFormPage" after="checkRequiredFieldsNewOrder"/> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder" after="scrollToTopOfOrderFormPage"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder" after="scrollToTopOfOrderFormPage"> <argument name="product" value="_defaultProduct"/> </actionGroup> @@ -50,12 +50,12 @@ <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail" after="selectCustomerGroup"/> <!--Fill wrong customer address information--> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillWrongCustomerAddress" after="fillCustomerEmail"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillWrongCustomerAddress" after="fillCustomerEmail"> <argument name="customer" value="Simple_US_Customer_Incorrect_Name"/> <argument name="address" value="US_Address_TX"/> </actionGroup> <!-- Select shipping --> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping" + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRateShipping" after="fillWrongCustomerAddress"/> <!--Verify totals on Order page--> @@ -72,7 +72,7 @@ after="clickSubmitOrderWrong"/> <!--Fill correct customer address information--> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress" after="firstNameError"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress" after="firstNameError"> <argument name="customer" value="Simple_US_Customer"/> <argument name="address" value="US_Address_TX"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml index c292afe65cdf3..ac377a0d31606 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AssignCustomOrderStatusNotVisibleOnStorefrontTest.xml @@ -87,7 +87,7 @@ <!-- Assert order status is correct --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrdersPage"/> <waitForPageLoad stepKey="waitForOrdersPageLoad"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrdersGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrdersGridById"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <click selector="{{AdminDataGridTableSection.firstRow}}" stepKey="clickCreatedOrderInGrid"/> @@ -112,7 +112,7 @@ <!-- Cancel order --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToAdminOrdersPage"/> <waitForPageLoad stepKey="waitForAdminOrdersPageLoad"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrdersGridByOrderId"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrdersGridByOrderId"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <checkOption selector="{{AdminOrdersGridSection.checkOrder}}" stepKey="selectOrder"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CheckXSSVulnerabilityDuringOrderCreationTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CheckXSSVulnerabilityDuringOrderCreationTest.xml index a728b57a743af..6eb9e37a3ab79 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CheckXSSVulnerabilityDuringOrderCreationTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CheckXSSVulnerabilityDuringOrderCreationTest.xml @@ -52,7 +52,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Try to create order in admin with provided email --> - <actionGroup ref="navigateToNewOrderPageNewCustomerSingleStore" stepKey="navigateToNewOrderPage"/> + <actionGroup ref="NavigateToNewOrderPageNewCustomerSingleStoreActionGroup" stepKey="navigateToNewOrderPage"/> <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer_Incorrect_Email.email}}" stepKey="fillEmailAddressAdminPanel"/> <click selector="{{AdminOrderFormActionSection.submitOrder}}" stepKey="clickSubmitOrder"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceAndCheckInvoiceOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceAndCheckInvoiceOrderTest.xml index 45953b7b584f2..0b065e0da54f0 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceAndCheckInvoiceOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceAndCheckInvoiceOrderTest.xml @@ -51,7 +51,7 @@ </after> <!-- Create order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="goToCreateOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="goToCreateOrderPage"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> @@ -79,7 +79,7 @@ <!-- Open created order --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrdersPage"/> <waitForPageLoad stepKey="waitForOrdersPageLoad"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrdersGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrdersGridById"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <click selector="{{AdminDataGridTableSection.firstRow}}" stepKey="clickCreatedOrderInGrid"/> @@ -105,7 +105,7 @@ <!-- Assert invoice in invoices tab --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> <waitForPageLoad stepKey="waitForOrdersLoad"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridByIdForAssertingInvoiceBtn"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridByIdForAssertingInvoiceBtn"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <click selector="{{AdminDataGridTableSection.firstRow}}" stepKey="clickOrderInGrid"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithCashOnDeliveryPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithCashOnDeliveryPaymentMethodTest.xml index ef194028a4367..295d388ced96e 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithCashOnDeliveryPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithCashOnDeliveryPaymentMethodTest.xml @@ -51,7 +51,7 @@ </after> <!-- Create order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="goToCreateOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="goToCreateOrderPage"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> @@ -79,7 +79,7 @@ <!-- Open created order --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrdersPage"/> <waitForPageLoad stepKey="waitForOrdersPageLoad"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrdersGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrdersGridById"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <click selector="{{AdminDataGridTableSection.firstRow}}" stepKey="clickCreatedOrderInGrid"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithShipmentAndCheckInvoicedOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithShipmentAndCheckInvoicedOrderTest.xml index 30ca1f5175576..2ccecf34a5a0c 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithShipmentAndCheckInvoicedOrderTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithShipmentAndCheckInvoicedOrderTest.xml @@ -49,12 +49,12 @@ </after> <!-- Create order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="goToCreateOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="goToCreateOrderPage"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> <!-- Add product to order --> - <actionGroup ref="addSimpleProductToOrder" stepKey="addProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProductToOrder"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> @@ -73,7 +73,7 @@ <!-- Open created order --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrdersPage"/> <waitForPageLoad stepKey="waitForOrdersPageLoad"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrdersGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrdersGridById"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <click selector="{{AdminDataGridTableSection.firstRow}}" stepKey="clickCreatedOrderInGrid"/> @@ -103,7 +103,7 @@ <!-- Assert no invoice button --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> <waitForPageLoad stepKey="waitForOrdersLoad"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridByIdForAssertingInvoiceBtn"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridByIdForAssertingInvoiceBtn"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <click selector="{{AdminDataGridTableSection.firstRow}}" stepKey="clickOrderInGrid"/> @@ -148,7 +148,7 @@ <!-- Assert no ship button --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToAdminOrdersPage"/> <waitForPageLoad stepKey="waitForOrdersPageToLoad"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridByIdForAssertingShipBtn"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridByIdForAssertingShipBtn"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <click selector="{{AdminDataGridTableSection.firstRow}}" stepKey="selectOrderInGrid"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithZeroSubtotalCheckoutTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithZeroSubtotalCheckoutTest.xml index 4b8e5d88cdf49..944a1ed75cebd 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithZeroSubtotalCheckoutTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateInvoiceWithZeroSubtotalCheckoutTest.xml @@ -62,12 +62,12 @@ </after> <!-- Create order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="goToCreateOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="goToCreateOrderPage"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> <!-- Add product to order --> - <actionGroup ref="addSimpleProductToOrder" stepKey="addProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProductToOrder"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> @@ -77,7 +77,7 @@ </actionGroup> <!-- Select Free shipping --> - <actionGroup ref="orderSelectFreeShipping" stepKey="selectFreeShippingOption"/> + <actionGroup ref="OrderSelectFreeShippingActionGroup" stepKey="selectFreeShippingOption"/> <!-- Submit order --> <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/> @@ -88,7 +88,7 @@ <!-- Open created order --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrdersPage"/> <waitForPageLoad stepKey="waitForOrdersPageLoad"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrdersGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrdersGridById"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <click selector="{{AdminDataGridTableSection.firstRow}}" stepKey="clickCreatedOrderInGrid"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml index 9da5afffb48e5..d32a5304c5087 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml @@ -103,19 +103,19 @@ <conditionalClick selector="{{AdminOrderStoreScopeTreeSection.storeOption(_defaultStore.name)}}" dependentSelector="{{AdminOrderStoreScopeTreeSection.storeOption(_defaultStore.name)}}" visible="true" stepKey="selectStoreViewIfAppears"/> <!--Add configurable product to order--> - <actionGroup ref="addConfigurableProductToOrderFromAdmin" stepKey="addConfigurableProductToOrder"> + <actionGroup ref="AddConfigurableProductToOrderFromAdminActionGroup" stepKey="addConfigurableProductToOrder"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="attribute" value="$$createConfigProductAttribute$$"/> <argument name="option" value="$$getConfigAttributeOption1$$"/> </actionGroup> <!--Add Simple product to order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> <!--Add Second Simple product to order--> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSecondSimpleProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSecondSimpleProductToOrder"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> @@ -185,7 +185,7 @@ <waitForPageLoad stepKey="waitForAdminOrderFormLoad"/> <!-- Verify order information --> - <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> <!-- Filter and Open the customer edit page --> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml index 0fdd8d8c35b32..08fd95e73ad93 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -35,14 +35,14 @@ <!--Admin creates order--> <comment userInput="Admin creates order" stepKey="adminCreateOrderComment" before="navigateToNewOrderPage"/> - <actionGroup ref="navigateToNewOrderPageNewCustomer" stepKey="navigateToNewOrderPage" after="deleteCategory"/> + <actionGroup ref="NavigateToNewOrderPageNewCustomerActionGroup" stepKey="navigateToNewOrderPage" after="deleteCategory"/> - <actionGroup ref="checkRequiredFieldsNewOrderForm" stepKey="checkRequiredFieldsNewOrder" after="navigateToNewOrderPage"/> + <actionGroup ref="CheckRequiredFieldsNewOrderFormActionGroup" stepKey="checkRequiredFieldsNewOrder" after="navigateToNewOrderPage"/> <scrollToTopOfPage stepKey="scrollToTopOfOrderFormPage" after="checkRequiredFieldsNewOrder"/> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder" after="scrollToTopOfOrderFormPage"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder" after="scrollToTopOfOrderFormPage"> <argument name="product" value="SimpleProduct"/> </actionGroup> - <actionGroup ref="addConfigurableProductToOrder" stepKey="addConfigurableProductToOrder" after="addSimpleProductToOrder"> + <actionGroup ref="AddConfigurableProductToOrderActionGroup" stepKey="addConfigurableProductToOrder" after="addSimpleProductToOrder"> <argument name="product" value="BaseConfigurableProduct"/> <argument name="attribute" value="colorProductAttribute"/> <argument name="option" value="colorProductAttribute1"/> @@ -53,12 +53,12 @@ <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillEmail" after="selectGroup"/> <!--Fill customer address information--> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress" after="fillEmail"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress" after="fillEmail"> <argument name="customer" value="Simple_US_Customer"/> <argument name="address" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping" after="fillCustomerAddress"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRateShipping" after="fillCustomerAddress"/> <!--Verify totals on Order page--> <see selector="{{AdminOrderFormTotalSection.total('Subtotal')}}" userInput="${{AdminOrderSimpleConfigurableProduct.subtotal}}" stepKey="seeOrderSubTotal" after="selectFlatRateShipping"/> @@ -73,15 +73,15 @@ <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderPendingStatus" after="seeSuccessMessage"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId" after="seeOrderPendingStatus"/> <assertNotEmpty actual="$getOrderId" stepKey="assertOrderIdIsNotEmpty" after="getOrderId"/> - <actionGroup ref="verifyBasicOrderInformation" stepKey="verifyOrderInformation" after="assertOrderIdIsNotEmpty"> + <actionGroup ref="VerifyBasicOrderInformationActionGroup" stepKey="verifyOrderInformation" after="assertOrderIdIsNotEmpty"> <argument name="customer" value="Simple_US_Customer"/> <argument name="shippingAddress" value="US_Address_TX"/> <argument name="billingAddress" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="seeProductInItemsOrdered" stepKey="seeSimpleProductInItemsOrdered" after="verifyOrderInformation"> + <actionGroup ref="SeeProductInItemsOrderedActionGroup" stepKey="seeSimpleProductInItemsOrdered" after="verifyOrderInformation"> <argument name="product" value="SimpleProduct"/> </actionGroup> - <actionGroup ref="seeProductInItemsOrdered" stepKey="seeConfigurableProductInItemsOrdered" after="seeSimpleProductInItemsOrdered"> + <actionGroup ref="SeeProductInItemsOrderedActionGroup" stepKey="seeConfigurableProductInItemsOrdered" after="seeSimpleProductInItemsOrdered"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> @@ -94,7 +94,7 @@ <!--Check Invoice Data--> <see selector="{{AdminInvoiceOrderInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderPendingInvoice" after="seePageNameNewInvoicePage"/> - <actionGroup ref="verifyBasicInvoiceInformation" stepKey="verifyOrderInvoiceInformation" after="seeOrderPendingInvoice"> + <actionGroup ref="VerifyBasicInvoiceInformationActionGroup" stepKey="verifyOrderInvoiceInformation" after="seeOrderPendingInvoice"> <argument name="customer" value="Simple_US_Customer"/> <argument name="shippingAddress" value="US_Address_TX"/> <argument name="billingAddress" value="US_Address_TX"/> @@ -113,15 +113,15 @@ <see selector="{{AdminOrderInvoicesTabSection.gridRow('1')}}" userInput="{{Simple_US_Customer.firstname}}" stepKey="seeOrderInvoiceInTabGrid" after="waitForInvoiceGridLoadingMask"/> <click selector="{{AdminOrderInvoicesTabSection.viewGridRow('1')}}" stepKey="clickToViewInvoiceRow" after="seeOrderInvoiceInTabGrid"/> <see selector="{{AdminInvoiceOrderInformationSection.orderId}}" userInput="$getOrderId" stepKey="seeOrderIdOnInvoice" after="clickToViewInvoiceRow"/> - <actionGroup ref="verifyBasicInvoiceInformation" stepKey="verifyBasicInvoiceInformation" after="seeOrderIdOnInvoice"> + <actionGroup ref="VerifyBasicInvoiceInformationActionGroup" stepKey="verifyBasicInvoiceInformation" after="seeOrderIdOnInvoice"> <argument name="customer" value="Simple_US_Customer"/> <argument name="shippingAddress" value="US_Address_TX"/> <argument name="billingAddress" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="seeProductInInvoiceItems" stepKey="seeSimpleProductInInvoice" after="verifyBasicInvoiceInformation"> + <actionGroup ref="SeeProductInInvoiceItemsActionGroup" stepKey="seeSimpleProductInInvoice" after="verifyBasicInvoiceInformation"> <argument name="product" value="SimpleProduct"/> </actionGroup> - <actionGroup ref="seeProductInInvoiceItems" stepKey="seeConfigurableProductInInvoice" after="seeSimpleProductInInvoice"> + <actionGroup ref="SeeProductInInvoiceItemsActionGroup" stepKey="seeConfigurableProductInInvoice" after="seeSimpleProductInInvoice"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <click selector="{{AdminInvoiceOrderInformationSection.orderId}}" stepKey="clickOrderIdLinkOnInvoice" after="seeConfigurableProductInInvoice"/> @@ -132,7 +132,7 @@ <seeInCurrentUrl url="{{AdminCreditMemoNewPage.url}}" stepKey="seeNewCreditMemoPage" after="clickCreateCreditMemo"/> <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Memo" stepKey="seeNewMemoInPageTitle" after="seeNewCreditMemoPage"/> <!--Check Credit Memo Order Data--> - <actionGroup ref="verifyBasicCreditMemoInformation" stepKey="verifyOrderCreditMemoInformation" after="seeNewMemoInPageTitle"> + <actionGroup ref="VerifyBasicCreditMemoInformationActionGroup" stepKey="verifyOrderCreditMemoInformation" after="seeNewMemoInPageTitle"> <argument name="customer" value="Simple_US_Customer"/> <argument name="shippingAddress" value="US_Address_TX"/> <argument name="billingAddress" value="US_Address_TX"/> @@ -146,15 +146,15 @@ <click selector="{{AdminOrderCreditMemosTabSection.viewGridRow('1')}}" stepKey="clickToViewCreditMemoRow" after="seeOrderCreditMemoInTabGrid"/> <waitForPageLoad stepKey="waitForCreditMemoPageLoad" after="clickToViewCreditMemoRow"/> <see selector="{{AdminCreditMemoOrderInformationSection.orderId}}" userInput="$getOrderId" stepKey="seeOrderIdOnCreditMemo" after="waitForCreditMemoPageLoad"/> - <actionGroup ref="verifyBasicCreditMemoInformation" stepKey="verifyBasicCreditMemoInformation" after="seeOrderIdOnCreditMemo"> + <actionGroup ref="VerifyBasicCreditMemoInformationActionGroup" stepKey="verifyBasicCreditMemoInformation" after="seeOrderIdOnCreditMemo"> <argument name="customer" value="Simple_US_Customer"/> <argument name="shippingAddress" value="US_Address_TX"/> <argument name="billingAddress" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="seeProductInItemsRefunded" stepKey="seeSimpleProductInItemsRefunded" after="verifyBasicCreditMemoInformation"> + <actionGroup ref="SeeProductInItemsRefundedActionGroup" stepKey="seeSimpleProductInItemsRefunded" after="verifyBasicCreditMemoInformation"> <argument name="product" value="SimpleProduct"/> </actionGroup> - <actionGroup ref="seeProductInItemsRefunded" stepKey="seeConfigurableProductInItemsRefunded" after="seeSimpleProductInItemsRefunded"> + <actionGroup ref="SeeProductInItemsRefundedActionGroup" stepKey="seeConfigurableProductInItemsRefunded" after="seeSimpleProductInItemsRefunded"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <scrollToTopOfPage stepKey="scrollToTopOfCreditMemo" after="seeConfigurableProductInItemsRefunded"/> @@ -183,7 +183,7 @@ <actionGroup ref="resetAdminDataGridToDefaultView" stepKey="resetOrderGridForNameFilter" after="filterOrderGridByNameComment"/> <!--@TODO use "Bill-to Name" when MQE-794 is fixed--> <see selector="{{AdminDataGridTableSection.column('Bill')}}" userInput="{{BillingAddressTX.fullname}}" stepKey="seeNonFilterNameInColumn" after="resetOrderGridForNameFilter"/> - <actionGroup ref="filterOrderGridByBillingName" stepKey="filterOrderGridByBillingName" after="seeNonFilterNameInColumn"> + <actionGroup ref="FilterOrderGridByBillingNameActionGroup" stepKey="filterOrderGridByBillingName" after="seeNonFilterNameInColumn"> <argument name="customer" value="Simple_US_Customer"/> </actionGroup> <dontSee selector="{{AdminDataGridTableSection.column('Bill')}}" userInput="{{BillingAddressTX.fullname}}" stepKey="dontSeeNonFilterNameInColumn" after="filterOrderGridByBillingName"/> @@ -192,7 +192,7 @@ <comment userInput="Admin filters order grid by 'Grand Total'" stepKey="filterOrderGridByTotalComment" after="seeFilterNameInColumn"/> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilterBeforeTotalFilter" after="filterOrderGridByTotalComment"/> <see selector="{{AdminDataGridTableSection.column('Grand Total')}}" userInput="{{AdminOrderSimpleProduct.grandTotal}}" stepKey="seeLowerTotalInGrid" after="clearFilterBeforeTotalFilter"/> - <actionGroup ref="filterOrderGridByBaseTotalRange" stepKey="filterOrderGridByTotal" after="seeLowerTotalInGrid"> + <actionGroup ref="FilterOrderGridByBaseTotalRangeActionGroup" stepKey="filterOrderGridByTotal" after="seeLowerTotalInGrid"> <argument name="from" value="OrderGrandTotalFilterRange.from"/> <argument name="to" value="OrderGrandTotalFilterRange.to"/> </actionGroup> @@ -217,12 +217,12 @@ <!--Filter order grid by status--> <comment userInput="Admin filters order grid by 'Status'" stepKey="filterOrderGridByStatusComment" after="dontSeeSecondOrderInGrid"/> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilterBeforeStatusFilter" after="filterOrderGridByStatusComment"/> - <actionGroup ref="filterOrderGridByStatus" stepKey="filterOrderGridByPendingStatus" after="clearFilterBeforeStatusFilter"> + <actionGroup ref="FilterOrderGridByStatusActionGroup" stepKey="filterOrderGridByPendingStatus" after="clearFilterBeforeStatusFilter"> <argument name="status" value="OrderStatus.pending"/> </actionGroup> <dontSee selector="{{AdminDataGridTableSection.column('Status')}}" userInput="{{OrderStatus.closed}}" stepKey="dontSeeClosedStatusInOrderGrid" after="filterOrderGridByPendingStatus"/> <see selector="{{AdminDataGridTableSection.column('Status')}}" userInput="{{OrderStatus.pending}}" stepKey="seePendingStatusInOrderGrid" after="dontSeeClosedStatusInOrderGrid"/> - <actionGroup ref="filterOrderGridByStatus" stepKey="filterOrderGridByClosedStatus" after="seePendingStatusInOrderGrid"> + <actionGroup ref="FilterOrderGridByStatusActionGroup" stepKey="filterOrderGridByClosedStatus" after="seePendingStatusInOrderGrid"> <argument name="status" value="OrderStatus.closed"/> </actionGroup> <see selector="{{AdminDataGridTableSection.column('Status')}}" userInput="{{OrderStatus.closed}}" stepKey="seeClosedStatusInOrderGrid" after="filterOrderGridByClosedStatus"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/MoveLastOrderedConfigurableProductOnOrderPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/MoveLastOrderedConfigurableProductOnOrderPageTest.xml index 3cc14392c6183..b3c3f045f0d59 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/MoveLastOrderedConfigurableProductOnOrderPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/MoveLastOrderedConfigurableProductOnOrderPageTest.xml @@ -69,12 +69,12 @@ </after> <!-- Create order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="goToCreateOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="goToCreateOrderPage"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> <!-- Add configurable product to order --> - <actionGroup ref="addConfigurableProductToOrderFromAdmin" stepKey="addConfigurableProductToOrder"> + <actionGroup ref="AddConfigurableProductToOrderFromAdminActionGroup" stepKey="addConfigurableProductToOrder"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="attribute" value="$$createConfigProductAttribute$$"/> <argument name="option" value="$$getConfigAttributeOption$$"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml index 0bd8ab4855e97..f5fc0851b3ec8 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml @@ -164,7 +164,7 @@ <magentoCLI command="cache:flush" stepKey="flushCache"/> <!-- Place order with options according to dataset --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="newOrder"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="newOrder"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> @@ -200,12 +200,12 @@ <argument name="couponCode" value="$$createCouponForCartPriceRule.code$$"/> </actionGroup> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillOrder"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillOrder"> <argument name="customer" value="$$createCustomer$$"/> <argument name="address" value="US_Address_TX"/> </actionGroup> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRate"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRate"/> </before> <after> <magentoCLI command="downloadable:domains:remove" arguments="example.com static.magento.com" stepKey="removeDownloadableDomain"/> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml index b2e3e2516a5c3..48797336431fa 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml @@ -86,14 +86,14 @@ </actionGroup> <actionGroup ref="saveProductForm" stepKey="saveProduct"/> <!--Create order--> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$createCustomer$$"/> <argument name="storeView" value="customStore"/> </actionGroup> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToTheOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToTheOrder"> <argument name="product" value="$$createProduct$$"/> </actionGroup> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerInfo"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerInfo"> <argument name="customer" value="$$createCustomer$$"/> <argument name="address" value="US_Address_TX"/> </actionGroup> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreatePartialShipmentEntityTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreatePartialShipmentEntityTest.xml index 30dc98c2f68ca..0e4fd3ce9a86c 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreatePartialShipmentEntityTest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreatePartialShipmentEntityTest.xml @@ -40,15 +40,15 @@ <!-- TEST BODY --> <!-- Create Order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="goToCreateOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="goToCreateOrderPage"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> - <actionGroup ref="addSimpleProductToOrder" stepKey="addProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProductToOrder"> <argument name="product" value="$$createSimpleProduct$$"/> <argument name="productQty" value="2"/> </actionGroup> <!-- Select Free shipping --> - <actionGroup ref="orderSelectFreeShipping" stepKey="selectFreeShippingOption"/> + <actionGroup ref="OrderSelectFreeShippingActionGroup" stepKey="selectFreeShippingOption"/> <!--Click *Submit Order* button--> <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="clickSubmitOrder"/> <!-- Create Partial Shipment --> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateShipmentEntityTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateShipmentEntityTest.xml index 3e6bf29b1bf54..f4087932a0710 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateShipmentEntityTest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateShipmentEntityTest.xml @@ -41,14 +41,14 @@ <!-- TEST BODY --> <!-- Create Order --> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="goToCreateOrderPage"> + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="goToCreateOrderPage"> <argument name="customer" value="$$createCustomer$$"/> </actionGroup> - <actionGroup ref="addSimpleProductToOrder" stepKey="addProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProductToOrder"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <!-- Select Free shipping --> - <actionGroup ref="orderSelectFreeShipping" stepKey="selectFreeShippingOption"/> + <actionGroup ref="OrderSelectFreeShippingActionGroup" stepKey="selectFreeShippingOption"/> <!--Click *Submit Order* button--> <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="clickSubmitOrder"/> <!-- Create Shipment --> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxCalcWithApplyTaxOnSettingTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxCalcWithApplyTaxOnSettingTest.xml index d249af983f715..d023f2eae25c8 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxCalcWithApplyTaxOnSettingTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxCalcWithApplyTaxOnSettingTest.xml @@ -52,12 +52,12 @@ <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="navigateToNewOrderPageNewCustomerSingleStore" stepKey="gotoNewOrderCreationPage"/> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder"> + <actionGroup ref="NavigateToNewOrderPageNewCustomerSingleStoreActionGroup" stepKey="gotoNewOrderCreationPage"/> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder"> <argument name="product" value="$$createProduct$$"></argument> </actionGroup> <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillEmailField"/> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress"> <argument name="customer" value="Simple_US_Customer"/> <argument name="address" value="US_Address_CA"/> </actionGroup> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml index 628d189823a52..b7f604974fec2 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml @@ -104,10 +104,10 @@ <waitForPageLoad stepKey="waitForPage" time="60"/> <!--Check if order can be submitted without the required fields including email address--> <scrollToTopOfPage stepKey="scrollToTopOfOrderFormPage" after="seeNewOrderPageTitle"/> - <actionGroup ref="addSimpleProductToOrder" stepKey="addFirstProductToOrder" after="scrollToTopOfOrderFormPage"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addFirstProductToOrder" after="scrollToTopOfOrderFormPage"> <argument name="product" value="$$firstProduct$$"/> </actionGroup> - <actionGroup ref="addSimpleProductToOrder" stepKey="addSecondProductToOrder" after="addFirstProductToOrder"> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSecondProductToOrder" after="addFirstProductToOrder"> <argument name="product" value="$$secondProduct$$"/> </actionGroup> @@ -116,15 +116,15 @@ <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail" after="selectCustomerGroup"/> <!--Fill customer address information--> - <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress" after="fillCustomerEmail"> + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerAddress" after="fillCustomerEmail"> <argument name="customer" value="Simple_US_Customer"/> <argument name="address" value="US_Address_TX"/> </actionGroup> <!-- Select shipping --> - <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping" after="fillCustomerAddress"/> + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRateShipping" after="fillCustomerAddress"/> <!-- Checkout select Check/Money Order payment --> - <actionGroup ref="SelectCheckMoneyPaymentMethod" after="selectFlatRateShipping" stepKey="selectCheckMoneyPayment"/> + <actionGroup ref="SelectCheckMoneyPaymentMethodActionGroup" after="selectFlatRateShipping" stepKey="selectCheckMoneyPayment"/> <!--Submit Order and verify information--> <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" after="selectCheckMoneyPayment" stepKey="clickSubmitOrder"/> <seeInCurrentUrl url="{{AdminOrderDetailsPage.url}}" stepKey="seeViewOrderPage" after="clickSubmitOrder"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml index 38cc687ff53a4..d80e48bc08a90 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml @@ -102,7 +102,7 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!--Create new order--> - <actionGroup stepKey="CreateNewOrder" ref="navigateToNewOrderPageExistingCustomer"> + <actionGroup stepKey="CreateNewOrder" ref="NavigateToNewOrderPageExistingCustomerActionGroup"> <argument name="customer" value="Simple_US_Customer_NY"/> </actionGroup> <!--Add product to order--> @@ -112,7 +112,7 @@ <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> <waitForPageLoad stepKey="waitForPageLoad3"/> <!--Set shipping method--> - <actionGroup stepKey="orderSelectFlatRateShipping" ref="orderSelectFlatRateShipping"/> + <actionGroup stepKey="orderSelectFlatRateShipping" ref="OrderSelectFlatRateShippingActionGroup"/> <!--Submit order--> <click stepKey="SubmitOrder" selector="{{AdminOrderFormActionSection.SubmitOrder}}"/> <waitForPageLoad stepKey="waitForPageLoad4"/> @@ -120,7 +120,7 @@ <!--Open new created order--> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> <waitForPageLoad stepKey="waitForPageLoad5"/> - <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$getOrderId"/> </actionGroup> <!--Create order invoice--> From df6c294861e48ee81dcf4de0c1dec3986d6c09bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 17:04:36 +0100 Subject: [PATCH 320/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../GenerateOrderReportActionGroup.xml | 20 +------------ ...rateOrderReportForNotCancelActionGroup.xml | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 19 deletions(-) create mode 100644 app/code/Magento/Reports/Test/Mftf/ActionGroup/GenerateOrderReportForNotCancelActionGroup.xml diff --git a/app/code/Magento/Reports/Test/Mftf/ActionGroup/GenerateOrderReportActionGroup.xml b/app/code/Magento/Reports/Test/Mftf/ActionGroup/GenerateOrderReportActionGroup.xml index 29bbe91afbd11..1250c7b0ac370 100644 --- a/app/code/Magento/Reports/Test/Mftf/ActionGroup/GenerateOrderReportActionGroup.xml +++ b/app/code/Magento/Reports/Test/Mftf/ActionGroup/GenerateOrderReportActionGroup.xml @@ -16,29 +16,11 @@ <argument name="orderFromDate" type="string"/> <argument name="orderToDate" type="string"/> </arguments> - + <click selector="{{OrderReportMainSection.here}}" stepKey="clickOnHere"/> <fillField selector="{{OrderReportFilterSection.dateFrom}}" userInput="{{orderFromDate}}" stepKey="fillFromDate"/> <fillField selector="{{OrderReportFilterSection.dateTo}}" userInput="{{orderToDate}}" stepKey="fillToDate"/> <selectOption selector="{{OrderReportFilterSection.orderStatus}}" userInput="Any" stepKey="selectAnyOption"/> <click selector="{{OrderReportMainSection.showReport}}" stepKey="showReport"/> </actionGroup> - - <actionGroup name="GenerateOrderReportForNotCancelActionGroup"> - <annotations> - <description>Clicks on 'here' to refresh the grid data. Enters the provided Order From/To Dates and provided Order Status. Clicks on 'Show Report'.</description> - </annotations> - <arguments> - <argument name="orderFromDate" type="string"/> - <argument name="orderToDate" type="string"/> - <argument name="statuses" type="string"/> - </arguments> - - <click selector="{{OrderReportMainSection.here}}" stepKey="clickOnHere"/> - <fillField selector="{{OrderReportFilterSection.dateFrom}}" userInput="{{orderFromDate}}" stepKey="fillFromDate"/> - <fillField selector="{{OrderReportFilterSection.dateTo}}" userInput="{{orderToDate}}" stepKey="fillToDate"/> - <selectOption selector="{{OrderReportFilterSection.orderStatus}}" userInput="Specified" stepKey="selectSpecifiedOption"/> - <selectOption selector="{{OrderReportFilterSection.orderStatusSpecified}}" parameterArray="{{statuses}}" stepKey="selectSpecifiedOptionStatus"/> - <click selector="{{OrderReportMainSection.showReport}}" stepKey="showReport"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Reports/Test/Mftf/ActionGroup/GenerateOrderReportForNotCancelActionGroup.xml b/app/code/Magento/Reports/Test/Mftf/ActionGroup/GenerateOrderReportForNotCancelActionGroup.xml new file mode 100644 index 0000000000000..32c82308c8f99 --- /dev/null +++ b/app/code/Magento/Reports/Test/Mftf/ActionGroup/GenerateOrderReportForNotCancelActionGroup.xml @@ -0,0 +1,28 @@ +<?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="GenerateOrderReportForNotCancelActionGroup"> + <annotations> + <description>Clicks on 'here' to refresh the grid data. Enters the provided Order From/To Dates and provided Order Status. Clicks on 'Show Report'.</description> + </annotations> + <arguments> + <argument name="orderFromDate" type="string"/> + <argument name="orderToDate" type="string"/> + <argument name="statuses" type="string"/> + </arguments> + + <click selector="{{OrderReportMainSection.here}}" stepKey="clickOnHere"/> + <fillField selector="{{OrderReportFilterSection.dateFrom}}" userInput="{{orderFromDate}}" stepKey="fillFromDate"/> + <fillField selector="{{OrderReportFilterSection.dateTo}}" userInput="{{orderToDate}}" stepKey="fillToDate"/> + <selectOption selector="{{OrderReportFilterSection.orderStatus}}" userInput="Specified" stepKey="selectSpecifiedOption"/> + <selectOption selector="{{OrderReportFilterSection.orderStatusSpecified}}" parameterArray="{{statuses}}" stepKey="selectSpecifiedOptionStatus"/> + <click selector="{{OrderReportMainSection.showReport}}" stepKey="showReport"/> + </actionGroup> +</actionGroups> From 2270cebfeb0a8744d100c0b64031c99874a39bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 17:16:37 +0100 Subject: [PATCH 321/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../AddProductVideoActionGroup.xml | 33 ++++++++ .../AdminProductVideoActionGroup.xml | 77 ------------------- ...roductVideoAdminProductPageActionGroup.xml | 25 ++++++ ...tVideoNotInAdminProductPageActionGroup.xml | 25 ++++++ ...oNotInStorefrontProductPageActionGroup.xml | 21 +++++ ...VideoStorefrontProductPageActionGroup.xml} | 14 +--- .../RemoveProductVideoActionGroup.xml | 21 +++++ .../AdminAddDefaultVideoSimpleProductTest.xml | 6 +- ...minRemoveDefaultVideoSimpleProductTest.xml | 8 +- .../YoutubeVideoWindowOnProductPageTest.xml | 6 +- 10 files changed, 136 insertions(+), 100 deletions(-) create mode 100644 app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AddProductVideoActionGroup.xml delete mode 100644 app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AdminProductVideoActionGroup.xml create mode 100644 app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoAdminProductPageActionGroup.xml create mode 100644 app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNotInAdminProductPageActionGroup.xml create mode 100644 app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNotInStorefrontProductPageActionGroup.xml rename app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/{StorefrontProductVideoActionGroup.xml => AssertProductVideoStorefrontProductPageActionGroup.xml} (56%) create mode 100644 app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/RemoveProductVideoActionGroup.xml diff --git a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AddProductVideoActionGroup.xml b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AddProductVideoActionGroup.xml new file mode 100644 index 0000000000000..bf76b7c11acfd --- /dev/null +++ b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AddProductVideoActionGroup.xml @@ -0,0 +1,33 @@ +<?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"> + <!-- Add video in Admin Product page --> + <actionGroup name="AddProductVideoActionGroup"> + <annotations> + <description>Expands the 'Images And Videos' section on the Admin Product creation/edit page. Adds the provided Video to the Product. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="video" defaultValue="mftfTestProductVideo"/> + </arguments> + + <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> + <waitForElementVisible selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="waitForAddVideoButtonVisible" time="30"/> + <click selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="addVideo"/> + <waitForElementVisible selector=".modal-slide.mage-new-video-dialog.form-inline._show" stepKey="waitForUrlElementVisibleslide" time="30"/> + <waitForElementVisible selector="{{AdminProductNewVideoSection.videoUrlTextField}}" stepKey="waitForUrlElementVisible" time="60"/> + <fillField selector="{{AdminProductNewVideoSection.videoUrlTextField}}" userInput="{{video.videoUrl}}" stepKey="fillFieldVideoUrl"/> + <fillField selector="{{AdminProductNewVideoSection.videoTitleTextField}}" userInput="{{video.videoTitle}}" stepKey="fillFieldVideoTitle"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForElementNotVisible selector="{{AdminProductNewVideoSection.saveButtonDisabled}}" stepKey="waitForSaveButtonVisible" time="30"/> + <click selector="{{AdminProductNewVideoSection.saveButton}}" stepKey="saveVideo"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AdminProductVideoActionGroup.xml b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AdminProductVideoActionGroup.xml deleted file mode 100644 index 67a79e7f37adf..0000000000000 --- a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AdminProductVideoActionGroup.xml +++ /dev/null @@ -1,77 +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"> - <!-- Add video in Admin Product page --> - <actionGroup name="addProductVideo"> - <annotations> - <description>Expands the 'Images And Videos' section on the Admin Product creation/edit page. Adds the provided Video to the Product. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="video" defaultValue="mftfTestProductVideo"/> - </arguments> - - <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> - <waitForElementVisible selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="waitForAddVideoButtonVisible" time="30"/> - <click selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="addVideo"/> - <waitForElementVisible selector=".modal-slide.mage-new-video-dialog.form-inline._show" stepKey="waitForUrlElementVisibleslide" time="30"/> - <waitForElementVisible selector="{{AdminProductNewVideoSection.videoUrlTextField}}" stepKey="waitForUrlElementVisible" time="60"/> - <fillField selector="{{AdminProductNewVideoSection.videoUrlTextField}}" userInput="{{video.videoUrl}}" stepKey="fillFieldVideoUrl"/> - <fillField selector="{{AdminProductNewVideoSection.videoTitleTextField}}" userInput="{{video.videoTitle}}" stepKey="fillFieldVideoTitle"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <waitForElementNotVisible selector="{{AdminProductNewVideoSection.saveButtonDisabled}}" stepKey="waitForSaveButtonVisible" time="30"/> - <click selector="{{AdminProductNewVideoSection.saveButton}}" stepKey="saveVideo"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/> - </actionGroup> - - <!-- Remove video in Admin Product page --> - <actionGroup name="removeProductVideo"> - <annotations> - <description>Expands the 'Images And Videos' section on the Admin Product creation/edit page. Clicks on the Remove Video button.</description> - </annotations> - - <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> - <waitForElementVisible selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="waitForAddVideoButtonVisible" time="30"/> - <click selector="{{AdminProductImagesSection.removeVideoButton}}" stepKey="removeVideo"/> - </actionGroup> - - <!-- Assert product video in Admin Product page --> - <actionGroup name="assertProductVideoAdminProductPage"> - <annotations> - <description>Validates that the provided Video is present on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="video" defaultValue="mftfTestProductVideo"/> - </arguments> - - <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <seeElement selector="{{AdminProductImagesSection.videoTitleText(video.videoShortTitle)}}" stepKey="seeVideoTitle"/> - <seeElementInDOM selector="{{AdminProductImagesSection.videoUrlHiddenField(video.videoUrl)}}" stepKey="seeVideoItem"/> - </actionGroup> - - <!-- Assert product video not in Admin Product page --> - <actionGroup name="assertProductVideoNotInAdminProductPage"> - <annotations> - <description>Validates that the provided Video is NOT present on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="video" defaultValue="mftfTestProductVideo"/> - </arguments> - - <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <dontSeeElement selector="{{AdminProductImagesSection.videoTitleText(video.videoShortTitle)}}" stepKey="seeVideoTitle"/> - <dontSeeElementInDOM selector="{{AdminProductImagesSection.videoUrlHiddenField(video.videoUrl)}}" stepKey="seeVideoItem"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoAdminProductPageActionGroup.xml b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoAdminProductPageActionGroup.xml new file mode 100644 index 0000000000000..bda0b9532f2a1 --- /dev/null +++ b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoAdminProductPageActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AssertProductVideoAdminProductPageActionGroup"> + <annotations> + <description>Validates that the provided Video is present on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="video" defaultValue="mftfTestProductVideo"/> + </arguments> + + <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <seeElement selector="{{AdminProductImagesSection.videoTitleText(video.videoShortTitle)}}" stepKey="seeVideoTitle"/> + <seeElementInDOM selector="{{AdminProductImagesSection.videoUrlHiddenField(video.videoUrl)}}" stepKey="seeVideoItem"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNotInAdminProductPageActionGroup.xml b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNotInAdminProductPageActionGroup.xml new file mode 100644 index 0000000000000..3a10c096222b8 --- /dev/null +++ b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNotInAdminProductPageActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AssertProductVideoNotInAdminProductPageActionGroup"> + <annotations> + <description>Validates that the provided Video is NOT present on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="video" defaultValue="mftfTestProductVideo"/> + </arguments> + + <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <dontSeeElement selector="{{AdminProductImagesSection.videoTitleText(video.videoShortTitle)}}" stepKey="seeVideoTitle"/> + <dontSeeElementInDOM selector="{{AdminProductImagesSection.videoUrlHiddenField(video.videoUrl)}}" stepKey="seeVideoItem"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNotInStorefrontProductPageActionGroup.xml b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNotInStorefrontProductPageActionGroup.xml new file mode 100644 index 0000000000000..22666ad0eddcf --- /dev/null +++ b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoNotInStorefrontProductPageActionGroup.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="AssertProductVideoNotInStorefrontProductPageActionGroup"> + <annotations> + <description>Validates that the provided Video is NOT present on the Storefront Product page.</description> + </annotations> + <arguments> + <argument name="dataTypeAttribute" defaultValue="'youtube'"/> + </arguments> + + <dontSeeElement selector="{{StorefrontProductInfoMainSection.productVideo(dataTypeAttribute)}}" stepKey="dontSeeProductVideoDataType"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/StorefrontProductVideoActionGroup.xml b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoStorefrontProductPageActionGroup.xml similarity index 56% rename from app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/StorefrontProductVideoActionGroup.xml rename to app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoStorefrontProductPageActionGroup.xml index e2cdac9ec9287..c2bb4e016147a 100644 --- a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/StorefrontProductVideoActionGroup.xml +++ b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/AssertProductVideoStorefrontProductPageActionGroup.xml @@ -9,7 +9,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <!--Assert product video in Storefront Product page --> - <actionGroup name="assertProductVideoStorefrontProductPage"> + <actionGroup name="AssertProductVideoStorefrontProductPageActionGroup"> <annotations> <description>Validates that the provided Video is present on the Storefront Product page.</description> </annotations> @@ -19,16 +19,4 @@ <seeElement selector="{{StorefrontProductInfoMainSection.productVideo(dataTypeAttribute)}}" stepKey="seeProductVideoDataType"/> </actionGroup> - - <!--Assert product video not in Storefront Product page --> - <actionGroup name="assertProductVideoNotInStorefrontProductPage"> - <annotations> - <description>Validates that the provided Video is NOT present on the Storefront Product page.</description> - </annotations> - <arguments> - <argument name="dataTypeAttribute" defaultValue="'youtube'"/> - </arguments> - - <dontSeeElement selector="{{StorefrontProductInfoMainSection.productVideo(dataTypeAttribute)}}" stepKey="dontSeeProductVideoDataType"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/RemoveProductVideoActionGroup.xml b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/RemoveProductVideoActionGroup.xml new file mode 100644 index 0000000000000..5666d51082543 --- /dev/null +++ b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/RemoveProductVideoActionGroup.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="RemoveProductVideoActionGroup"> + <annotations> + <description>Expands the 'Images And Videos' section on the Admin Product creation/edit page. Clicks on the Remove Video button.</description> + </annotations> + + <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> + <waitForElementVisible selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="waitForAddVideoButtonVisible" time="30"/> + <click selector="{{AdminProductImagesSection.removeVideoButton}}" stepKey="removeVideo"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml b/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml index 2b5f87f78d5e5..c2b92e6af452a 100644 --- a/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml +++ b/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml @@ -22,12 +22,12 @@ </after> <!-- Add product video --> - <actionGroup ref="addProductVideo" stepKey="addProductVideo" after="fillMainProductForm"/> + <actionGroup ref="AddProductVideoActionGroup" stepKey="addProductVideo" after="fillMainProductForm"/> <!-- Assert product video in admin product form --> - <actionGroup ref="assertProductVideoAdminProductPage" stepKey="assertProductVideoAdminProductPage" after="saveProductForm"/> + <actionGroup ref="AssertProductVideoAdminProductPageActionGroup" stepKey="assertProductVideoAdminProductPage" after="saveProductForm"/> <!-- Assert product video in storefront product page --> - <actionGroup ref="assertProductVideoStorefrontProductPage" stepKey="assertProductVideoStorefrontProductPage" after="AssertProductInStorefrontProductPage"/> + <actionGroup ref="AssertProductVideoStorefrontProductPageActionGroup" stepKey="assertProductVideoStorefrontProductPage" after="AssertProductInStorefrontProductPage"/> </test> </tests> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml b/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml index d4da0ffa54451..c674f12115334 100644 --- a/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml +++ b/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml @@ -22,15 +22,15 @@ </after> <!-- Add product video --> - <actionGroup ref="addProductVideo" stepKey="addProductVideo" after="fillMainProductForm"/> + <actionGroup ref="AddProductVideoActionGroup" stepKey="addProductVideo" after="fillMainProductForm"/> <!-- Remove product video --> - <actionGroup ref="removeProductVideo" stepKey="removeProductVideo" after="saveProductForm"/> + <actionGroup ref="RemoveProductVideoActionGroup" stepKey="removeProductVideo" after="saveProductForm"/> <!-- Assert product video not in admin product form --> - <actionGroup ref="assertProductVideoNotInAdminProductPage" stepKey="assertProductVideoNotInAdminProductPage" after="saveProductFormAfterRemove"/> + <actionGroup ref="AssertProductVideoNotInAdminProductPageActionGroup" stepKey="assertProductVideoNotInAdminProductPage" after="saveProductFormAfterRemove"/> <!-- Assert product video not in storefront product page --> - <actionGroup ref="assertProductVideoNotInStorefrontProductPage" stepKey="assertProductVideoNotInStorefrontProductPage" after="AssertProductInStorefrontProductPage"/> + <actionGroup ref="AssertProductVideoNotInStorefrontProductPageActionGroup" stepKey="assertProductVideoNotInStorefrontProductPage" after="AssertProductInStorefrontProductPage"/> </test> </tests> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml b/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml index 7249a4223503e..a550471715018 100644 --- a/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml +++ b/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml @@ -42,9 +42,9 @@ <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openFirstProductForEdit"/> <!-- Add product video --> - <actionGroup ref="addProductVideo" stepKey="addProductVideo" after="openFirstProductForEdit"/> + <actionGroup ref="AddProductVideoActionGroup" stepKey="addProductVideo" after="openFirstProductForEdit"/> <!-- Assert product video in admin product form --> - <actionGroup ref="assertProductVideoAdminProductPage" stepKey="assertProductVideoAdminProductPage" after="addProductVideo"/> + <actionGroup ref="AssertProductVideoAdminProductPageActionGroup" stepKey="assertProductVideoAdminProductPage" after="addProductVideo"/> <!-- Save the product --> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveFirstProduct"/> @@ -53,7 +53,7 @@ <!-- Assert product video in storefront product page --> <amOnPage url="$$createProduct.name$$.html" stepKey="goToStorefrontCategoryPage"/> <waitForPageLoad stepKey="waitForStorefrontPageLoaded"/> - <actionGroup ref="assertProductVideoStorefrontProductPage" stepKey="assertProductVideoStorefrontProductPage" after="waitForStorefrontPageLoaded"/> + <actionGroup ref="AssertProductVideoStorefrontProductPageActionGroup" stepKey="assertProductVideoStorefrontProductPage" after="waitForStorefrontPageLoaded"/> <!--Click Play video button--> <click stepKey="clickToPlayVideo" selector="{{StorefrontProductInfoMainSection.clickInVideo}}"/> From f1781b6d5c9a18fc4eda5e1e45cde96c62aa1651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 17:23:47 +0100 Subject: [PATCH 322/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...efrontWithRememberMeCheckedActionGroup.xml | 18 +++++++++ ...rontWithRememberMeUnCheckedActionGroup.xml | 18 +++++++++ ...tentCustomerWelcomeMessageActionGroup.xml} | 5 --- ...merWelcomeMessageNotPresentActionGroup.xml | 15 +++++++ ...RegisterPageDoNotRememberMeActionGroup.xml | 18 +++++++++ .../StorefrontCustomerActionGroup.xml | 40 ------------------- ...tRegisterCustomerRememberMeActionGroup.xml | 17 ++++++++ 7 files changed, 86 insertions(+), 45 deletions(-) create mode 100644 app/code/Magento/Persistent/Test/Mftf/ActionGroup/CustomerLoginOnStorefrontWithRememberMeCheckedActionGroup.xml create mode 100644 app/code/Magento/Persistent/Test/Mftf/ActionGroup/CustomerLoginOnStorefrontWithRememberMeUnCheckedActionGroup.xml rename app/code/Magento/Persistent/Test/Mftf/ActionGroup/{StorefrontPersistentAssertCustomerWelcomeMessageActionGroup.xml => StorefrontAssertPersistentCustomerWelcomeMessageActionGroup.xml} (64%) create mode 100644 app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontAssertPersistentCustomerWelcomeMessageNotPresentActionGroup.xml create mode 100644 app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCreateCustomerOnRegisterPageDoNotRememberMeActionGroup.xml delete mode 100644 app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCustomerActionGroup.xml create mode 100644 app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontRegisterCustomerRememberMeActionGroup.xml diff --git a/app/code/Magento/Persistent/Test/Mftf/ActionGroup/CustomerLoginOnStorefrontWithRememberMeCheckedActionGroup.xml b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/CustomerLoginOnStorefrontWithRememberMeCheckedActionGroup.xml new file mode 100644 index 0000000000000..6a28829034611 --- /dev/null +++ b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/CustomerLoginOnStorefrontWithRememberMeCheckedActionGroup.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="CustomerLoginOnStorefrontWithRememberMeCheckedActionGroup" extends="LoginToStorefrontActionGroup"> + <annotations> + <description>EXTENDS: LoginToStorefrontActionGroup. Checks the 'Remember Me' checkbox.</description> + </annotations> + + <checkOption selector="{{StorefrontCustomerSignInFormSection.rememberMe}}" before="clickSignInAccountButton" stepKey="checkRememberMe"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Persistent/Test/Mftf/ActionGroup/CustomerLoginOnStorefrontWithRememberMeUnCheckedActionGroup.xml b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/CustomerLoginOnStorefrontWithRememberMeUnCheckedActionGroup.xml new file mode 100644 index 0000000000000..080dde1f60f93 --- /dev/null +++ b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/CustomerLoginOnStorefrontWithRememberMeUnCheckedActionGroup.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="CustomerLoginOnStorefrontWithRememberMeUnCheckedActionGroup" extends="LoginToStorefrontActionGroup"> + <annotations> + <description>EXTENDS: LoginToStorefrontActionGroup. Uncheck the 'Remember Me' checkbox.</description> + </annotations> + + <uncheckOption selector="{{StorefrontCustomerSignInFormSection.rememberMe}}" before="clickSignInAccountButton" stepKey="unCheckRememberMe"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontPersistentAssertCustomerWelcomeMessageActionGroup.xml b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontAssertPersistentCustomerWelcomeMessageActionGroup.xml similarity index 64% rename from app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontPersistentAssertCustomerWelcomeMessageActionGroup.xml rename to app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontAssertPersistentCustomerWelcomeMessageActionGroup.xml index b081f5c3eb0c8..54105dc0d31ad 100644 --- a/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontPersistentAssertCustomerWelcomeMessageActionGroup.xml +++ b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontAssertPersistentCustomerWelcomeMessageActionGroup.xml @@ -15,9 +15,4 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <see selector="{{StorefrontPanelHeaderSection.welcomeMessage}}" userInput="Welcome, {{customerFullName}}! Not you?" stepKey="verifyMessage" /> </actionGroup> - - <actionGroup name="StorefrontAssertPersistentCustomerWelcomeMessageNotPresentActionGroup" extends="StorefrontAssertPersistentCustomerWelcomeMessageActionGroup"> - <remove keyForRemoval="verifyMessage"/> - <dontSee selector="{{StorefrontPanelHeaderSection.welcomeMessage}}" userInput="Welcome, {{customerFullName}}! Not you?" stepKey="dontSeeWelcomeMessageNotYou"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontAssertPersistentCustomerWelcomeMessageNotPresentActionGroup.xml b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontAssertPersistentCustomerWelcomeMessageNotPresentActionGroup.xml new file mode 100644 index 0000000000000..3aa0c4d9c0de5 --- /dev/null +++ b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontAssertPersistentCustomerWelcomeMessageNotPresentActionGroup.xml @@ -0,0 +1,15 @@ +<?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="StorefrontAssertPersistentCustomerWelcomeMessageNotPresentActionGroup" extends="StorefrontAssertPersistentCustomerWelcomeMessageActionGroup"> + <remove keyForRemoval="verifyMessage"/> + <dontSee selector="{{StorefrontPanelHeaderSection.welcomeMessage}}" userInput="Welcome, {{customerFullName}}! Not you?" stepKey="dontSeeWelcomeMessageNotYou"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCreateCustomerOnRegisterPageDoNotRememberMeActionGroup.xml b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCreateCustomerOnRegisterPageDoNotRememberMeActionGroup.xml new file mode 100644 index 0000000000000..75ca7bca24dce --- /dev/null +++ b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCreateCustomerOnRegisterPageDoNotRememberMeActionGroup.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="StorefrontCreateCustomerOnRegisterPageDoNotRememberMeActionGroup" extends="SignUpNewUserFromStorefrontActionGroup"> + <!--- Assume we are on customer registration page. --> + <remove keyForRemoval="amOnStorefrontPage"/> + <remove keyForRemoval="clickOnCreateAccountLink"/> + <uncheckOption selector="{{StorefrontCustomerSignInFormSection.rememberMe}}" before="clickCreateAccountButton" stepKey="unCheckRememberMe"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCustomerActionGroup.xml b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCustomerActionGroup.xml deleted file mode 100644 index 70d5be2dcf23f..0000000000000 --- a/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCustomerActionGroup.xml +++ /dev/null @@ -1,40 +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="CustomerLoginOnStorefrontWithRememberMeChecked" extends="LoginToStorefrontActionGroup"> - <annotations> - <description>EXTENDS: LoginToStorefrontActionGroup. Checks the 'Remember Me' checkbox.</description> - </annotations> - - <checkOption selector="{{StorefrontCustomerSignInFormSection.rememberMe}}" before="clickSignInAccountButton" stepKey="checkRememberMe"/> - </actionGroup> - - <actionGroup name="CustomerLoginOnStorefrontWithRememberMeUnChecked" extends="LoginToStorefrontActionGroup"> - <annotations> - <description>EXTENDS: LoginToStorefrontActionGroup. Uncheck the 'Remember Me' checkbox.</description> - </annotations> - - <uncheckOption selector="{{StorefrontCustomerSignInFormSection.rememberMe}}" before="clickSignInAccountButton" stepKey="unCheckRememberMe"/> - </actionGroup> - - <actionGroup name="StorefrontRegisterCustomerRememberMe" extends="SignUpNewUserFromStorefrontActionGroup"> - <!--- Assume we are on customer registration page. --> - <remove keyForRemoval="amOnStorefrontPage"/> - <remove keyForRemoval="clickOnCreateAccountLink"/> - <checkOption selector="{{StorefrontCustomerSignInFormSection.rememberMe}}" before="clickCreateAccountButton" stepKey="checkRememberMe"/> - </actionGroup> - - <actionGroup name="StorefrontCreateCustomerOnRegisterPageDoNotRememberMe" extends="SignUpNewUserFromStorefrontActionGroup"> - <!--- Assume we are on customer registration page. --> - <remove keyForRemoval="amOnStorefrontPage"/> - <remove keyForRemoval="clickOnCreateAccountLink"/> - <uncheckOption selector="{{StorefrontCustomerSignInFormSection.rememberMe}}" before="clickCreateAccountButton" stepKey="unCheckRememberMe"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontRegisterCustomerRememberMeActionGroup.xml b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontRegisterCustomerRememberMeActionGroup.xml new file mode 100644 index 0000000000000..44cdb341b2b10 --- /dev/null +++ b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontRegisterCustomerRememberMeActionGroup.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="StorefrontRegisterCustomerRememberMeActionGroup" extends="SignUpNewUserFromStorefrontActionGroup"> + <!--- Assume we are on customer registration page. --> + <remove keyForRemoval="amOnStorefrontPage"/> + <remove keyForRemoval="clickOnCreateAccountLink"/> + <checkOption selector="{{StorefrontCustomerSignInFormSection.rememberMe}}" before="clickCreateAccountButton" stepKey="checkRememberMe"/> + </actionGroup> +</actionGroups> From b082a86ec685cbd88a112d8848e99bea2d683ff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 17:28:23 +0100 Subject: [PATCH 323/595] FIX: Invalid references to ActionGroups after extracting --- ...CreateCustomerOnRegisterPageDoNotRememberMeActionGroup.xml | 1 - .../Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml | 2 +- ...frontCorrectWelcomeMessageAfterCustomerIsLoggedOutTest.xml | 4 ++-- ...ntVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCreateCustomerOnRegisterPageDoNotRememberMeActionGroup.xml b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCreateCustomerOnRegisterPageDoNotRememberMeActionGroup.xml index 75ca7bca24dce..9c8f04bf6292a 100644 --- a/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCreateCustomerOnRegisterPageDoNotRememberMeActionGroup.xml +++ b/app/code/Magento/Persistent/Test/Mftf/ActionGroup/StorefrontCreateCustomerOnRegisterPageDoNotRememberMeActionGroup.xml @@ -1,4 +1,3 @@ - <?xml version="1.0" encoding="UTF-8"?> <!-- /** diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml index d508ebaa26885..add7f8a8bc0f8 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml @@ -40,7 +40,7 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!--Step 1: Login as a Customer with remember me checked--> - <actionGroup ref="CustomerLoginOnStorefrontWithRememberMeChecked" stepKey="loginToStorefrontAccountWithRememberMeChecked"> + <actionGroup ref="CustomerLoginOnStorefrontWithRememberMeCheckedActionGroup" stepKey="loginToStorefrontAccountWithRememberMeChecked"> <argument name="Customer" value="$$createCustomer$$"/> </actionGroup> <!--Step 2: Open the Product Page and add the product to shopping cart--> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontCorrectWelcomeMessageAfterCustomerIsLoggedOutTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontCorrectWelcomeMessageAfterCustomerIsLoggedOutTest.xml index 61710cbc98082..b41cad61c93a5 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontCorrectWelcomeMessageAfterCustomerIsLoggedOutTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontCorrectWelcomeMessageAfterCustomerIsLoggedOutTest.xml @@ -43,7 +43,7 @@ <deleteData createDataKey="createCustomerForPersistent" stepKey="deleteCustomerForPersistent"/> </after> <!--Login as a Customer with remember me unchecked--> - <actionGroup ref="CustomerLoginOnStorefrontWithRememberMeUnChecked" stepKey="loginToStorefrontAccountWithRememberMeUnchecked"> + <actionGroup ref="CustomerLoginOnStorefrontWithRememberMeUnCheckedActionGroup" stepKey="loginToStorefrontAccountWithRememberMeUnchecked"> <argument name="Customer" value="$$createCustomer$$"/> </actionGroup> @@ -60,7 +60,7 @@ stepKey="seeDefaultWelcomeMessage"/> <!--Login as a Customer with remember me checked--> - <actionGroup ref="CustomerLoginOnStorefrontWithRememberMeChecked" stepKey="loginToStorefrontAccountWithRememberMeChecked"> + <actionGroup ref="CustomerLoginOnStorefrontWithRememberMeCheckedActionGroup" stepKey="loginToStorefrontAccountWithRememberMeChecked"> <argument name="Customer" value="$$createCustomerForPersistent$$"/> </actionGroup> <!--Check customer name and last name in welcome message--> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml index e50fc4af83107..e80ff5b031125 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml @@ -54,7 +54,7 @@ <actionGroup ref="StorefrontAssertPersistentRegistrationPageFields" stepKey="assertPersistentRegistrationPageFields"/> <!-- 2. Fill fields for registration, set password and unselect the Remember Me checkbox--> - <actionGroup ref="StorefrontCreateCustomerOnRegisterPageDoNotRememberMe" stepKey="registrationJohnSmithCustomer"> + <actionGroup ref="StorefrontCreateCustomerOnRegisterPageDoNotRememberMeActionGroup" stepKey="registrationJohnSmithCustomer"> <argument name="Customer" value="John_Smith_Customer"/> </actionGroup> <!--Check customer name and last name in welcome message--> @@ -83,7 +83,7 @@ <!-- 5. Click the Create an Account link again and fill fields for registration of another customer, set password and check the Remember Me checkbox --> <amOnPage url="{{StorefrontCustomerCreatePage.url}}" stepKey="amOnCustomerAccountCreatePage"/> - <actionGroup ref="StorefrontRegisterCustomerRememberMe" stepKey="registrationJohnDoeCustomer"> + <actionGroup ref="StorefrontRegisterCustomerRememberMeActionGroup" stepKey="registrationJohnDoeCustomer"> <argument name="Customer" value="Simple_Customer_Without_Address"/> </actionGroup> <!--Check customer name and last name in welcome message--> From 59758da8a9ddb601abba21db21e5009da2b1d531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 17:52:38 +0100 Subject: [PATCH 324/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../AddProductToCheckoutPageActionGroup.xml | 35 ++++++ ...leOptionPayPalConfigurationActionGroup.xml | 29 +++++ ...ConfigPayPalExpressCheckoutActionGroup.xml | 35 ++++++ ...erWithSelectedPaymentMethodActionGroup.xml | 44 +++++++ .../EnablePayPalConfigurationActionGroup.xml | 31 +++++ ...lePayPalSolutionWithoutSaveActionGroup.xml | 26 ++++ .../OtherPayPalConfigurationActionGroup.xml | 64 ---------- ...xpressCheckoutConfigurationActionGroup.xml | 118 ------------------ ...ConfigPayPalExpressCheckoutActionGroup.xml | 34 +++++ ...figPaymentsConflictResolutionForPayPal.xml | 74 +++++------ ...ayPalSolutionsEnabledAtTheSameTimeTest.xml | 4 +- ...rontCheckCreditButtonConfigurationTest.xml | 2 +- 12 files changed, 274 insertions(+), 222 deletions(-) create mode 100644 app/code/Magento/Paypal/Test/Mftf/ActionGroup/AddProductToCheckoutPageActionGroup.xml create mode 100644 app/code/Magento/Paypal/Test/Mftf/ActionGroup/CheckEnableOptionPayPalConfigurationActionGroup.xml create mode 100644 app/code/Magento/Paypal/Test/Mftf/ActionGroup/ConfigPayPalExpressCheckoutActionGroup.xml create mode 100644 app/code/Magento/Paypal/Test/Mftf/ActionGroup/CreatePayPalOrderWithSelectedPaymentMethodActionGroup.xml create mode 100644 app/code/Magento/Paypal/Test/Mftf/ActionGroup/EnablePayPalConfigurationActionGroup.xml create mode 100644 app/code/Magento/Paypal/Test/Mftf/ActionGroup/EnablePayPalSolutionWithoutSaveActionGroup.xml delete mode 100644 app/code/Magento/Paypal/Test/Mftf/ActionGroup/OtherPayPalConfigurationActionGroup.xml delete mode 100644 app/code/Magento/Paypal/Test/Mftf/ActionGroup/PayPalExpressCheckoutConfigurationActionGroup.xml create mode 100644 app/code/Magento/Paypal/Test/Mftf/ActionGroup/SampleConfigPayPalExpressCheckoutActionGroup.xml diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AddProductToCheckoutPageActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AddProductToCheckoutPageActionGroup.xml new file mode 100644 index 0000000000000..bf2643fc535f7 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AddProductToCheckoutPageActionGroup.xml @@ -0,0 +1,35 @@ +<?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="AddProductToCheckoutPageActionGroup"> + <annotations> + <description>Goes to the provided Category page on the Storefront. Adds the 1st Product to the Cart. Goes to Checkout. Select the Shipping Method. Selects PayPal as the Payment Method.</description> + </annotations> + <arguments> + <argument name="Category"/> + </arguments> + + <amOnPage url="{{StorefrontCategoryPage.url(Category.name)}}" stepKey="onCategoryPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverProduct"/> + <click selector="{{StorefrontCategoryMainSection.AddToCartBtn}}" stepKey="addToCart"/> + <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="waitForProductAdded"/> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/> + <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + <click selector="{{CheckoutShippingMethodsSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask2"/> + <waitForElement selector="{{CheckoutShippingMethodsSection.next}}" time="30" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext"/> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPlaceOrderButton"/> + <click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="clickPayPalCheckbox"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/CheckEnableOptionPayPalConfigurationActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/CheckEnableOptionPayPalConfigurationActionGroup.xml new file mode 100644 index 0000000000000..6fe01799c5422 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/CheckEnableOptionPayPalConfigurationActionGroup.xml @@ -0,0 +1,29 @@ +<?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="CheckEnableOptionPayPalConfigurationActionGroup"> + <annotations> + <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code.</description> + </annotations> + <arguments> + <argument name="payPalConfigType"/> + <argument name="enabledOption" type="string"/> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + + <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> + <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> + <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> + <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn1"/> + <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> + <seeOptionIsSelected selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="{{enabledOption}}" stepKey="seeSelectedOption"/> + <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/ConfigPayPalExpressCheckoutActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/ConfigPayPalExpressCheckoutActionGroup.xml new file mode 100644 index 0000000000000..90f0a25a8cd69 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/ConfigPayPalExpressCheckoutActionGroup.xml @@ -0,0 +1,35 @@ +<?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="ConfigPayPalExpressCheckoutActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Payment Methods'. Fills in the provided PayPal credentials and other details. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="credentials" defaultValue="_CREDS"/> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/> + <waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="waitForAdvancedSettingTab"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.email(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_business_account}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/> + <selectOption selector ="{{PayPalExpressCheckoutConfigSection.apiMethod(countryCode)}}" userInput="API Signature" stepKey="inputAPIAuthenticationMethods"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.username(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_username}}" stepKey="inputAPIUsername"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.password(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_password}}" stepKey="inputAPIPassword"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.signature(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_signature}}" stepKey="inputAPISignature"/> + <selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode(countryCode)}}" userInput="Yes" stepKey="enableSandboxMode"/> + <selectOption selector="{{PayPalExpressCheckoutConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_merchant_id}}" stepKey="inputMerchantID"/> + <!--Save configuration--> + <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/CreatePayPalOrderWithSelectedPaymentMethodActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/CreatePayPalOrderWithSelectedPaymentMethodActionGroup.xml new file mode 100644 index 0000000000000..49ebe90418436 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/CreatePayPalOrderWithSelectedPaymentMethodActionGroup.xml @@ -0,0 +1,44 @@ +<?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="CreatePayPalOrderWithSelectedPaymentMethodActionGroup" extends="CreateOrderToPrintPageActionGroup"> + <annotations> + <description>EXTENDS: CreateOrderToPrintPageActionGroup. Clicks on PayPal. Fills the PayPay details in the modal. PLEASE NOTE: The PayPal Payment credentials are Hardcoded using 'Payer'.</description> + </annotations> + <arguments> + <argument name="payerName" defaultValue="MPI" type="string"/> + <argument name="credentials" defaultValue="_CREDS"/> + </arguments> + + <!-- click on PayPal payment radio button --> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPlaceOrderButton"/> + <click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="clickPlaceOrder"/> + + <!--set ID for iframe of PayPal group button--> + <executeJS function="jQuery('.zoid-component-frame.zoid-visible').attr('id', 'myIframe')" stepKey="clickOrderLink"/> + + <!--switch to iframe of PayPal group button--> + <switchToIFrame userInput="myIframe" stepKey="clickPrintOrderLink"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.PayPalBtn}}" stepKey="waitForPayPalBtn"/> + <click selector="{{CheckoutPaymentSection.PayPalBtn}}" stepKey="clickPayPalBtn"/> + <switchToIFrame stepKey="switchBack1"/> + + <!--Check in-context--> + <switchToNextTab stepKey="switchToInContentTab"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <seeCurrentUrlMatches regex="~\//www.sandbox.paypal.com/~" stepKey="seeCurrentUrlMatchesConfigPath1"/> + <waitForElement selector="{{PayPalPaymentSection.email}}" stepKey="waitForLoginForm" /> + <fillField selector="{{PayPalPaymentSection.email}}" userInput="{{credentials.magento/paypal_sandbox_login_email}}" stepKey="fillEmail"/> + <fillField selector="{{PayPalPaymentSection.password}}" userInput="{{credentials.magento/paypal_sandbox_login_password}}" stepKey="fillPassword"/> + <click selector="{{PayPalPaymentSection.loginBtn}}" stepKey="login"/> + <waitForPageLoad stepKey="wait"/> + <see userInput="{{payerName}}" selector="{{PayPalPaymentSection.reviewUserInfo}}" stepKey="seePayerName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/EnablePayPalConfigurationActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/EnablePayPalConfigurationActionGroup.xml new file mode 100644 index 0000000000000..b653858f770e9 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/EnablePayPalConfigurationActionGroup.xml @@ -0,0 +1,31 @@ +<?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="EnablePayPalConfigurationActionGroup"> + <annotations> + <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code.</description> + </annotations> + <arguments> + <argument name="payPalConfigType"/> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + + <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> + <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> + <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> + <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn"/> + <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> + <selectOption selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableWPSExpressSolution"/> + <seeInPopup userInput="There is already another PayPal solution enabled. Enable this solution instead?" stepKey="seeAlertMessage"/> + <acceptPopup stepKey="acceptEnablePopUp"/> + <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/EnablePayPalSolutionWithoutSaveActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/EnablePayPalSolutionWithoutSaveActionGroup.xml new file mode 100644 index 0000000000000..51b70b10a8827 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/EnablePayPalSolutionWithoutSaveActionGroup.xml @@ -0,0 +1,26 @@ +<?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="EnablePayPalSolutionWithoutSaveActionGroup" > + <annotations> + <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code without saving.</description> + </annotations> + <arguments> + <argument name="payPalConfigType"/> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> + <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> + <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> + <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn"/> + <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> + <selectOption selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableWPSExpressSolution"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/OtherPayPalConfigurationActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/OtherPayPalConfigurationActionGroup.xml deleted file mode 100644 index c3e99854ce3ac..0000000000000 --- a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/OtherPayPalConfigurationActionGroup.xml +++ /dev/null @@ -1,64 +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="EnablePayPalConfiguration"> - <annotations> - <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code.</description> - </annotations> - <arguments> - <argument name="payPalConfigType"/> - <argument name="countryCode" type="string" defaultValue="us"/> - </arguments> - - <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> - <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> - <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> - <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn"/> - <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> - <selectOption selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableWPSExpressSolution"/> - <seeInPopup userInput="There is already another PayPal solution enabled. Enable this solution instead?" stepKey="seeAlertMessage"/> - <acceptPopup stepKey="acceptEnablePopUp"/> - <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - </actionGroup> - <actionGroup name="EnablePayPalSolutionWithoutSave" > - <annotations> - <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code without saving.</description> - </annotations> - <arguments> - <argument name="payPalConfigType"/> - <argument name="countryCode" type="string" defaultValue="us"/> - </arguments> - <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> - <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> - <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> - <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn"/> - <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> - <selectOption selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableWPSExpressSolution"/> - </actionGroup> - <actionGroup name="CheckEnableOptionPayPalConfiguration"> - <annotations> - <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code.</description> - </annotations> - <arguments> - <argument name="payPalConfigType"/> - <argument name="enabledOption" type="string"/> - <argument name="countryCode" type="string" defaultValue="us"/> - </arguments> - - <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> - <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> - <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> - <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn1"/> - <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> - <seeOptionIsSelected selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="{{enabledOption}}" stepKey="seeSelectedOption"/> - <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn2"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/PayPalExpressCheckoutConfigurationActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/PayPalExpressCheckoutConfigurationActionGroup.xml deleted file mode 100644 index 4d752d8377640..0000000000000 --- a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/PayPalExpressCheckoutConfigurationActionGroup.xml +++ /dev/null @@ -1,118 +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="ConfigPayPalExpressCheckout"> - <annotations> - <description>Goes to the 'Configuration' page for 'Payment Methods'. Fills in the provided PayPal credentials and other details. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="credentials" defaultValue="_CREDS"/> - <argument name="countryCode" type="string" defaultValue="us"/> - </arguments> - - <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/> - <waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="waitForAdvancedSettingTab"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.email(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_business_account}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/> - <selectOption selector ="{{PayPalExpressCheckoutConfigSection.apiMethod(countryCode)}}" userInput="API Signature" stepKey="inputAPIAuthenticationMethods"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.username(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_username}}" stepKey="inputAPIUsername"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.password(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_password}}" stepKey="inputAPIPassword"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.signature(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_signature}}" stepKey="inputAPISignature"/> - <selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode(countryCode)}}" userInput="Yes" stepKey="enableSandboxMode"/> - <selectOption selector="{{PayPalExpressCheckoutConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_merchant_id}}" stepKey="inputMerchantID"/> - <!--Save configuration--> - <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> - </actionGroup> - - <actionGroup name="SampleConfigPayPalExpressCheckout"> - <annotations> - <description>Goes to the 'Configuration' page for 'Payment Methods'. Fills in the provided Sample PayPal credentials and other details. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="credentials" defaultValue="SamplePaypalExpressConfig"/> - <argument name="countryCode" type="string" defaultValue="us"/> - </arguments> - <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/> - <waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="waitForAdvancedSettingTab"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.email(countryCode)}}" userInput="{{credentials.paypal_express_email}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/> - <selectOption selector ="{{PayPalExpressCheckoutConfigSection.apiMethod(countryCode)}}" userInput="API Signature" stepKey="inputAPIAuthenticationMethods"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.username(countryCode)}}" userInput="{{credentials.paypal_express_api_username}}" stepKey="inputAPIUsername"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.password(countryCode)}}" userInput="{{credentials.paypal_express_api_password}}" stepKey="inputAPIPassword"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.signature(countryCode)}}" userInput="{{credentials.paypal_express_api_signature}}" stepKey="inputAPISignature"/> - <selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode(countryCode)}}" userInput="Yes" stepKey="enableSandboxMode"/> - <selectOption selector="{{PayPalExpressCheckoutConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID(countryCode)}}" userInput="{{credentials.paypal_express_merchantID}}" stepKey="inputMerchantID"/> - <!--Save configuration--> - <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> - </actionGroup> - - <actionGroup name="CreatePayPalOrderWithSelectedPaymentMethodActionGroup" extends="CreateOrderToPrintPageActionGroup"> - <annotations> - <description>EXTENDS: CreateOrderToPrintPageActionGroup. Clicks on PayPal. Fills the PayPay details in the modal. PLEASE NOTE: The PayPal Payment credentials are Hardcoded using 'Payer'.</description> - </annotations> - <arguments> - <argument name="payerName" defaultValue="MPI" type="string"/> - <argument name="credentials" defaultValue="_CREDS"/> - </arguments> - - <!-- click on PayPal payment radio button --> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="clickPlaceOrder"/> - - <!--set ID for iframe of PayPal group button--> - <executeJS function="jQuery('.zoid-component-frame.zoid-visible').attr('id', 'myIframe')" stepKey="clickOrderLink"/> - - <!--switch to iframe of PayPal group button--> - <switchToIFrame userInput="myIframe" stepKey="clickPrintOrderLink"/> - <waitForElementVisible selector="{{CheckoutPaymentSection.PayPalBtn}}" stepKey="waitForPayPalBtn"/> - <click selector="{{CheckoutPaymentSection.PayPalBtn}}" stepKey="clickPayPalBtn"/> - <switchToIFrame stepKey="switchBack1"/> - - <!--Check in-context--> - <switchToNextTab stepKey="switchToInContentTab"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <seeCurrentUrlMatches regex="~\//www.sandbox.paypal.com/~" stepKey="seeCurrentUrlMatchesConfigPath1"/> - <waitForElement selector="{{PayPalPaymentSection.email}}" stepKey="waitForLoginForm" /> - <fillField selector="{{PayPalPaymentSection.email}}" userInput="{{credentials.magento/paypal_sandbox_login_email}}" stepKey="fillEmail"/> - <fillField selector="{{PayPalPaymentSection.password}}" userInput="{{credentials.magento/paypal_sandbox_login_password}}" stepKey="fillPassword"/> - <click selector="{{PayPalPaymentSection.loginBtn}}" stepKey="login"/> - <waitForPageLoad stepKey="wait"/> - <see userInput="{{payerName}}" selector="{{PayPalPaymentSection.reviewUserInfo}}" stepKey="seePayerName"/> - </actionGroup> - - <actionGroup name="addProductToCheckoutPage"> - <annotations> - <description>Goes to the provided Category page on the Storefront. Adds the 1st Product to the Cart. Goes to Checkout. Select the Shipping Method. Selects PayPal as the Payment Method.</description> - </annotations> - <arguments> - <argument name="Category"/> - </arguments> - - <amOnPage url="{{StorefrontCategoryPage.url(Category.name)}}" stepKey="onCategoryPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverProduct"/> - <click selector="{{StorefrontCategoryMainSection.AddToCartBtn}}" stepKey="addToCart"/> - <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="waitForProductAdded"/> - <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/> - <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> - <click selector="{{CheckoutShippingMethodsSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask2"/> - <waitForElement selector="{{CheckoutShippingMethodsSection.next}}" time="30" stepKey="waitForNextButton"/> - <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext"/> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="clickPayPalCheckbox"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/SampleConfigPayPalExpressCheckoutActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/SampleConfigPayPalExpressCheckoutActionGroup.xml new file mode 100644 index 0000000000000..23d956c8e9b8f --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/SampleConfigPayPalExpressCheckoutActionGroup.xml @@ -0,0 +1,34 @@ +<?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="SampleConfigPayPalExpressCheckoutActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Payment Methods'. Fills in the provided Sample PayPal credentials and other details. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="credentials" defaultValue="SamplePaypalExpressConfig"/> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/> + <waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="waitForAdvancedSettingTab"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.email(countryCode)}}" userInput="{{credentials.paypal_express_email}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/> + <selectOption selector ="{{PayPalExpressCheckoutConfigSection.apiMethod(countryCode)}}" userInput="API Signature" stepKey="inputAPIAuthenticationMethods"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.username(countryCode)}}" userInput="{{credentials.paypal_express_api_username}}" stepKey="inputAPIUsername"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.password(countryCode)}}" userInput="{{credentials.paypal_express_api_password}}" stepKey="inputAPIPassword"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.signature(countryCode)}}" userInput="{{credentials.paypal_express_api_signature}}" stepKey="inputAPISignature"/> + <selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode(countryCode)}}" userInput="Yes" stepKey="enableSandboxMode"/> + <selectOption selector="{{PayPalExpressCheckoutConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID(countryCode)}}" userInput="{{credentials.paypal_express_merchantID}}" stepKey="inputMerchantID"/> + <!--Save configuration--> + <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/AdminConfigPaymentsConflictResolutionForPayPal.xml b/app/code/Magento/Paypal/Test/Mftf/Test/AdminConfigPaymentsConflictResolutionForPayPal.xml index cfc7d66ba23cf..e918a417dcfde 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/AdminConfigPaymentsConflictResolutionForPayPal.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/AdminConfigPaymentsConflictResolutionForPayPal.xml @@ -20,7 +20,7 @@ </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="SampleConfigPayPalExpressCheckout" stepKey="ConfigPayPalExpress"> + <actionGroup ref="SampleConfigPayPalExpressCheckoutActionGroup" stepKey="ConfigPayPalExpress"> <argument name="credentials" value="SamplePaypalExpressConfig"/> </actionGroup> </before> @@ -38,36 +38,36 @@ <waitForPageLoad stepKey="waitForPageLoad1"/> <!-- Enable WPS Express --> <comment userInput="Enable WPS Express" stepKey="enableWPSExpressComment"/> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableWPSExpress"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableWPSExpress"> <argument name="payPalConfigType" value="WPSExpressConfigSection"/> <argument name="countryCode" value="gb"/> </actionGroup> <!-- Check only the correct solution is enabled --> <comment userInput="Check only the correct solution is enabled" stepKey="checkOnlyTheCorrectSolutionIsEnabledComment1"/> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkPayPalExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkPayPalExpressIsDisabled"> <argument name="payPalConfigType" value="PayPalExpressCheckoutConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="gb"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsEnabled"> <argument name="payPalConfigType" value="WPSExpressConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="gb"/> </actionGroup> <!-- Enable Pro Hosted With Express Checkout --> <comment userInput="Enable Pro Hosted With Express Checkout" stepKey="enableProHostedWithExpressCheckoutComment"/> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableProHostedWithExpressCheckou"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableProHostedWithExpressCheckou"> <argument name="payPalConfigType" value="PaymentsProHostedWithExpressCheckoutConfigSection"/> <argument name="countryCode" value="gb"/> </actionGroup> <!-- Check only the correct solution is enabled --> <comment userInput="Check only the correct solution is enabled" stepKey="checkOnlyTheCorrectSolutionIsEnabledComment2"/> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsDisabled"> <argument name="payPalConfigType" value="WPSExpressConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="gb"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkProHostedIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkProHostedIsEnabled"> <argument name="payPalConfigType" value="PaymentsProHostedWithExpressCheckoutConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="gb"/> @@ -84,30 +84,30 @@ <group value="paypal"/> </annotations> <selectOption selector="{{PaymentsConfigSection.merchantCountry}}" userInput="Japan" stepKey="setMerchantCountry"/> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableWPSExpress"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableWPSExpress"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="countryCode" value="jp"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkPayPalExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkPayPalExpressIsDisabled"> <argument name="payPalConfigType" value="PayPalExpressCheckoutOtherCountryConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="jp"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsEnabled"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="jp"/> </actionGroup> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableProHostedWithExpressCheckou"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableProHostedWithExpressCheckou"> <argument name="payPalConfigType" value="WebsitePaymentsPlusConfigSection"/> <argument name="countryCode" value="jp"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsDisabled"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="jp"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkProHostedIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkProHostedIsEnabled"> <argument name="payPalConfigType" value="WebsitePaymentsPlusConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="jp"/> @@ -124,30 +124,30 @@ <group value="paypal"/> </annotations> <selectOption selector="{{PaymentsConfigSection.merchantCountry}}" userInput="France" stepKey="setMerchantCountry"/> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableWPSExpress"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableWPSExpress"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="countryCode" value="fr"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkPayPalExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkPayPalExpressIsDisabled"> <argument name="payPalConfigType" value="PayPalExpressCheckoutOtherCountryConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="fr"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsEnabled"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="fr"/> </actionGroup> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableProHostedWithExpressCheckou"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableProHostedWithExpressCheckou"> <argument name="payPalConfigType" value="WebsitePaymentsPlusConfigSection"/> <argument name="countryCode" value="fr"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsDisabled"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="fr"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkProHostedIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkProHostedIsEnabled"> <argument name="payPalConfigType" value="WebsitePaymentsPlusConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="fr"/> @@ -164,30 +164,30 @@ <group value="paypal"/> </annotations> <selectOption selector="{{PaymentsConfigSection.merchantCountry}}" userInput="Hong Kong SAR China" stepKey="setMerchantCountry"/> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableWPSExpress"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableWPSExpress"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="countryCode" value="hk"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkPayPalExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkPayPalExpressIsDisabled"> <argument name="payPalConfigType" value="PayPalExpressCheckoutOtherCountryConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="hk"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsEnabled"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="hk"/> </actionGroup> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableProHostedWithExpressCheckou"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableProHostedWithExpressCheckou"> <argument name="payPalConfigType" value="WebsitePaymentsPlusConfigSection"/> <argument name="countryCode" value="hk"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsDisabled"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="hk"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkProHostedIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkProHostedIsEnabled"> <argument name="payPalConfigType" value="WebsitePaymentsPlusConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="hk"/> @@ -204,30 +204,30 @@ <group value="paypal"/> </annotations> <selectOption selector="{{PaymentsConfigSection.merchantCountry}}" userInput="Italy" stepKey="setMerchantCountry"/> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableWPSExpress"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableWPSExpress"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="countryCode" value="it"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkPayPalExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkPayPalExpressIsDisabled"> <argument name="payPalConfigType" value="PayPalExpressCheckoutOtherCountryConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="it"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsEnabled"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="it"/> </actionGroup> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableProHostedWithExpressCheckou"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableProHostedWithExpressCheckou"> <argument name="payPalConfigType" value="WebsitePaymentsPlusConfigSection"/> <argument name="countryCode" value="it"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsDisabled"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="it"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkProHostedIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkProHostedIsEnabled"> <argument name="payPalConfigType" value="WebsitePaymentsPlusConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="it"/> @@ -244,30 +244,30 @@ <group value="paypal"/> </annotations> <selectOption selector="{{PaymentsConfigSection.merchantCountry}}" userInput="Spain" stepKey="setMerchantCountry"/> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableWPSExpress"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableWPSExpress"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="countryCode" value="es"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkPayPalExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkPayPalExpressIsDisabled"> <argument name="payPalConfigType" value="PayPalExpressCheckoutOtherCountryConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="es"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsEnabled"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="es"/> </actionGroup> - <actionGroup ref="EnablePayPalConfiguration" stepKey="EnableProHostedWithExpressCheckou"> + <actionGroup ref="EnablePayPalConfigurationActionGroup" stepKey="EnableProHostedWithExpressCheckou"> <argument name="payPalConfigType" value="WebsitePaymentsPlusConfigSection"/> <argument name="countryCode" value="es"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkWPSExpressIsDisabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkWPSExpressIsDisabled"> <argument name="payPalConfigType" value="WPSOtherConfigSection"/> <argument name="enabledOption" value="No"/> <argument name="countryCode" value="es"/> </actionGroup> - <actionGroup ref="CheckEnableOptionPayPalConfiguration" stepKey="checkProHostedIsEnabled"> + <actionGroup ref="CheckEnableOptionPayPalConfigurationActionGroup" stepKey="checkProHostedIsEnabled"> <argument name="payPalConfigType" value="WebsitePaymentsPlusConfigSection"/> <argument name="enabledOption" value="Yes"/> <argument name="countryCode" value="es"/> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/AdminOnePayPalSolutionsEnabledAtTheSameTimeTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/AdminOnePayPalSolutionsEnabledAtTheSameTimeTest.xml index c653c1f03fd74..fd0e74f38287d 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/AdminOnePayPalSolutionsEnabledAtTheSameTimeTest.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/AdminOnePayPalSolutionsEnabledAtTheSameTimeTest.xml @@ -39,13 +39,13 @@ <!--Try to enable express checkout Solution--> <comment userInput="Try to enable express checkout Solution" stepKey="commentTryEnableExpressCheckout"/> <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/> - <actionGroup ref="EnablePayPalSolutionWithoutSave" stepKey="enableExpressCheckout"> + <actionGroup ref="EnablePayPalSolutionWithoutSaveActionGroup" stepKey="enableExpressCheckout"> <argument name="payPalConfigType" value="WPSExpressConfigSection"/> <argument name="countryCode" value="us"/> </actionGroup> <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> <waitForPageLoad stepKey="waitForPageLoad2"/> - <actionGroup ref="EnablePayPalSolutionWithoutSave" stepKey="enableExpressCheckout2"> + <actionGroup ref="EnablePayPalSolutionWithoutSaveActionGroup" stepKey="enableExpressCheckout2"> <argument name="payPalConfigType" value="PayPalExpressCheckoutConfigSection"/> <argument name="countryCode" value="us"/> </actionGroup> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontCheckCreditButtonConfigurationTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontCheckCreditButtonConfigurationTest.xml index d8cea82bcc2f5..78a27106bf406 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontCheckCreditButtonConfigurationTest.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontCheckCreditButtonConfigurationTest.xml @@ -65,7 +65,7 @@ <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> <argument name="Customer" value="$$createCustomer$$"/> </actionGroup> - <actionGroup ref="addProductToCheckoutPage" stepKey="addProductToCheckoutPage"> + <actionGroup ref="AddProductToCheckoutPageActionGroup" stepKey="addProductToCheckoutPage"> <argument name="Category" value="$$createPreReqCategory$$"/> </actionGroup> <!--set ID for iframe of PayPal group button--> From 91584fc4b7cb4d600a9846ad6943fa53fda46a6c Mon Sep 17 00:00:00 2001 From: Subash Natarajan <subash.natarajan@ziffity.com> Date: Fri, 29 Nov 2019 00:07:07 +0530 Subject: [PATCH 325/595] Group save error message with escaped html --- .../Customer/Controller/Adminhtml/Group/Save.php | 12 ++++++++++-- .../Unit/Controller/Adminhtml/Group/SaveTest.php | 7 ++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Group/Save.php b/app/code/Magento/Customer/Controller/Adminhtml/Group/Save.php index 64c94fa230fb1..fd6f0ed7daf54 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Group/Save.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Group/Save.php @@ -20,6 +20,11 @@ class Save extends \Magento\Customer\Controller\Adminhtml\Group implements HttpP */ protected $dataObjectProcessor; + /** + * @var \Magento\Framework\Escaper + */ + protected $escaper; + /** * * @param \Magento\Backend\App\Action\Context $context @@ -29,6 +34,7 @@ class Save extends \Magento\Customer\Controller\Adminhtml\Group implements HttpP * @param \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory * @param \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor + * @param \Magento\Framework\Escaper $escaper */ public function __construct( \Magento\Backend\App\Action\Context $context, @@ -37,9 +43,11 @@ public function __construct( GroupInterfaceFactory $groupDataFactory, \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory, \Magento\Framework\View\Result\PageFactory $resultPageFactory, - \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor + \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor, + \Magento\Framework\Escaper $escaper ) { $this->dataObjectProcessor = $dataObjectProcessor; + $this->escaper = $escaper; parent::__construct( $context, $coreRegistry, @@ -96,7 +104,7 @@ public function execute() $this->messageManager->addSuccessMessage(__('You saved the customer group.')); $resultRedirect->setPath('customer/group'); } catch (\Exception $e) { - $this->messageManager->addErrorMessage($e->getMessage()); + $this->messageManager->addErrorMessage($this->escaper->escapeHtml($e->getMessage())); if ($customerGroup != null) { $this->storeCustomerGroupDataToSession( $this->dataObjectProcessor->buildOutputDataArray( diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Group/SaveTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Group/SaveTest.php index c9f885315b0ef..7edc631fc71c1 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Group/SaveTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Group/SaveTest.php @@ -87,6 +87,10 @@ protected function setUp() $this->dataObjectProcessorMock = $this->getMockBuilder(DataObjectProcessor::class) ->disableOriginalConstructor() ->getMock(); + $this->escaper = $this->getMockBuilder(\Magento\Framework\Escaper::class) + ->disableOriginalConstructor() + ->setMethods(['escapeHtml']) + ->getMock(); $this->request = $this->getMockBuilder(\Magento\Framework\App\RequestInterface::class) ->getMockForAbstractClass(); $this->resultRedirectFactory = $this->getMockBuilder(RedirectFactory::class) @@ -129,7 +133,8 @@ protected function setUp() $this->groupInterfaceFactoryMock, $this->forwardFactoryMock, $this->pageFactoryMock, - $this->dataObjectProcessorMock + $this->dataObjectProcessorMock, + $this->escaper ); } From 9f774144e527e81df731900005c249e2714f825c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 21:27:24 +0100 Subject: [PATCH 326/595] REFACTOR: Replace redundant Action Group with the same one --- .../Mftf/ActionGroup/ClearCacheActionGroup.xml | 15 +-------------- .../Test/Mftf/Test/NewProductsListWidgetTest.xml | 14 +++++++------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/app/code/Magento/PageCache/Test/Mftf/ActionGroup/ClearCacheActionGroup.xml b/app/code/Magento/PageCache/Test/Mftf/ActionGroup/ClearCacheActionGroup.xml index 1eec4b40db68d..4bd68fa1e9929 100644 --- a/app/code/Magento/PageCache/Test/Mftf/ActionGroup/ClearCacheActionGroup.xml +++ b/app/code/Magento/PageCache/Test/Mftf/ActionGroup/ClearCacheActionGroup.xml @@ -12,23 +12,10 @@ <annotations> <description>Goes to the Admin Cache Management page. Clicks on 'Flush Magento Cache'.</description> </annotations> - + <amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/admin/cache/" stepKey="goToNewCustomVarialePage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <click selector="{{AdminCacheManagementSection.FlushMagentoCache}}" stepKey="clickFlushMagentoCache"/> <waitForPageLoad stepKey="waitForCacheFlush"/> </actionGroup> - - <actionGroup name="clearPageCache"> - <annotations> - <description>Goes to the Admin Cache Management page. Selects 'Refresh'. Checks the 'Page Cache' row. Clicks on Submit.</description> - </annotations> - - <amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/admin/cache/" stepKey="amOnCacheManagementPage"/> - <waitForPageLoad stepKey="waitForCacheManagement"/> - <selectOption selector="{{AdminCacheManagementSection.massActionSelect}}" userInput="refresh" stepKey="selectRefresh"/> - <click selector="{{AdminCacheManagementSection.pageCacheCheckbox}}" stepKey="selectPageCache"/> - <click selector="{{AdminCacheManagementSection.massActionSubmit}}" stepKey="submitCacheForm"/> - <waitForPageLoad stepKey="waitForCacheFlush"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/PageCache/Test/Mftf/Test/NewProductsListWidgetTest.xml b/app/code/Magento/PageCache/Test/Mftf/Test/NewProductsListWidgetTest.xml index a3c9e7b39217d..e7dc40c20f4dd 100644 --- a/app/code/Magento/PageCache/Test/Mftf/Test/NewProductsListWidgetTest.xml +++ b/app/code/Magento/PageCache/Test/Mftf/Test/NewProductsListWidgetTest.xml @@ -9,21 +9,21 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="NewProductsListWidgetSimpleProductTest"> - <actionGroup ref="clearPageCache" stepKey="clearPageCache" before="amOnCmsPage"/> + <actionGroup ref="ClearPageCacheActionGroup" stepKey="clearPageCache" before="amOnCmsPage"/> </test> <test name="NewProductsListWidgetConfigurableProductTest"> - <actionGroup ref="clearPageCache" stepKey="clearPageCache" after="clickSaveProduct"/> + <actionGroup ref="ClearPageCacheActionGroup" stepKey="clearPageCache" after="clickSaveProduct"/> </test> <test name="NewProductsListWidgetGroupedProductTest"> - <actionGroup ref="clearPageCache" stepKey="clearPageCache" after="clickSaveProduct"/> + <actionGroup ref="ClearPageCacheActionGroup" stepKey="clearPageCache" after="clickSaveProduct"/> </test> <test name="NewProductsListWidgetVirtualProductTest"> - <actionGroup ref="clearPageCache" stepKey="clearPageCache" before="amOnCmsPage"/> + <actionGroup ref="ClearPageCacheActionGroup" stepKey="clearPageCache" before="amOnCmsPage"/> </test> <test name="NewProductsListWidgetBundleProductTest"> - <actionGroup ref="clearPageCache" stepKey="clearPageCache" after="clickSaveProduct"/> + <actionGroup ref="ClearPageCacheActionGroup" stepKey="clearPageCache" after="clickSaveProduct"/> </test> <test name="NewProductsListWidgetDownloadableProductTest"> - <actionGroup ref="clearPageCache" stepKey="clearPageCache" after="clickSaveProduct"/> + <actionGroup ref="ClearPageCacheActionGroup" stepKey="clearPageCache" after="clickSaveProduct"/> </test> -</tests> \ No newline at end of file +</tests> From 5f90f1aae78c7d20924a171bc03ca8a772c27426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 21:36:20 +0100 Subject: [PATCH 327/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../CheckSubscribedNewsletterActionGroup.xml | 19 ++++++++ ...NewAccountNewsletterCheckedActionGroup.xml | 20 +++++++++ ...wAccountNewsletterUncheckedActionGroup.xml | 24 ++++++++++ ...l => SwitchToPreviewIframeActionGroup.xml} | 0 ...bscribedNewsletterDisplayedActionGroup.xml | 45 ------------------- ...erifySubscribedNewsletterDisplayedTest.xml | 4 +- 6 files changed, 65 insertions(+), 47 deletions(-) create mode 100644 app/code/Magento/Newsletter/Test/Mftf/ActionGroup/CheckSubscribedNewsletterActionGroup.xml create mode 100644 app/code/Magento/Newsletter/Test/Mftf/ActionGroup/StorefrontCreateNewAccountNewsletterCheckedActionGroup.xml create mode 100644 app/code/Magento/Newsletter/Test/Mftf/ActionGroup/StorefrontCreateNewAccountNewsletterUncheckedActionGroup.xml rename app/code/Magento/Newsletter/Test/Mftf/ActionGroup/{AdminNewsletterTemplateActionGroup.xml => SwitchToPreviewIframeActionGroup.xml} (100%) delete mode 100644 app/code/Magento/Newsletter/Test/Mftf/ActionGroup/VerifySubscribedNewsletterDisplayedActionGroup.xml diff --git a/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/CheckSubscribedNewsletterActionGroup.xml b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/CheckSubscribedNewsletterActionGroup.xml new file mode 100644 index 0000000000000..feedd58c911aa --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/CheckSubscribedNewsletterActionGroup.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="CheckSubscribedNewsletterActionGroup"> + <annotations> + <description>Goes to the Storefront Newsletter Management page. Validates that the 'Subscription' checkbox is checked.</description> + </annotations> + + <amOnPage url="{{StorefrontNewsletterManagePage.url}}" stepKey="goToNewsletterManage"/> + <seeCheckboxIsChecked selector="{{StorefrontNewsletterManageSection.subscriptionCheckbox}}" stepKey="checkSubscribedNewsletter"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/StorefrontCreateNewAccountNewsletterCheckedActionGroup.xml b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/StorefrontCreateNewAccountNewsletterCheckedActionGroup.xml new file mode 100644 index 0000000000000..ff543febcd9a3 --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/StorefrontCreateNewAccountNewsletterCheckedActionGroup.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"> + <!--Create an Account. Check Sign Up for Newsletter checkbox --> + <actionGroup name="StorefrontCreateNewAccountNewsletterCheckedActionGroup" extends="SignUpNewUserFromStorefrontActionGroup"> + <annotations> + <description>EXTENDS: SignUpNewUserFromStorefrontActionGroup. Clicks on 'Sign Up for Newsletter'. Validates that the Subscription Confirmation message is present and correct.</description> + </annotations> + + <click selector="{{StorefrontCustomerCreateFormSection.signUpForNewsletter}}" stepKey="selectSignUpForNewsletterCheckbox" after="fillLastName"/> + <see stepKey="seeDescriptionNewsletter" userInput='You are subscribed to "General Subscription".' selector="{{CustomerMyAccountPage.DescriptionNewsletter}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/StorefrontCreateNewAccountNewsletterUncheckedActionGroup.xml b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/StorefrontCreateNewAccountNewsletterUncheckedActionGroup.xml new file mode 100644 index 0000000000000..d6b0adff53a86 --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/StorefrontCreateNewAccountNewsletterUncheckedActionGroup.xml @@ -0,0 +1,24 @@ +<?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="StorefrontCreateNewAccountNewsletterUncheckedActionGroup" extends="SignUpNewUserFromStorefrontActionGroup"> + <annotations> + <description>EXTENDS: SignUpNewUserFromStorefrontActionGroup. Validates that the you are NOT subscribed message is present and correct.</description> + </annotations> + <arguments> + <argument name="Customer"/> + <argument name="Store"/> + </arguments> + + <amOnPage stepKey="amOnStorefrontPage" url="{{Store.code}}"/> + <see stepKey="seeDescriptionNewsletter" userInput="You aren't subscribed to our newsletter." selector="{{CustomerMyAccountPage.DescriptionNewsletter}}"/> + <see stepKey="seeThankYouMessage" userInput="Thank you for registering with NewStore."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/AdminNewsletterTemplateActionGroup.xml b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/SwitchToPreviewIframeActionGroup.xml similarity index 100% rename from app/code/Magento/Newsletter/Test/Mftf/ActionGroup/AdminNewsletterTemplateActionGroup.xml rename to app/code/Magento/Newsletter/Test/Mftf/ActionGroup/SwitchToPreviewIframeActionGroup.xml diff --git a/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/VerifySubscribedNewsletterDisplayedActionGroup.xml b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/VerifySubscribedNewsletterDisplayedActionGroup.xml deleted file mode 100644 index 69b973dbddbda..0000000000000 --- a/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/VerifySubscribedNewsletterDisplayedActionGroup.xml +++ /dev/null @@ -1,45 +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"> - <!--Create an Account. Check Sign Up for Newsletter checkbox --> - <actionGroup name="StorefrontCreateNewAccountNewsletterChecked" extends="SignUpNewUserFromStorefrontActionGroup"> - <annotations> - <description>EXTENDS: SignUpNewUserFromStorefrontActionGroup. Clicks on 'Sign Up for Newsletter'. Validates that the Subscription Confirmation message is present and correct.</description> - </annotations> - - <click selector="{{StorefrontCustomerCreateFormSection.signUpForNewsletter}}" stepKey="selectSignUpForNewsletterCheckbox" after="fillLastName"/> - <see stepKey="seeDescriptionNewsletter" userInput='You are subscribed to "General Subscription".' selector="{{CustomerMyAccountPage.DescriptionNewsletter}}"/> - </actionGroup> - - <!--Create an Account. Uncheck Sign Up for Newsletter checkbox --> - <actionGroup name="StorefrontCreateNewAccountNewsletterUnchecked" extends="SignUpNewUserFromStorefrontActionGroup"> - <annotations> - <description>EXTENDS: SignUpNewUserFromStorefrontActionGroup. Validates that the you are NOT subscribed message is present and correct.</description> - </annotations> - <arguments> - <argument name="Customer"/> - <argument name="Store"/> - </arguments> - - <amOnPage stepKey="amOnStorefrontPage" url="{{Store.code}}"/> - <see stepKey="seeDescriptionNewsletter" userInput="You aren't subscribed to our newsletter." selector="{{CustomerMyAccountPage.DescriptionNewsletter}}"/> - <see stepKey="seeThankYouMessage" userInput="Thank you for registering with NewStore."/> - </actionGroup> - - <!--Check Subscribed Newsletter via StoreFront--> - <actionGroup name="CheckSubscribedNewsletterActionGroup"> - <annotations> - <description>Goes to the Storefront Newsletter Management page. Validates that the 'Subscription' checkbox is checked.</description> - </annotations> - - <amOnPage url="{{StorefrontNewsletterManagePage.url}}" stepKey="goToNewsletterManage"/> - <seeCheckboxIsChecked selector="{{StorefrontNewsletterManageSection.subscriptionCheckbox}}" stepKey="checkSubscribedNewsletter"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml index 4d60b7676605e..2afeb8f8b0746 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml @@ -53,14 +53,14 @@ </after> <!--Go to store front (default) and click Create an Account.--> - <actionGroup ref="StorefrontCreateNewAccountNewsletterChecked" stepKey="SignUpNewUser"> + <actionGroup ref="StorefrontCreateNewAccountNewsletterCheckedActionGroup" stepKey="SignUpNewUser"> <argument name="Customer" value="CustomerEntityOne"/> </actionGroup> <!--Sign Out--> <amOnPage url="customer/account/logout/" stepKey="customerOnLogoutPage"/> <waitForPageLoad stepKey="waitLogoutCustomer"/> <!--Create new Account with the same email address. (unchecked Sign Up for Newsletter checkbox)--> - <actionGroup ref="StorefrontCreateNewAccountNewsletterUnchecked" stepKey="createNewAccountNewsletterUnchecked"> + <actionGroup ref="StorefrontCreateNewAccountNewsletterUncheckedActionGroup" stepKey="createNewAccountNewsletterUnchecked"> <argument name="Customer" value="CustomerEntityOne"/> <argument name="Store" value="staticStore"/> </actionGroup> From 5564c689d274012f97e4e8f63459bc33681727cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 21:46:13 +0100 Subject: [PATCH 328/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...eckingWithMultipleAddressesActionGroup.xml | 26 +-------------- .../CheckingWithSingleAddressActionGroup.xml | 18 ++++++++++ .../ActionGroup/PlaceOrderActionGroup.xml | 10 ------ .../ActionGroup/ReviewOrderActionGroup.xml | 22 ------------- ...ReviewOrderForMultiShipmentActionGroup.xml | 33 +++++++++++++++++++ ...=> SelectMultiShippingInfoActionGroup.xml} | 15 +-------- .../SelectSingleShippingInfoActionGroup.xml | 20 +++++++++++ ...ingSelectMultipleAddressesActionGroup.xml} | 7 ---- ...eckoutWithMultipleAddressesActionGroup.xml | 15 +++++++++ ...eckoutWithMultipleAddressesActionGroup.xml | 14 ++++++++ ...frontGoToBillingInformationActionGroup.xml | 15 +++++++++ ...ngMethodsAndGoToBillingInfoActionGroup.xml | 15 +++++++++ ...ceOrderForMultipleAddressesActionGroup.xml | 21 ++++++++++++ .../StorefrontSaveAddressActionGroup.xml | 17 ++++++++++ .../StorefrontSelectAddressActionGroup.xml | 18 ++++++++++ ...utWhenCartPageIsOpenedInAnotherTabTest.xml | 2 +- 16 files changed, 189 insertions(+), 79 deletions(-) create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/CheckingWithSingleAddressActionGroup.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/ReviewOrderForMultiShipmentActionGroup.xml rename app/code/Magento/Multishipping/Test/Mftf/ActionGroup/{SelectShippingInfoActionGroup.xml => SelectMultiShippingInfoActionGroup.xml} (62%) create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/SelectSingleShippingInfoActionGroup.xml rename app/code/Magento/Multishipping/Test/Mftf/ActionGroup/{StorefrontMultishippingCheckoutActionGroup.xml => StorefrontCheckoutShippingSelectMultipleAddressesActionGroup.xml} (70%) create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontCheckoutWithMultipleAddressesActionGroup.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontGoCheckoutWithMultipleAddressesActionGroup.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontGoToBillingInformationActionGroup.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontLeaveDefaultShippingMethodsAndGoToBillingInfoActionGroup.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontPlaceOrderForMultipleAddressesActionGroup.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontSaveAddressActionGroup.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontSelectAddressActionGroup.xml diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/CheckingWithMultipleAddressesActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/CheckingWithMultipleAddressesActionGroup.xml index 34ce38bd0d935..a34e0627bd150 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/CheckingWithMultipleAddressesActionGroup.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/CheckingWithMultipleAddressesActionGroup.xml @@ -7,13 +7,7 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <actionGroup name="CheckingWithSingleAddressActionGroup"> - <click selector="{{SingleShippingSection.checkoutWithMultipleAddresses}}" stepKey="clickOnCheckoutWithMultipleAddresses"/> - <waitForPageLoad stepKey="waitForMultipleAddressPageLoad"/> - <click selector="{{SingleShippingSection.goToShippingInfo}}" stepKey="goToShippingInformation"/> - <waitForPageLoad stepKey="waitForShippingPageLoad"/> - </actionGroup> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="CheckingWithMultipleAddressesActionGroup" extends="CheckingWithSingleAddressActionGroup"> <arguments> <argument name="addressOption1" type="string" defaultValue="1"/> @@ -27,22 +21,4 @@ <click selector="{{SingleShippingSection.updateAddress}}" after="selectSecondShippingMethod" stepKey="clickOnUpdateAddress"/> <waitForPageLoad after="clickOnUpdateAddress" stepKey="waitForShippingInformation"/> </actionGroup> - <actionGroup name="StorefrontCheckoutWithMultipleAddressesActionGroup"> - <click selector="{{SingleShippingSection.checkoutWithMultipleAddresses}}" stepKey="clickOnCheckoutWithMultipleAddresses"/> - <waitForPageLoad stepKey="waitForMultipleAddressPageLoad"/> - </actionGroup> - <actionGroup name="StorefrontSelectAddressActionGroup"> - <arguments> - <argument name="sequenceNumber" type="string" defaultValue="1"/> - <argument name="option" type="string" defaultValue="1"/> - </arguments> - <selectOption selector="{{MultishippingSection.selectShippingAddress(sequenceNumber)}}" userInput="{{option}}" stepKey="selectShippingAddress"/> - </actionGroup> - <actionGroup name="StorefrontSaveAddressActionGroup"> - <click selector="{{SingleShippingSection.updateAddress}}" stepKey="clickOnUpdateAddress"/> - <waitForPageLoad time="90" stepKey="waitForShippingInformationAfterUpdated"/> - <click selector="{{SingleShippingSection.goToShippingInfo}}" stepKey="goToShippingInformation"/> - <waitForPageLoad stepKey="waitForShippingPageLoad"/> - </actionGroup> </actionGroups> - diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/CheckingWithSingleAddressActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/CheckingWithSingleAddressActionGroup.xml new file mode 100644 index 0000000000000..d911488925427 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/CheckingWithSingleAddressActionGroup.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/testSchema.xsd"> + <actionGroup name="CheckingWithSingleAddressActionGroup"> + <click selector="{{SingleShippingSection.checkoutWithMultipleAddresses}}" stepKey="clickOnCheckoutWithMultipleAddresses"/> + <waitForPageLoad stepKey="waitForMultipleAddressPageLoad"/> + <click selector="{{SingleShippingSection.goToShippingInfo}}" stepKey="goToShippingInformation"/> + <waitForPageLoad stepKey="waitForShippingPageLoad"/> + </actionGroup> +</actionGroups> + diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/PlaceOrderActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/PlaceOrderActionGroup.xml index 871c71de522c7..8cfbe2665d685 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/PlaceOrderActionGroup.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/PlaceOrderActionGroup.xml @@ -13,14 +13,4 @@ <waitForPageLoad stepKey="waitForSuccessfullyPlacedOrder"/> <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/> </actionGroup> - <actionGroup name="StorefrontPlaceOrderForMultipleAddressesActionGroup" extends="PlaceOrderActionGroup"> - <arguments> - <argument name="firstOrderPosition" type="string" defaultValue="1"/> - <argument name="secondOrderPosition" type="string" defaultValue="2"/> - </arguments> - <grabTextFrom selector="{{StorefrontSalesOrderSection.orderLinkByPosition(firstOrderPosition)}}" after="waitForLoadSuccessPage" stepKey="getFirstOrderId"/> - <grabAttributeFrom selector="{{StorefrontSalesOrderSection.orderLinkByPosition(firstOrderPosition)}}" userInput="href" after="getFirstOrderId" stepKey="dataHrefForFirstOrder"/> - <grabTextFrom selector="{{StorefrontSalesOrderSection.orderLinkByPosition(secondOrderPosition)}}" after="dataHrefForFirstOrder" stepKey="getSecondOrderId"/> - <grabAttributeFrom selector="{{StorefrontSalesOrderSection.orderLinkByPosition(secondOrderPosition)}}" userInput="href" after="getSecondOrderId" stepKey="dataHrefForSecondOrder"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/ReviewOrderActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/ReviewOrderActionGroup.xml index 638c5dd8dde61..8a63c42006443 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/ReviewOrderActionGroup.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/ReviewOrderActionGroup.xml @@ -20,26 +20,4 @@ <actualResult type="string">$shippingMethodBasePrice</actualResult> </assertEquals> </actionGroup> - <actionGroup name="ReviewOrderForMultiShipmentActionGroup"> - <arguments> - <argument name="totalNameForFirstOrder" type="string" defaultValue="Shipping & Handling"/> - <argument name="totalPositionForFirstOrder" type="string" defaultValue="1"/> - <argument name="totalNameForSecondOrder" type="string" defaultValue="Shipping & Handling"/> - <argument name="totalPositionForSecondOrder" type="string" defaultValue="2"/> - </arguments> - <!--Check First Shipping Method Price--> - <grabTextFrom selector="{{ReviewOrderSection.shippingMethodBasePrice(totalPositionForFirstOrder)}}" stepKey="firstShippingMethodBasePrice"/> - <grabTextFrom selector="{{ReviewOrderSection.shippingMethodSubtotalPrice(totalPositionForFirstOrder,totalNameForFirstOrder)}}" stepKey="firstShippingMethodSubtotalPrice"/> - <assertEquals stepKey="assertShippingMethodPrice"> - <expectedResult type="string">$firstShippingMethodSubtotalPrice</expectedResult> - <actualResult type="string">$firstShippingMethodBasePrice</actualResult> - </assertEquals> - <!--Check Second Shipping Method Price--> - <grabTextFrom selector="{{ReviewOrderSection.shippingMethodBasePrice(totalPositionForSecondOrder)}}" stepKey="secondShippingMethodBasePrice"/> - <grabTextFrom selector="{{ReviewOrderSection.shippingMethodSubtotalPrice(totalPositionForSecondOrder,totalNameForSecondOrder)}}" stepKey="secondShippingMethodSubtotalPrice"/> - <assertEquals stepKey="assertSecondShippingMethodPrice" > - <expectedResult type="string">$secondShippingMethodSubtotalPrice</expectedResult> - <actualResult type="string">$secondShippingMethodBasePrice</actualResult> - </assertEquals> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/ReviewOrderForMultiShipmentActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/ReviewOrderForMultiShipmentActionGroup.xml new file mode 100644 index 0000000000000..3a95c7779d596 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/ReviewOrderForMultiShipmentActionGroup.xml @@ -0,0 +1,33 @@ +<?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="ReviewOrderForMultiShipmentActionGroup"> + <arguments> + <argument name="totalNameForFirstOrder" type="string" defaultValue="Shipping & Handling"/> + <argument name="totalPositionForFirstOrder" type="string" defaultValue="1"/> + <argument name="totalNameForSecondOrder" type="string" defaultValue="Shipping & Handling"/> + <argument name="totalPositionForSecondOrder" type="string" defaultValue="2"/> + </arguments> + <!--Check First Shipping Method Price--> + <grabTextFrom selector="{{ReviewOrderSection.shippingMethodBasePrice(totalPositionForFirstOrder)}}" stepKey="firstShippingMethodBasePrice"/> + <grabTextFrom selector="{{ReviewOrderSection.shippingMethodSubtotalPrice(totalPositionForFirstOrder,totalNameForFirstOrder)}}" stepKey="firstShippingMethodSubtotalPrice"/> + <assertEquals stepKey="assertShippingMethodPrice"> + <expectedResult type="string">$firstShippingMethodSubtotalPrice</expectedResult> + <actualResult type="string">$firstShippingMethodBasePrice</actualResult> + </assertEquals> + <!--Check Second Shipping Method Price--> + <grabTextFrom selector="{{ReviewOrderSection.shippingMethodBasePrice(totalPositionForSecondOrder)}}" stepKey="secondShippingMethodBasePrice"/> + <grabTextFrom selector="{{ReviewOrderSection.shippingMethodSubtotalPrice(totalPositionForSecondOrder,totalNameForSecondOrder)}}" stepKey="secondShippingMethodSubtotalPrice"/> + <assertEquals stepKey="assertSecondShippingMethodPrice" > + <expectedResult type="string">$secondShippingMethodSubtotalPrice</expectedResult> + <actualResult type="string">$secondShippingMethodBasePrice</actualResult> + </assertEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/SelectShippingInfoActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/SelectMultiShippingInfoActionGroup.xml similarity index 62% rename from app/code/Magento/Multishipping/Test/Mftf/ActionGroup/SelectShippingInfoActionGroup.xml rename to app/code/Magento/Multishipping/Test/Mftf/ActionGroup/SelectMultiShippingInfoActionGroup.xml index a5aac6b32011b..9da09a524184d 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/SelectShippingInfoActionGroup.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/SelectMultiShippingInfoActionGroup.xml @@ -7,15 +7,7 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <actionGroup name="SelectSingleShippingInfoActionGroup"> - <arguments> - <argument name="shippingMethodType" type="string" defaultValue="Fixed"/> - </arguments> - <selectOption selector="{{ShippingMethodSection.shippingMethodRadioButton}}" userInput="{{shippingMethodType}}" stepKey="selectShippingMethod"/> - <waitForPageLoad stepKey="waitForRadioOptions"/> - <click selector="{{ShippingMethodSection.goToBillingInfo}}" stepKey="goToBillingInformation"/> - </actionGroup> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="SelectMultiShippingInfoActionGroup"> <arguments> <argument name="shippingMethodPosition1" type="string" defaultValue="1"/> @@ -29,9 +21,4 @@ <waitForPageLoad stepKey="waitForRadioOptions"/> <click selector="{{ShippingMethodSection.goToBillingInfo}}" stepKey="goToBillingInformation"/> </actionGroup> - <actionGroup name="StorefrontLeaveDefaultShippingMethodsAndGoToBillingInfoActionGroup"> - <waitForPageLoad stepKey="waitForShippingInfo"/> - <click selector="{{ShippingMethodSection.goToBillingInfo}}" stepKey="goToBillingInformation"/> - </actionGroup> </actionGroups> - diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/SelectSingleShippingInfoActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/SelectSingleShippingInfoActionGroup.xml new file mode 100644 index 0000000000000..329f1451788cd --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/SelectSingleShippingInfoActionGroup.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/testSchema.xsd"> + <actionGroup name="SelectSingleShippingInfoActionGroup"> + <arguments> + <argument name="shippingMethodType" type="string" defaultValue="Fixed"/> + </arguments> + <selectOption selector="{{ShippingMethodSection.shippingMethodRadioButton}}" userInput="{{shippingMethodType}}" stepKey="selectShippingMethod"/> + <waitForPageLoad stepKey="waitForRadioOptions"/> + <click selector="{{ShippingMethodSection.goToBillingInfo}}" stepKey="goToBillingInformation"/> + </actionGroup> +</actionGroups> + diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontMultishippingCheckoutActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontCheckoutShippingSelectMultipleAddressesActionGroup.xml similarity index 70% rename from app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontMultishippingCheckoutActionGroup.xml rename to app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontCheckoutShippingSelectMultipleAddressesActionGroup.xml index c5dee010239d7..b698f00078bd6 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontMultishippingCheckoutActionGroup.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontCheckoutShippingSelectMultipleAddressesActionGroup.xml @@ -17,12 +17,5 @@ <selectOption selector="{{StorefrontCheckoutShippingMultipleAddressesSection.selectedMultipleShippingAddress('2')}}" userInput="{{secondAddress}}" stepKey="selectShippingAddressForTheSecondItem"/> <click selector="{{CheckoutSuccessMainSection.continueShoppingButton}}" stepKey="clickToGoToInformationButton"/> </actionGroup> - <actionGroup name="StorefrontGoCheckoutWithMultipleAddresses"> - <click selector="{{MultishippingSection.shippingMultipleCheckout}}" stepKey="clickToMultipleAddressShippingButton"/> - </actionGroup> - <actionGroup name="StorefrontGoToBillingInformationActionGroup"> - <click selector="{{StorefrontMultipleShippingMethodSection.continueToBillingInformationButton}}" stepKey="clickToContinueToBillingInformationButton"/> - <waitForPageLoad stepKey="waitForBillingPage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontCheckoutWithMultipleAddressesActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontCheckoutWithMultipleAddressesActionGroup.xml new file mode 100644 index 0000000000000..f7d6ea6711f89 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontCheckoutWithMultipleAddressesActionGroup.xml @@ -0,0 +1,15 @@ +<?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="StorefrontCheckoutWithMultipleAddressesActionGroup"> + <click selector="{{SingleShippingSection.checkoutWithMultipleAddresses}}" stepKey="clickOnCheckoutWithMultipleAddresses"/> + <waitForPageLoad stepKey="waitForMultipleAddressPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontGoCheckoutWithMultipleAddressesActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontGoCheckoutWithMultipleAddressesActionGroup.xml new file mode 100644 index 0000000000000..fd57a3b095a3d --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontGoCheckoutWithMultipleAddressesActionGroup.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="StorefrontGoCheckoutWithMultipleAddressesActionGroup"> + <click selector="{{MultishippingSection.shippingMultipleCheckout}}" stepKey="clickToMultipleAddressShippingButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontGoToBillingInformationActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontGoToBillingInformationActionGroup.xml new file mode 100644 index 0000000000000..baca62007d3cb --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontGoToBillingInformationActionGroup.xml @@ -0,0 +1,15 @@ +<?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="StorefrontGoToBillingInformationActionGroup"> + <click selector="{{StorefrontMultipleShippingMethodSection.continueToBillingInformationButton}}" stepKey="clickToContinueToBillingInformationButton"/> + <waitForPageLoad stepKey="waitForBillingPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontLeaveDefaultShippingMethodsAndGoToBillingInfoActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontLeaveDefaultShippingMethodsAndGoToBillingInfoActionGroup.xml new file mode 100644 index 0000000000000..1054d9b7d9160 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontLeaveDefaultShippingMethodsAndGoToBillingInfoActionGroup.xml @@ -0,0 +1,15 @@ +<?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="StorefrontLeaveDefaultShippingMethodsAndGoToBillingInfoActionGroup"> + <waitForPageLoad stepKey="waitForShippingInfo"/> + <click selector="{{ShippingMethodSection.goToBillingInfo}}" stepKey="goToBillingInformation"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontPlaceOrderForMultipleAddressesActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontPlaceOrderForMultipleAddressesActionGroup.xml new file mode 100644 index 0000000000000..8391a16f81b6d --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontPlaceOrderForMultipleAddressesActionGroup.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="StorefrontPlaceOrderForMultipleAddressesActionGroup" extends="PlaceOrderActionGroup"> + <arguments> + <argument name="firstOrderPosition" type="string" defaultValue="1"/> + <argument name="secondOrderPosition" type="string" defaultValue="2"/> + </arguments> + <grabTextFrom selector="{{StorefrontSalesOrderSection.orderLinkByPosition(firstOrderPosition)}}" after="waitForLoadSuccessPage" stepKey="getFirstOrderId"/> + <grabAttributeFrom selector="{{StorefrontSalesOrderSection.orderLinkByPosition(firstOrderPosition)}}" userInput="href" after="getFirstOrderId" stepKey="dataHrefForFirstOrder"/> + <grabTextFrom selector="{{StorefrontSalesOrderSection.orderLinkByPosition(secondOrderPosition)}}" after="dataHrefForFirstOrder" stepKey="getSecondOrderId"/> + <grabAttributeFrom selector="{{StorefrontSalesOrderSection.orderLinkByPosition(secondOrderPosition)}}" userInput="href" after="getSecondOrderId" stepKey="dataHrefForSecondOrder"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontSaveAddressActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontSaveAddressActionGroup.xml new file mode 100644 index 0000000000000..c977c94b4e590 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontSaveAddressActionGroup.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="StorefrontSaveAddressActionGroup"> + <click selector="{{SingleShippingSection.updateAddress}}" stepKey="clickOnUpdateAddress"/> + <waitForPageLoad time="90" stepKey="waitForShippingInformationAfterUpdated"/> + <click selector="{{SingleShippingSection.goToShippingInfo}}" stepKey="goToShippingInformation"/> + <waitForPageLoad stepKey="waitForShippingPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontSelectAddressActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontSelectAddressActionGroup.xml new file mode 100644 index 0000000000000..9a20c325df7a6 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/StorefrontSelectAddressActionGroup.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="StorefrontSelectAddressActionGroup"> + <arguments> + <argument name="sequenceNumber" type="string" defaultValue="1"/> + <argument name="option" type="string" defaultValue="1"/> + </arguments> + <selectOption selector="{{MultishippingSection.selectShippingAddress(sequenceNumber)}}" userInput="{{option}}" stepKey="selectShippingAddress"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml index fd79d4d954cd4..cb333a16dfb96 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml @@ -62,7 +62,7 @@ <amOnPage url="{{CheckoutCartPage.url}}" stepKey="amOnShoppingCartPage"/> <!-- Click 'Check Out with Multiple Addresses' --> <waitForPageLoad stepKey="waitForSecondPageLoad"/> - <actionGroup ref="StorefrontGoCheckoutWithMultipleAddresses" stepKey="goCheckoutWithMultipleAddresses"/> + <actionGroup ref="StorefrontGoCheckoutWithMultipleAddressesActionGroup" stepKey="goCheckoutWithMultipleAddresses"/> <!-- Select different addresses and click 'Go to Shipping Information' --> <actionGroup ref="StorefrontCheckoutShippingSelectMultipleAddressesActionGroup" stepKey="selectMultipleAddresses"> <argument name="firstAddress" value="{{UK_Not_Default_Address.street[0]}}"/> From 02e83cabc83534c1bebcd4e90b0a29ab87e5e70a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 21:52:28 +0100 Subject: [PATCH 329/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...oductQuickSearchUsingElasticSearchTest.xml | 6 ++--- ...=> UpdateIndexerByScheduleActionGroup.xml} | 19 +------------ .../UpdateIndexerOnSaveActionGroup.xml | 27 +++++++++++++++++++ 3 files changed, 31 insertions(+), 21 deletions(-) rename app/code/Magento/Indexer/Test/Mftf/ActionGroup/{IndexerActionGroup.xml => UpdateIndexerByScheduleActionGroup.xml} (54%) create mode 100644 app/code/Magento/Indexer/Test/Mftf/ActionGroup/UpdateIndexerOnSaveActionGroup.xml diff --git a/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml b/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml index d8ce091fba76f..d2df6119aa98a 100644 --- a/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml +++ b/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml @@ -29,7 +29,7 @@ <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> <deleteData createDataKey="categoryFirst" stepKey="deleteCategory"/> <actionGroup ref="ResetSearchEngineConfiguration" stepKey="resetCatalogSearchConfiguration"/> - <actionGroup ref="updateIndexerOnSave" stepKey="resetIndexerBackToOriginalState"> + <actionGroup ref="UpdateIndexerOnSaveActionGroup" stepKey="resetIndexerBackToOriginalState"> <argument name="indexerName" value="catalogsearch_fulltext"/> </actionGroup> <actionGroup ref="logout" stepKey="logoutOfAdmin"/> @@ -39,7 +39,7 @@ <comment userInput="Change Catalog search engine option to Elastic Search 5.0+" stepKey="chooseElasticSearch5"/> <actionGroup ref="ChooseElasticSearchAsSearchEngine" stepKey="chooseES5"/> <actionGroup ref="ClearPageCacheActionGroup" stepKey="clearing"/> - <actionGroup ref="updateIndexerBySchedule" stepKey="updateAnIndexerBySchedule"> + <actionGroup ref="UpdateIndexerByScheduleActionGroup" stepKey="updateAnIndexerBySchedule"> <argument name="indexerName" value="catalogsearch_fulltext"/> </actionGroup> <actionGroup ref="logout" stepKey="logoutOfAdmin"/> @@ -57,4 +57,4 @@ <comment userInput="End of searching products" stepKey="endOfSearchingProducts"/> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin2"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Indexer/Test/Mftf/ActionGroup/IndexerActionGroup.xml b/app/code/Magento/Indexer/Test/Mftf/ActionGroup/UpdateIndexerByScheduleActionGroup.xml similarity index 54% rename from app/code/Magento/Indexer/Test/Mftf/ActionGroup/IndexerActionGroup.xml rename to app/code/Magento/Indexer/Test/Mftf/ActionGroup/UpdateIndexerByScheduleActionGroup.xml index 642982f37866f..04a5b97469c8e 100644 --- a/app/code/Magento/Indexer/Test/Mftf/ActionGroup/IndexerActionGroup.xml +++ b/app/code/Magento/Indexer/Test/Mftf/ActionGroup/UpdateIndexerByScheduleActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="updateIndexerBySchedule"> + <actionGroup name="UpdateIndexerByScheduleActionGroup"> <annotations> <description>Goes to the Index Management page. Checks the provided Indexer Name. Selects 'Update by Schedule'. Clicks on Submit.</description> </annotations> @@ -24,21 +24,4 @@ <!-- No re-indexing is done as part of this actionGroup since the test required no re-indexing --> <waitForPageLoad stepKey="waitForSave"/> </actionGroup> - - <actionGroup name="updateIndexerOnSave"> - <annotations> - <description>Goes to the Index Management page. Checks the provided Indexer Name. Selects 'Update on Save'. Clicks on Submit.</description> - </annotations> - <arguments> - <argument name="indexerName" type="string"/> - </arguments> - - <amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/indexer/indexer/list/" stepKey="amOnIndexManagementPage2"/> - <waitForPageLoad stepKey="waitForIndexManagementPageToLoad2"/> - <click selector="{{AdminIndexManagementSection.indexerCheckbox(indexerName)}}" stepKey="selectIndexer2"/> - <selectOption selector="{{AdminIndexManagementSection.massActionSelect}}" userInput="change_mode_onthefly" stepKey="selectUpdateOnSave"/> - <click selector="{{AdminIndexManagementSection.massActionSubmit}}" stepKey="submitIndexerForm2"/> - <!-- No re-indexing is done as part of this actionGroup since the test required no re-indexing --> - <waitForPageLoad stepKey="waitForSave2"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Indexer/Test/Mftf/ActionGroup/UpdateIndexerOnSaveActionGroup.xml b/app/code/Magento/Indexer/Test/Mftf/ActionGroup/UpdateIndexerOnSaveActionGroup.xml new file mode 100644 index 0000000000000..65be57a335006 --- /dev/null +++ b/app/code/Magento/Indexer/Test/Mftf/ActionGroup/UpdateIndexerOnSaveActionGroup.xml @@ -0,0 +1,27 @@ +<?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="UpdateIndexerOnSaveActionGroup"> + <annotations> + <description>Goes to the Index Management page. Checks the provided Indexer Name. Selects 'Update on Save'. Clicks on Submit.</description> + </annotations> + <arguments> + <argument name="indexerName" type="string"/> + </arguments> + + <amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/indexer/indexer/list/" stepKey="amOnIndexManagementPage2"/> + <waitForPageLoad stepKey="waitForIndexManagementPageToLoad2"/> + <click selector="{{AdminIndexManagementSection.indexerCheckbox(indexerName)}}" stepKey="selectIndexer2"/> + <selectOption selector="{{AdminIndexManagementSection.massActionSelect}}" userInput="change_mode_onthefly" stepKey="selectUpdateOnSave"/> + <click selector="{{AdminIndexManagementSection.massActionSubmit}}" stepKey="submitIndexerForm2"/> + <!-- No re-indexing is done as part of this actionGroup since the test required no re-indexing --> + <waitForPageLoad stepKey="waitForSave2"/> + </actionGroup> +</actionGroups> From e6926df80eb7f180b55d2b135156de48c6ab1599 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 21:55:41 +0100 Subject: [PATCH 330/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...inCheckDataForImportProductActionGroup.xml | 25 +++++++++++++++++++ .../AdminImportProductsActionGroup.xml | 24 ------------------ ...tsWithCheckValidationResultActionGroup.xml | 20 +++++++++++++++ 3 files changed, 45 insertions(+), 24 deletions(-) create mode 100644 app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminCheckDataForImportProductActionGroup.xml create mode 100644 app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminImportProductsWithCheckValidationResultActionGroup.xml diff --git a/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminCheckDataForImportProductActionGroup.xml b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminCheckDataForImportProductActionGroup.xml new file mode 100644 index 0000000000000..8628d246248b1 --- /dev/null +++ b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminCheckDataForImportProductActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AdminCheckDataForImportProductActionGroup"> + <arguments> + <argument name="behavior" type="string" defaultValue="Add/Update"/> + <argument name="importFile" type="string"/> + </arguments> + <amOnPage url="{{AdminImportIndexPage.url}}" stepKey="goToImportIndexPage"/> + <waitForPageLoad stepKey="adminImportMainSectionLoad"/> + <selectOption selector="{{AdminImportMainSection.entityType}}" userInput="Products" stepKey="selectProductsOption"/> + <waitForElementVisible selector="{{AdminImportMainSection.importBehavior}}" stepKey="waitForImportBehaviorElementVisible"/> + <selectOption selector="{{AdminImportMainSection.importBehavior}}" userInput="{{behavior}}" stepKey="selectImportBehaviorOption"/> + <attachFile selector="{{AdminImportMainSection.selectFileToImport}}" userInput="{{importFile}}" stepKey="attachFileForImport"/> + <click selector="{{AdminImportHeaderSection.checkDataButton}}" stepKey="clickCheckDataButton"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminImportProductsActionGroup.xml b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminImportProductsActionGroup.xml index 12da5974bdbe8..956822fc3cbef 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminImportProductsActionGroup.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminImportProductsActionGroup.xml @@ -36,28 +36,4 @@ <see selector="{{AdminImportValidationMessagesSection.notice}}" userInput="{{importNoticeMessage}}" stepKey="seeNoticeMessage"/> <see selector="{{AdminImportValidationMessagesSection.messageByType(importMessageType)}}" userInput="{{importMessage}}" stepKey="seeImportMessage"/> </actionGroup> - - <actionGroup name="AdminImportProductsWithCheckValidationResultActionGroup" extends="AdminImportProductsActionGroup"> - <arguments> - <argument name="validationNoticeMessage" type="string"/> - <argument name="validationMessage" type="string" defaultValue="File is valid! To start import process press "Import" button"/> - </arguments> - <waitForElementVisible selector="{{AdminImportValidationMessagesSection.notice}}" after="clickCheckDataButton" stepKey="waitForValidationNoticeMessage"/> - <see selector="{{AdminImportValidationMessagesSection.notice}}" userInput="{{validationNoticeMessage}}" after="waitForValidationNoticeMessage" stepKey="seeValidationNoticeMessage"/> - <see selector="{{AdminImportValidationMessagesSection.success}}" userInput="{{validationMessage}}" after="seeValidationNoticeMessage" stepKey="seeValidationMessage"/> - </actionGroup> - <actionGroup name="AdminCheckDataForImportProductActionGroup"> - <arguments> - <argument name="behavior" type="string" defaultValue="Add/Update"/> - <argument name="importFile" type="string"/> - </arguments> - <amOnPage url="{{AdminImportIndexPage.url}}" stepKey="goToImportIndexPage"/> - <waitForPageLoad stepKey="adminImportMainSectionLoad"/> - <selectOption selector="{{AdminImportMainSection.entityType}}" userInput="Products" stepKey="selectProductsOption"/> - <waitForElementVisible selector="{{AdminImportMainSection.importBehavior}}" stepKey="waitForImportBehaviorElementVisible"/> - <selectOption selector="{{AdminImportMainSection.importBehavior}}" userInput="{{behavior}}" stepKey="selectImportBehaviorOption"/> - <attachFile selector="{{AdminImportMainSection.selectFileToImport}}" userInput="{{importFile}}" stepKey="attachFileForImport"/> - <click selector="{{AdminImportHeaderSection.checkDataButton}}" stepKey="clickCheckDataButton"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminImportProductsWithCheckValidationResultActionGroup.xml b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminImportProductsWithCheckValidationResultActionGroup.xml new file mode 100644 index 0000000000000..a631ec72a5a72 --- /dev/null +++ b/app/code/Magento/ImportExport/Test/Mftf/ActionGroup/AdminImportProductsWithCheckValidationResultActionGroup.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="AdminImportProductsWithCheckValidationResultActionGroup" extends="AdminImportProductsActionGroup"> + <arguments> + <argument name="validationNoticeMessage" type="string"/> + <argument name="validationMessage" type="string" defaultValue="File is valid! To start import process press "Import" button"/> + </arguments> + <waitForElementVisible selector="{{AdminImportValidationMessagesSection.notice}}" after="clickCheckDataButton" stepKey="waitForValidationNoticeMessage"/> + <see selector="{{AdminImportValidationMessagesSection.notice}}" userInput="{{validationNoticeMessage}}" after="waitForValidationNoticeMessage" stepKey="seeValidationNoticeMessage"/> + <see selector="{{AdminImportValidationMessagesSection.success}}" userInput="{{validationMessage}}" after="seeValidationNoticeMessage" stepKey="seeValidationMessage"/> + </actionGroup> +</actionGroups> From 439132a5de79fe2c37dc277cc4de6ff2ed18d849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 21:58:33 +0100 Subject: [PATCH 331/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../AdminAssignProductToGroupActionGroup.xml | 29 ++++++ .../AdminGroupedProductActionGroup.xml | 92 ------------------- ...dFieldsInGroupedProductFormActionGroup.xml | 37 ++++++++ ...rLinkedToGroupProductInGridActionGroup.xml | 22 +++++ .../FillGroupedProductFormActionGroup.xml | 22 +++++ ...ewGroupedProductInAdminGridActionGroup.xml | 30 ++++++ 6 files changed, 140 insertions(+), 92 deletions(-) create mode 100644 app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminAssignProductToGroupActionGroup.xml delete mode 100644 app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminGroupedProductActionGroup.xml create mode 100644 app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/CheckRequiredFieldsInGroupedProductFormActionGroup.xml create mode 100644 app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/FillDefaultQuantityForLinkedToGroupProductInGridActionGroup.xml create mode 100644 app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/FillGroupedProductFormActionGroup.xml create mode 100644 app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/ViewGroupedProductInAdminGridActionGroup.xml diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminAssignProductToGroupActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminAssignProductToGroupActionGroup.xml new file mode 100644 index 0000000000000..fa1b24616ee6f --- /dev/null +++ b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminAssignProductToGroupActionGroup.xml @@ -0,0 +1,29 @@ +<?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="AdminAssignProductToGroupActionGroup"> + <annotations> + <description>Adds the provided Product to a Grouped Product on an Admin Grouped Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <scrollTo selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" x="0" y="-100" stepKey="scrollToGroupedSection"/> + <conditionalClick selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" dependentSelector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" visible="false" stepKey="openGroupedProductsSection"/> + <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/> + <conditionalClick selector="{{AdminAddProductsToGroupPanel.clearFilters}}" dependentSelector="{{AdminAddProductsToGroupPanel.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> + <click selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="showFiltersPanel"/> + <fillField userInput="{{product.name}}" selector="{{AdminAddProductsToGroupPanel.nameFilter}}" stepKey="fillNameFilter"/> + <click selector="{{AdminAddProductsToGroupPanel.applyFilters}}" stepKey="clickApplyFilters"/> + <click selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="selectProduct"/> + <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="clickAddSelectedGroupProducts"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminGroupedProductActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminGroupedProductActionGroup.xml deleted file mode 100644 index 7b44697880a70..0000000000000 --- a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/AdminGroupedProductActionGroup.xml +++ /dev/null @@ -1,92 +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"> - <!--Check that required fields are actually required--> - <actionGroup name="checkRequiredFieldsInGroupedProductForm"> - <annotations> - <description>Clears the Product Name and SKU fields when adding a Grouped Product and then verifies that they are required after attempting to Save.</description> - </annotations> - - <clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductSku"/> - <clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductName"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/> - <see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/> - <see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/> - </actionGroup> - - <!--Fill main fields in grouped product form--> - <actionGroup name="fillGroupedProductForm"> - <annotations> - <description>Fills in the provided Product Name and SKU on the Grouped Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="GroupedProduct"/> - </arguments> - - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> - </actionGroup> - - <!--Filter product grid and see expected grouped product--> - <actionGroup name="viewGroupedProductInAdminGrid"> - <annotations> - <description>Goes to the Admin Products grid page. Filters the grid for the provided Product. Validates that the provided Product appears in the grid.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="GroupedProduct"/> - </arguments> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <waitForPageLoad stepKey="waitForPageLoadInitial"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> - <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionProductType"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeProductNameInGrid"/> - <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> - </actionGroup> - - <!--Fill product min quantity in group products grid--> - <actionGroup name="fillDefaultQuantityForLinkedToGroupProductInGrid"> - <annotations> - <description>Fills the provided Qty for a Product linked to a Grouped Product.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - <argument name="qty" type="string"/> - </arguments> - - <fillField selector="{{AdminAddedProductsToGroupGrid.inputByProductName(productName)}}" userInput="{{qty}}" stepKey="fillDefaultQtyForLinkedProduct"/> - </actionGroup> - - <!-- Assign Specified Product To Grouped Product --> - <!-- Assumes web client is on grouped product edit page --> - <actionGroup name="AdminAssignProductToGroup"> - <annotations> - <description>Adds the provided Product to a Grouped Product on an Admin Grouped Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <scrollTo selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" x="0" y="-100" stepKey="scrollToGroupedSection"/> - <conditionalClick selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" dependentSelector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" visible="false" stepKey="openGroupedProductsSection"/> - <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/> - <conditionalClick selector="{{AdminAddProductsToGroupPanel.clearFilters}}" dependentSelector="{{AdminAddProductsToGroupPanel.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> - <click selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="showFiltersPanel"/> - <fillField userInput="{{product.name}}" selector="{{AdminAddProductsToGroupPanel.nameFilter}}" stepKey="fillNameFilter"/> - <click selector="{{AdminAddProductsToGroupPanel.applyFilters}}" stepKey="clickApplyFilters"/> - <click selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="selectProduct"/> - <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="clickAddSelectedGroupProducts"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/CheckRequiredFieldsInGroupedProductFormActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/CheckRequiredFieldsInGroupedProductFormActionGroup.xml new file mode 100644 index 0000000000000..26257dd98673c --- /dev/null +++ b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/CheckRequiredFieldsInGroupedProductFormActionGroup.xml @@ -0,0 +1,37 @@ +<?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"> + <!--Check that required fields are actually required--> + <actionGroup name="CheckRequiredFieldsInGroupedProductFormActionGroup"> + <annotations> + <description>Clears the Product Name and SKU fields when adding a Grouped Product and then verifies that they are required after attempting to Save.</description> + </annotations> + + <clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductSku"/> + <clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductName"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/> + <see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/> + <see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/> + </actionGroup> + + <!--Fill main fields in grouped product form--> + + + <!--Filter product grid and see expected grouped product--> + + + <!--Fill product min quantity in group products grid--> + + + <!-- Assign Specified Product To Grouped Product --> + <!-- Assumes web client is on grouped product edit page --> + +</actionGroups> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/FillDefaultQuantityForLinkedToGroupProductInGridActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/FillDefaultQuantityForLinkedToGroupProductInGridActionGroup.xml new file mode 100644 index 0000000000000..faa39eb70cced --- /dev/null +++ b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/FillDefaultQuantityForLinkedToGroupProductInGridActionGroup.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="FillDefaultQuantityForLinkedToGroupProductInGridActionGroup"> + <annotations> + <description>Fills the provided Qty for a Product linked to a Grouped Product.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="qty" type="string"/> + </arguments> + + <fillField selector="{{AdminAddedProductsToGroupGrid.inputByProductName(productName)}}" userInput="{{qty}}" stepKey="fillDefaultQtyForLinkedProduct"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/FillGroupedProductFormActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/FillGroupedProductFormActionGroup.xml new file mode 100644 index 0000000000000..c4df7f67ac201 --- /dev/null +++ b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/FillGroupedProductFormActionGroup.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="FillGroupedProductFormActionGroup"> + <annotations> + <description>Fills in the provided Product Name and SKU on the Grouped Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="GroupedProduct"/> + </arguments> + + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/ViewGroupedProductInAdminGridActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/ViewGroupedProductInAdminGridActionGroup.xml new file mode 100644 index 0000000000000..369a0c3f12970 --- /dev/null +++ b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/ViewGroupedProductInAdminGridActionGroup.xml @@ -0,0 +1,30 @@ +<?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="ViewGroupedProductInAdminGridActionGroup"> + <annotations> + <description>Goes to the Admin Products grid page. Filters the grid for the provided Product. Validates that the provided Product appears in the grid.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="GroupedProduct"/> + </arguments> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <waitForPageLoad stepKey="waitForPageLoadInitial"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> + <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionProductType"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeProductNameInGrid"/> + <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> + </actionGroup> +</actionGroups> From c0901615f14e004f28147909c609595ce7307194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 22:07:39 +0100 Subject: [PATCH 332/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../AssertEmailTemplateContentActionGroup.xml | 18 ++++ .../CreateCustomTemplateActionGroup.xml | 18 ++++ .../CreateNewTemplateActionGroup.xml | 33 +++++++ .../DeleteEmailTemplateActionGroup.xml | 21 +++++ .../ActionGroup/EmailTemplateActionGroup.xml | 86 ------------------- .../FindAndOpenEmailTemplateActionGroup.xml | 25 ++++++ .../PreviewEmailTemplateActionGroup.xml | 19 ++++ .../Test/AdminEmailTemplatePreviewTest.xml | 8 +- 8 files changed, 138 insertions(+), 90 deletions(-) create mode 100644 app/code/Magento/Email/Test/Mftf/ActionGroup/AssertEmailTemplateContentActionGroup.xml create mode 100644 app/code/Magento/Email/Test/Mftf/ActionGroup/CreateCustomTemplateActionGroup.xml create mode 100644 app/code/Magento/Email/Test/Mftf/ActionGroup/CreateNewTemplateActionGroup.xml create mode 100644 app/code/Magento/Email/Test/Mftf/ActionGroup/DeleteEmailTemplateActionGroup.xml delete mode 100644 app/code/Magento/Email/Test/Mftf/ActionGroup/EmailTemplateActionGroup.xml create mode 100644 app/code/Magento/Email/Test/Mftf/ActionGroup/FindAndOpenEmailTemplateActionGroup.xml create mode 100644 app/code/Magento/Email/Test/Mftf/ActionGroup/PreviewEmailTemplateActionGroup.xml diff --git a/app/code/Magento/Email/Test/Mftf/ActionGroup/AssertEmailTemplateContentActionGroup.xml b/app/code/Magento/Email/Test/Mftf/ActionGroup/AssertEmailTemplateContentActionGroup.xml new file mode 100644 index 0000000000000..653de14a56c9c --- /dev/null +++ b/app/code/Magento/Email/Test/Mftf/ActionGroup/AssertEmailTemplateContentActionGroup.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="AssertEmailTemplateContentActionGroup"> + <arguments> + <argument name="expectedContent" type="string" defaultValue="{{EmailTemplate.templateText}}"/> + </arguments> + + <see userInput="{{expectedContent}}" stepKey="checkTemplateContainText"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Email/Test/Mftf/ActionGroup/CreateCustomTemplateActionGroup.xml b/app/code/Magento/Email/Test/Mftf/ActionGroup/CreateCustomTemplateActionGroup.xml new file mode 100644 index 0000000000000..6fe1dfad761ff --- /dev/null +++ b/app/code/Magento/Email/Test/Mftf/ActionGroup/CreateCustomTemplateActionGroup.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="CreateCustomTemplateActionGroup" extends="CreateNewTemplateActionGroup"> + <remove keyForRemoval="selectValueFromTemplateDropDown"/> + <remove keyForRemoval="clickLoadTemplateButton"/> + + <fillField selector="{{AdminEmailTemplateEditSection.templateSubject}}" userInput="{{template.templateSubject}}" after="fillTemplateNameField" stepKey="fillTemplateSubject"/> + <fillField selector="{{AdminEmailTemplateEditSection.templateText}}" userInput="{{template.templateText}}" after="fillTemplateSubject" stepKey="fillTemplateText"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Email/Test/Mftf/ActionGroup/CreateNewTemplateActionGroup.xml b/app/code/Magento/Email/Test/Mftf/ActionGroup/CreateNewTemplateActionGroup.xml new file mode 100644 index 0000000000000..c6e45ad06971a --- /dev/null +++ b/app/code/Magento/Email/Test/Mftf/ActionGroup/CreateNewTemplateActionGroup.xml @@ -0,0 +1,33 @@ +<?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"> + <!--Create New Template --> + <actionGroup name="CreateNewTemplateActionGroup"> + <annotations> + <description>Clicks on Add New Template. Fills the Template details. Clicks on Save. PLEASE NOTE: The values are Hardcoded.</description> + </annotations> + <arguments> + <argument name="template" defaultValue="EmailTemplate"/> + </arguments> + + <!--Go to Marketing> Email Templates--> + <amOnPage url="{{AdminEmailTemplateIndexPage.url}}" stepKey="navigateToEmailTemplatePage"/> + <!--Click "Add New Template" button--> + <click selector="{{AdminMainActionsSection.add}}" stepKey="clickAddNewTemplateButton"/> + <!--Select value for "Template" drop-down menu in "Load Default Template" tab--> + <selectOption selector="{{AdminEmailTemplateEditSection.templateDropDown}}" userInput="Registry Update" stepKey="selectValueFromTemplateDropDown"/> + <!--Fill in required fields in "Template Information" tab and click "Save Template" button--> + <click selector="{{AdminEmailTemplateEditSection.loadTemplateButton}}" stepKey="clickLoadTemplateButton"/> + <fillField selector="{{AdminEmailTemplateEditSection.templateCode}}" userInput="{{EmailTemplate.templateName}}" stepKey="fillTemplateNameField"/> + <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveTemplateButton"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the email template." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Email/Test/Mftf/ActionGroup/DeleteEmailTemplateActionGroup.xml b/app/code/Magento/Email/Test/Mftf/ActionGroup/DeleteEmailTemplateActionGroup.xml new file mode 100644 index 0000000000000..b12f79da5f597 --- /dev/null +++ b/app/code/Magento/Email/Test/Mftf/ActionGroup/DeleteEmailTemplateActionGroup.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="DeleteEmailTemplateActionGroup" extends="FindAndOpenEmailTemplateActionGroup"> + <annotations> + <description>Clicks on Delete Template. Accepts the Popup. Validates that the Email Template is NOT present in the Email Templates Grid.</description> + </annotations> + <click selector="{{AdminEmailTemplateEditSection.deleteTemplateButton}}" after="checkTemplateName" stepKey="deleteTemplate"/> + <waitForElementVisible selector="{{AdminEmailTemplateEditSection.acceptPopupButton}}" after="deleteTemplate" stepKey="waitForConfirmButton"/> + <click selector="{{AdminEmailTemplateEditSection.acceptPopupButton}}" after="waitForConfirmButton" stepKey="acceptPopup"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" after="acceptPopup" stepKey="waitForSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the email template." after="waitForSuccessMessage" stepKey="seeSuccessfulMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Email/Test/Mftf/ActionGroup/EmailTemplateActionGroup.xml b/app/code/Magento/Email/Test/Mftf/ActionGroup/EmailTemplateActionGroup.xml deleted file mode 100644 index c859b956810c7..0000000000000 --- a/app/code/Magento/Email/Test/Mftf/ActionGroup/EmailTemplateActionGroup.xml +++ /dev/null @@ -1,86 +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"> - <!--Create New Template --> - <actionGroup name="CreateNewTemplate"> - <annotations> - <description>Clicks on Add New Template. Fills the Template details. Clicks on Save. PLEASE NOTE: The values are Hardcoded.</description> - </annotations> - <arguments> - <argument name="template" defaultValue="EmailTemplate"/> - </arguments> - - <!--Go to Marketing> Email Templates--> - <amOnPage url="{{AdminEmailTemplateIndexPage.url}}" stepKey="navigateToEmailTemplatePage"/> - <!--Click "Add New Template" button--> - <click selector="{{AdminMainActionsSection.add}}" stepKey="clickAddNewTemplateButton"/> - <!--Select value for "Template" drop-down menu in "Load Default Template" tab--> - <selectOption selector="{{AdminEmailTemplateEditSection.templateDropDown}}" userInput="Registry Update" stepKey="selectValueFromTemplateDropDown"/> - <!--Fill in required fields in "Template Information" tab and click "Save Template" button--> - <click selector="{{AdminEmailTemplateEditSection.loadTemplateButton}}" stepKey="clickLoadTemplateButton"/> - <fillField selector="{{AdminEmailTemplateEditSection.templateCode}}" userInput="{{EmailTemplate.templateName}}" stepKey="fillTemplateNameField"/> - <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveTemplateButton"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You saved the email template." stepKey="seeSuccessMessage"/> - </actionGroup> - - <!--Create New Custom Template --> - <actionGroup name="CreateCustomTemplate" extends="CreateNewTemplate"> - <remove keyForRemoval="selectValueFromTemplateDropDown"/> - <remove keyForRemoval="clickLoadTemplateButton"/> - - <fillField selector="{{AdminEmailTemplateEditSection.templateSubject}}" userInput="{{template.templateSubject}}" after="fillTemplateNameField" stepKey="fillTemplateSubject"/> - <fillField selector="{{AdminEmailTemplateEditSection.templateText}}" userInput="{{template.templateText}}" after="fillTemplateSubject" stepKey="fillTemplateText"/> - </actionGroup> - - <!-- Find and Open Email Template --> - <actionGroup name="FindAndOpenEmailTemplate"> - <arguments> - <argument name="template" defaultValue="EmailTemplate"/> - </arguments> - - <amOnPage url="{{AdminEmailTemplateIndexPage.url}}" stepKey="navigateEmailTemplatePage" /> - <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clearFilters"/> - <fillField selector="{{AdminEmailTemplateIndexSection.searchTemplateField}}" userInput="{{template.templateName}}" stepKey="findCreatedTemplate"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearch"/> - <waitForElementVisible selector="{{AdminEmailTemplateIndexSection.templateRowByName(template.templateName)}}" stepKey="waitForTemplatesAppeared"/> - <click selector="{{AdminEmailTemplateIndexSection.templateRowByName(template.templateName)}}" stepKey="clickToOpenTemplate"/> - <waitForElementVisible selector="{{AdminEmailTemplateEditSection.templateCode}}" stepKey="waitForTemplateNameisible"/> - <seeInField selector="{{AdminEmailTemplateEditSection.templateCode}}" userInput="{{template.templateName}}" stepKey="checkTemplateName"/> - </actionGroup> - - <actionGroup name="DeleteEmailTemplate" extends="FindAndOpenEmailTemplate"> - <annotations> - <description>Clicks on Delete Template. Accepts the Popup. Validates that the Email Template is NOT present in the Email Templates Grid.</description> - </annotations> - <click selector="{{AdminEmailTemplateEditSection.deleteTemplateButton}}" after="checkTemplateName" stepKey="deleteTemplate"/> - <waitForElementVisible selector="{{AdminEmailTemplateEditSection.acceptPopupButton}}" after="deleteTemplate" stepKey="waitForConfirmButton"/> - <click selector="{{AdminEmailTemplateEditSection.acceptPopupButton}}" after="waitForConfirmButton" stepKey="acceptPopup"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" after="acceptPopup" stepKey="waitForSuccessMessage"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the email template." after="waitForSuccessMessage" stepKey="seeSuccessfulMessage"/> - </actionGroup> - - <actionGroup name="PreviewEmailTemplate" extends="FindAndOpenEmailTemplate"> - <click selector="{{AdminEmailTemplateEditSection.previewTemplateButton}}" after="checkTemplateName" stepKey="clickPreviewTemplate"/> - <switchToNextTab after="clickPreviewTemplate" stepKey="switchToNewOpenedTab"/> - <seeInCurrentUrl url="{{AdminEmailTemplatePreviewPage.url}}" after="switchToNewOpenedTab" stepKey="seeCurrentUrl"/> - <seeElement selector="{{AdminEmailTemplatePreviewSection.iframe}}" after="seeCurrentUrl" stepKey="seeIframeOnPage"/> - <switchToIFrame userInput="preview_iframe" after="seeIframeOnPage" stepKey="switchToIframe"/> - <waitForPageLoad after="switchToIframe" stepKey="waitForPageLoaded"/> - </actionGroup> - - <actionGroup name="AssertEmailTemplateContent"> - <arguments> - <argument name="expectedContent" type="string" defaultValue="{{EmailTemplate.templateText}}"/> - </arguments> - - <see userInput="{{expectedContent}}" stepKey="checkTemplateContainText"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Email/Test/Mftf/ActionGroup/FindAndOpenEmailTemplateActionGroup.xml b/app/code/Magento/Email/Test/Mftf/ActionGroup/FindAndOpenEmailTemplateActionGroup.xml new file mode 100644 index 0000000000000..5e95b4a72b0ec --- /dev/null +++ b/app/code/Magento/Email/Test/Mftf/ActionGroup/FindAndOpenEmailTemplateActionGroup.xml @@ -0,0 +1,25 @@ +<?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="FindAndOpenEmailTemplateActionGroup"> + <arguments> + <argument name="template" defaultValue="EmailTemplate"/> + </arguments> + + <amOnPage url="{{AdminEmailTemplateIndexPage.url}}" stepKey="navigateEmailTemplatePage" /> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clearFilters"/> + <fillField selector="{{AdminEmailTemplateIndexSection.searchTemplateField}}" userInput="{{template.templateName}}" stepKey="findCreatedTemplate"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearch"/> + <waitForElementVisible selector="{{AdminEmailTemplateIndexSection.templateRowByName(template.templateName)}}" stepKey="waitForTemplatesAppeared"/> + <click selector="{{AdminEmailTemplateIndexSection.templateRowByName(template.templateName)}}" stepKey="clickToOpenTemplate"/> + <waitForElementVisible selector="{{AdminEmailTemplateEditSection.templateCode}}" stepKey="waitForTemplateNameisible"/> + <seeInField selector="{{AdminEmailTemplateEditSection.templateCode}}" userInput="{{template.templateName}}" stepKey="checkTemplateName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Email/Test/Mftf/ActionGroup/PreviewEmailTemplateActionGroup.xml b/app/code/Magento/Email/Test/Mftf/ActionGroup/PreviewEmailTemplateActionGroup.xml new file mode 100644 index 0000000000000..4038a34625800 --- /dev/null +++ b/app/code/Magento/Email/Test/Mftf/ActionGroup/PreviewEmailTemplateActionGroup.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="PreviewEmailTemplateActionGroup" extends="FindAndOpenEmailTemplateActionGroup"> + <click selector="{{AdminEmailTemplateEditSection.previewTemplateButton}}" after="checkTemplateName" stepKey="clickPreviewTemplate"/> + <switchToNextTab after="clickPreviewTemplate" stepKey="switchToNewOpenedTab"/> + <seeInCurrentUrl url="{{AdminEmailTemplatePreviewPage.url}}" after="switchToNewOpenedTab" stepKey="seeCurrentUrl"/> + <seeElement selector="{{AdminEmailTemplatePreviewSection.iframe}}" after="seeCurrentUrl" stepKey="seeIframeOnPage"/> + <switchToIFrame userInput="preview_iframe" after="seeIframeOnPage" stepKey="switchToIframe"/> + <waitForPageLoad after="switchToIframe" stepKey="waitForPageLoaded"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Email/Test/Mftf/Test/AdminEmailTemplatePreviewTest.xml b/app/code/Magento/Email/Test/Mftf/Test/AdminEmailTemplatePreviewTest.xml index 459e3c0f9290f..ca73de1f88fcc 100644 --- a/app/code/Magento/Email/Test/Mftf/Test/AdminEmailTemplatePreviewTest.xml +++ b/app/code/Magento/Email/Test/Mftf/Test/AdminEmailTemplatePreviewTest.xml @@ -27,14 +27,14 @@ <after> <!--Delete created Template--> - <actionGroup ref="DeleteEmailTemplate" stepKey="deleteTemplate"/> + <actionGroup ref="DeleteEmailTemplateActionGroup" stepKey="deleteTemplate"/> <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clearFilters"/> <!--Logout from Admin Area--> <actionGroup ref="logout" stepKey="logoutOfAdmin"/> </after> - <actionGroup ref="CreateCustomTemplate" stepKey="createTemplate"/> - <actionGroup ref="PreviewEmailTemplate" stepKey="previewTemplate"/> - <actionGroup ref="AssertEmailTemplateContent" stepKey="assertContent"/> + <actionGroup ref="CreateCustomTemplateActionGroup" stepKey="createTemplate"/> + <actionGroup ref="PreviewEmailTemplateActionGroup" stepKey="previewTemplate"/> + <actionGroup ref="AssertEmailTemplateContentActionGroup" stepKey="assertContent"/> </test> </tests> From e5bcfcdb9fede393d57d6d3f5c695aa20e008db4 Mon Sep 17 00:00:00 2001 From: Subash Natarajan <subash.natarajan@ziffity.com> Date: Fri, 29 Nov 2019 02:44:22 +0530 Subject: [PATCH 333/595] Escape html removed from error message --- .../Customer/Controller/Adminhtml/Group/Save.php | 12 ++---------- .../Unit/Controller/Adminhtml/Group/SaveTest.php | 7 +------ .../Customer/Controller/Adminhtml/GroupTest.php | 4 ++-- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Group/Save.php b/app/code/Magento/Customer/Controller/Adminhtml/Group/Save.php index fd6f0ed7daf54..64c94fa230fb1 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Group/Save.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Group/Save.php @@ -20,11 +20,6 @@ class Save extends \Magento\Customer\Controller\Adminhtml\Group implements HttpP */ protected $dataObjectProcessor; - /** - * @var \Magento\Framework\Escaper - */ - protected $escaper; - /** * * @param \Magento\Backend\App\Action\Context $context @@ -34,7 +29,6 @@ class Save extends \Magento\Customer\Controller\Adminhtml\Group implements HttpP * @param \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory * @param \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor - * @param \Magento\Framework\Escaper $escaper */ public function __construct( \Magento\Backend\App\Action\Context $context, @@ -43,11 +37,9 @@ public function __construct( GroupInterfaceFactory $groupDataFactory, \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory, \Magento\Framework\View\Result\PageFactory $resultPageFactory, - \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor, - \Magento\Framework\Escaper $escaper + \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor ) { $this->dataObjectProcessor = $dataObjectProcessor; - $this->escaper = $escaper; parent::__construct( $context, $coreRegistry, @@ -104,7 +96,7 @@ public function execute() $this->messageManager->addSuccessMessage(__('You saved the customer group.')); $resultRedirect->setPath('customer/group'); } catch (\Exception $e) { - $this->messageManager->addErrorMessage($this->escaper->escapeHtml($e->getMessage())); + $this->messageManager->addErrorMessage($e->getMessage()); if ($customerGroup != null) { $this->storeCustomerGroupDataToSession( $this->dataObjectProcessor->buildOutputDataArray( diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Group/SaveTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Group/SaveTest.php index 7edc631fc71c1..c9f885315b0ef 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Group/SaveTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Group/SaveTest.php @@ -87,10 +87,6 @@ protected function setUp() $this->dataObjectProcessorMock = $this->getMockBuilder(DataObjectProcessor::class) ->disableOriginalConstructor() ->getMock(); - $this->escaper = $this->getMockBuilder(\Magento\Framework\Escaper::class) - ->disableOriginalConstructor() - ->setMethods(['escapeHtml']) - ->getMock(); $this->request = $this->getMockBuilder(\Magento\Framework\App\RequestInterface::class) ->getMockForAbstractClass(); $this->resultRedirectFactory = $this->getMockBuilder(RedirectFactory::class) @@ -133,8 +129,7 @@ protected function setUp() $this->groupInterfaceFactoryMock, $this->forwardFactoryMock, $this->pageFactoryMock, - $this->dataObjectProcessorMock, - $this->escaper + $this->dataObjectProcessorMock ); } diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/GroupTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/GroupTest.php index db1cc4995e676..8daf74d037249 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/GroupTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/GroupTest.php @@ -199,7 +199,7 @@ public function testSaveActionCreateNewGroupWithoutCode() $this->dispatch('backend/customer/group/save'); $this->assertSessionMessages( - $this->equalTo(['"code" is required. Enter and try again.']), + $this->equalTo([htmlspecialchars('"code" is required. Enter and try again.')]), MessageInterface::TYPE_ERROR ); } @@ -292,7 +292,7 @@ public function testSaveActionNewGroupWithoutGroupCode() $this->dispatch('backend/customer/group/save'); $this->assertSessionMessages( - $this->equalTo(['"code" is required. Enter and try again.']), + $this->equalTo([htmlspecialchars('"code" is required. Enter and try again.')]), MessageInterface::TYPE_ERROR ); $this->assertSessionMessages($this->isEmpty(), MessageInterface::TYPE_SUCCESS); From 988705f2acfcafbf8128c40851a3f910497a485e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 22:17:39 +0100 Subject: [PATCH 334/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...AdminProductTypeSwitchingOnEditingTest.xml | 2 +- .../AddDownloadableProductLinkActionGroup.xml | 32 ++++++ ...ProductLinkWithMaxDownloadsActionGroup.xml | 30 ++++++ .../AddDownloadableSampleFileActionGroup.xml | 26 +++++ .../AddDownloadableSampleUrlActionGroup.xml | 25 +++++ .../AdminDownloadableProductActionGroup.xml | 102 ------------------ ...MainDownloadableProductFormActionGroup.xml | 25 +++++ ...AddDefaultImageDownloadableProductTest.xml | 4 +- ...AddDefaultVideoDownloadableProductTest.xml | 4 +- ...bleProductAndAssignItToCustomStoreTest.xml | 2 +- ...wnloadableProductWithCustomOptionsTest.xml | 2 +- ...loadableProductWithDefaultSetLinksTest.xml | 4 +- ...eDownloadableProductWithGroupPriceTest.xml | 4 +- ...bleProductWithInvalidDomainLinkUrlTest.xml | 4 +- ...nCreateDownloadableProductWithLinkTest.xml | 2 +- ...DownloadableProductWithManageStockTest.xml | 4 +- ...oadableProductWithOutOfStockStatusTest.xml | 4 +- ...ownloadableProductWithSpecialPriceTest.xml | 4 +- ...ductWithoutFillingQuantityAndStockTest.xml | 4 +- ...wnloadableProductWithoutTaxClassIdTest.xml | 4 +- ...AdminProductTypeSwitchingOnEditingTest.xml | 2 +- ...oveDefaultImageDownloadableProductTest.xml | 4 +- ...oveDefaultVideoDownloadableProductTest.xml | 4 +- ...leProductWithSeparateLinksFromCartTest.xml | 4 +- .../Test/Mftf/Test/EndToEndB2CAdminTest.xml | 10 +- ...wnloadableLinksDownloadableProductTest.xml | 4 +- ...ductsListWidgetDownloadableProductTest.xml | 4 +- ...wnloadableLinksDownloadableProductTest.xml | 4 +- 28 files changed, 180 insertions(+), 144 deletions(-) create mode 100644 app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableProductLinkActionGroup.xml create mode 100644 app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableProductLinkWithMaxDownloadsActionGroup.xml create mode 100644 app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableSampleFileActionGroup.xml create mode 100644 app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableSampleUrlActionGroup.xml delete mode 100644 app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AdminDownloadableProductActionGroup.xml create mode 100644 app/code/Magento/Downloadable/Test/Mftf/ActionGroup/FillMainDownloadableProductFormActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml index de065d2d930cb..609f9a6629a3d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml @@ -42,7 +42,7 @@ <waitForPageLoad stepKey="waitForDownloadableProductPageLoad"/> <actionGroup ref="AdminAddDownloadableLinkInformationActionGroup" stepKey="addDownloadableLinkInformation"/> <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <actionGroup ref="saveProductForm" stepKey="saveDownloadableProductForm"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableProductLinkActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableProductLinkActionGroup.xml new file mode 100644 index 0000000000000..d132b3bc609ae --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableProductLinkActionGroup.xml @@ -0,0 +1,32 @@ +<?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="AddDownloadableProductLinkActionGroup"> + <annotations> + <description>Clicks on 'Add Link', under the 'Links' section. Fills in the provided Link details including Unlimited Downloads.</description> + </annotations> + <arguments> + <argument name="link" defaultValue="downloadableLink"/> + <argument name="index" type="string" defaultValue="1"/> + </arguments> + + <click selector="{{AdminProductDownloadableSection.linksAddLinkButton}}" stepKey="clickLinkAddLinkButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <fillField userInput="{{link.title}}" selector="{{AdminProductDownloadableSection.addLinkTitleInput(index)}}" stepKey="fillDownloadableLinkTitle"/> + <fillField userInput="{{link.price}}" selector="{{AdminProductDownloadableSection.addLinkPriceInput(index)}}" stepKey="fillDownloadableLinkPrice"/> + <selectOption userInput="{{link.file_type}}" selector="{{AdminProductDownloadableSection.addLinkFileTypeSelector(index)}}" stepKey="selectDownloadableLinkFileType"/> + <selectOption userInput="{{link.sample_type}}" selector="{{AdminProductDownloadableSection.addLinkSampleTypeSelector(index)}}" stepKey="selectDownloadableLinkSampleType"/> + <selectOption userInput="{{link.shareable}}" selector="{{AdminProductDownloadableSection.addLinkShareableSelector(index)}}" stepKey="selectDownloadableLinkShareable"/> + <checkOption selector="{{AdminProductDownloadableSection.addLinkIsUnlimitedDownloads(index)}}" stepKey="checkDownloadableLinkUnlimited"/> + <fillField userInput="{{link.file}}" selector="{{AdminProductDownloadableSection.addLinkFileUrlInput(index)}}" stepKey="fillDownloadableLinkFileUrl"/> + <attachFile userInput="{{link.sample}}" selector="{{AdminProductDownloadableSection.addLinkSampleUploadFile(index)}}" stepKey="attachDownloadableLinkUploadSample"/> + <waitForPageLoad stepKey="waitForPageLoadAfterFillingOutForm" /> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableProductLinkWithMaxDownloadsActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableProductLinkWithMaxDownloadsActionGroup.xml new file mode 100644 index 0000000000000..fb21724130042 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableProductLinkWithMaxDownloadsActionGroup.xml @@ -0,0 +1,30 @@ +<?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="AddDownloadableProductLinkWithMaxDownloadsActionGroup"> + <annotations> + <description>Clicks on 'Add Link'. Fills in the provided Link details including a Max Downloads limit.</description> + </annotations> + <arguments> + <argument name="link" defaultValue="downloadableLinkWithMaxDownloads"/> + </arguments> + + <click selector="{{AdminProductDownloadableSection.linksAddLinkButton}}" stepKey="clickLinkAddLinkButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <fillField userInput="{{link.title}}" selector="{{AdminProductDownloadableSection.addLinkTitleInput('0')}}" stepKey="fillDownloadableLinkTitle"/> + <fillField userInput="{{link.price}}" selector="{{AdminProductDownloadableSection.addLinkPriceInput('0')}}" stepKey="fillDownloadableLinkPrice"/> + <selectOption userInput="{{link.file_type}}" selector="{{AdminProductDownloadableSection.addLinkFileTypeSelector('0')}}" stepKey="selectDownloadableLinkFileType"/> + <selectOption userInput="{{link.sample_type}}" selector="{{AdminProductDownloadableSection.addLinkSampleTypeSelector('0')}}" stepKey="selectDownloadableLinkSampleType"/> + <selectOption userInput="{{link.shareable}}" selector="{{AdminProductDownloadableSection.addLinkShareableSelector('0')}}" stepKey="selectDownloadableLinkShareable"/> + <fillField userInput="{{link.max_downloads}}" selector="{{AdminProductDownloadableSection.addLinkMaxDownloadsInput('0')}}" stepKey="fillDownloadableLinkMaxDownloads"/> + <attachFile userInput="{{link.file}}" selector="{{AdminProductDownloadableSection.addLinkFileUploadFile('0')}}" stepKey="fillDownloadableLinkUploadFile"/> + <fillField userInput="{{link.sample}}" selector="{{AdminProductDownloadableSection.addLinkSampleUrlInput('0')}}" stepKey="fillDownloadableLinkSampleUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableSampleFileActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableSampleFileActionGroup.xml new file mode 100644 index 0000000000000..b5b37d0a41b98 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableSampleFileActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AddDownloadableSampleFileActionGroup"> + <annotations> + <description>Clicks on 'Add Link' under the 'Samples' section. Fills in the provided Downloadable Sample File details.</description> + </annotations> + <arguments> + <argument name="sample" defaultValue="downloadableSampleFile"/> + </arguments> + + <click selector="{{AdminProductDownloadableSection.samplesAddLinkButton}}" stepKey="clickSampleAddLinkButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <fillField userInput="{{sample.title}}" selector="{{AdminProductDownloadableSection.addSampleTitleInput('0')}}" stepKey="fillDownloadableSampleTitle"/> + <selectOption userInput="{{sample.file_type}}" selector="{{AdminProductDownloadableSection.addSampleFileTypeSelector('0')}}" stepKey="selectDownloadableSampleFileType"/> + <attachFile userInput="{{sample.file}}" selector="{{AdminProductDownloadableSection.addSampleFileUploadFile('0')}}" stepKey="selectDownloadableSampleUpload"/> + <waitForAjaxLoad stepKey="waitForSampleFileUpload"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableSampleUrlActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableSampleUrlActionGroup.xml new file mode 100644 index 0000000000000..5002722feb51d --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AddDownloadableSampleUrlActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AddDownloadableSampleUrlActionGroup"> + <annotations> + <description>Clicks on 'Add Link' under the 'Samples' section. Fills in the provided Downloadable Sample URL details.</description> + </annotations> + <arguments> + <argument name="sample" defaultValue="downloadableSampleUrl"/> + </arguments> + + <click selector="{{AdminProductDownloadableSection.samplesAddLinkButton}}" stepKey="clickSampleAddLinkButton2"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <fillField userInput="{{sample.title}}" selector="{{AdminProductDownloadableSection.addSampleTitleInput('1')}}" stepKey="fillDownloadableSampleTitle"/> + <selectOption userInput="{{sample.file_type}}" selector="{{AdminProductDownloadableSection.addSampleFileTypeSelector('1')}}" stepKey="selectDownloadableSampleFileType"/> + <fillField userInput="{{sample.file}}" selector="{{AdminProductDownloadableSection.addSampleFileUrlInput('1')}}" stepKey="fillDownloadableSampleFileUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AdminDownloadableProductActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AdminDownloadableProductActionGroup.xml deleted file mode 100644 index 2d2cdd969ac9d..0000000000000 --- a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/AdminDownloadableProductActionGroup.xml +++ /dev/null @@ -1,102 +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"> - <!--Fill main fields in product form--> - <actionGroup name="fillMainDownloadableProductForm"> - <annotations> - <description>Fills the Name, SKU, Price and Quantity on the Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="DownloadableProduct"/> - </arguments> - - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/> - <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="fillProductQty"/> - </actionGroup> - - <!--Add a downloadable link that has max downloads--> - <actionGroup name="addDownloadableProductLinkWithMaxDownloads"> - <annotations> - <description>Clicks on 'Add Link'. Fills in the provided Link details including a Max Downloads limit.</description> - </annotations> - <arguments> - <argument name="link" defaultValue="downloadableLinkWithMaxDownloads"/> - </arguments> - - <click selector="{{AdminProductDownloadableSection.linksAddLinkButton}}" stepKey="clickLinkAddLinkButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <fillField userInput="{{link.title}}" selector="{{AdminProductDownloadableSection.addLinkTitleInput('0')}}" stepKey="fillDownloadableLinkTitle"/> - <fillField userInput="{{link.price}}" selector="{{AdminProductDownloadableSection.addLinkPriceInput('0')}}" stepKey="fillDownloadableLinkPrice"/> - <selectOption userInput="{{link.file_type}}" selector="{{AdminProductDownloadableSection.addLinkFileTypeSelector('0')}}" stepKey="selectDownloadableLinkFileType"/> - <selectOption userInput="{{link.sample_type}}" selector="{{AdminProductDownloadableSection.addLinkSampleTypeSelector('0')}}" stepKey="selectDownloadableLinkSampleType"/> - <selectOption userInput="{{link.shareable}}" selector="{{AdminProductDownloadableSection.addLinkShareableSelector('0')}}" stepKey="selectDownloadableLinkShareable"/> - <fillField userInput="{{link.max_downloads}}" selector="{{AdminProductDownloadableSection.addLinkMaxDownloadsInput('0')}}" stepKey="fillDownloadableLinkMaxDownloads"/> - <attachFile userInput="{{link.file}}" selector="{{AdminProductDownloadableSection.addLinkFileUploadFile('0')}}" stepKey="fillDownloadableLinkUploadFile"/> - <fillField userInput="{{link.sample}}" selector="{{AdminProductDownloadableSection.addLinkSampleUrlInput('0')}}" stepKey="fillDownloadableLinkSampleUrl"/> - </actionGroup> - - <!--Add a downloadable link with unlimited downloads--> - <actionGroup name="addDownloadableProductLink"> - <annotations> - <description>Clicks on 'Add Link', under the 'Links' section. Fills in the provided Link details including Unlimited Downloads.</description> - </annotations> - <arguments> - <argument name="link" defaultValue="downloadableLink"/> - <argument name="index" type="string" defaultValue="1"/> - </arguments> - - <click selector="{{AdminProductDownloadableSection.linksAddLinkButton}}" stepKey="clickLinkAddLinkButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <fillField userInput="{{link.title}}" selector="{{AdminProductDownloadableSection.addLinkTitleInput(index)}}" stepKey="fillDownloadableLinkTitle"/> - <fillField userInput="{{link.price}}" selector="{{AdminProductDownloadableSection.addLinkPriceInput(index)}}" stepKey="fillDownloadableLinkPrice"/> - <selectOption userInput="{{link.file_type}}" selector="{{AdminProductDownloadableSection.addLinkFileTypeSelector(index)}}" stepKey="selectDownloadableLinkFileType"/> - <selectOption userInput="{{link.sample_type}}" selector="{{AdminProductDownloadableSection.addLinkSampleTypeSelector(index)}}" stepKey="selectDownloadableLinkSampleType"/> - <selectOption userInput="{{link.shareable}}" selector="{{AdminProductDownloadableSection.addLinkShareableSelector(index)}}" stepKey="selectDownloadableLinkShareable"/> - <checkOption selector="{{AdminProductDownloadableSection.addLinkIsUnlimitedDownloads(index)}}" stepKey="checkDownloadableLinkUnlimited"/> - <fillField userInput="{{link.file}}" selector="{{AdminProductDownloadableSection.addLinkFileUrlInput(index)}}" stepKey="fillDownloadableLinkFileUrl"/> - <attachFile userInput="{{link.sample}}" selector="{{AdminProductDownloadableSection.addLinkSampleUploadFile(index)}}" stepKey="attachDownloadableLinkUploadSample"/> - <waitForPageLoad stepKey="waitForPageLoadAfterFillingOutForm" /> - </actionGroup> - - <!--Add a downloadable sample file--> - <actionGroup name="addDownloadableSampleFile"> - <annotations> - <description>Clicks on 'Add Link' under the 'Samples' section. Fills in the provided Downloadable Sample File details.</description> - </annotations> - <arguments> - <argument name="sample" defaultValue="downloadableSampleFile"/> - </arguments> - - <click selector="{{AdminProductDownloadableSection.samplesAddLinkButton}}" stepKey="clickSampleAddLinkButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <fillField userInput="{{sample.title}}" selector="{{AdminProductDownloadableSection.addSampleTitleInput('0')}}" stepKey="fillDownloadableSampleTitle"/> - <selectOption userInput="{{sample.file_type}}" selector="{{AdminProductDownloadableSection.addSampleFileTypeSelector('0')}}" stepKey="selectDownloadableSampleFileType"/> - <attachFile userInput="{{sample.file}}" selector="{{AdminProductDownloadableSection.addSampleFileUploadFile('0')}}" stepKey="selectDownloadableSampleUpload"/> - <waitForAjaxLoad stepKey="waitForSampleFileUpload"/> - </actionGroup> - - <!--Add a downloadable sample URL--> - <actionGroup name="addDownloadableSampleUrl"> - <annotations> - <description>Clicks on 'Add Link' under the 'Samples' section. Fills in the provided Downloadable Sample URL details.</description> - </annotations> - <arguments> - <argument name="sample" defaultValue="downloadableSampleUrl"/> - </arguments> - - <click selector="{{AdminProductDownloadableSection.samplesAddLinkButton}}" stepKey="clickSampleAddLinkButton2"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <fillField userInput="{{sample.title}}" selector="{{AdminProductDownloadableSection.addSampleTitleInput('1')}}" stepKey="fillDownloadableSampleTitle"/> - <selectOption userInput="{{sample.file_type}}" selector="{{AdminProductDownloadableSection.addSampleFileTypeSelector('1')}}" stepKey="selectDownloadableSampleFileType"/> - <fillField userInput="{{sample.file}}" selector="{{AdminProductDownloadableSection.addSampleFileUrlInput('1')}}" stepKey="fillDownloadableSampleFileUrl"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/FillMainDownloadableProductFormActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/FillMainDownloadableProductFormActionGroup.xml new file mode 100644 index 0000000000000..f18267459c4be --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/FillMainDownloadableProductFormActionGroup.xml @@ -0,0 +1,25 @@ +<?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"> + <!--Fill main fields in product form--> + <actionGroup name="FillMainDownloadableProductFormActionGroup"> + <annotations> + <description>Fills the Name, SKU, Price and Quantity on the Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="DownloadableProduct"/> + </arguments> + + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> + <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/> + <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="fillProductQty"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml index a7ce96ddf1fde..a9c0c8c058890 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml @@ -51,10 +51,10 @@ <fillField userInput="{{downloadableData.link_title}}" selector="{{AdminProductDownloadableSection.linksTitleInput}}" stepKey="fillDownloadableLinkTitle"/> <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkLinksPurchasedSeparately"/> <fillField userInput="{{downloadableData.sample_title}}" selector="{{AdminProductDownloadableSection.samplesTitleInput}}" stepKey="fillDownloadableSampleTitle"/> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableLinkWithMaxDownloads"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableLinkWithMaxDownloads"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> - <actionGroup ref="addDownloadableProductLink" stepKey="addDownloadableLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addDownloadableLink"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultVideoDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultVideoDownloadableProductTest.xml index d95ddaf12470d..814090c3f4450 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultVideoDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultVideoDownloadableProductTest.xml @@ -40,10 +40,10 @@ <fillField userInput="{{downloadableData.link_title}}" selector="{{AdminProductDownloadableSection.linksTitleInput}}" stepKey="fillLinkTitle" after="checkOptionIsDownloadable"/> <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately" after="fillLinkTitle"/> <fillField userInput="{{downloadableData.sample_title}}" selector="{{AdminProductDownloadableSection.samplesTitleInput}}" stepKey="fillSampleTitle" after="checkOptionPurchaseSeparately"/> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableProductLinkWithMaxDownloads" after="fillSampleTitle"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableProductLinkWithMaxDownloads" after="fillSampleTitle"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> - <actionGroup ref="addDownloadableProductLink" stepKey="addDownloadableProductLink" before="saveProductForm"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addDownloadableProductLink" before="saveProductForm"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductAndAssignItToCustomStoreTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductAndAssignItToCustomStoreTest.xml index 4f07334640cf3..2e196d1d4e115 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductAndAssignItToCustomStoreTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductAndAssignItToCustomStoreTest.xml @@ -69,7 +69,7 @@ <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> <!-- Add downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml index 54a2ff606f384..c6bbbc1f6885a 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml @@ -81,7 +81,7 @@ <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> <!-- Add downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml index 24741c281d7f6..7e8950cbfb6e0 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml @@ -65,12 +65,12 @@ <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> <!-- Add first downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addFirstDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <!-- Add second downloadable link --> - <actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addSecondDownloadableProductLink"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithGroupPriceTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithGroupPriceTest.xml index 06cf31b763f1c..92b409b4e882e 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithGroupPriceTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithGroupPriceTest.xml @@ -69,12 +69,12 @@ <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> <!-- Add first downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addFirstDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <!-- Add second downloadable link --> - <actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addSecondDownloadableProductLink"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithInvalidDomainLinkUrlTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithInvalidDomainLinkUrlTest.xml index f2e4bdfb4890f..d21d44b85df89 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithInvalidDomainLinkUrlTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithInvalidDomainLinkUrlTest.xml @@ -21,7 +21,7 @@ <before> <remove keyForRemoval="addDownloadableDomain" /> </before> - <actionGroup ref="addDownloadableProductLink" stepKey="addDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addDownloadableProductLink"> <argument name="link" value="downloadableLink"/> <argument name="index" value="0"/> </actionGroup> @@ -33,7 +33,7 @@ </actionGroup> <checkOption selector="{{AdminProductDownloadableSection.isDownloadableProduct}}" stepKey="checkIsDownloadable" after="fillDownloadableProductFormAgain"/> <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkIsLinksPurchasedSeparately" after="checkIsDownloadable"/> - <actionGroup ref="addDownloadableProductLink" stepKey="addDownloadableProductLinkAgain" after="checkIsLinksPurchasedSeparately"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addDownloadableProductLinkAgain" after="checkIsLinksPurchasedSeparately"> <argument name="link" value="downloadableLink"/> <argument name="index" value="0"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml index e43b8f94c7a3d..3dfe45341b694 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml @@ -63,7 +63,7 @@ <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> <!-- Add downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml index fb6a48254fa8d..14f7fca32782f 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml @@ -76,12 +76,12 @@ <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> <!-- Add first downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addFirstDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <!-- Add second downloadable link --> - <actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addSecondDownloadableProductLink"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithOutOfStockStatusTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithOutOfStockStatusTest.xml index 5e3fe6836f7e9..737945715cd57 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithOutOfStockStatusTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithOutOfStockStatusTest.xml @@ -63,12 +63,12 @@ <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> <!-- Add first downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addFirstDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <!-- Add second downloadable link --> - <actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addSecondDownloadableProductLink"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithSpecialPriceTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithSpecialPriceTest.xml index fb59d51831bae..4e01fb575f9f4 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithSpecialPriceTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithSpecialPriceTest.xml @@ -68,12 +68,12 @@ <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> <!-- Add first downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addFirstDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <!-- Add second downloadable link --> - <actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addSecondDownloadableProductLink"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutFillingQuantityAndStockTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutFillingQuantityAndStockTest.xml index af9487e3e6a23..12d2d5492d12b 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutFillingQuantityAndStockTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutFillingQuantityAndStockTest.xml @@ -65,12 +65,12 @@ <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> <!-- Add first downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addFirstDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <!-- Add second downloadable link --> - <actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addSecondDownloadableProductLink"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutTaxClassIdTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutTaxClassIdTest.xml index dd7e3331a0ed2..670f9f66c186b 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutTaxClassIdTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutTaxClassIdTest.xml @@ -66,12 +66,12 @@ <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> <!-- Add first downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addFirstDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <!-- Add second downloadable link --> - <actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addSecondDownloadableProductLink"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml index 20c1acaf8d612..ff76180e34d05 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml @@ -59,7 +59,7 @@ <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has no weight" stepKey="selectNoWeightForProduct"/> <actionGroup ref="AdminAddDownloadableLinkInformationActionGroup" stepKey="addDownloadableLinkInformation"/> <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately"/> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <actionGroup ref="saveProductForm" stepKey="saveDownloadableProductForm"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultImageDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultImageDownloadableProductTest.xml index 3597c12e82df0..90d77a016629b 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultImageDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultImageDownloadableProductTest.xml @@ -48,10 +48,10 @@ <fillField userInput="{{downloadableData.link_title}}" selector="{{AdminProductDownloadableSection.linksTitleInput}}" stepKey="fillDownloadableLinkTitle"/> <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkLinksPurchasedSeparately"/> <fillField userInput="{{downloadableData.sample_title}}" selector="{{AdminProductDownloadableSection.samplesTitleInput}}" stepKey="fillDownloadableSampleTitle"/> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableLinkWithMaxDownloads"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableLinkWithMaxDownloads"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> - <actionGroup ref="addDownloadableProductLink" stepKey="addDownloadableLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addDownloadableLink"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultVideoDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultVideoDownloadableProductTest.xml index 0d98862d9a5e7..ff31087b05d20 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultVideoDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultVideoDownloadableProductTest.xml @@ -41,10 +41,10 @@ <fillField userInput="{{downloadableData.link_title}}" selector="{{AdminProductDownloadableSection.linksTitleInput}}" stepKey="fillLinkTitle" after="checkOptionIsDownloadable"/> <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOptionPurchaseSeparately" after="fillLinkTitle"/> <fillField userInput="{{downloadableData.sample_title}}" selector="{{AdminProductDownloadableSection.samplesTitleInput}}" stepKey="fillSampleTitle" after="checkOptionPurchaseSeparately"/> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableProductLinkWithMaxDownloads" after="fillSampleTitle"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableProductLinkWithMaxDownloads" after="fillSampleTitle"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> - <actionGroup ref="addDownloadableProductLink" stepKey="addDownloadableProductLink" before="saveProductForm"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addDownloadableProductLink" before="saveProductForm"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/EditDownloadableProductWithSeparateLinksFromCartTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/EditDownloadableProductWithSeparateLinksFromCartTest.xml index 274dd39468a2b..6beb145de5cfa 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/EditDownloadableProductWithSeparateLinksFromCartTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/EditDownloadableProductWithSeparateLinksFromCartTest.xml @@ -51,12 +51,12 @@ stepKey="checkOptionPurchaseSeparately"/> <!-- Add first downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addFirstDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <!-- Add second downloadable link --> - <actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addSecondDownloadableProductLink"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/EndToEndB2CAdminTest.xml index 75a66cec91692..18b851f08927b 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -14,7 +14,7 @@ <actionGroup ref="goToCreateProductPage" stepKey="goToCreateDownloadableProduct" after="waitForProductPageLoadDownloadable"> <argument name="product" value="DownloadableProduct"/> </actionGroup> - <actionGroup ref="fillMainDownloadableProductForm" stepKey="fillMainProductFormDownloadable" after="goToCreateDownloadableProduct"> + <actionGroup ref="FillMainDownloadableProductFormActionGroup" stepKey="fillMainProductFormDownloadable" after="goToCreateDownloadableProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -25,22 +25,22 @@ <fillField userInput="{{downloadableData.sample_title}}" selector="{{AdminProductDownloadableSection.samplesTitleInput}}" stepKey="fillDownloadableSampleTitle" after="checkLinksPurchasedSeparately"/> <!-- Link 1 --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableLinkWithMaxDownloads" after="fillDownloadableSampleTitle"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableLinkWithMaxDownloads" after="fillDownloadableSampleTitle"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <!-- Link 2 --> - <actionGroup ref="addDownloadableProductLink" stepKey="addDownloadableLink" after="addDownloadableLinkWithMaxDownloads"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addDownloadableLink" after="addDownloadableLinkWithMaxDownloads"> <argument name="link" value="downloadableLink"/> </actionGroup> <!-- Sample 1 --> - <actionGroup ref="addDownloadableSampleFile" stepKey="addDownloadSampleFile" after="addDownloadableLink"> + <actionGroup ref="AddDownloadableSampleFileActionGroup" stepKey="addDownloadSampleFile" after="addDownloadableLink"> <argument name="sample" value="downloadableSampleFile"/> </actionGroup> <!-- Sample 2 --> - <actionGroup ref="addDownloadableSampleUrl" stepKey="addDownloadableSampleUrl" after="addDownloadSampleFile"> + <actionGroup ref="AddDownloadableSampleUrlActionGroup" stepKey="addDownloadableSampleUrl" after="addDownloadSampleFile"> <argument name="sample" value="downloadableSampleUrl"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/ManualSelectAllDownloadableLinksDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/ManualSelectAllDownloadableLinksDownloadableProductTest.xml index a86fd544d24d6..505151c3ac458 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/ManualSelectAllDownloadableLinksDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/ManualSelectAllDownloadableLinksDownloadableProductTest.xml @@ -51,12 +51,12 @@ stepKey="checkOptionPurchaseSeparately"/> <!-- Add first downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addFirstDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <!-- Add second downloadable link --> - <actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addSecondDownloadableProductLink"> <argument name="link" value="downloadableLink"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/NewProductsListWidgetDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/NewProductsListWidgetDownloadableProductTest.xml index 94fca6f507637..55c673146021d 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/NewProductsListWidgetDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/NewProductsListWidgetDownloadableProductTest.xml @@ -46,7 +46,7 @@ <fillField userInput="This Is A Title" selector="{{AdminProductDownloadableSection.linksTitleInput}}" stepKey="fillDownloadableLinkTitle"/> <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkLinksPurchasedSeparately"/> <fillField userInput="This Is Another Title" selector="{{AdminProductDownloadableSection.samplesTitleInput}}" stepKey="fillDownloadableSampleTitle"/> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableLinkWithMaxDownloads"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addDownloadableLinkWithMaxDownloads"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/> @@ -59,4 +59,4 @@ <waitForPageLoad stepKey="waitForCmsPage"/> <see selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" userInput="{{_defaultProduct.name}}" stepKey="seeProductName"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/SelectAllDownloadableLinksDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/SelectAllDownloadableLinksDownloadableProductTest.xml index f9ca6fea09cf0..fdd4268bd84e1 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/SelectAllDownloadableLinksDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/SelectAllDownloadableLinksDownloadableProductTest.xml @@ -51,12 +51,12 @@ stepKey="checkOptionPurchaseSeparately"/> <!-- Add first downloadable link --> - <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addFirstDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkWithMaxDownloadsActionGroup" stepKey="addFirstDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> <!-- Add second downloadable link --> - <actionGroup ref="addDownloadableProductLink" stepKey="addSecondDownloadableProductLink"> + <actionGroup ref="AddDownloadableProductLinkActionGroup" stepKey="addSecondDownloadableProductLink"> <argument name="link" value="downloadableLink"/> </actionGroup> From 8ac3bba1327060112cd2b437f95d9fbc71fea89a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 22:27:30 +0100 Subject: [PATCH 335/595] FIX: Update references to the right ones (forgot to replace) --- ...equiredFieldsInGroupedProductFormActionGroup.xml | 13 ------------- .../Test/AdminAddDefaultImageGroupedProductTest.xml | 2 +- .../Test/AdminAddDefaultVideoGroupedProductTest.xml | 2 +- ...AdminCreateAndEditGroupedProductSettingsTest.xml | 4 ++-- .../Test/Mftf/Test/AdminGroupedProductsListTest.xml | 2 +- .../Test/AdminGroupedSetEditRelatedProductsTest.xml | 2 +- .../AdminRemoveDefaultImageGroupedProductTest.xml | 2 +- .../AdminRemoveDefaultVideoGroupedProductTest.xml | 2 +- .../Test/AdminSortingAssociatedProductsTest.xml | 2 +- .../Test/Mftf/Test/EndToEndB2CAdminTest.xml | 8 ++++---- 10 files changed, 13 insertions(+), 26 deletions(-) diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/CheckRequiredFieldsInGroupedProductFormActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/CheckRequiredFieldsInGroupedProductFormActionGroup.xml index 26257dd98673c..84bb291120ee5 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/CheckRequiredFieldsInGroupedProductFormActionGroup.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/CheckRequiredFieldsInGroupedProductFormActionGroup.xml @@ -21,17 +21,4 @@ <see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/> <see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/> </actionGroup> - - <!--Fill main fields in grouped product form--> - - - <!--Filter product grid and see expected grouped product--> - - - <!--Fill product min quantity in group products grid--> - - - <!-- Assign Specified Product To Grouped Product --> - <!-- Assumes web client is on grouped product edit page --> - </actionGroups> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml index f2cb2cc993a50..3618e90e6efda 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml @@ -45,7 +45,7 @@ <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> - <actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="GroupedProduct"/> </actionGroup> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultVideoGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultVideoGroupedProductTest.xml index c3a95bbef3aa3..9892df4bb0b41 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultVideoGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultVideoGroupedProductTest.xml @@ -32,7 +32,7 @@ <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> <argument name="product" value="GroupedProduct"/> </actionGroup> - <actionGroup ref="fillGroupedProductForm" stepKey="fillMainProductForm"> + <actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="GroupedProduct"/> </actionGroup> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml index 62a685554f735..8420de66a1604 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml @@ -52,12 +52,12 @@ </actionGroup> <!-- Fill all main fields --> - <actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="GroupedProduct"/> </actionGroup> <!-- Add simple product to the Group --> - <actionGroup ref="AdminAssignProductToGroup" stepKey="addFirstSimpleToGroup"> + <actionGroup ref="AdminAssignProductToGroupActionGroup" stepKey="addFirstSimpleToGroup"> <argument name="product" value="$$createProduct$$"/> </actionGroup> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductsListTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductsListTest.xml index b59cf1e2175d8..8c9b9ee552ffe 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductsListTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductsListTest.xml @@ -42,7 +42,7 @@ <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> <argument name="product" value="GroupedProduct"/> </actionGroup> - <actionGroup ref="fillGroupedProductForm" stepKey="fillMainProductForm"> + <actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="GroupedProduct"/> </actionGroup> <!-- Add two simple products to grouped product --> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml index 8117d627a370c..cddadff986539 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml @@ -30,7 +30,7 @@ <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> - <actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="GroupedProduct"/> </actionGroup> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultImageGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultImageGroupedProductTest.xml index da7cfaeb71566..de899d77a9a7a 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultImageGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultImageGroupedProductTest.xml @@ -42,7 +42,7 @@ <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> - <actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="GroupedProduct"/> </actionGroup> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultVideoGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultVideoGroupedProductTest.xml index e322d4a1eb038..3bd74c103a519 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultVideoGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultVideoGroupedProductTest.xml @@ -32,7 +32,7 @@ <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> <argument name="product" value="GroupedProduct"/> </actionGroup> - <actionGroup ref="fillGroupedProductForm" stepKey="fillMainProductForm"> + <actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="GroupedProduct"/> </actionGroup> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminSortingAssociatedProductsTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminSortingAssociatedProductsTest.xml index ad5fbbb30edeb..dc6cde31c1ae6 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminSortingAssociatedProductsTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminSortingAssociatedProductsTest.xml @@ -133,7 +133,7 @@ <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> - <actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="GroupedProduct"/> </actionGroup> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml index dbe3dddfca81b..80b7640f8283c 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -14,8 +14,8 @@ <actionGroup ref="goToCreateProductPage" stepKey="goToCreateGroupedProduct" after="waitForProductPageLoadGrouped"> <argument name="product" value="GroupedProduct"/> </actionGroup> - <actionGroup ref="checkRequiredFieldsInGroupedProductForm" stepKey="checkRequiredFieldsProductGrouped" after="goToCreateGroupedProduct"/> - <actionGroup ref="fillGroupedProductForm" stepKey="fillGroupedProductForm" after="checkRequiredFieldsProductGrouped"> + <actionGroup ref="CheckRequiredFieldsInGroupedProductFormActionGroup" stepKey="checkRequiredFieldsProductGrouped" after="goToCreateGroupedProduct"/> + <actionGroup ref="FillGroupedProductFormActionGroup" stepKey="fillGroupedProductForm" after="checkRequiredFieldsProductGrouped"> <argument name="product" value="GroupedProduct"/> </actionGroup> <scrollTo selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" x="0" y="-100" stepKey="scrollToGroupedSection" after="fillGroupedProductForm"/> @@ -29,7 +29,7 @@ <checkOption selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="checkFilterResult" after="filterGroupedProductOptions"/> <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="clickAddSelectedGroupProducts" after="checkFilterResult"/> <actionGroup ref="saveProductForm" stepKey="saveGroupedProduct" after="clickAddSelectedGroupProducts"/> - <actionGroup ref="viewGroupedProductInAdminGrid" stepKey="viewGroupedProductInGrid" after="saveGroupedProduct"> + <actionGroup ref="ViewGroupedProductInAdminGridActionGroup" stepKey="viewGroupedProductInGrid" after="saveGroupedProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> @@ -39,4 +39,4 @@ <argument name="product" value="GroupedProduct"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> From c6c5a3302467f20e270dc5d20ff5b4f23e3f2e8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 28 Nov 2019 22:53:03 +0100 Subject: [PATCH 336/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../AdminCurrencyRatesActionGroup.xml | 16 -------------- .../AdminSaveCurrencyRatesActionGroup.xml | 16 ++++++++++++++ .../AdminSetCurrencyRatesActionGroup.xml | 22 +++++++++++++++++++ .../StorefrontCurrencyRatesActionGroup.xml | 9 -------- ...ayWhenChooseThreeAllowedCurrenciesTest.xml | 2 +- 5 files changed, 39 insertions(+), 26 deletions(-) create mode 100644 app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminSaveCurrencyRatesActionGroup.xml create mode 100644 app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminSetCurrencyRatesActionGroup.xml diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminCurrencyRatesActionGroup.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminCurrencyRatesActionGroup.xml index a2e25cf858a6e..7f2a9846f3fd0 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminCurrencyRatesActionGroup.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminCurrencyRatesActionGroup.xml @@ -16,20 +16,4 @@ <click selector="{{AdminCurrencyRatesSection.import}}" stepKey="clickImport"/> <waitForElementVisible selector="{{AdminCurrencyRatesSection.oldRate}}" stepKey="waitForOldRateVisible"/> </actionGroup> - <actionGroup name="AdminSaveCurrencyRatesActionGroup"> - <click selector="{{AdminCurrencyRatesSection.saveCurrencyRates}}" stepKey="clickSaveCurrencyRates"/> - <waitForPageLoad stepKey="waitForSave"/> - <see selector="{{AdminMessagesSection.success}}" userInput="All valid rates have been saved." stepKey="seeSuccessMessage"/> - </actionGroup> - <actionGroup name="AdminSetCurrencyRatesActionGroup"> - <arguments> - <argument name="firstCurrency" type="string" defaultValue="USD"/> - <argument name="secondCurrency" type="string" defaultValue="EUR"/> - <argument name="rate" type="string" defaultValue="0.5"/> - </arguments> - <fillField selector="{{AdminCurrencyRatesSection.currencyRate(firstCurrency, secondCurrency)}}" userInput="{{rate}}" stepKey="setCurrencyRate"/> - <click selector="{{AdminCurrencyRatesSection.saveCurrencyRates}}" stepKey="clickSaveCurrencyRates"/> - <waitForPageLoad stepKey="waitForSave"/> - <see selector="{{AdminMessagesSection.success}}" userInput="{{AdminSaveCurrencyRatesMessageData.success}}" stepKey="seeSuccessMessage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminSaveCurrencyRatesActionGroup.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminSaveCurrencyRatesActionGroup.xml new file mode 100644 index 0000000000000..82401eea34aca --- /dev/null +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminSaveCurrencyRatesActionGroup.xml @@ -0,0 +1,16 @@ +<?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="AdminSaveCurrencyRatesActionGroup"> + <click selector="{{AdminCurrencyRatesSection.saveCurrencyRates}}" stepKey="clickSaveCurrencyRates"/> + <waitForPageLoad stepKey="waitForSave"/> + <see selector="{{AdminMessagesSection.success}}" userInput="All valid rates have been saved." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminSetCurrencyRatesActionGroup.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminSetCurrencyRatesActionGroup.xml new file mode 100644 index 0000000000000..6b8a93ef3542d --- /dev/null +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminSetCurrencyRatesActionGroup.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="AdminSetCurrencyRatesActionGroup"> + <arguments> + <argument name="firstCurrency" type="string" defaultValue="USD"/> + <argument name="secondCurrency" type="string" defaultValue="EUR"/> + <argument name="rate" type="string" defaultValue="0.5"/> + </arguments> + <fillField selector="{{AdminCurrencyRatesSection.currencyRate(firstCurrency, secondCurrency)}}" userInput="{{rate}}" stepKey="setCurrencyRate"/> + <click selector="{{AdminCurrencyRatesSection.saveCurrencyRates}}" stepKey="clickSaveCurrencyRates"/> + <waitForPageLoad stepKey="waitForSave"/> + <see selector="{{AdminMessagesSection.success}}" userInput="{{AdminSaveCurrencyRatesMessageData.success}}" stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/StorefrontCurrencyRatesActionGroup.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/StorefrontCurrencyRatesActionGroup.xml index 02cf23c323a8a..2f6d1df102d06 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/StorefrontCurrencyRatesActionGroup.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/StorefrontCurrencyRatesActionGroup.xml @@ -17,13 +17,4 @@ <click selector="{{StorefrontSwitchCurrencyRatesSection.currency(currency)}}" stepKey="chooseCurrency"/> <see selector="{{StorefrontSwitchCurrencyRatesSection.selectedCurrency}}" userInput="{{currency}}" stepKey="seeSelectedCurrency"/> </actionGroup> - <actionGroup name="StorefrontSwitchCurrency"> - <arguments> - <argument name="currency" type="string" defaultValue="EUR"/> - </arguments> - <click selector="{{StorefrontSwitchCurrencyRatesSection.currencyTrigger}}" stepKey="openTrigger"/> - <waitForElementVisible selector="{{StorefrontSwitchCurrencyRatesSection.currency(currency)}}" stepKey="waitForCurrency"/> - <click selector="{{StorefrontSwitchCurrencyRatesSection.currency(currency)}}" stepKey="chooseCurrency"/> - <see selector="{{StorefrontSwitchCurrencyRatesSection.selectedCurrency}}" userInput="{{currency}}" stepKey="seeSelectedCurrency"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml index 26fbfd394be68..8783f1cee041b 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml @@ -45,7 +45,7 @@ <!--Open created product on Storefront and place for order--> <amOnPage url="{{StorefrontProductPage.url($$createNewProduct.custom_attributes[url_key]$$)}}" stepKey="goToNewProductPage"/> <waitForPageLoad stepKey="waitForNewProductPagePageLoad"/> - <actionGroup ref="StorefrontSwitchCurrency" stepKey="switchCurrency"> + <actionGroup ref="StorefrontSwitchCurrencyActionGroup" stepKey="switchCurrency"> <argument name="currency" value="RUB"/> </actionGroup> <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontNewProductPage"> From 121a17d31906f2cedc266e0c5a316b9b15cc0064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Fri, 29 Nov 2019 00:04:35 +0100 Subject: [PATCH 337/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../Test/AdminDeleteCatalogPriceRuleTest.xml | 2 +- .../Mftf/Test/SearchEntityResultsTest.xml | 4 +- ...oductConfigurationAttributeActionGroup.xml | 49 ++ ...ProductToConfigurationsGridActionGroup.xml | 29 + ...ToConfigurableProductOptionActionGroup.xml | 27 + ...ToConfigurableProductOptionActionGroup.xml | 25 + ...ToConfigurableProductOptionActionGroup.xml | 21 + .../AdminConfigurableProductActionGroup.xml | 545 ------------------ ...roductDisableConfigurationsActionGroup.xml | 19 + ...gurableWizardMoveToNextStepActionGroup.xml | 23 + ...reateApiConfigurableProductActionGroup.xml | 17 - ...rableProductWithHiddenChildActionGroup.xml | 26 + ...tWithAttributeUncheckOptionActionGroup.xml | 25 + ...eConfigurationsForAttributeActionGroup.xml | 22 + ...leProductOnAdminProductPageActionGroup.xml | 23 + ...riceOnStorefrontProductPageActionGroup.xml | 26 + ...AndPriceInStorefrontProductActionGroup.xml | 25 + ...mageInStorefrontProductPageActionGroup.xml | 26 + ...bleProductChildProductPriceActionGroup.xml | 21 + ...ProductConfigurationsInGridActionGroup.xml | 31 + ...nfigurationsInGridExceptSkuActionGroup.xml | 19 + .../CreateConfigurableProductActionGroup.xml | 75 +++ ...ableProductWithAttributeSetActionGroup.xml | 27 + ...bleProductWithTwoAttributesActionGroup.xml | 57 ++ ...eConfigurationsForAttributeActionGroup.xml | 22 + ...tionsForAttributeWithImagesActionGroup.xml | 29 + ...nfigurationsForTwoAttributeActionGroup.xml | 34 ++ ....xml => CreateNewAttributeActionGroup.xml} | 74 +-- .../CreateOptionsForAttributeActionGroup.xml | 31 + .../DeleteCreatedAttributeActionGroup.xml | 45 ++ .../FillAllRequiredFieldsActionGroup.xml | 24 + ...dProductAfterSettingOptionsActionGroup.xml | 15 + ...nfigurationsByAttributeCodeActionGroup.xml | 32 + .../GotoCatalogProductsPageActionGroup.xml | 22 + ...GotoConfigurableProductPageActionGroup.xml | 21 + .../SaveConfigurableProductActionGroup.xml | 23 + ...uctAddToCurrentAttributeSetActionGroup.xml | 22 + ...eProductWithNewAttributeSetActionGroup.xml | 23 + .../SaveConfiguredProductActionGroup.xml | 20 + ...ttributeAndCreateTwoOptionsActionGroup.xml | 28 + ...SingleAttributeAndAddToCartActionGroup.xml | 26 + ...eConfigurationsForAttributeActionGroup.xml | 15 + ...ategoryConfigurableProductActionGroup.xml} | 17 +- ...tOfStockConfigurableProductActionGroup.xml | 24 + ...ontCheckConfigurableProductActionGroup.xml | 31 + ...kConfigurableProductOptionsActionGroup.xml | 32 + ...AndCheckConfigurableProductActionGroup.xml | 24 + .../StorefrontProductActionGroup.xml | 134 ----- .../StorefrontProductCartActionGroup.xml | 12 - ...fyOptionInProductStorefrontActionGroup.xml | 22 + ...figurableProductInAdminGridActionGroup.xml | 41 ++ ...agesAndPricesToConfigurableProductTest.xml | 6 +- ...hangedWhenSavingProductWithSameSkuTest.xml | 2 +- ...bleProductAttributeValueUniquenessTest.xml | 2 +- ...CheckResultsOfColorAndOtherFiltersTest.xml | 14 +- .../AdminConfigurableProductCreateTest.xml | 2 +- .../AdminConfigurableProductLongSkuTest.xml | 2 +- .../AdminConfigurableProductUpdateTest.xml | 4 +- ...ConfigurableSetEditRelatedProductsTest.xml | 2 +- .../Test/AdminCreateAndSwitchProductType.xml | 18 +- ...onfigurableProductBasedOnParentSkuTest.xml | 8 +- ...ctWithCreatingCategoryAndAttributeTest.xml | 12 +- ...roductWithDisabledChildrenProductsTest.xml | 6 +- ...reateConfigurableProductWithImagesTest.xml | 16 +- ...eeProductDisplayOutOfStockProductsTest.xml | 12 +- ...oductDontDisplayOutOfStockProductsTest.xml | 12 +- ...ableProductWithTierPriceForOneItemTest.xml | 6 +- ...ctWithTwoOptionsAssignedToCategoryTest.xml | 10 +- ...woOptionsWithoutAssignedToCategoryTest.xml | 8 +- ...AdminProductTypeSwitchingOnEditingTest.xml | 8 +- ...igurableProductAttributeNameDesignTest.xml | 10 +- .../Test/Mftf/Test/EndToEndB2CAdminTest.xml | 4 +- .../Mftf/Test/EndToEndB2CGuestUserTest.xml | 32 +- .../Mftf/Test/EndToEndB2CLoggedInUserTest.xml | 16 +- ...orefrontConfigurableProductDetailsTest.xml | 10 +- .../StorefrontConfigurableProductViewTest.xml | 6 +- ...gurableProductWithFileCustomOptionTest.xml | 4 +- ...efrontVisibilityOfDuplicateProductTest.xml | 28 +- ...uctWithAttributesImagesAndSwatchesTest.xml | 2 +- ...figurableProductSwatchMinimumPriceTest.xml | 22 +- .../StorefrontFilterByImageSwatchTest.xml | 2 +- .../Test/StorefrontFilterByTextSwatchTest.xml | 2 +- .../StorefrontFilterByVisualSwatchTest.xml | 2 +- ...tImageColorWhenFilterByColorFilterTest.xml | 4 +- ...oductImagesMatchingProductSwatchesTest.xml | 8 +- ...ddToCartWishListWithUnselectedAttrTest.xml | 2 +- ...tChildImageShouldBeShownOnWishListTest.xml | 2 +- .../Test/EndToEndB2CGuestUserTest.xml | 8 +- .../Test/EndToEndB2CLoggedInUserTest.xml | 4 +- 89 files changed, 1366 insertions(+), 959 deletions(-) create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddNewProductConfigurationAttributeActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddProductToConfigurationsGridActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniqueImageToConfigurableProductOptionActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniquePriceToConfigurableProductOptionActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniqueQuantityToConfigurableProductOptionActionGroup.xml delete mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableProductActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableProductDisableConfigurationsActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableWizardMoveToNextStepActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateApiConfigurableProductWithHiddenChildActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateConfigurableProductWithAttributeUncheckOptionActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateConfigurationsForAttributeActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertConfigurableProductOnAdminProductPageActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertConfigurableProductWithSpecialPriceOnStorefrontProductPageActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertOptionImageAndPriceInStorefrontProductActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertOptionImageInStorefrontProductPageActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeConfigurableProductChildProductPriceActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeProductConfigurationsInGridActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeProductConfigurationsInGridExceptSkuActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductWithAttributeSetActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductWithTwoAttributesActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForAttributeActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForAttributeWithImagesActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForTwoAttributeActionGroup.xml rename app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/{ConfigurableProductAttributeNameDesignActionGroup.xml => CreateNewAttributeActionGroup.xml} (55%) create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateOptionsForAttributeActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/DeleteCreatedAttributeActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/FillAllRequiredFieldsActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GenerateAndSaveConfiguredProductAfterSettingOptionsActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GenerateConfigurationsByAttributeCodeActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GotoCatalogProductsPageActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GotoConfigurableProductPageActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductAddToCurrentAttributeSetActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductWithNewAttributeSetActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfiguredProductActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SelectCreatedAttributeAndCreateTwoOptionsActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SelectSingleAttributeAndAddToCartActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StartCreateConfigurationsForAttributeActionGroup.xml rename app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/{StorefrontCategoryActionGroup.xml => StorefrontCheckCategoryConfigurableProductActionGroup.xml} (60%) create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckCategoryOutOfStockConfigurableProductActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckConfigurableProductActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckConfigurableProductOptionsActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontOpenMinicartAndCheckConfigurableProductActionGroup.xml delete mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/VerifyOptionInProductStorefrontActionGroup.xml create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ViewConfigurableProductInAdminGridActionGroup.xml diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml index 16fbca2697702..f9665e9e0a48a 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml @@ -28,7 +28,7 @@ <!-- Login to Admin page --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Create a configurable product --> - <actionGroup ref="createConfigurableProduct" stepKey="createConfigurableProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml index 3b60e4b09de28..a4a41b38aa954 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml @@ -366,7 +366,7 @@ <before> <createData entity="_defaultCategory" stepKey="createCategory"/> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> @@ -391,7 +391,7 @@ <argument name="productName" value="{{_defaultProduct.name}}"/> <argument name="productUrlKey" value="{{_defaultProduct.urlKey}}"/> </actionGroup> - <actionGroup ref="SelectSingleAttributeAndAddToCart" stepKey="addProductToCart"> + <actionGroup ref="SelectSingleAttributeAndAddToCartActionGroup" stepKey="addProductToCart"> <argument name="productName" value="{{_defaultProduct.name}}"/> <argument name="attributeCode" value="{{colorProductAttribute.default_label}}"/> <argument name="optionName" value="{{colorProductAttribute1.name}}"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddNewProductConfigurationAttributeActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddNewProductConfigurationAttributeActionGroup.xml new file mode 100644 index 0000000000000..5914d935d3c49 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddNewProductConfigurationAttributeActionGroup.xml @@ -0,0 +1,49 @@ +<?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="AddNewProductConfigurationAttributeActionGroup"> + <annotations> + <description>Generates the Product Configurations for the 2 provided Attribute Names on the Configurable Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="attribute" type="entity"/> + <argument name="firstOption" type="entity"/> + <argument name="secondOption" type="entity"/> + </arguments> + + <!-- Create new attribute --> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickOnNewAttribute"/> + <waitForPageLoad stepKey="waitForIFrame"/> + <switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/> + <fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{attribute.default_label}}" stepKey="fillDefaultLabel"/> + <click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/> + <waitForPageLoad stepKey="waitForSaveAttribute"/> + <switchToIFrame stepKey="switchOutOfIFrame"/> + <waitForPageLoad stepKey="waitForFilters"/> + + <!-- Find created below attribute and add option; save attribute --> + <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> + <fillField userInput="{{attribute.default_label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateFirstNewValue"/> + <fillField userInput="{{firstOption.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateSecondNewValue"/> + <fillField userInput="{{secondOption.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveAttribute"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnSecondNextButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnThirdNextButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnFourthNextButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddProductToConfigurationsGridActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddProductToConfigurationsGridActionGroup.xml new file mode 100644 index 0000000000000..f9bd485fa4511 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddProductToConfigurationsGridActionGroup.xml @@ -0,0 +1,29 @@ +<?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="AddProductToConfigurationsGridActionGroup"> + <annotations> + <description>Adds the provided Product SKU to the provided Product Name.</description> + </annotations> + <arguments> + <argument name="sku" type="string"/> + <argument name="name" type="string"/> + </arguments> + + <click selector="{{AdminProductFormConfigurationsSection.actionsBtnByProductName(name)}}" stepKey="clickToExpandFirstActions"/> + <click selector="{{AdminProductFormConfigurationsSection.addProduct(name)}}" stepKey="clickChooseFirstDifferentProduct"/> + <switchToIFrame stepKey="switchOutOfIFrame"/> + <waitForPageLoad stepKey="waitForFilters"/> + <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <click selector="{{AdminProductGridFilterSection.firstRowBySku(sku)}}" stepKey="clickOnFirstRow"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniqueImageToConfigurableProductOptionActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniqueImageToConfigurableProductOptionActionGroup.xml new file mode 100644 index 0000000000000..26fe50d845dbc --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniqueImageToConfigurableProductOptionActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AddUniqueImageToConfigurableProductOptionActionGroup"> + <annotations> + <description>Adds the provided Image to a Configurable Product on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="image" defaultValue="ProductImage"/> + <argument name="frontend_label" type="string"/> + <argument name="label" type="string"/> + </arguments> + + <click selector="{{AdminCreateProductConfigurationsPanel.applyUniqueImagesToEachSkus}}" stepKey="clickOnApplyUniqueImagesToEachSku"/> + <selectOption userInput="{{frontend_label}}" selector="{{AdminCreateProductConfigurationsPanel.selectImagesButton}}" stepKey="selectOption"/> + <attachFile selector="{{AdminCreateProductConfigurationsPanel.uploadImagesButton(label)}}" userInput="{{image.file}}" stepKey="uploadFile"/> + <waitForElementNotVisible selector="{{AdminCreateProductConfigurationsPanel.uploadProgressBar}}" stepKey="waitForUpload"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageFile(image.fileName)}}" stepKey="waitForThumbnail"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniquePriceToConfigurableProductOptionActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniquePriceToConfigurableProductOptionActionGroup.xml new file mode 100644 index 0000000000000..3852dc5c821ed --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniquePriceToConfigurableProductOptionActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AddUniquePriceToConfigurableProductOptionActionGroup"> + <annotations> + <description>On the 'Step 3: Bulk Images, Price and Quantity' page of the 'Create Product Configurations' model click on 'Apply unique prices...'. Select provided Option. Fill price.</description> + </annotations> + <arguments> + <argument name="frontend_label" type="string"/> + <argument name="label" type="string"/> + <argument name="price" type="string"/> + </arguments> + + <click selector="{{AdminCreateProductConfigurationsPanel.applyUniquePricesToEachSkus}}" stepKey="clickOnApplyUniquePricesToEachSku"/> + <selectOption userInput="{{frontend_label}}" selector="{{AdminCreateProductConfigurationsPanel.selectPriceButton}}" stepKey="selectOption"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.price(label)}}" userInput="{{price}}" stepKey="enterAttributeQuantity"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniqueQuantityToConfigurableProductOptionActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniqueQuantityToConfigurableProductOptionActionGroup.xml new file mode 100644 index 0000000000000..b92a847df8f1d --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AddUniqueQuantityToConfigurableProductOptionActionGroup.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="AddUniqueQuantityToConfigurableProductOptionActionGroup"> + <arguments> + <argument name="frontend_label" type="string" defaultValue="{{productAttributeColor.default_label}}"/> + <argument name="label" type="string" defaultValue="option1"/> + <argument name="quantity" type="string" defaultValue="10"/> + </arguments> + <click selector="{{AdminCreateProductConfigurationsPanel.applyUniqueQuantityToEachSkus}}" stepKey="clickOnApplyUniqueQuantitiesToEachSku"/> + <selectOption selector="{{AdminCreateProductConfigurationsPanel.selectQuantity}}" userInput="{{frontend_label}}" stepKey="selectOption"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.applyUniqueQuantity(label)}}" userInput="{{quantity}}" stepKey="enterAttributeQuantity"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableProductActionGroup.xml deleted file mode 100644 index 02c7aeb3db6ac..0000000000000 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableProductActionGroup.xml +++ /dev/null @@ -1,545 +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="CreateConfigurableProductWithAttributeSet"> - <annotations> - <description>Admin edit created product as configurable. Choose created options</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - <argument name="category" defaultValue="_defaultCategory"/> - <argument name="label" type="string" defaultValue="mySet"/> - <argument name="option" type="string" defaultValue="['option1', 'option2', 'option3', 'option4']"/> - </arguments> - <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/> - <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{label}}" stepKey="searchForAttrSet"/> - <click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/> - <fillField userInput="{{product.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> - <selectOption selector="{{AdminProductFormSection.additionalOptions}}" parameterArray="{{option}}" stepKey="searchAndMultiSelectCreatedOption"/> - </actionGroup> - <actionGroup name="AdminCreateConfigurationsForAttribute" extends="generateConfigurationsByAttributeCode"> - <annotations> - <description>EXTENDS: generateConfigurationsByAttributeCode. Click to apply single price to all Skus. Enter Attribute price</description> - </annotations> - <arguments> - <argument name="price" type="string" defaultValue="100"/> - </arguments> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="clickOnNextButton2" stepKey="waitForNextPageOpened2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="waitForNextPageOpened2" stepKey="clickOnApplySinglePriceToAllSkus"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="{{price}}" before="clickOnApplySingleQuantityToEachSku" stepKey="enterAttributePrice"/> - </actionGroup> - <actionGroup name="AdminCreateConfigurableProductWithAttributeUncheckOption" extends="generateConfigurationsByAttributeCode"> - <annotations> - <description>EXTENDS: generateConfigurationsByAttributeCode. Click to uncheck created option. Enter Attribute price</description> - </annotations> - <arguments> - <argument name="attributeOption" type="string" defaultValue="option1"/> - <argument name="price" type="string" defaultValue="100"/> - </arguments> - <click selector="{{AdminCreateProductConfigurationsPanel.attributeOption('attributeOption')}}" after="clickOnSelectAll" stepKey="clickToUncheckOption"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" after="clickToUncheckOption" stepKey="clickOnNextButton22"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="clickOnNextButton22" stepKey="waitForNextPageOpened2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="waitForNextPageOpened2" stepKey="clickOnApplySinglePriceToAllSkus"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="{{price}}" before="clickOnApplySingleQuantityToEachSku" stepKey="enterAttributePrice"/> - </actionGroup> - <!--Filter the product grid and view expected products--> - <actionGroup name="viewConfigurableProductInAdminGrid"> - <annotations> - <description>Goes to the Admin Product grid page. Validates the provided Configurable Product is present and correct in the grid.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <waitForPageLoad stepKey="waitForPageLoadInitial"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="3" stepKey="seeCorrectNumberOfProducts"/> - - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFiltersSimple"/> - <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="simple" stepKey="selectionProductType"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersWithSimpleType"/> - <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeSimpleProductNameInGrid"/> - <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.price}}" stepKey="seeSimpleProductPriceInGrid"/> - - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFiltersConfigurable"/> - <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionConfigurableProductType"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersWithConfigurableType"/> - <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeConfigurableProductNameInGrid"/> - <dontSee selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.price}}" stepKey="dontSeeProductPriceNameInGrid"/> - - <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> - </actionGroup> - - <!--Create a configurable product with three options for color: red, white, and blue - Expected start state = logged in as an admin - End state = on the product edit page in the admin--> - <actionGroup name="createConfigurableProduct"> - <annotations> - <description>Goes to the Admin Product grid page. Creates a Configurable Product using the default Product Options.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - <argument name="category" defaultValue="_defaultCategory"/> - </arguments> - - <!-- fill in basic configurable product values --> - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> - <waitForPageLoad time="30" stepKey="wait1"/> - <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickOnAddProductToggle"/> - <click selector="{{AdminProductGridActionSection.addConfigurableProduct}}" stepKey="clickOnAddConfigurableProduct"/> - <fillField userInput="{{product.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> - <fillField userInput="{{product.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/> - <fillField userInput="{{product.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/> - <fillField userInput="{{product.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/> - <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="fillCategory"/> - <selectOption userInput="{{product.visibility}}" selector="{{AdminProductFormSection.visibility}}" stepKey="fillVisibility"/> - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> - <fillField userInput="{{product.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> - - <!-- create configurations for colors the product is available in --> - <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurations"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickOnNewAttribute"/> - <waitForPageLoad stepKey="waitForIFrame"/> - <switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/> - <fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{colorProductAttribute.default_label}}" stepKey="fillDefaultLabel"/> - <click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/> - <waitForPageLoad stepKey="waitForSaveAttribute"/> - <switchToIFrame stepKey="switchOutOfIFrame"/> - <waitForPageLoad stepKey="waitForFilters"/> - <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> - <fillField userInput="{{colorProductAttribute.default_label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue1"/> - <fillField userInput="{{colorProductAttribute1.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute1"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute1"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue2"/> - <fillField userInput="{{colorProductAttribute2.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue3"/> - <fillField userInput="{{colorProductAttribute3.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute3"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute3"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applyUniquePricesByAttributeToEachSku}}" stepKey="clickOnApplyUniquePricesByAttributeToEachSku"/> - <selectOption selector="{{AdminCreateProductConfigurationsPanel.selectAttribute}}" userInput="{{colorProductAttribute.default_label}}" stepKey="selectAttributes"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute1}}" userInput="{{colorProductAttribute1.price}}" stepKey="fillAttributePrice1"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute2}}" userInput="{{colorProductAttribute2.price}}" stepKey="fillAttributePrice2"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute3}}" userInput="{{colorProductAttribute3.price}}" stepKey="fillAttributePrice3"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="1" stepKey="enterAttributeQuantity"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> - <seeInTitle userInput="{{product.name}}" stepKey="seeProductNameInTitle"/> - </actionGroup> - - <actionGroup name="createConfigurableProductWithTwoAttributes" extends="createConfigurableProduct"> - <annotations> - <description>Goes to the Admin Product grid page. Creates a Configurable Product with 2 product attributes.</description> - </annotations> - <arguments> - <argument name="attribute1" defaultValue="ProductColorAttribute"/> - <argument name="attribute2" defaultValue="ProductSizeAttribute"/> - </arguments> - <remove keyForRemoval="clickOnNewAttribute"/> - <remove keyForRemoval="waitForIFrame"/> - <remove keyForRemoval="switchToNewAttributeIFrame"/> - <remove keyForRemoval="fillDefaultLabel"/> - <remove keyForRemoval="clickOnNewAttributePanel"/> - <remove keyForRemoval="waitForSaveAttribute"/> - <remove keyForRemoval="switchOutOfIFrame"/> - <remove keyForRemoval="waitForFilters"/> - <remove keyForRemoval="clickOnFilters"/> - <remove keyForRemoval="fillFilterAttributeCodeField"/> - <remove keyForRemoval="clickApplyFiltersButton"/> - <remove keyForRemoval="clickOnFirstCheckbox"/> - <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attribute1.attribute_code)}}" stepKey="selectAttribute1" after="clickOnCreateConfigurations"/> - <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attribute2.attribute_code)}}" stepKey="selectAttribute2" after="selectAttribute1"/> - <remove keyForRemoval="waitCreateNewValueAppears"/> - <remove keyForRemoval="clickOnCreateNewValue1"/> - <remove keyForRemoval="fillFieldForNewAttribute1"/> - <remove keyForRemoval="clickOnSaveNewAttribute1"/> - <remove keyForRemoval="clickOnCreateNewValue2"/> - <remove keyForRemoval="fillFieldForNewAttribute2"/> - <remove keyForRemoval="clickOnSaveNewAttribute2"/> - <remove keyForRemoval="clickOnCreateNewValue3"/> - <remove keyForRemoval="fillFieldForNewAttribute3"/> - <remove keyForRemoval="clickOnSaveNewAttribute3"/> - <remove keyForRemoval="clickOnSelectAll"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attribute1.frontend_label)}}" stepKey="selectAllOptionsOfAttribute1" before="clickOnNextButton2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attribute2.frontend_label)}}" stepKey="selectAllOptionsOfAttribute2" before="clickOnNextButton2"/> - <remove keyForRemoval="applyUniquePricesByAttributeToEachSku"/> - <remove keyForRemoval="clickOnApplyUniquePricesByAttributeToEachSku"/> - <remove keyForRemoval="selectAttributes"/> - <remove keyForRemoval="fillAttributePrice1"/> - <remove keyForRemoval="fillAttributePrice2"/> - <remove keyForRemoval="fillAttributePrice3"/> - <remove keyForRemoval="clickOnSaveButton2"/> - <remove keyForRemoval="clickOnConfirmInPopup"/> - <remove keyForRemoval="seeSaveProductMessage"/> - <remove keyForRemoval="seeProductNameInTitle"/> - </actionGroup> - <actionGroup name="saveConfigurableProduct"> - <annotations> - <description>Save configurable product</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> - <seeInTitle userInput="{{product.name}}" stepKey="seeProductNameInTitle"/> - </actionGroup> - - <actionGroup name="generateConfigurationsByAttributeCode"> - <annotations> - <description>Generates the Product Configurations for the provided Attribute Code on the Configurable Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="attributeCode" type="string" defaultValue="SomeString"/> - </arguments> - - <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickCreateConfigurations"/> - <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickFilters"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" userInput="{{attributeCode}}" stepKey="fillFilterAttributeCodeField"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="99" stepKey="enterAttributeQuantity"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/> - </actionGroup> - <actionGroup name="createOptionsForAttribute"> - <arguments> - <argument name="attributeName" type="string" defaultValue="{{productAttributeColor.default_label}}"/> - <argument name="firstOptionName" type="string" defaultValue="option1"/> - <argument name="secondOptionName" type="string" defaultValue="option2"/> - </arguments> - <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> - <fillField userInput="{{attributeName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateFirstNewValue"/> - <fillField userInput="{{firstOptionName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateSecondNewValue"/> - <fillField userInput="{{secondOptionName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveAttribute"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> - </actionGroup> - - <actionGroup name="createConfigurationsForAttribute" extends="generateConfigurationsByAttributeCode"> - <annotations> - <description>EXTENDS: generateConfigurationsByAttributeCode. Clicks on the Save button. Clicks on the Confirm button.</description> - </annotations> - <arguments> - <argument name="attributeCode" type="string" defaultValue="SomeString"/> - </arguments> - - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> - </actionGroup> - - <actionGroup name="createConfigurationsForAttributeWithImages" extends="generateConfigurationsByAttributeCode"> - <annotations> - <description>EXTENDS: generateConfigurationsByAttributeCode. Adds the provided Attribute Image to the provided Attribute Code.</description> - </annotations> - <arguments> - <argument name="attributeCode" type="string" defaultValue="SomeString"/> - <argument name="image" defaultValue="ProductImage"/> - </arguments> - - <click selector="{{AdminCreateProductConfigurationsPanel.applySingleSetOfImages}}" stepKey="clickOnApplySingleImageSetToAllSku" after="enterAttributeQuantity"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageUploadButton}}" stepKey="seeImageSectionIsReady" after="clickOnApplySingleImageSetToAllSku"/> - <attachFile selector="{{AdminCreateProductConfigurationsPanel.imageFileUpload}}" userInput="{{image.file}}" stepKey="uploadFile" after="seeImageSectionIsReady"/> - <waitForElementNotVisible selector="{{AdminCreateProductConfigurationsPanel.uploadProgressBar}}" stepKey="waitForUpload" after="uploadFile"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageFile(image.fileName)}}" stepKey="waitForThumbnail" after="waitForUpload"/> - - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2" after="clickOnNextButton4"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup" after="clickOnSaveButton2"/> - </actionGroup> - - <actionGroup name="createConfigurationsForTwoAttribute" extends="generateConfigurationsByAttributeCode"> - <annotations> - <description>EXTENDS: generateConfigurationsByAttributeCode. Generates the Product Configurations for the 2 provided Attribute Codes on the Configurable Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="secondAttributeCode" type="string"/> - </arguments> - - <remove keyForRemoval="clickOnSelectAll"/> - <remove keyForRemoval="clickFilters"/> - <remove keyForRemoval="fillFilterAttributeCodeField"/> - <remove keyForRemoval="clickApplyFiltersButton"/> - <remove keyForRemoval="clickOnFirstCheckbox"/> - - <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attributeCode)}}" stepKey="clickOnFirstAttributeCheckbox" after="clickCreateConfigurations"/> - <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(secondAttributeCode)}}" stepKey="clickOnSecondAttributeCheckbox" after="clickOnFirstAttributeCheckbox"/> - <grabTextFrom selector="{{AdminCreateProductConfigurationsPanel.defaultLabel(attributeCode)}}" stepKey="grabFirstAttributeDefaultLabel" after="clickOnSecondAttributeCheckbox"/> - <grabTextFrom selector="{{AdminCreateProductConfigurationsPanel.defaultLabel(secondAttributeCode)}}" stepKey="grabSecondAttributeDefaultLabel" after="grabFirstAttributeDefaultLabel"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute({$grabFirstAttributeDefaultLabel})}}" stepKey="clickOnSelectAllForFirstAttribute" after="clickOnNextButton1"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute({$grabSecondAttributeDefaultLabel})}}" stepKey="clickOnSelectAllForSecondAttribute" after="clickOnSelectAllForFirstAttribute"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> - </actionGroup> - - <actionGroup name="saveConfiguredProduct"> - <annotations> - <description>Save the Configurable Product on the Configurable Product creation/edit page. Validates that the Success Message is present.</description> - </annotations> - - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> - </actionGroup> - - <!--Generate and save configurable product after setting options--> - <actionGroup name="GenerateAndSaveConfiguredProductAfterSettingOptions" extends="saveConfiguredProduct"> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" before="clickOnSaveButton2" stepKey="clickOnNextButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" after="clickOnNextButton" stepKey="clickOnGenerateProductsButton"/> - </actionGroup> - - <actionGroup name="addNewProductConfigurationAttribute"> - <annotations> - <description>Generates the Product Configurations for the 2 provided Attribute Names on the Configurable Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="attribute" type="entity"/> - <argument name="firstOption" type="entity"/> - <argument name="secondOption" type="entity"/> - </arguments> - - <!-- Create new attribute --> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickOnNewAttribute"/> - <waitForPageLoad stepKey="waitForIFrame"/> - <switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/> - <fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{attribute.default_label}}" stepKey="fillDefaultLabel"/> - <click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/> - <waitForPageLoad stepKey="waitForSaveAttribute"/> - <switchToIFrame stepKey="switchOutOfIFrame"/> - <waitForPageLoad stepKey="waitForFilters"/> - - <!-- Find created below attribute and add option; save attribute --> - <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> - <fillField userInput="{{attribute.default_label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateFirstNewValue"/> - <fillField userInput="{{firstOption.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateSecondNewValue"/> - <fillField userInput="{{secondOption.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveAttribute"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnSecondNextButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnThirdNextButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnFourthNextButton"/> - </actionGroup> - <actionGroup name="selectCreatedAttributeAndCreateTwoOptions" extends="addNewProductConfigurationAttribute"> - <remove keyForRemoval="clickOnNewAttribute"/> - <remove keyForRemoval="waitForIFrame"/> - <remove keyForRemoval="switchToNewAttributeIFrame"/> - <remove keyForRemoval="fillDefaultLabel"/> - <remove keyForRemoval="clickOnNewAttributePanel"/> - <remove keyForRemoval="waitForSaveAttribute"/> - <remove keyForRemoval="switchOutOfIFrame"/> - <remove keyForRemoval="waitForFilters"/> - <fillField userInput="{{attribute.attribute_code}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> - <fillField userInput="{{firstOption.label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> - <fillField userInput="{{secondOption.label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> - <remove keyForRemoval="clickOnSelectAll"/> - <remove keyForRemoval="clickOnSecondNextButton"/> - <remove keyForRemoval="clickOnThirdNextButton"/> - <remove keyForRemoval="clickOnFourthNextButton"/> - </actionGroup> - <actionGroup name="changeProductConfigurationsInGrid"> - <annotations> - <description>Edit the Product Configuration via the Admin Product grid page.</description> - </annotations> - <arguments> - <argument name="firstOption" type="entity"/> - <argument name="secondOption" type="entity"/> - </arguments> - - <fillField userInput="{{firstOption.name}}" selector="{{AdminProductFormConfigurationsSection.confProductNameCell(firstOption.name)}}" stepKey="fillFieldNameForFirstAttributeOption"/> - <fillField userInput="{{secondOption.name}}" selector="{{AdminProductFormConfigurationsSection.confProductNameCell(secondOption.name)}}" stepKey="fillFieldNameForSecondAttributeOption"/> - <fillField userInput="{{firstOption.sku}}" selector="{{AdminProductFormConfigurationsSection.confProductSkuCell(firstOption.name)}}" stepKey="fillFieldSkuForFirstAttributeOption"/> - <fillField userInput="{{secondOption.sku}}" selector="{{AdminProductFormConfigurationsSection.confProductSkuCell(secondOption.name)}}" stepKey="fillFieldSkuForSecondAttributeOption"/> - <fillField userInput="{{firstOption.price}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(firstOption.name)}}" stepKey="fillFieldPriceForFirstAttributeOption"/> - <fillField userInput="{{secondOption.price}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(secondOption.name)}}" stepKey="fillFieldPriceForSecondAttributeOption"/> - <fillField userInput="{{firstOption.quantity}}" selector="{{AdminProductFormConfigurationsSection.confProductQuantityCell(firstOption.name)}}" stepKey="fillFieldQuantityForFirstAttributeOption"/> - <fillField userInput="{{secondOption.quantity}}" selector="{{AdminProductFormConfigurationsSection.confProductQuantityCell(secondOption.name)}}" stepKey="fillFieldQuantityForSecondAttributeOption"/> - <fillField userInput="{{firstOption.weight}}" selector="{{AdminProductFormConfigurationsSection.confProductWeightCell(firstOption.name)}}" stepKey="fillFieldWeightForFirstAttributeOption"/> - <fillField userInput="{{secondOption.weight}}" selector="{{AdminProductFormConfigurationsSection.confProductWeightCell(secondOption.name)}}" stepKey="fillFieldWeightForSecondAttributeOption"/> - </actionGroup> - <actionGroup name="changeConfigurableProductChildProductPrice"> - <annotations> - <description>Change the price of a configurable child product in the grid under configurations.</description> - </annotations> - <arguments> - <argument name="productAttributes" type="string"/> - <argument name="productPrice" type="string"/> - </arguments> - <fillField userInput="{{productPrice}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(productAttributes)}}" stepKey="fillPriceForConfigurableProductAttributeOption"/> - </actionGroup> - <actionGroup name="changeProductConfigurationsInGridExceptSku" extends="changeProductConfigurationsInGrid"> - <annotations> - <description>EXTENDS: changeProductConfigurationsInGrid. Removes 'fillFieldSkuForFirstAttributeOption' and 'fillFieldSkuForSecondAttributeOption'.</description> - </annotations> - - <remove keyForRemoval="fillFieldSkuForFirstAttributeOption"/> - <remove keyForRemoval="fillFieldSkuForSecondAttributeOption"/> - </actionGroup> - - <actionGroup name="addProductToConfigurationsGrid"> - <annotations> - <description>Adds the provided Product SKU to the provided Product Name.</description> - </annotations> - <arguments> - <argument name="sku" type="string"/> - <argument name="name" type="string"/> - </arguments> - - <click selector="{{AdminProductFormConfigurationsSection.actionsBtnByProductName(name)}}" stepKey="clickToExpandFirstActions"/> - <click selector="{{AdminProductFormConfigurationsSection.addProduct(name)}}" stepKey="clickChooseFirstDifferentProduct"/> - <switchToIFrame stepKey="switchOutOfIFrame"/> - <waitForPageLoad stepKey="waitForFilters"/> - <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <click selector="{{AdminProductGridFilterSection.firstRowBySku(sku)}}" stepKey="clickOnFirstRow"/> - </actionGroup> - - <actionGroup name="addUniqueImageToConfigurableProductOption"> - <annotations> - <description>Adds the provided Image to a Configurable Product on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="image" defaultValue="ProductImage"/> - <argument name="frontend_label" type="string"/> - <argument name="label" type="string"/> - </arguments> - - <click selector="{{AdminCreateProductConfigurationsPanel.applyUniqueImagesToEachSkus}}" stepKey="clickOnApplyUniqueImagesToEachSku"/> - <selectOption userInput="{{frontend_label}}" selector="{{AdminCreateProductConfigurationsPanel.selectImagesButton}}" stepKey="selectOption"/> - <attachFile selector="{{AdminCreateProductConfigurationsPanel.uploadImagesButton(label)}}" userInput="{{image.file}}" stepKey="uploadFile"/> - <waitForElementNotVisible selector="{{AdminCreateProductConfigurationsPanel.uploadProgressBar}}" stepKey="waitForUpload"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageFile(image.fileName)}}" stepKey="waitForThumbnail"/> - </actionGroup> - - <actionGroup name="addUniquePriceToConfigurableProductOption"> - <annotations> - <description>On the 'Step 3: Bulk Images, Price and Quantity' page of the 'Create Product Configurations' model click on 'Apply unique prices...'. Select provided Option. Fill price.</description> - </annotations> - <arguments> - <argument name="frontend_label" type="string"/> - <argument name="label" type="string"/> - <argument name="price" type="string"/> - </arguments> - - <click selector="{{AdminCreateProductConfigurationsPanel.applyUniquePricesToEachSkus}}" stepKey="clickOnApplyUniquePricesToEachSku"/> - <selectOption userInput="{{frontend_label}}" selector="{{AdminCreateProductConfigurationsPanel.selectPriceButton}}" stepKey="selectOption"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.price(label)}}" userInput="{{price}}" stepKey="enterAttributeQuantity"/> - </actionGroup> - <actionGroup name="addUniqueQuantityToConfigurableProductOption"> - <arguments> - <argument name="frontend_label" type="string" defaultValue="{{productAttributeColor.default_label}}"/> - <argument name="label" type="string" defaultValue="option1"/> - <argument name="quantity" type="string" defaultValue="10"/> - </arguments> - <click selector="{{AdminCreateProductConfigurationsPanel.applyUniqueQuantityToEachSkus}}" stepKey="clickOnApplyUniqueQuantitiesToEachSku"/> - <selectOption selector="{{AdminCreateProductConfigurationsPanel.selectQuantity}}" userInput="{{frontend_label}}" stepKey="selectOption"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.applyUniqueQuantity(label)}}" userInput="{{quantity}}" stepKey="enterAttributeQuantity"/> - </actionGroup> - - <actionGroup name="saveConfigurableProductWithNewAttributeSet"> - <annotations> - <description>Clicks on 'Save'. Clicks radio for '...new Attribute Set...' in the 'Choose Affected Attribute Set' modal. Clicks on 'Confirm' in the model on the Configurable Product creation/edit page.</description> - </annotations> - - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveConfigurableProduct"/> - <waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" time="30" stepKey="waitForAttributeSetConfirmation"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.addNewAttrSet}}" stepKey="clickAddNewAttributeSet"/> - <fillField selector="{{AdminChooseAffectedAttributeSetPopup.createNewAttrSetName}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="fillFieldNewAttrSetName"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickConfirmAttributeSet"/> - <see selector="You saved the product" stepKey="seeConfigurableSaveConfirmation" after="clickConfirmAttributeSet"/> - </actionGroup> - - <actionGroup name="saveConfigurableProductAddToCurrentAttributeSet"> - <annotations> - <description>Clicks on 'Save'. Clicks on 'Confirm' in the 'Choose Affected Attribute Set' model on the Configurable Product creation/edit page.</description> - </annotations> - - <waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveBtnVisible"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProductAgain"/> - <waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="waitPopUpVisible"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmPopup"/> - <seeElement selector="{{AdminMessagesSection.success}}" stepKey="seeSaveProductMessage"/> - </actionGroup> - - <actionGroup name="assertConfigurableProductOnAdminProductPage"> - <annotations> - <description>Validates that the provided Configurable Product Name, SKU and Price are present and correct on the Configurable Product creation/edit page. PLEASE NOTE: The Product Data is Hardcoded.</description> - </annotations> - <arguments> - <argument name="product" type="entity"/> - </arguments> - - <seeInField userInput="{{ApiConfigurableProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="seeNameRequired"/> - <seeInField userInput="{{ApiConfigurableProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="seeSkuRequired"/> - <dontSeeInField userInput="{{ApiConfigurableProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="dontSeePriceRequired"/> - </actionGroup> - - <!--Click in Next Step and see Title--> - <actionGroup name="AdminConfigurableWizardMoveToNextStepActionGroup"> - <annotations> - <description>Click on the 'Next' button in the 'Create Product Configurations' panel on the Configurable Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="title" type="string"/> - </arguments> - - <click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton"/> - <waitForPageLoad stepKey="waitForNextStepLoaded"/> - <see userInput="{{title}}" selector="{{AdminProductFormConfigurationsSection.stepsWizardTitle}}" stepKey="seeStepTitle"/> - </actionGroup> - <actionGroup name="AdminConfigurableProductDisableConfigurationsActionGroup"> - <arguments> - <argument name="productName" type="string" defaultValue="{{SimpleProduct.name}}"/> - </arguments> - <click selector="{{AdminProductFormConfigurationsSection.actionsBtnByProductName(productName)}}" stepKey="clickToExpandActionsSelect"/> - <click selector="{{AdminProductFormConfigurationsSection.disableProductBtn}}" stepKey="clickDisableChildProduct"/> - <see selector="{{AdminProductFormConfigurationsSection.confProductOptionStatusCell(productName)}}" userInput="Disabled" stepKey="seeConfigDisabled"/> - </actionGroup> - - <!--You are on AdminProductEditPage--> - <!--Start create configurations for attribute and fill quantity--> - <actionGroup name="StartCreateConfigurationsForAttribute" extends="generateConfigurationsByAttributeCode"> - <remove keyForRemoval="clickOnNextButton3"/> - <remove keyForRemoval="clickOnNextButton4"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableProductDisableConfigurationsActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableProductDisableConfigurationsActionGroup.xml new file mode 100644 index 0000000000000..69b2c37b6e850 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableProductDisableConfigurationsActionGroup.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="AdminConfigurableProductDisableConfigurationsActionGroup"> + <arguments> + <argument name="productName" type="string" defaultValue="{{SimpleProduct.name}}"/> + </arguments> + <click selector="{{AdminProductFormConfigurationsSection.actionsBtnByProductName(productName)}}" stepKey="clickToExpandActionsSelect"/> + <click selector="{{AdminProductFormConfigurationsSection.disableProductBtn}}" stepKey="clickDisableChildProduct"/> + <see selector="{{AdminProductFormConfigurationsSection.confProductOptionStatusCell(productName)}}" userInput="Disabled" stepKey="seeConfigDisabled"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableWizardMoveToNextStepActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableWizardMoveToNextStepActionGroup.xml new file mode 100644 index 0000000000000..50621b7114002 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableWizardMoveToNextStepActionGroup.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="AdminConfigurableWizardMoveToNextStepActionGroup"> + <annotations> + <description>Click on the 'Next' button in the 'Create Product Configurations' panel on the Configurable Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="title" type="string"/> + </arguments> + + <click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton"/> + <waitForPageLoad stepKey="waitForNextStepLoaded"/> + <see userInput="{{title}}" selector="{{AdminProductFormConfigurationsSection.stepsWizardTitle}}" stepKey="seeStepTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateApiConfigurableProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateApiConfigurableProductActionGroup.xml index 2cdee5468a457..6dba2f09a707b 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateApiConfigurableProductActionGroup.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateApiConfigurableProductActionGroup.xml @@ -65,21 +65,4 @@ <requiredEntity createDataKey="createConfigChildProduct2"/> </createData> </actionGroup> - - <!-- Create the configurable product, children are not visible individually --> - <actionGroup name="AdminCreateApiConfigurableProductWithHiddenChildActionGroup" extends="AdminCreateApiConfigurableProductActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateApiConfigurableProductActionGroup. Adds 2 Hidden Product Options.</description> - </annotations> - - <!-- Create the 2 children that will be a part of the configurable product --> - <createData entity="ApiSimpleOneHidden" stepKey="createConfigChildProduct1"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - <requiredEntity createDataKey="getConfigAttributeOption1"/> - </createData> - <createData entity="ApiSimpleTwoHidden" stepKey="createConfigChildProduct2"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - <requiredEntity createDataKey="getConfigAttributeOption2"/> - </createData> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateApiConfigurableProductWithHiddenChildActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateApiConfigurableProductWithHiddenChildActionGroup.xml new file mode 100644 index 0000000000000..2562c8cc20e6e --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateApiConfigurableProductWithHiddenChildActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AdminCreateApiConfigurableProductWithHiddenChildActionGroup" extends="AdminCreateApiConfigurableProductActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateApiConfigurableProductActionGroup. Adds 2 Hidden Product Options.</description> + </annotations> + + <!-- Create the 2 children that will be a part of the configurable product --> + <createData entity="ApiSimpleOneHidden" stepKey="createConfigChildProduct1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption1"/> + </createData> + <createData entity="ApiSimpleTwoHidden" stepKey="createConfigChildProduct2"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption2"/> + </createData> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateConfigurableProductWithAttributeUncheckOptionActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateConfigurableProductWithAttributeUncheckOptionActionGroup.xml new file mode 100644 index 0000000000000..2f494bb003bfa --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateConfigurableProductWithAttributeUncheckOptionActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AdminCreateConfigurableProductWithAttributeUncheckOptionActionGroup" extends="GenerateConfigurationsByAttributeCodeActionGroup"> + <annotations> + <description>EXTENDS: generateConfigurationsByAttributeCode. Click to uncheck created option. Enter Attribute price</description> + </annotations> + <arguments> + <argument name="attributeOption" type="string" defaultValue="option1"/> + <argument name="price" type="string" defaultValue="100"/> + </arguments> + <click selector="{{AdminCreateProductConfigurationsPanel.attributeOption('attributeOption')}}" after="clickOnSelectAll" stepKey="clickToUncheckOption"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" after="clickToUncheckOption" stepKey="clickOnNextButton22"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="clickOnNextButton22" stepKey="waitForNextPageOpened2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="waitForNextPageOpened2" stepKey="clickOnApplySinglePriceToAllSkus"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="{{price}}" before="clickOnApplySingleQuantityToEachSku" stepKey="enterAttributePrice"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateConfigurationsForAttributeActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateConfigurationsForAttributeActionGroup.xml new file mode 100644 index 0000000000000..57468165fe4f9 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateConfigurationsForAttributeActionGroup.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="AdminCreateConfigurationsForAttributeActionGroup" extends="GenerateConfigurationsByAttributeCodeActionGroup"> + <annotations> + <description>EXTENDS: generateConfigurationsByAttributeCode. Click to apply single price to all Skus. Enter Attribute price</description> + </annotations> + <arguments> + <argument name="price" type="string" defaultValue="100"/> + </arguments> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="clickOnNextButton2" stepKey="waitForNextPageOpened2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="waitForNextPageOpened2" stepKey="clickOnApplySinglePriceToAllSkus"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="{{price}}" before="clickOnApplySingleQuantityToEachSku" stepKey="enterAttributePrice"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertConfigurableProductOnAdminProductPageActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertConfigurableProductOnAdminProductPageActionGroup.xml new file mode 100644 index 0000000000000..88e170e3a3a90 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertConfigurableProductOnAdminProductPageActionGroup.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="AssertConfigurableProductOnAdminProductPageActionGroup"> + <annotations> + <description>Validates that the provided Configurable Product Name, SKU and Price are present and correct on the Configurable Product creation/edit page. PLEASE NOTE: The Product Data is Hardcoded.</description> + </annotations> + <arguments> + <argument name="product" type="entity"/> + </arguments> + + <seeInField userInput="{{ApiConfigurableProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="seeNameRequired"/> + <seeInField userInput="{{ApiConfigurableProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="seeSkuRequired"/> + <dontSeeInField userInput="{{ApiConfigurableProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="dontSeePriceRequired"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertConfigurableProductWithSpecialPriceOnStorefrontProductPageActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertConfigurableProductWithSpecialPriceOnStorefrontProductPageActionGroup.xml new file mode 100644 index 0000000000000..b998b4443f446 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertConfigurableProductWithSpecialPriceOnStorefrontProductPageActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AssertConfigurableProductWithSpecialPriceOnStorefrontProductPageActionGroup"> + <annotations> + <description>Validates that Special Price for a Configurable Product is present and correct when the provided Product Option is selected.</description> + </annotations> + <arguments> + <argument name="option" type="string"/> + <argument name="price" type="string"/> + <argument name="specialPrice" defaultValue="specialProductPrice"/> + </arguments> + + <selectOption userInput="{{option}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOptionWithSpecialPrice"/> + <see userInput="{{specialProductPrice.price}}" selector="{{StorefrontProductInfoMainSection.productSpecialPrice}}" stepKey="seeSpecialProductPrice"/> + <see userInput="Regular Price" selector="{{StorefrontProductInfoMainSection.specialProductText}}" stepKey="seeText"/> + <see userInput="{{price}}" selector="{{StorefrontProductInfoMainSection.oldProductPrice}}" stepKey="seeOldProductPrice"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertOptionImageAndPriceInStorefrontProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertOptionImageAndPriceInStorefrontProductActionGroup.xml new file mode 100644 index 0000000000000..e13d1909b5a10 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertOptionImageAndPriceInStorefrontProductActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AssertOptionImageAndPriceInStorefrontProductActionGroup"> + <annotations> + <description>Validates that the provided Product Image and Price are present when the provided Product Option is selected.</description> + </annotations> + <arguments> + <argument name="label" type="string"/> + <argument name="image" type="string"/> + <argument name="price" type="string"/> + </arguments> + + <selectOption userInput="{{label}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption"/> + <seeElement selector="{{StorefrontProductMediaSection.imageFile(image)}}" stepKey="seeImage"/> + <see userInput="{{price}}" selector="{{StorefrontProductInfoMainSection.price}}" stepKey="seeProductPrice"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertOptionImageInStorefrontProductPageActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertOptionImageInStorefrontProductPageActionGroup.xml new file mode 100644 index 0000000000000..ba41d36d95970 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AssertOptionImageInStorefrontProductPageActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AssertOptionImageInStorefrontProductPageActionGroup"> + <annotations> + <description>Validates that the provided Product Image is present when the provided Product Option is selected.</description> + </annotations> + <arguments> + <argument name="product" type="entity"/> + <argument name="label" type="string"/> + <argument name="image" defaultValue="MagentoLogo"/> + </arguments> + + <seeInCurrentUrl url="/{{product.urlKey}}.html" stepKey="checkUrl"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <selectOption userInput="{{label}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/> + <seeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeFirstImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeConfigurableProductChildProductPriceActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeConfigurableProductChildProductPriceActionGroup.xml new file mode 100644 index 0000000000000..b244681afbbb9 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeConfigurableProductChildProductPriceActionGroup.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="ChangeConfigurableProductChildProductPriceActionGroup"> + <annotations> + <description>Change the price of a configurable child product in the grid under configurations.</description> + </annotations> + <arguments> + <argument name="productAttributes" type="string"/> + <argument name="productPrice" type="string"/> + </arguments> + <fillField userInput="{{productPrice}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(productAttributes)}}" stepKey="fillPriceForConfigurableProductAttributeOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeProductConfigurationsInGridActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeProductConfigurationsInGridActionGroup.xml new file mode 100644 index 0000000000000..48523fe693c44 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeProductConfigurationsInGridActionGroup.xml @@ -0,0 +1,31 @@ +<?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="ChangeProductConfigurationsInGridActionGroup"> + <annotations> + <description>Edit the Product Configuration via the Admin Product grid page.</description> + </annotations> + <arguments> + <argument name="firstOption" type="entity"/> + <argument name="secondOption" type="entity"/> + </arguments> + + <fillField userInput="{{firstOption.name}}" selector="{{AdminProductFormConfigurationsSection.confProductNameCell(firstOption.name)}}" stepKey="fillFieldNameForFirstAttributeOption"/> + <fillField userInput="{{secondOption.name}}" selector="{{AdminProductFormConfigurationsSection.confProductNameCell(secondOption.name)}}" stepKey="fillFieldNameForSecondAttributeOption"/> + <fillField userInput="{{firstOption.sku}}" selector="{{AdminProductFormConfigurationsSection.confProductSkuCell(firstOption.name)}}" stepKey="fillFieldSkuForFirstAttributeOption"/> + <fillField userInput="{{secondOption.sku}}" selector="{{AdminProductFormConfigurationsSection.confProductSkuCell(secondOption.name)}}" stepKey="fillFieldSkuForSecondAttributeOption"/> + <fillField userInput="{{firstOption.price}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(firstOption.name)}}" stepKey="fillFieldPriceForFirstAttributeOption"/> + <fillField userInput="{{secondOption.price}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(secondOption.name)}}" stepKey="fillFieldPriceForSecondAttributeOption"/> + <fillField userInput="{{firstOption.quantity}}" selector="{{AdminProductFormConfigurationsSection.confProductQuantityCell(firstOption.name)}}" stepKey="fillFieldQuantityForFirstAttributeOption"/> + <fillField userInput="{{secondOption.quantity}}" selector="{{AdminProductFormConfigurationsSection.confProductQuantityCell(secondOption.name)}}" stepKey="fillFieldQuantityForSecondAttributeOption"/> + <fillField userInput="{{firstOption.weight}}" selector="{{AdminProductFormConfigurationsSection.confProductWeightCell(firstOption.name)}}" stepKey="fillFieldWeightForFirstAttributeOption"/> + <fillField userInput="{{secondOption.weight}}" selector="{{AdminProductFormConfigurationsSection.confProductWeightCell(secondOption.name)}}" stepKey="fillFieldWeightForSecondAttributeOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeProductConfigurationsInGridExceptSkuActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeProductConfigurationsInGridExceptSkuActionGroup.xml new file mode 100644 index 0000000000000..740eda889637f --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ChangeProductConfigurationsInGridExceptSkuActionGroup.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="ChangeProductConfigurationsInGridExceptSkuActionGroup" extends="ChangeProductConfigurationsInGridActionGroup"> + <annotations> + <description>EXTENDS: changeProductConfigurationsInGrid. Removes 'fillFieldSkuForFirstAttributeOption' and 'fillFieldSkuForSecondAttributeOption'.</description> + </annotations> + + <remove keyForRemoval="fillFieldSkuForFirstAttributeOption"/> + <remove keyForRemoval="fillFieldSkuForSecondAttributeOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductActionGroup.xml new file mode 100644 index 0000000000000..cb903222822eb --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductActionGroup.xml @@ -0,0 +1,75 @@ +<?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="CreateConfigurableProductActionGroup"> + <annotations> + <description>Goes to the Admin Product grid page. Creates a Configurable Product using the default Product Options.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + <argument name="category" defaultValue="_defaultCategory"/> + </arguments> + + <!-- fill in basic configurable product values --> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> + <waitForPageLoad time="30" stepKey="wait1"/> + <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickOnAddProductToggle"/> + <click selector="{{AdminProductGridActionSection.addConfigurableProduct}}" stepKey="clickOnAddConfigurableProduct"/> + <fillField userInput="{{product.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> + <fillField userInput="{{product.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/> + <fillField userInput="{{product.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/> + <fillField userInput="{{product.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/> + <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="fillCategory"/> + <selectOption userInput="{{product.visibility}}" selector="{{AdminProductFormSection.visibility}}" stepKey="fillVisibility"/> + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> + <fillField userInput="{{product.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> + + <!-- create configurations for colors the product is available in --> + <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurations"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickOnNewAttribute"/> + <waitForPageLoad stepKey="waitForIFrame"/> + <switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/> + <fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{colorProductAttribute.default_label}}" stepKey="fillDefaultLabel"/> + <click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/> + <waitForPageLoad stepKey="waitForSaveAttribute"/> + <switchToIFrame stepKey="switchOutOfIFrame"/> + <waitForPageLoad stepKey="waitForFilters"/> + <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> + <fillField userInput="{{colorProductAttribute.default_label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue1"/> + <fillField userInput="{{colorProductAttribute1.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute1"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute1"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue2"/> + <fillField userInput="{{colorProductAttribute2.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue3"/> + <fillField userInput="{{colorProductAttribute3.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute3"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute3"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applyUniquePricesByAttributeToEachSku}}" stepKey="clickOnApplyUniquePricesByAttributeToEachSku"/> + <selectOption selector="{{AdminCreateProductConfigurationsPanel.selectAttribute}}" userInput="{{colorProductAttribute.default_label}}" stepKey="selectAttributes"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute1}}" userInput="{{colorProductAttribute1.price}}" stepKey="fillAttributePrice1"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute2}}" userInput="{{colorProductAttribute2.price}}" stepKey="fillAttributePrice2"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute3}}" userInput="{{colorProductAttribute3.price}}" stepKey="fillAttributePrice3"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="1" stepKey="enterAttributeQuantity"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> + <seeInTitle userInput="{{product.name}}" stepKey="seeProductNameInTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductWithAttributeSetActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductWithAttributeSetActionGroup.xml new file mode 100644 index 0000000000000..cf8d36b393178 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductWithAttributeSetActionGroup.xml @@ -0,0 +1,27 @@ +<?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="CreateConfigurableProductWithAttributeSetActionGroup"> + <annotations> + <description>Admin edit created product as configurable. Choose created options</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + <argument name="category" defaultValue="_defaultCategory"/> + <argument name="label" type="string" defaultValue="mySet"/> + <argument name="option" type="string" defaultValue="['option1', 'option2', 'option3', 'option4']"/> + </arguments> + <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/> + <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{label}}" stepKey="searchForAttrSet"/> + <click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/> + <fillField userInput="{{product.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> + <selectOption selector="{{AdminProductFormSection.additionalOptions}}" parameterArray="{{option}}" stepKey="searchAndMultiSelectCreatedOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductWithTwoAttributesActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductWithTwoAttributesActionGroup.xml new file mode 100644 index 0000000000000..aeb39fc9cbb0a --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurableProductWithTwoAttributesActionGroup.xml @@ -0,0 +1,57 @@ +<?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="CreateConfigurableProductWithTwoAttributesActionGroup" extends="CreateConfigurableProductActionGroup"> + <annotations> + <description>Goes to the Admin Product grid page. Creates a Configurable Product with 2 product attributes.</description> + </annotations> + <arguments> + <argument name="attribute1" defaultValue="ProductColorAttribute"/> + <argument name="attribute2" defaultValue="ProductSizeAttribute"/> + </arguments> + <remove keyForRemoval="clickOnNewAttribute"/> + <remove keyForRemoval="waitForIFrame"/> + <remove keyForRemoval="switchToNewAttributeIFrame"/> + <remove keyForRemoval="fillDefaultLabel"/> + <remove keyForRemoval="clickOnNewAttributePanel"/> + <remove keyForRemoval="waitForSaveAttribute"/> + <remove keyForRemoval="switchOutOfIFrame"/> + <remove keyForRemoval="waitForFilters"/> + <remove keyForRemoval="clickOnFilters"/> + <remove keyForRemoval="fillFilterAttributeCodeField"/> + <remove keyForRemoval="clickApplyFiltersButton"/> + <remove keyForRemoval="clickOnFirstCheckbox"/> + <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attribute1.attribute_code)}}" stepKey="selectAttribute1" after="clickOnCreateConfigurations"/> + <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attribute2.attribute_code)}}" stepKey="selectAttribute2" after="selectAttribute1"/> + <remove keyForRemoval="waitCreateNewValueAppears"/> + <remove keyForRemoval="clickOnCreateNewValue1"/> + <remove keyForRemoval="fillFieldForNewAttribute1"/> + <remove keyForRemoval="clickOnSaveNewAttribute1"/> + <remove keyForRemoval="clickOnCreateNewValue2"/> + <remove keyForRemoval="fillFieldForNewAttribute2"/> + <remove keyForRemoval="clickOnSaveNewAttribute2"/> + <remove keyForRemoval="clickOnCreateNewValue3"/> + <remove keyForRemoval="fillFieldForNewAttribute3"/> + <remove keyForRemoval="clickOnSaveNewAttribute3"/> + <remove keyForRemoval="clickOnSelectAll"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attribute1.frontend_label)}}" stepKey="selectAllOptionsOfAttribute1" before="clickOnNextButton2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attribute2.frontend_label)}}" stepKey="selectAllOptionsOfAttribute2" before="clickOnNextButton2"/> + <remove keyForRemoval="applyUniquePricesByAttributeToEachSku"/> + <remove keyForRemoval="clickOnApplyUniquePricesByAttributeToEachSku"/> + <remove keyForRemoval="selectAttributes"/> + <remove keyForRemoval="fillAttributePrice1"/> + <remove keyForRemoval="fillAttributePrice2"/> + <remove keyForRemoval="fillAttributePrice3"/> + <remove keyForRemoval="clickOnSaveButton2"/> + <remove keyForRemoval="clickOnConfirmInPopup"/> + <remove keyForRemoval="seeSaveProductMessage"/> + <remove keyForRemoval="seeProductNameInTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForAttributeActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForAttributeActionGroup.xml new file mode 100644 index 0000000000000..bcfad4849276d --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForAttributeActionGroup.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="CreateConfigurationsForAttributeActionGroup" extends="GenerateConfigurationsByAttributeCodeActionGroup"> + <annotations> + <description>EXTENDS: generateConfigurationsByAttributeCode. Clicks on the Save button. Clicks on the Confirm button.</description> + </annotations> + <arguments> + <argument name="attributeCode" type="string" defaultValue="SomeString"/> + </arguments> + + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForAttributeWithImagesActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForAttributeWithImagesActionGroup.xml new file mode 100644 index 0000000000000..b74300b0d5a13 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForAttributeWithImagesActionGroup.xml @@ -0,0 +1,29 @@ +<?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="CreateConfigurationsForAttributeWithImagesActionGroup" extends="GenerateConfigurationsByAttributeCodeActionGroup"> + <annotations> + <description>EXTENDS: generateConfigurationsByAttributeCode. Adds the provided Attribute Image to the provided Attribute Code.</description> + </annotations> + <arguments> + <argument name="attributeCode" type="string" defaultValue="SomeString"/> + <argument name="image" defaultValue="ProductImage"/> + </arguments> + + <click selector="{{AdminCreateProductConfigurationsPanel.applySingleSetOfImages}}" stepKey="clickOnApplySingleImageSetToAllSku" after="enterAttributeQuantity"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageUploadButton}}" stepKey="seeImageSectionIsReady" after="clickOnApplySingleImageSetToAllSku"/> + <attachFile selector="{{AdminCreateProductConfigurationsPanel.imageFileUpload}}" userInput="{{image.file}}" stepKey="uploadFile" after="seeImageSectionIsReady"/> + <waitForElementNotVisible selector="{{AdminCreateProductConfigurationsPanel.uploadProgressBar}}" stepKey="waitForUpload" after="uploadFile"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageFile(image.fileName)}}" stepKey="waitForThumbnail" after="waitForUpload"/> + + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2" after="clickOnNextButton4"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup" after="clickOnSaveButton2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForTwoAttributeActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForTwoAttributeActionGroup.xml new file mode 100644 index 0000000000000..e241d1dfa3921 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateConfigurationsForTwoAttributeActionGroup.xml @@ -0,0 +1,34 @@ +<?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="CreateConfigurationsForTwoAttributeActionGroup" extends="GenerateConfigurationsByAttributeCodeActionGroup"> + <annotations> + <description>EXTENDS: generateConfigurationsByAttributeCode. Generates the Product Configurations for the 2 provided Attribute Codes on the Configurable Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="secondAttributeCode" type="string"/> + </arguments> + + <remove keyForRemoval="clickOnSelectAll"/> + <remove keyForRemoval="clickFilters"/> + <remove keyForRemoval="fillFilterAttributeCodeField"/> + <remove keyForRemoval="clickApplyFiltersButton"/> + <remove keyForRemoval="clickOnFirstCheckbox"/> + + <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attributeCode)}}" stepKey="clickOnFirstAttributeCheckbox" after="clickCreateConfigurations"/> + <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(secondAttributeCode)}}" stepKey="clickOnSecondAttributeCheckbox" after="clickOnFirstAttributeCheckbox"/> + <grabTextFrom selector="{{AdminCreateProductConfigurationsPanel.defaultLabel(attributeCode)}}" stepKey="grabFirstAttributeDefaultLabel" after="clickOnSecondAttributeCheckbox"/> + <grabTextFrom selector="{{AdminCreateProductConfigurationsPanel.defaultLabel(secondAttributeCode)}}" stepKey="grabSecondAttributeDefaultLabel" after="grabFirstAttributeDefaultLabel"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute({$grabFirstAttributeDefaultLabel})}}" stepKey="clickOnSelectAllForFirstAttribute" after="clickOnNextButton1"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute({$grabSecondAttributeDefaultLabel})}}" stepKey="clickOnSelectAllForSecondAttribute" after="clickOnSelectAllForFirstAttribute"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ConfigurableProductAttributeNameDesignActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateNewAttributeActionGroup.xml similarity index 55% rename from app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ConfigurableProductAttributeNameDesignActionGroup.xml rename to app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateNewAttributeActionGroup.xml index 8863cfaf4aeaa..9925aba09fb82 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ConfigurableProductAttributeNameDesignActionGroup.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateNewAttributeActionGroup.xml @@ -8,44 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="GotoCatalogProductsPage"> - <annotations> - <description>Goes to the Admin Products grid via the Admin Side Menu.</description> - </annotations> - - <click stepKey="clickOnCatalogItem" selector="{{CatalogProductsSection.catalogItem}}"/> - <waitForPageLoad stepKey="waitForCatalogLoad"/> - <click stepKey="clickOnProductItem" selector="{{CatalogProductsSection.productItem}}"/> - <waitForPageLoad stepKey="waitForCatalogProductPageLoad"/> - <seeInCurrentUrl stepKey="assertWeAreOnTheCatalogProductPage" url="{{assertionData.catalogProduct}}"/> - </actionGroup> - - <actionGroup name="GotoConfigurableProductPage"> - <annotations> - <description>Clicks on create Configurable Product from the Admin Products grid page.</description> - </annotations> - - <click stepKey="clickOnAddProductItem" selector="{{ConfigurableProductSection.addProductItem}}"/> - <click stepKey="clickOnConfigurationProductItem" selector="{{ConfigurableProductSection.configProductItem}}"/> - <waitForPageLoad stepKey="waitForConfigurableProductPageLoad"/> - <seeInCurrentUrl stepKey="assertWeAreOnTheConfigurableProductPage" url="{{assertionData.configurableProduct}}"/> - </actionGroup> - - <actionGroup name="FillAllRequiredFields"> - <annotations> - <description>Fills the Product Name, Price and Weight fields. Clicks on 'Create Configurations'. Clicks on 'Create New Attribute'.</description> - </annotations> - - <fillField stepKey="fillInProductNameFields" selector="{{NewProduct.productName}}" userInput="{{NewProductsData.productName}}"/> - <fillField stepKey="fillInPriceFields" selector="{{NewProduct.price}}" userInput="{{NewProductsData.price}}"/> - <fillField stepKey="fillInWeightFields" selector="{{NewProduct.weight}}" userInput="{{NewProductsData.weight}}"/> - <click stepKey="clickOnCreateConfigurationsButton" selector="{{NewProduct.createConfigurationButton}}"/> - <waitForPageLoad stepKey="waitForCreateProductConfigurationsPageLoad"/> - <click stepKey="clickOnCreateNewAttributeButton" selector="{{NewProduct.createNewAttributeButton}}"/> - <waitForPageLoad stepKey="waitForNewAttributePageLoad"/> - </actionGroup> - - <actionGroup name="CreateNewAttribute"> + <actionGroup name="CreateNewAttributeActionGroup"> <annotations> <description>Creates a new Product Attribute via the Admin Products creation/edit page. PLEASE NOTE: The Product Attributes are Hardcoded.</description> </annotations> @@ -120,39 +83,4 @@ <conditionalClick selector="{{ConfigurableProductSection.closeFrame}}" dependentSelector="{{ConfigurableProductSection.closeFrame}}" visible="1" stepKey="closeFrame"/> <waitForPageLoad stepKey="waitForClosingFrame"/> </actionGroup> - - <actionGroup name="DeleteCreatedAttribute"> - <annotations> - <description>Deletes the Configurable Product Attribute.</description> - </annotations> - - <!--Click on Stores item--> - <click stepKey="clickOnStoresItem" selector="{{CatalogProductsSection.storesItem}}"/> - <waitForPageLoad stepKey="waitForNavigationPanel"/> - - <!--Click on Products item--> - <waitForElementVisible selector="{{CatalogProductsSection.storesProductItem}}" stepKey="waitForCatalogLoad"/> - <click stepKey="clickOnStoresProductItem" selector="{{CatalogProductsSection.storesProductItem}}"/> - <waitForPageLoad stepKey="waitForStoresProductPageLoad"/> - - <!--Click on created Attribute --> - <fillField stepKey="searchProductDefaultLabel" selector="{{CatalogProductsSection.searchDefaultLabelField}}" userInput="{{NewProductsData.defaultLabel}}"/> - <click stepKey="clickSearchButton" selector="{{CatalogProductsSection.searchButton}}"/> - <waitForPageLoad stepKey="waitForCreatedAttributeLoad"/> - <click stepKey="clickOnCreatedAttributeItem" selector="{{CatalogProductsSection.createdAttributeItem}}"/> - <waitForPageLoad stepKey="waitForAttributePropertiesPageLoad"/> - - <!--Click on Delete Attribute item--> - <click stepKey="clickOnDeleteAttributeItem" selector="{{CatalogProductsSection.deleteAttributeItem}}"/> - <waitForPageLoad stepKey="waitForDeletedDialogOpened"/> - - <!--Click on OK button--> - <click stepKey="clickOnOKButton" selector="{{CatalogProductsSection.okButton}}"/> - <waitForPageLoad stepKey="waitFordAttributeDeleted"/> - <see userInput="You deleted the product attribute." stepKey="seeDeletedTheProductAttributeMessage"/> - - <!-- Click Reset Filter button--> - <click stepKey="clickResetFilterButton" selector="{{CatalogProductsSection.resetFilter}}"/> - <waitForPageLoad stepKey="waitForAllFilterReset"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateOptionsForAttributeActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateOptionsForAttributeActionGroup.xml new file mode 100644 index 0000000000000..d691564f331f1 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/CreateOptionsForAttributeActionGroup.xml @@ -0,0 +1,31 @@ +<?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="CreateOptionsForAttributeActionGroup"> + <arguments> + <argument name="attributeName" type="string" defaultValue="{{productAttributeColor.default_label}}"/> + <argument name="firstOptionName" type="string" defaultValue="option1"/> + <argument name="secondOptionName" type="string" defaultValue="option2"/> + </arguments> + <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> + <fillField userInput="{{attributeName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateFirstNewValue"/> + <fillField userInput="{{firstOptionName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateSecondNewValue"/> + <fillField userInput="{{secondOptionName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveAttribute"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/DeleteCreatedAttributeActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/DeleteCreatedAttributeActionGroup.xml new file mode 100644 index 0000000000000..ff8cfecf83ab9 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/DeleteCreatedAttributeActionGroup.xml @@ -0,0 +1,45 @@ +<?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="DeleteCreatedAttributeActionGroup"> + <annotations> + <description>Deletes the Configurable Product Attribute.</description> + </annotations> + + <!--Click on Stores item--> + <click stepKey="clickOnStoresItem" selector="{{CatalogProductsSection.storesItem}}"/> + <waitForPageLoad stepKey="waitForNavigationPanel"/> + + <!--Click on Products item--> + <waitForElementVisible selector="{{CatalogProductsSection.storesProductItem}}" stepKey="waitForCatalogLoad"/> + <click stepKey="clickOnStoresProductItem" selector="{{CatalogProductsSection.storesProductItem}}"/> + <waitForPageLoad stepKey="waitForStoresProductPageLoad"/> + + <!--Click on created Attribute --> + <fillField stepKey="searchProductDefaultLabel" selector="{{CatalogProductsSection.searchDefaultLabelField}}" userInput="{{NewProductsData.defaultLabel}}"/> + <click stepKey="clickSearchButton" selector="{{CatalogProductsSection.searchButton}}"/> + <waitForPageLoad stepKey="waitForCreatedAttributeLoad"/> + <click stepKey="clickOnCreatedAttributeItem" selector="{{CatalogProductsSection.createdAttributeItem}}"/> + <waitForPageLoad stepKey="waitForAttributePropertiesPageLoad"/> + + <!--Click on Delete Attribute item--> + <click stepKey="clickOnDeleteAttributeItem" selector="{{CatalogProductsSection.deleteAttributeItem}}"/> + <waitForPageLoad stepKey="waitForDeletedDialogOpened"/> + + <!--Click on OK button--> + <click stepKey="clickOnOKButton" selector="{{CatalogProductsSection.okButton}}"/> + <waitForPageLoad stepKey="waitFordAttributeDeleted"/> + <see userInput="You deleted the product attribute." stepKey="seeDeletedTheProductAttributeMessage"/> + + <!-- Click Reset Filter button--> + <click stepKey="clickResetFilterButton" selector="{{CatalogProductsSection.resetFilter}}"/> + <waitForPageLoad stepKey="waitForAllFilterReset"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/FillAllRequiredFieldsActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/FillAllRequiredFieldsActionGroup.xml new file mode 100644 index 0000000000000..9021225dd6fca --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/FillAllRequiredFieldsActionGroup.xml @@ -0,0 +1,24 @@ +<?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="FillAllRequiredFieldsActionGroup"> + <annotations> + <description>Fills the Product Name, Price and Weight fields. Clicks on 'Create Configurations'. Clicks on 'Create New Attribute'.</description> + </annotations> + + <fillField stepKey="fillInProductNameFields" selector="{{NewProduct.productName}}" userInput="{{NewProductsData.productName}}"/> + <fillField stepKey="fillInPriceFields" selector="{{NewProduct.price}}" userInput="{{NewProductsData.price}}"/> + <fillField stepKey="fillInWeightFields" selector="{{NewProduct.weight}}" userInput="{{NewProductsData.weight}}"/> + <click stepKey="clickOnCreateConfigurationsButton" selector="{{NewProduct.createConfigurationButton}}"/> + <waitForPageLoad stepKey="waitForCreateProductConfigurationsPageLoad"/> + <click stepKey="clickOnCreateNewAttributeButton" selector="{{NewProduct.createNewAttributeButton}}"/> + <waitForPageLoad stepKey="waitForNewAttributePageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GenerateAndSaveConfiguredProductAfterSettingOptionsActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GenerateAndSaveConfiguredProductAfterSettingOptionsActionGroup.xml new file mode 100644 index 0000000000000..a4eade1549b07 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GenerateAndSaveConfiguredProductAfterSettingOptionsActionGroup.xml @@ -0,0 +1,15 @@ +<?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="GenerateAndSaveConfiguredProductAfterSettingOptionsActionGroup" extends="SaveConfiguredProductActionGroup"> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" before="clickOnSaveButton2" stepKey="clickOnNextButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" after="clickOnNextButton" stepKey="clickOnGenerateProductsButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GenerateConfigurationsByAttributeCodeActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GenerateConfigurationsByAttributeCodeActionGroup.xml new file mode 100644 index 0000000000000..80248cf5e00f8 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GenerateConfigurationsByAttributeCodeActionGroup.xml @@ -0,0 +1,32 @@ +<?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="GenerateConfigurationsByAttributeCodeActionGroup"> + <annotations> + <description>Generates the Product Configurations for the provided Attribute Code on the Configurable Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="attributeCode" type="string" defaultValue="SomeString"/> + </arguments> + + <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickCreateConfigurations"/> + <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickFilters"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" userInput="{{attributeCode}}" stepKey="fillFilterAttributeCodeField"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="99" stepKey="enterAttributeQuantity"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GotoCatalogProductsPageActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GotoCatalogProductsPageActionGroup.xml new file mode 100644 index 0000000000000..237c55dd591ae --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GotoCatalogProductsPageActionGroup.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="GotoCatalogProductsPageActionGroup"> + <annotations> + <description>Goes to the Admin Products grid via the Admin Side Menu.</description> + </annotations> + + <click stepKey="clickOnCatalogItem" selector="{{CatalogProductsSection.catalogItem}}"/> + <waitForPageLoad stepKey="waitForCatalogLoad"/> + <click stepKey="clickOnProductItem" selector="{{CatalogProductsSection.productItem}}"/> + <waitForPageLoad stepKey="waitForCatalogProductPageLoad"/> + <seeInCurrentUrl stepKey="assertWeAreOnTheCatalogProductPage" url="{{assertionData.catalogProduct}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GotoConfigurableProductPageActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GotoConfigurableProductPageActionGroup.xml new file mode 100644 index 0000000000000..a16d99944003b --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/GotoConfigurableProductPageActionGroup.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="GotoConfigurableProductPageActionGroup"> + <annotations> + <description>Clicks on create Configurable Product from the Admin Products grid page.</description> + </annotations> + + <click stepKey="clickOnAddProductItem" selector="{{ConfigurableProductSection.addProductItem}}"/> + <click stepKey="clickOnConfigurationProductItem" selector="{{ConfigurableProductSection.configProductItem}}"/> + <waitForPageLoad stepKey="waitForConfigurableProductPageLoad"/> + <seeInCurrentUrl stepKey="assertWeAreOnTheConfigurableProductPage" url="{{assertionData.configurableProduct}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductActionGroup.xml new file mode 100644 index 0000000000000..3b77a3b00c960 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductActionGroup.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="SaveConfigurableProductActionGroup"> + <annotations> + <description>Save configurable product</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> + <seeInTitle userInput="{{product.name}}" stepKey="seeProductNameInTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductAddToCurrentAttributeSetActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductAddToCurrentAttributeSetActionGroup.xml new file mode 100644 index 0000000000000..2b45b52e39d8f --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductAddToCurrentAttributeSetActionGroup.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="SaveConfigurableProductAddToCurrentAttributeSetActionGroup"> + <annotations> + <description>Clicks on 'Save'. Clicks on 'Confirm' in the 'Choose Affected Attribute Set' model on the Configurable Product creation/edit page.</description> + </annotations> + + <waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveBtnVisible"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProductAgain"/> + <waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="waitPopUpVisible"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmPopup"/> + <seeElement selector="{{AdminMessagesSection.success}}" stepKey="seeSaveProductMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductWithNewAttributeSetActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductWithNewAttributeSetActionGroup.xml new file mode 100644 index 0000000000000..449c97cb5da6e --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfigurableProductWithNewAttributeSetActionGroup.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="SaveConfigurableProductWithNewAttributeSetActionGroup"> + <annotations> + <description>Clicks on 'Save'. Clicks radio for '...new Attribute Set...' in the 'Choose Affected Attribute Set' modal. Clicks on 'Confirm' in the model on the Configurable Product creation/edit page.</description> + </annotations> + + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveConfigurableProduct"/> + <waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" time="30" stepKey="waitForAttributeSetConfirmation"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.addNewAttrSet}}" stepKey="clickAddNewAttributeSet"/> + <fillField selector="{{AdminChooseAffectedAttributeSetPopup.createNewAttrSetName}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="fillFieldNewAttrSetName"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickConfirmAttributeSet"/> + <see selector="You saved the product" stepKey="seeConfigurableSaveConfirmation" after="clickConfirmAttributeSet"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfiguredProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfiguredProductActionGroup.xml new file mode 100644 index 0000000000000..011c1f195dbd1 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SaveConfiguredProductActionGroup.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="SaveConfiguredProductActionGroup"> + <annotations> + <description>Save the Configurable Product on the Configurable Product creation/edit page. Validates that the Success Message is present.</description> + </annotations> + + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SelectCreatedAttributeAndCreateTwoOptionsActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SelectCreatedAttributeAndCreateTwoOptionsActionGroup.xml new file mode 100644 index 0000000000000..ef06518205196 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SelectCreatedAttributeAndCreateTwoOptionsActionGroup.xml @@ -0,0 +1,28 @@ +<?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="SelectCreatedAttributeAndCreateTwoOptionsActionGroup" extends="AddNewProductConfigurationAttributeActionGroup"> + <remove keyForRemoval="clickOnNewAttribute"/> + <remove keyForRemoval="waitForIFrame"/> + <remove keyForRemoval="switchToNewAttributeIFrame"/> + <remove keyForRemoval="fillDefaultLabel"/> + <remove keyForRemoval="clickOnNewAttributePanel"/> + <remove keyForRemoval="waitForSaveAttribute"/> + <remove keyForRemoval="switchOutOfIFrame"/> + <remove keyForRemoval="waitForFilters"/> + <fillField userInput="{{attribute.attribute_code}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> + <fillField userInput="{{firstOption.label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> + <fillField userInput="{{secondOption.label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> + <remove keyForRemoval="clickOnSelectAll"/> + <remove keyForRemoval="clickOnSecondNextButton"/> + <remove keyForRemoval="clickOnThirdNextButton"/> + <remove keyForRemoval="clickOnFourthNextButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SelectSingleAttributeAndAddToCartActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SelectSingleAttributeAndAddToCartActionGroup.xml new file mode 100644 index 0000000000000..681e3a319eac6 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/SelectSingleAttributeAndAddToCartActionGroup.xml @@ -0,0 +1,26 @@ +<?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="SelectSingleAttributeAndAddToCartActionGroup"> + <annotations> + <description>Selects a Product Option. Clicks 'Add to Cart'. Validates that the Product Added Success message appears.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="attributeCode" type="string"/> + <argument name="optionName" type="string"/> + </arguments> + + <selectOption selector="{{StorefrontProductInfoMainSection.attributeSelectByAttributeID(attributeCode)}}" userInput="{{optionName}}" stepKey="selectAttribute"/> + <click stepKey="addProduct" selector="{{StorefrontProductActionSection.addToCart}}"/> + <waitForElementVisible selector="{{StorefrontQuickSearchResultsSection.messageSection}}" time="30" stepKey="waitForProductAdded"/> + <see selector="{{StorefrontQuickSearchResultsSection.messageSection}}" userInput="You added {{productName}} to your shopping cart." stepKey="seeAddedToCartMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StartCreateConfigurationsForAttributeActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StartCreateConfigurationsForAttributeActionGroup.xml new file mode 100644 index 0000000000000..d91d918c9ec79 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StartCreateConfigurationsForAttributeActionGroup.xml @@ -0,0 +1,15 @@ +<?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="StartCreateConfigurationsForAttributeActionGroup" extends="GenerateConfigurationsByAttributeCodeActionGroup"> + <remove keyForRemoval="clickOnNextButton3"/> + <remove keyForRemoval="clickOnNextButton4"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCategoryActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckCategoryConfigurableProductActionGroup.xml similarity index 60% rename from app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCategoryActionGroup.xml rename to app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckCategoryConfigurableProductActionGroup.xml index 8b61f0e109591..d33675e2c6b06 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCategoryActionGroup.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckCategoryConfigurableProductActionGroup.xml @@ -9,7 +9,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <!-- Check configurable product on the category page --> - <actionGroup name="StorefrontCheckCategoryConfigurableProduct"> + <actionGroup name="StorefrontCheckCategoryConfigurableProductActionGroup"> <annotations> <description>Validates that the provided Configurable Product is present and correct on a Category page.</description> </annotations> @@ -25,19 +25,4 @@ <!-- @TODO: MAGETWO-80272 Move to Magento_Checkout --> <seeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="AssertAddToCart"/> </actionGroup> - - <!-- Check configurable product out of stock on the category page --> - <actionGroup name="StorefrontCheckCategoryOutOfStockConfigurableProduct"> - <annotations> - <description>Validates that the provided Configurable Product is present and correct on a Category page.</description> - </annotations> - <arguments> - <argument name="product" type="entity"/> - </arguments> - - <seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName(product.name)}}" stepKey="assertProductName"/> - <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> - <seeElement selector="{{StorefrontCategoryProductSection.ProductStockUnavailable}}" stepKey="AssertOutOfStock"/> - <dontSeeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="AssertAddToCart"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckCategoryOutOfStockConfigurableProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckCategoryOutOfStockConfigurableProductActionGroup.xml new file mode 100644 index 0000000000000..1de28e36d83ae --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckCategoryOutOfStockConfigurableProductActionGroup.xml @@ -0,0 +1,24 @@ +<?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="StorefrontCheckCategoryOutOfStockConfigurableProductActionGroup"> + <annotations> + <description>Validates that the provided Configurable Product is present and correct on a Category page.</description> + </annotations> + <arguments> + <argument name="product" type="entity"/> + </arguments> + + <seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName(product.name)}}" stepKey="assertProductName"/> + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> + <seeElement selector="{{StorefrontCategoryProductSection.ProductStockUnavailable}}" stepKey="AssertOutOfStock"/> + <dontSeeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="AssertAddToCart"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckConfigurableProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckConfigurableProductActionGroup.xml new file mode 100644 index 0000000000000..e21c2e11fcc4c --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckConfigurableProductActionGroup.xml @@ -0,0 +1,31 @@ +<?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"> + <!-- Check the configurable product on the product page --> + <actionGroup name="StorefrontCheckConfigurableProductActionGroup"> + <annotations> + <description>Goes to the provided Storefront Product page. Validates that the Product details are present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="optionProduct"/> + </arguments> + + <seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> + <seeInTitle userInput="{{product.name}}" stepKey="AssertProductNameInTitle"/> + <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> + <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> + <see userInput="${{optionProduct.price}}.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/> + <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertInStock"/> + <seeElement selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="assertAddToCart"/> + <see userInput="{{product.custom_attributes[description]}}" selector="{{StorefrontProductInfoMainSection.productDescription}}" stepKey="assertProductDescription"/> + <see userInput="{{product.custom_attributes[short_description]}}" selector="{{StorefrontProductInfoMainSection.productShortDescription}}" stepKey="assertProductShortDescription"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckConfigurableProductOptionsActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckConfigurableProductOptionsActionGroup.xml new file mode 100644 index 0000000000000..bee1181601f9b --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontCheckConfigurableProductOptionsActionGroup.xml @@ -0,0 +1,32 @@ +<?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="StorefrontCheckConfigurableProductOptionsActionGroup"> + <annotations> + <description>Validates that the Options for a Configurable Product are present and correct.</description> + </annotations> + <arguments> + <argument name="product" type="entity"/> + <argument name="firstOption" type="entity"/> + <argument name="secondOption" type="entity"/> + </arguments> + + <selectOption userInput="{{firstOption.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/> + <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="seeConfigurableProductName"/> + <see userInput="{{firstOption.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPricePresent"/> + <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="seeConfigurableProductSku"/> + <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertInStock"/> + <see userInput="{{colorProductAttribute.default_label}}" selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" stepKey="seeColorAttributeName"/> + <dontSee userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeProductPriceLabel1"/> + <selectOption userInput="{{secondOption.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption2"/> + <dontSee userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeProductPriceLabel2"/> + <see userInput="{{secondOption.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeProductPrice2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontOpenMinicartAndCheckConfigurableProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontOpenMinicartAndCheckConfigurableProductActionGroup.xml new file mode 100644 index 0000000000000..d2567aa9c87f8 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontOpenMinicartAndCheckConfigurableProductActionGroup.xml @@ -0,0 +1,24 @@ +<?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="StorefrontOpenMinicartAndCheckConfigurableProductActionGroup"> + <annotations> + <description>Validates that the provided Option Price is present and correct in the Mini Shopping Cart on the Storefront.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="optionProduct"/> + </arguments> + + <waitForElement selector="{{StorefrontMinicartSection.productLinkByName(product.name)}}" stepKey="waitForMinicartProduct"/> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickShowMinicart"/> + <see userInput="${{optionProduct.price}}.00" selector="{{StorefrontMinicartSection.productPriceByName(product.name)}}" stepKey="assertProductPrice"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml deleted file mode 100644 index e5d537f350299..0000000000000 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml +++ /dev/null @@ -1,134 +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"> - <!-- Check the configurable product on the product page --> - <actionGroup name="StorefrontCheckConfigurableProduct"> - <annotations> - <description>Goes to the provided Storefront Product page. Validates that the Product details are present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="optionProduct"/> - </arguments> - - <seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> - <seeInTitle userInput="{{product.name}}" stepKey="AssertProductNameInTitle"/> - <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> - <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> - <see userInput="${{optionProduct.price}}.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/> - <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertInStock"/> - <seeElement selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="assertAddToCart"/> - <see userInput="{{product.custom_attributes[description]}}" selector="{{StorefrontProductInfoMainSection.productDescription}}" stepKey="assertProductDescription"/> - <see userInput="{{product.custom_attributes[short_description]}}" selector="{{StorefrontProductInfoMainSection.productShortDescription}}" stepKey="assertProductShortDescription"/> - </actionGroup> - - <!-- Check Storefront Configurable Product Option --> - <actionGroup name="VerifyOptionInProductStorefront"> - <annotations> - <description>Validates that the provided Option Code and Option Name are present and correct on a Configurable Product page.</description> - </annotations> - <arguments> - <argument name="attributeCode" type="string"/> - <argument name="optionName" type="string"/> - </arguments> - - <seeElement selector="{{StorefrontProductInfoMainSection.attributeOptionByAttributeID(attributeCode, optionName)}}" stepKey="verifyOptionExists"/> - </actionGroup> - - <!-- Adds Single Option Configurable Product to cart--> - <actionGroup name="SelectSingleAttributeAndAddToCart"> - <annotations> - <description>Selects a Product Option. Clicks 'Add to Cart'. Validates that the Product Added Success message appears.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - <argument name="attributeCode" type="string"/> - <argument name="optionName" type="string"/> - </arguments> - - <selectOption selector="{{StorefrontProductInfoMainSection.attributeSelectByAttributeID(attributeCode)}}" userInput="{{optionName}}" stepKey="selectAttribute"/> - <click stepKey="addProduct" selector="{{StorefrontProductActionSection.addToCart}}"/> - <waitForElementVisible selector="{{StorefrontQuickSearchResultsSection.messageSection}}" time="30" stepKey="waitForProductAdded"/> - <see selector="{{StorefrontQuickSearchResultsSection.messageSection}}" userInput="You added {{productName}} to your shopping cart." stepKey="seeAddedToCartMessage"/> - </actionGroup> - - <!-- Verify configurable product options in storefront product view --> - <actionGroup name="storefrontCheckConfigurableProductOptions"> - <annotations> - <description>Validates that the Options for a Configurable Product are present and correct.</description> - </annotations> - <arguments> - <argument name="product" type="entity"/> - <argument name="firstOption" type="entity"/> - <argument name="secondOption" type="entity"/> - </arguments> - - <selectOption userInput="{{firstOption.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/> - <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="seeConfigurableProductName"/> - <see userInput="{{firstOption.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPricePresent"/> - <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="seeConfigurableProductSku"/> - <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertInStock"/> - <see userInput="{{colorProductAttribute.default_label}}" selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" stepKey="seeColorAttributeName"/> - <dontSee userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeProductPriceLabel1"/> - <selectOption userInput="{{secondOption.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption2"/> - <dontSee userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeProductPriceLabel2"/> - <see userInput="{{secondOption.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeProductPrice2"/> - </actionGroup> - - <!-- Assert option image in storefront product page --> - <actionGroup name="assertOptionImageInStorefrontProductPage"> - <annotations> - <description>Validates that the provided Product Image is present when the provided Product Option is selected.</description> - </annotations> - <arguments> - <argument name="product" type="entity"/> - <argument name="label" type="string"/> - <argument name="image" defaultValue="MagentoLogo"/> - </arguments> - - <seeInCurrentUrl url="/{{product.urlKey}}.html" stepKey="checkUrl"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <selectOption userInput="{{label}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/> - <seeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeFirstImage"/> - </actionGroup> - - <!-- Assert option image and price in storefront product page --> - <actionGroup name="AssertOptionImageAndPriceInStorefrontProductActionGroup"> - <annotations> - <description>Validates that the provided Product Image and Price are present when the provided Product Option is selected.</description> - </annotations> - <arguments> - <argument name="label" type="string"/> - <argument name="image" type="string"/> - <argument name="price" type="string"/> - </arguments> - - <selectOption userInput="{{label}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption"/> - <seeElement selector="{{StorefrontProductMediaSection.imageFile(image)}}" stepKey="seeImage"/> - <see userInput="{{price}}" selector="{{StorefrontProductInfoMainSection.price}}" stepKey="seeProductPrice"/> - </actionGroup> - - <!-- Assert configurable product with special price in storefront product page --> - <actionGroup name="assertConfigurableProductWithSpecialPriceOnStorefrontProductPage"> - <annotations> - <description>Validates that Special Price for a Configurable Product is present and correct when the provided Product Option is selected.</description> - </annotations> - <arguments> - <argument name="option" type="string"/> - <argument name="price" type="string"/> - <argument name="specialPrice" defaultValue="specialProductPrice"/> - </arguments> - - <selectOption userInput="{{option}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOptionWithSpecialPrice"/> - <see userInput="{{specialProductPrice.price}}" selector="{{StorefrontProductInfoMainSection.productSpecialPrice}}" stepKey="seeSpecialProductPrice"/> - <see userInput="Regular Price" selector="{{StorefrontProductInfoMainSection.specialProductText}}" stepKey="seeText"/> - <see userInput="{{price}}" selector="{{StorefrontProductInfoMainSection.oldProductPrice}}" stepKey="seeOldProductPrice"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml index 965f452861f7c..28c23955aa1f8 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml @@ -25,17 +25,5 @@ </actionGroup> <!-- Open the Minicart and check Configurable Product --> - <actionGroup name="StorefrontOpenMinicartAndCheckConfigurableProductActionGroup"> - <annotations> - <description>Validates that the provided Option Price is present and correct in the Mini Shopping Cart on the Storefront.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="optionProduct"/> - </arguments> - <waitForElement selector="{{StorefrontMinicartSection.productLinkByName(product.name)}}" stepKey="waitForMinicartProduct"/> - <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickShowMinicart"/> - <see userInput="${{optionProduct.price}}.00" selector="{{StorefrontMinicartSection.productPriceByName(product.name)}}" stepKey="assertProductPrice"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/VerifyOptionInProductStorefrontActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/VerifyOptionInProductStorefrontActionGroup.xml new file mode 100644 index 0000000000000..05623ee9c8ee4 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/VerifyOptionInProductStorefrontActionGroup.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="VerifyOptionInProductStorefrontActionGroup"> + <annotations> + <description>Validates that the provided Option Code and Option Name are present and correct on a Configurable Product page.</description> + </annotations> + <arguments> + <argument name="attributeCode" type="string"/> + <argument name="optionName" type="string"/> + </arguments> + + <seeElement selector="{{StorefrontProductInfoMainSection.attributeOptionByAttributeID(attributeCode, optionName)}}" stepKey="verifyOptionExists"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ViewConfigurableProductInAdminGridActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ViewConfigurableProductInAdminGridActionGroup.xml new file mode 100644 index 0000000000000..135bd21aad3e9 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/ViewConfigurableProductInAdminGridActionGroup.xml @@ -0,0 +1,41 @@ +<?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="ViewConfigurableProductInAdminGridActionGroup"> + <annotations> + <description>Goes to the Admin Product grid page. Validates the provided Configurable Product is present and correct in the grid.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <waitForPageLoad stepKey="waitForPageLoadInitial"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="3" stepKey="seeCorrectNumberOfProducts"/> + + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFiltersSimple"/> + <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="simple" stepKey="selectionProductType"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersWithSimpleType"/> + <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeSimpleProductNameInGrid"/> + <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.price}}" stepKey="seeSimpleProductPriceInGrid"/> + + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFiltersConfigurable"/> + <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionConfigurableProductType"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersWithConfigurableType"/> + <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeConfigurableProductNameInGrid"/> + <dontSee selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.price}}" stepKey="dontSeeProductPriceNameInGrid"/> + + <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml index 36c135c427365..7740589b4d498 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml @@ -67,17 +67,17 @@ selector="{{AdminCreateProductConfigurationsPanel.selectImagesButton}}" stepKey="selectAttributeOption"/> <!-- Add images to configurable product attribute options --> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImageToConfigurableProductOptionOne"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImageToConfigurableProductOptionOne"> <argument name="image" value="ImageUpload"/> <argument name="frontend_label" value="$$createConfigProductAttributeCreateConfigurableProduct.default_frontend_label$$"/> <argument name="label" value="$$getConfigAttributeOption1CreateConfigurableProduct.label$$"/> </actionGroup> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImageToConfigurableProductOptionTwo"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImageToConfigurableProductOptionTwo"> <argument name="image" value="ImageUpload_1"/> <argument name="frontend_label" value="$$createConfigProductAttributeCreateConfigurableProduct.default_frontend_label$$"/> <argument name="label" value="$$getConfigAttributeOption2CreateConfigurableProduct.label$$"/> </actionGroup> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImageToConfigurableProductOptionThree"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImageToConfigurableProductOptionThree"> <argument name="image" value="ImageUpload3"/> <argument name="frontend_label" value="$$createConfigProductAttributeCreateConfigurableProduct.default_frontend_label$$"/> <argument name="label" value="{{colorDefaultProductAttribute1.name}}"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAssertNoticeThatExistingSkuAutomaticallyChangedWhenSavingProductWithSameSkuTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAssertNoticeThatExistingSkuAutomaticallyChangedWhenSavingProductWithSameSkuTest.xml index c085229da8028..0568ee445034e 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAssertNoticeThatExistingSkuAutomaticallyChangedWhenSavingProductWithSameSkuTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAssertNoticeThatExistingSkuAutomaticallyChangedWhenSavingProductWithSameSkuTest.xml @@ -52,7 +52,7 @@ <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" time="30" stepKey="waitForConfigurationModalOpen" after="clickCreateConfigurations"/> <!--Create new attribute with two option --> - <actionGroup ref="addNewProductConfigurationAttribute" stepKey="createProductConfigurationAttribute"> + <actionGroup ref="AddNewProductConfigurationAttributeActionGroup" stepKey="createProductConfigurationAttribute"> <argument name="attribute" value="colorProductAttribute"/> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckConfigurableProductAttributeValueUniquenessTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckConfigurableProductAttributeValueUniquenessTest.xml index df6afdcfd2243..7c25cf82a1181 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckConfigurableProductAttributeValueUniquenessTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckConfigurableProductAttributeValueUniquenessTest.xml @@ -55,7 +55,7 @@ <conditionalClick selector="{{AdminProductFormConfigurationsSection.sectionHeader}}" dependentSelector="{{AdminProductFormConfigurationsSection.createConfigurations}}" visible="false" stepKey="expandConfigurationsTab1"/> <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurations1"/> <waitForPageLoad stepKey="waitForSelectAttributesPage1"/> - <actionGroup ref="selectCreatedAttributeAndCreateTwoOptions" stepKey="selectCreatedAttributeAndCreateOptions"> + <actionGroup ref="SelectCreatedAttributeAndCreateTwoOptionsActionGroup" stepKey="selectCreatedAttributeAndCreateOptions"> <argument name="attribute" value="dropdownProductAttribute"/> <argument name="firstOption" value="productAttributeOption1"/> <argument name="secondOption" value="productAttributeOption1"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml index de0cca11235ea..502b25617e2b3 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml @@ -120,13 +120,13 @@ <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProductFirst"> <argument name="product" value="$$createFirstConfigurableProduct$$"/> </actionGroup> - <actionGroup ref="CreateConfigurableProductWithAttributeSet" stepKey="createProductFirst"> + <actionGroup ref="CreateConfigurableProductWithAttributeSetActionGroup" stepKey="createProductFirst"> <argument name="product" value="$$createFirstConfigurableProduct$$"/> <argument name="category" value="$$createCategory$$"/> <argument name="label" value="mySet"/> <argument name="option1" value="['option1', 'option2', 'option3', 'option4']"/> </actionGroup> - <actionGroup ref="AdminCreateConfigurationsForAttribute" stepKey="createConfigurationFirst"> + <actionGroup ref="AdminCreateConfigurationsForAttributeActionGroup" stepKey="createConfigurationFirst"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> <argument name="price" value="34"/> </actionGroup> @@ -142,13 +142,13 @@ <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProductSecond"> <argument name="product" value="$$createSecondConfigurableProduct$$"/> </actionGroup> - <actionGroup ref="CreateConfigurableProductWithAttributeSet" stepKey="createProductSecond"> + <actionGroup ref="CreateConfigurableProductWithAttributeSetActionGroup" stepKey="createProductSecond"> <argument name="product" value="$$createSecondConfigurableProduct$$"/> <argument name="category" value="$$createCategory$$"/> <argument name="label" value="mySet"/> <argument name="option1" value="['option1', 'option2', 'option3']"/> </actionGroup> - <actionGroup ref="AdminCreateConfigurableProductWithAttributeUncheckOption" stepKey="createConfigurationSecond"> + <actionGroup ref="AdminCreateConfigurableProductWithAttributeUncheckOptionActionGroup" stepKey="createConfigurationSecond"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> <argument name="price" value="34"/> <argument name="attributeOption" value="option5"/> @@ -165,13 +165,13 @@ <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProductThird"> <argument name="product" value="$$createThirdConfigurableProduct$$"/> </actionGroup> - <actionGroup ref="CreateConfigurableProductWithAttributeSet" stepKey="createProductThird"> + <actionGroup ref="CreateConfigurableProductWithAttributeSetActionGroup" stepKey="createProductThird"> <argument name="product" value="$$createThirdConfigurableProduct$$"/> <argument name="category" value="$$createCategory$$"/> <argument name="label" value="mySet"/> <argument name="option1" value="['option2', 'option3', 'option4']"/> </actionGroup> - <actionGroup ref="AdminCreateConfigurableProductWithAttributeUncheckOption" stepKey="createConfigurationThird"> + <actionGroup ref="AdminCreateConfigurableProductWithAttributeUncheckOptionActionGroup" stepKey="createConfigurationThird"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> <argument name="price" value="34"/> <argument name="attributeOption" value="option1"/> @@ -187,7 +187,7 @@ <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditSimpleProduct"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> - <actionGroup ref="CreateConfigurableProductWithAttributeSet" stepKey="createSimpleProduct"> + <actionGroup ref="CreateConfigurableProductWithAttributeSetActionGroup" stepKey="createSimpleProduct"> <argument name="product" value="$$createSimpleProduct$$"/> <argument name="category" value="$$createCategory$$"/> <argument name="label" value="mySet"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml index 430007ae761f7..aa2e7c1a8a073 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml @@ -30,7 +30,7 @@ </after> <!-- Create a configurable product via the UI --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml index cd09cbd295877..592642573a221 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml @@ -63,7 +63,7 @@ <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{ProductWithLongNameSku.price}}" stepKey="fillProductPrice"/> <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="selectCategory"/> <!--Setup configurations--> - <actionGroup ref="generateConfigurationsByAttributeCode" stepKey="setupConfigurations"> + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="setupConfigurations"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml index 7c6cd57097591..6514ed23ea2b5 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml @@ -284,7 +284,7 @@ </after> <!-- Create a configurable product via the UI --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> @@ -333,7 +333,7 @@ </after> <!-- Create a configurable product via the UI --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml index 11f1e9bb33c10..f6bcfac593bf2 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml @@ -32,7 +32,7 @@ <!-- Create product --> <remove keyForRemoval="goToCreateProduct"/> - <actionGroup ref="createConfigurableProduct" stepKey="fillProductForm"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="fillProductForm"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml index 2cc71964042a4..e1dab01697d89 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml @@ -70,12 +70,12 @@ <argument name="product" value="_defaultProduct"/> </actionGroup> <comment before="createConfiguration" stepKey="beforeCreateConfiguration" userInput="Adding Configuration to Product"/> - <actionGroup ref="generateConfigurationsByAttributeCode" stepKey="createConfiguration" after="fillProductForm"> + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="createConfiguration" after="fillProductForm"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> - <actionGroup ref="saveConfiguredProduct" stepKey="saveProductForm"/> + <actionGroup ref="SaveConfiguredProductActionGroup" stepKey="saveProductForm"/> <see selector="{{AdminProductGridSection.productGridCell('2', 'Type')}}" userInput="Configurable Product" stepKey="seeProductTypeInGrid"/> - <actionGroup ref="VerifyOptionInProductStorefront" stepKey="verifyConfigurableOption" after="AssertProductInStorefrontProductPage"> + <actionGroup ref="VerifyOptionInProductStorefrontActionGroup" stepKey="verifyConfigurableOption" after="AssertProductInStorefrontProductPage"> <argument name="attributeCode" value="$createConfigProductAttribute.default_frontend_label$"/> <argument name="optionName" value="$createConfigProductAttributeOption1.option[store_labels][1][label]$"/> </actionGroup> @@ -109,14 +109,14 @@ <argument name="product" value="_defaultProduct"/> </actionGroup> <comment before="createConfiguration" stepKey="beforeCreateConfiguration" userInput="Adding Configuration to Product"/> - <actionGroup ref="generateConfigurationsByAttributeCode" stepKey="createConfiguration" after="fillProductForm"> + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="createConfiguration" after="fillProductForm"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> - <actionGroup ref="saveConfiguredProduct" stepKey="saveProductForm"/> + <actionGroup ref="SaveConfiguredProductActionGroup" stepKey="saveProductForm"/> <see selector="{{AdminProductGridSection.productGridCell('2', 'Type')}}" userInput="Configurable Product" stepKey="seeProductTypeInGrid"/> <!-- Verify product on store front --> <comment userInput="Verify product on store front" stepKey="commentVerifyProductGrid"/> - <actionGroup ref="VerifyOptionInProductStorefront" stepKey="verifyConfigurableOption" after="AssertProductInStorefrontProductPage"> + <actionGroup ref="VerifyOptionInProductStorefrontActionGroup" stepKey="verifyConfigurableOption" after="AssertProductInStorefrontProductPage"> <argument name="attributeCode" value="$createConfigProductAttribute.default_frontend_label$"/> <argument name="optionName" value="$createConfigProductAttributeOption1.option[store_labels][1][label]$"/> </actionGroup> @@ -169,10 +169,10 @@ <argument name="product" value="_defaultProduct"/> </actionGroup> <comment before="createConfiguration" stepKey="beforeCreateConfiguration" userInput="Adding Configuration to Product"/> - <actionGroup ref="generateConfigurationsByAttributeCode" stepKey="createConfiguration"> + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="createConfiguration"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> - <actionGroup ref="saveConfiguredProduct" stepKey="saveProductForm"/> + <actionGroup ref="SaveConfiguredProductActionGroup" stepKey="saveProductForm"/> <!-- Check that product was added with implicit type change --> <comment stepKey="beforeVerify" userInput="Verify Product Type Assigned Correctly"/> <actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/> @@ -184,7 +184,7 @@ <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="assertProductInStorefrontProductPage"> <argument name="product" value="_defaultProduct"/> </actionGroup> - <actionGroup ref="VerifyOptionInProductStorefront" stepKey="verifyConfigurableOption"> + <actionGroup ref="VerifyOptionInProductStorefrontActionGroup" stepKey="verifyConfigurableOption"> <argument name="attributeCode" value="$createConfigProductAttribute.default_frontend_label$"/> <argument name="optionName" value="$createConfigProductAttributeOption1.option[store_labels][1][label]$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductBasedOnParentSkuTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductBasedOnParentSkuTest.xml index f4f607e9119b6..4bec1b243ae39 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductBasedOnParentSkuTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductBasedOnParentSkuTest.xml @@ -52,20 +52,20 @@ <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" time="30" stepKey="waitForConfigurationModalOpen" after="clickCreateConfigurations"/> <!--Create new attribute with two option --> - <actionGroup ref="addNewProductConfigurationAttribute" stepKey="createProductConfigurationAttribute"> + <actionGroup ref="AddNewProductConfigurationAttributeActionGroup" stepKey="createProductConfigurationAttribute"> <argument name="attribute" value="colorProductAttribute"/> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> </actionGroup> <!-- Change product configurations except sku --> - <actionGroup ref="changeProductConfigurationsInGridExceptSku" stepKey="changeProductConfigurationsInGridExceptSku"> + <actionGroup ref="ChangeProductConfigurationsInGridExceptSkuActionGroup" stepKey="changeProductConfigurationsInGridExceptSku"> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> </actionGroup> <!-- Save product --> - <actionGroup ref="saveConfigurableProductAddToCurrentAttributeSet" stepKey="saveProduct"/> + <actionGroup ref="SaveConfigurableProductAddToCurrentAttributeSetActionGroup" stepKey="saveProduct"/> <!-- Assert child products generated sku in grid --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="openProductCatalogPage"/> @@ -79,4 +79,4 @@ </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'SKU')}}" userInput="{{ApiConfigurableProduct.sku}}-{{colorConfigurableProductAttribute2.name}}" stepKey="seeSecondProductSkuInGrid"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml index a7242b43c2b5f..c87fd7dda867a 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml @@ -72,20 +72,20 @@ <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" time="30" stepKey="waitForConfigurationModalOpen" after="clickCreateConfigurations"/> <!--Create new attribute with two option --> - <actionGroup ref="addNewProductConfigurationAttribute" stepKey="createProductConfigurationAttribute"> + <actionGroup ref="AddNewProductConfigurationAttributeActionGroup" stepKey="createProductConfigurationAttribute"> <argument name="attribute" value="colorProductAttribute"/> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> </actionGroup> <!-- Change product configurations in grid --> - <actionGroup ref="changeProductConfigurationsInGrid" stepKey="changeProductConfigurationsInGrid"> + <actionGroup ref="ChangeProductConfigurationsInGridActionGroup" stepKey="changeProductConfigurationsInGrid"> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> </actionGroup> <!-- Save configurable product; add product to new attribute set --> - <actionGroup ref="saveConfigurableProductWithNewAttributeSet" stepKey="saveConfigurableProduct"/> + <actionGroup ref="SaveConfigurableProductWithNewAttributeSetActionGroup" stepKey="saveConfigurableProduct"/> <!-- Find configurable product in grid --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> @@ -97,7 +97,7 @@ <!-- Assert configurable product on admin product page --> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> - <actionGroup ref="assertConfigurableProductOnAdminProductPage" stepKey="assertConfigurableProductOnAdminProductPage"> + <actionGroup ref="AssertConfigurableProductOnAdminProductPageActionGroup" stepKey="assertConfigurableProductOnAdminProductPage"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -107,7 +107,7 @@ <!--Assert configurable product in category --> <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="assertConfigurableProductInCategory"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="assertConfigurableProductInCategory"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="optionProduct" value="colorConfigurableProductAttribute1"/> </actionGroup> @@ -115,7 +115,7 @@ <!--Assert configurable product on product page --> <amOnPage url="{{ApiConfigurableProduct.urlKey}}.html" stepKey="amOnProductPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> - <actionGroup ref="storefrontCheckConfigurableProductOptions" stepKey="checkConfigurableProductOptions"> + <actionGroup ref="StorefrontCheckConfigurableProductOptionsActionGroup" stepKey="checkConfigurableProductOptions"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml index 49f3f8b5ea931..8c69542117993 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml @@ -69,7 +69,7 @@ </actionGroup> <!-- Create product configurations and add attribute and select all options --> - <actionGroup ref="generateConfigurationsByAttributeCode" stepKey="generateConfigurationsByAttributeCode" after="fillConfigurableProductValues"> + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="generateConfigurationsByAttributeCode" after="fillConfigurableProductValues"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> @@ -77,7 +77,7 @@ <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory" after="fillConfigurableProductValues"/> <!-- Add child product to configurations grid --> - <actionGroup ref="addProductToConfigurationsGrid" stepKey="addSimpleProduct"> + <actionGroup ref="AddProductToConfigurationsGridActionGroup" stepKey="addSimpleProduct"> <argument name="sku" value="$$createSimpleProduct.sku$$"/> <argument name="name" value="$$createConfigProductAttributeOption.option[store_labels][1][label]$$"/> </actionGroup> @@ -95,7 +95,7 @@ <!-- Assert configurable product on admin product page --> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> - <actionGroup ref="assertConfigurableProductOnAdminProductPage" stepKey="assertConfigurableProductOnAdminProductPage"> + <actionGroup ref="AssertConfigurableProductOnAdminProductPageActionGroup" stepKey="assertConfigurableProductOnAdminProductPage"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml index 9796c14f5519a..e856755a48ff8 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml @@ -97,24 +97,24 @@ <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/> <!-- Add images to first product attribute options --> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImageToConfigurableProductOptionOne"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImageToConfigurableProductOptionOne"> <argument name="image" value="MagentoLogo"/> <argument name="frontend_label" value="$$createFirstConfigProductAttribute.default_frontend_label$$"/> <argument name="label" value="$$createConfigProductAttributeOptionOne.option[store_labels][1][label]$$"/> </actionGroup> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImageToConfigurableProductOptionTwo"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImageToConfigurableProductOptionTwo"> <argument name="image" value="TestImageNew"/> <argument name="frontend_label" value="$$createFirstConfigProductAttribute.default_frontend_label$$"/> <argument name="label" value="$$createConfigProductAttributeOptionTwo.option[store_labels][1][label]$$"/> </actionGroup> <!-- Add price to second product attribute options --> - <actionGroup ref="addUniquePriceToConfigurableProductOption" stepKey="addPriceToConfigurableProductOptionThree"> + <actionGroup ref="AddUniquePriceToConfigurableProductOptionActionGroup" stepKey="addPriceToConfigurableProductOptionThree"> <argument name="frontend_label" value="$$createSecondConfigProductAttribute.default_frontend_label$$"/> <argument name="label" value="$$createConfigProductAttributeOptionThree.option[store_labels][1][label]$$"/> <argument name="price" value="{{virtualProductWithRequiredFields.price}}"/> </actionGroup> - <actionGroup ref="addUniquePriceToConfigurableProductOption" stepKey="addPriceToConfigurableProductOptionFour"> + <actionGroup ref="AddUniquePriceToConfigurableProductOptionActionGroup" stepKey="addPriceToConfigurableProductOptionFour"> <argument name="frontend_label" value="$$createSecondConfigProductAttribute.default_frontend_label$$"/> <argument name="label" value="$$createConfigProductAttributeOptionFour.option[store_labels][1][label]$$"/> <argument name="price" value="{{virtualProductWithRequiredFields.price}}"/> @@ -127,7 +127,7 @@ <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/> <!-- Save product --> - <actionGroup ref="saveConfigurableProductAddToCurrentAttributeSet" stepKey="saveProduct"/> + <actionGroup ref="SaveConfigurableProductAddToCurrentAttributeSetActionGroup" stepKey="saveProduct"/> <!--Run re-index task--> <magentoCLI command="indexer:reindex" stepKey="reindex"/> @@ -135,7 +135,7 @@ <!-- Assert configurable product in category --> <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="assertConfigurableProductInCategory"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="assertConfigurableProductInCategory"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="optionProduct" value="virtualProductWithRequiredFields"/> </actionGroup> @@ -148,12 +148,12 @@ </actionGroup> <!-- Assert product options images in storefront product page --> - <actionGroup ref="assertOptionImageInStorefrontProductPage" stepKey="assertFirstOptionImageInStorefrontProductPage"> + <actionGroup ref="AssertOptionImageInStorefrontProductPageActionGroup" stepKey="assertFirstOptionImageInStorefrontProductPage"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="label" value="$$createConfigProductAttributeOptionOne.option[store_labels][1][label]$$"/> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="assertOptionImageInStorefrontProductPage" stepKey="assertSecondOptionImageInStorefrontProductPage"> + <actionGroup ref="AssertOptionImageInStorefrontProductPageActionGroup" stepKey="assertSecondOptionImageInStorefrontProductPage"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="label" value="$$createConfigProductAttributeOptionTwo.option[store_labels][1][label]$$"/> <argument name="image" value="TestImageNew"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml index 308e256543736..07d4f6cdabcf2 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml @@ -92,7 +92,7 @@ </actionGroup> <!-- Create product configurations and add attribute and select all options --> - <actionGroup ref="generateConfigurationsByAttributeCode" stepKey="generateConfigurationsByAttributeCode" after="fillConfigurableProductValues"> + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="generateConfigurationsByAttributeCode" after="fillConfigurableProductValues"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> @@ -100,17 +100,17 @@ <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory" after="fillConfigurableProductValues"/> <!-- Add child products to configurations grid --> - <actionGroup ref="addProductToConfigurationsGrid" stepKey="addFirstSimpleProduct"> + <actionGroup ref="AddProductToConfigurationsGridActionGroup" stepKey="addFirstSimpleProduct"> <argument name="sku" value="$$createFirstSimpleProduct.sku$$"/> <argument name="name" value="$$createConfigProductAttributeOptionOne.option[store_labels][1][label]$$"/> </actionGroup> - <actionGroup ref="addProductToConfigurationsGrid" stepKey="addSecondSimpleProduct"> + <actionGroup ref="AddProductToConfigurationsGridActionGroup" stepKey="addSecondSimpleProduct"> <argument name="sku" value="$$createSecondSimpleProduct.sku$$"/> <argument name="name" value="$$createConfigProductAttributeOptionTwo.option[store_labels][1][label]$$"/> </actionGroup> - <actionGroup ref="addProductToConfigurationsGrid" stepKey="addOutOfStockProduct"> + <actionGroup ref="AddProductToConfigurationsGridActionGroup" stepKey="addOutOfStockProduct"> <argument name="sku" value="$$createSimpleOutOfStockProduct.sku$$"/> <argument name="name" value="$$createConfigProductAttributeOptionThree.option[store_labels][1][label]$$"/> </actionGroup> @@ -127,7 +127,7 @@ <!--Assert configurable product in category --> <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="assertConfigurableProductInCategory"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="assertConfigurableProductInCategory"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="optionProduct" value="$$createFirstSimpleProduct$$"/> </actionGroup> @@ -137,4 +137,4 @@ <waitForPageLoad stepKey="waitForProductPageLoad"/> <see userInput="$$createConfigProductAttributeOptionThree.option[store_labels][1][label]$$" selector="{{StorefrontProductInfoMainSection.optionByAttributeId($$createConfigProductAttribute.attribute_id$$)}}" stepKey="assertOptionNotAvailable" /> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml index e24ac07c30d1e..514ad6ea6f675 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml @@ -89,7 +89,7 @@ </actionGroup> <!-- Create product configurations and add attribute and select all options --> - <actionGroup ref="generateConfigurationsByAttributeCode" stepKey="generateConfigurationsByAttributeCode" after="fillConfigurableProductValues"> + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="generateConfigurationsByAttributeCode" after="fillConfigurableProductValues"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> @@ -97,17 +97,17 @@ <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory" after="fillConfigurableProductValues"/> <!-- Add child products to configurations grid --> - <actionGroup ref="addProductToConfigurationsGrid" stepKey="addFirstSimpleProduct"> + <actionGroup ref="AddProductToConfigurationsGridActionGroup" stepKey="addFirstSimpleProduct"> <argument name="sku" value="$$createFirstSimpleProduct.sku$$"/> <argument name="name" value="$$createConfigProductAttributeOptionOne.option[store_labels][1][label]$$"/> </actionGroup> - <actionGroup ref="addProductToConfigurationsGrid" stepKey="addSecondSimpleProduct"> + <actionGroup ref="AddProductToConfigurationsGridActionGroup" stepKey="addSecondSimpleProduct"> <argument name="sku" value="$$createSecondSimpleProduct.sku$$"/> <argument name="name" value="$$createConfigProductAttributeOptionTwo.option[store_labels][1][label]$$"/> </actionGroup> - <actionGroup ref="addProductToConfigurationsGrid" stepKey="addOutOfStockProduct"> + <actionGroup ref="AddProductToConfigurationsGridActionGroup" stepKey="addOutOfStockProduct"> <argument name="sku" value="$$createSimpleOutOfStockProduct.sku$$"/> <argument name="name" value="$createConfigProductAttributeOptionThree.option[store_labels][1][label]$$"/> </actionGroup> @@ -121,7 +121,7 @@ <!--Assert configurable product in category --> <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="assertConfigurableProductInCategory"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="assertConfigurableProductInCategory"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="optionProduct" value="$$createFirstSimpleProduct$$"/> </actionGroup> @@ -131,4 +131,4 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <dontSee userInput="$$createConfigProductAttributeOptionThree.option[store_labels][1][label]$$" selector="{{StorefrontProductInfoMainSection.optionByAttributeId($$createConfigProductAttribute.attribute_id$$)}}" stepKey="assertOptionNotAvailable"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTierPriceForOneItemTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTierPriceForOneItemTest.xml index 51f4bf0279942..f4ce226960ca2 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTierPriceForOneItemTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTierPriceForOneItemTest.xml @@ -80,17 +80,17 @@ </actionGroup> <!-- Create product configurations and add attribute and select all options --> - <actionGroup ref="generateConfigurationsByAttributeCode" stepKey="generateConfigurationsByAttributeCode" after="fillConfigurableProductValues"> + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="generateConfigurationsByAttributeCode" after="fillConfigurableProductValues"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> <!-- Add associated products to configurations grid --> - <actionGroup ref="addProductToConfigurationsGrid" stepKey="addFirstSimpleProduct"> + <actionGroup ref="AddProductToConfigurationsGridActionGroup" stepKey="addFirstSimpleProduct"> <argument name="sku" value="$$createFirstSimpleProduct.sku$$"/> <argument name="name" value="$$createConfigProductAttributeOptionOne.option[store_labels][1][label]$$"/> </actionGroup> - <actionGroup ref="addProductToConfigurationsGrid" stepKey="addSecondSimpleProduct"> + <actionGroup ref="AddProductToConfigurationsGridActionGroup" stepKey="addSecondSimpleProduct"> <argument name="sku" value="$$createSecondSimpleProduct.sku$$"/> <argument name="name" value="$$createConfigProductAttributeOptionTwo.option[store_labels][1][label]$$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml index 1db9b3e5b79b2..bdf3e49aa466c 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml @@ -72,14 +72,14 @@ <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" time="30" stepKey="waitForConfigurationModalOpen" after="clickCreateConfigurations"/> <!--Create new attribute with two options --> - <actionGroup ref="addNewProductConfigurationAttribute" stepKey="createProductConfigurationAttribute"> + <actionGroup ref="AddNewProductConfigurationAttributeActionGroup" stepKey="createProductConfigurationAttribute"> <argument name="attribute" value="colorProductAttribute"/> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> </actionGroup> <!-- Change product configurations in grid --> - <actionGroup ref="changeProductConfigurationsInGrid" stepKey="changeProductConfigurationsInGrid"> + <actionGroup ref="ChangeProductConfigurationsInGridActionGroup" stepKey="changeProductConfigurationsInGrid"> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> </actionGroup> @@ -88,7 +88,7 @@ <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory" after="fillConfigurableProductValues"/> <!-- Save configurable product; add product to new attribute set --> - <actionGroup ref="saveConfigurableProductWithNewAttributeSet" stepKey="saveConfigurableProduct"/> + <actionGroup ref="SaveConfigurableProductWithNewAttributeSetActionGroup" stepKey="saveConfigurableProduct"/> <!-- Assert child products in grid --> <actionGroup ref="viewProductInAdminGrid" stepKey="viewFirstChildProductInAdminGrid"> @@ -111,7 +111,7 @@ <!--Assert configurable product in category --> <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="assertConfigurableProductInCategory"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="assertConfigurableProductInCategory"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="optionProduct" value="colorConfigurableProductAttribute1"/> </actionGroup> @@ -119,7 +119,7 @@ <!--Assert configurable product on product page --> <amOnPage url="{{ApiConfigurableProduct.urlKey}}.html" stepKey="amOnProductPage" after="assertConfigurableProductInCategory"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> - <actionGroup ref="storefrontCheckConfigurableProductOptions" stepKey="checkConfigurableProductOptions"> + <actionGroup ref="StorefrontCheckConfigurableProductOptionsActionGroup" stepKey="checkConfigurableProductOptions"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml index 934a410d58a8a..f3c56184bc956 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml @@ -65,20 +65,20 @@ <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" time="30" stepKey="waitForConfigurationModalOpen" after="clickCreateConfigurations"/> <!--Create new attribute with two option --> - <actionGroup ref="addNewProductConfigurationAttribute" stepKey="createProductConfigurationAttribute"> + <actionGroup ref="AddNewProductConfigurationAttributeActionGroup" stepKey="createProductConfigurationAttribute"> <argument name="attribute" value="colorProductAttribute"/> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> </actionGroup> <!-- Change product configurations in grid --> - <actionGroup ref="changeProductConfigurationsInGrid" stepKey="changeProductConfigurationsInGrid"> + <actionGroup ref="ChangeProductConfigurationsInGridActionGroup" stepKey="changeProductConfigurationsInGrid"> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> </actionGroup> <!-- Save configurable product; add product to new attribute set --> - <actionGroup ref="saveConfigurableProductWithNewAttributeSet" stepKey="saveConfigurableProduct"/> + <actionGroup ref="SaveConfigurableProductWithNewAttributeSetActionGroup" stepKey="saveConfigurableProduct"/> <!-- Assert Child Products in grid --> <actionGroup ref="viewProductInAdminGrid" stepKey="viewFirstChildProductInAdminGrid"> @@ -101,7 +101,7 @@ <!-- Assert configurable product on product page --> <amOnPage url="{{ApiConfigurableProduct.urlKey}}.html" stepKey="amOnProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> - <actionGroup ref="storefrontCheckConfigurableProductOptions" stepKey="checkConfigurableProductOptions"> + <actionGroup ref="StorefrontCheckConfigurableProductOptionsActionGroup" stepKey="checkConfigurableProductOptions"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="firstOption" value="colorConfigurableProductAttribute1"/> <argument name="secondOption" value="colorConfigurableProductAttribute2"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml index fa21d20eb4456..f3d9eef42458e 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml @@ -49,10 +49,10 @@ <comment userInput="Add configurations to product" stepKey="commentAddConfigs"/> <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="gotToSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPageLoad"/> - <actionGroup ref="generateConfigurationsByAttributeCode" stepKey="setupConfigurations"> + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="setupConfigurations"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> - <actionGroup ref="saveConfiguredProduct" stepKey="saveConfigProductForm"/> + <actionGroup ref="SaveConfiguredProductActionGroup" stepKey="saveConfigProductForm"/> <!--Assert configurable product on Admin product page grid--> <comment userInput="Assert configurable product in Admin product page grid" stepKey="commentAssertConfigProductOnAdmin"/> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPage"/> @@ -154,10 +154,10 @@ <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="gotToConfigProductPage"/> <waitForPageLoad stepKey="waitForConfigurableProductPageLoad"/> <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has weight" stepKey="selectWeightForConfigurableProduct"/> - <actionGroup ref="generateConfigurationsByAttributeCode" stepKey="setupConfigurationsForProduct"> + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="setupConfigurationsForProduct"> <argument name="attributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> - <actionGroup ref="saveConfiguredProduct" stepKey="saveNewConfigurableProductForm"/> + <actionGroup ref="SaveConfiguredProductActionGroup" stepKey="saveNewConfigurableProductForm"/> <!--Assert configurable product on Admin product page grid--> <comment userInput="Assert configurable product in Admin product page grid" stepKey="commentAssertConfigurableProductOnAdmin"/> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPageForConfigurable"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductAttributeNameDesignTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductAttributeNameDesignTest.xml index 7fbff5eac2583..bb16d04dfc94a 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductAttributeNameDesignTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductAttributeNameDesignTest.xml @@ -26,16 +26,16 @@ <!-- Navigate to Catalog-> Products --> - <actionGroup ref="GotoCatalogProductsPage" stepKey="goToCatalogProductsPage"/> + <actionGroup ref="GotoCatalogProductsPageActionGroup" stepKey="goToCatalogProductsPage"/> <!-- Fill the fields on Configurable Product--> - <actionGroup ref="GotoConfigurableProductPage" stepKey="goToConfigurableProductPage"/> - <actionGroup ref="FillAllRequiredFields" stepKey="fillInAllRequiredFields"/> + <actionGroup ref="GotoConfigurableProductPageActionGroup" stepKey="goToConfigurableProductPage"/> + <actionGroup ref="FillAllRequiredFieldsActionGroup" stepKey="fillInAllRequiredFields"/> <!-- Create New Attribute (Default Label= design) --> - <actionGroup ref="CreateNewAttribute" stepKey="createNewAttribute"/> + <actionGroup ref="CreateNewAttributeActionGroup" stepKey="createNewAttribute"/> <after> <!-- Delete Created Attribute --> - <actionGroup ref="DeleteCreatedAttribute" stepKey="deleteCreatedAttribute"/> + <actionGroup ref="DeleteCreatedAttributeActionGroup" stepKey="deleteCreatedAttribute"/> </after> </test> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml index 6bbb97c66cdd8..3135393bd502b 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -63,7 +63,7 @@ <waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" time="30" stepKey="waitForAttributeSetConfirmation" after="clickSaveConfigurableProduct"/> <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickConfirmAttributeSet" after="waitForAttributeSetConfirmation"/> <see selector="You saved the product" stepKey="seeConfigurableSaveConfirmation" after="clickConfirmAttributeSet"/> - <actionGroup ref="viewConfigurableProductInAdminGrid" stepKey="viewConfigurableProductInGrid" after="seeConfigurableSaveConfirmation"> + <actionGroup ref="ViewConfigurableProductInAdminGridActionGroup" stepKey="viewConfigurableProductInGrid" after="seeConfigurableSaveConfirmation"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> @@ -73,4 +73,4 @@ <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml index 04687a2314dc6..59bb7f53f0aa8 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml @@ -85,7 +85,7 @@ <!-- Check configurable product in category --> <comment userInput="Verify Configurable Product in category" stepKey="commentVerifyConfigurableProductInCategory" after="browseAssertSimpleProduct2ImageNotDefault" /> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="browseAssertCategoryConfigProduct" after="commentVerifyConfigurableProductInCategory"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="browseAssertCategoryConfigProduct" after="commentVerifyConfigurableProductInCategory"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -98,7 +98,7 @@ <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="clickCategory2" after="commentViewConfigurableProduct"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createConfigProduct.name$$)}}" stepKey="browseClickCategoryConfigProductView" after="clickCategory2"/> <waitForLoadingMaskToDisappear stepKey="waitForConfigurableProductViewloaded" after="browseClickCategoryConfigProductView"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="browseAssertConfigProductPage" after="waitForConfigurableProductViewloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="browseAssertConfigProductPage" after="waitForConfigurableProductViewloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -114,7 +114,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="cartAssertConfigProduct" after="cartAssertCategory1ForConfigurableProduct"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="cartAssertConfigProduct" after="cartAssertCategory1ForConfigurableProduct"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -123,7 +123,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartGrabConfigProductImageSrc" stepKey="cartAssertConfigProductImageNotDefault" after="cartGrabConfigProductImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName($$createConfigProduct.name$$)}}" stepKey="cartClickCategoryConfigProductAddToCart" after="cartAssertConfigProductImageNotDefault"/> <waitForElement selector="{{StorefrontMessagesSection.message('You need to choose options for your item.')}}" time="30" stepKey="cartWaitForConfigProductPageLoad" after="cartClickCategoryConfigProductAddToCart"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertConfigProductPage" after="cartWaitForConfigProductPageLoad"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertConfigProductPage" after="cartWaitForConfigProductPageLoad"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -132,7 +132,7 @@ <assertNotRegExp expected="'/placeholder\/image\.jpg/'" actual="$cartGrabConfigProductPageImageSrc1" stepKey="cartAssertConfigProductPageImageNotDefault1" after="cartGrabConfigProductPageImageSrc1"/> <selectOption userInput="$$createConfigProductAttributeOption2.option[store_labels][1][label]$$" selector="{{StorefrontProductInfoMainSection.optionByAttributeId($$createConfigProductAttribute.attribute_id$$)}}" stepKey="cartConfigProductFillOption" after="cartAssertConfigProductPageImageNotDefault1"/> <waitForLoadingMaskToDisappear stepKey="waitForConfigurableProductOptionloaded" after="cartConfigProductFillOption"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertConfigProductWithOptionPage" after="waitForConfigurableProductOptionloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertConfigProductWithOptionPage" after="waitForConfigurableProductOptionloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct2$$"/> </actionGroup> @@ -157,7 +157,7 @@ <see userInput="$$createConfigProductAttributeOption2.option[store_labels][1][label]$$" selector="{{StorefrontMinicartSection.productOptionByNameAndAttribute($$createConfigProduct.name$$, $$createConfigProductAttribute.attribute[frontend_labels][0][label]$$)}}" stepKey="cartMinicartCheckConfigProductOption" after="cartMinicartClickConfigProductDetails"/> <click selector="{{StorefrontMinicartSection.productLinkByName($$createConfigProduct.name$$)}}" stepKey="cartMinicartClickConfigProduct" after="cartMinicartCheckConfigProductOption"/> <waitForLoadingMaskToDisappear stepKey="waitForMinicartConfigProductloaded" after="cartMinicartClickConfigProduct"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertMinicartConfigProductPage" after="waitForMinicartConfigProductloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertMinicartConfigProductPage" after="waitForMinicartConfigProductloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -180,7 +180,7 @@ <see userInput="$$createConfigProductAttributeOption2.option[store_labels][1][label]$$" selector="{{CheckoutCartProductSection.ProductOptionByNameAndAttribute($$createConfigProduct.name$$, $$createConfigProductAttribute.attribute[frontend_labels][0][label]$$)}}" stepKey="cartCheckConfigProductOption" after="cartCartAssertConfigProduct2ImageNotDefault"/> <click selector="{{CheckoutCartProductSection.ProductLinkByName($$createConfigProduct.name$$)}}" stepKey="cartClickCartConfigProduct" after="cartCheckConfigProductOption"/> <waitForLoadingMaskToDisappear stepKey="waitForCartConfigProductloaded" after="cartClickCartConfigProduct"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertCartConfigProductPage" after="waitForCartConfigProductloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertCartConfigProductPage" after="waitForCartConfigProductloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -190,7 +190,7 @@ <!-- Add Configurable Product to comparison --> <comment userInput="Add Configurable Product to comparison" stepKey="commentAddConfigurableProductToComparison" after="compareAddSimpleProduct2ToCompare" /> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="compareAssertConfigProduct" after="commentAddConfigurableProductToComparison"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="compareAssertConfigProduct" after="commentAddConfigurableProductToComparison"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -294,7 +294,7 @@ <!-- Check configurable product in category --> <comment userInput="Verify Configurable Product in category" stepKey="commentVerifyConfigurableProductInCategory" after="browseAssertSimpleProduct2ImageNotDefault" /> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="browseAssertCategoryConfigProduct" after="commentVerifyConfigurableProductInCategory"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="browseAssertCategoryConfigProduct" after="commentVerifyConfigurableProductInCategory"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -307,7 +307,7 @@ <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="clickCategory2" after="commentViewConfigurableProduct"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createConfigProduct.name$$)}}" stepKey="browseClickCategoryConfigProductView" after="clickCategory2"/> <waitForLoadingMaskToDisappear stepKey="waitForConfigurableProductViewloaded" after="browseClickCategoryConfigProductView"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="browseAssertConfigProductPage" after="waitForConfigurableProductViewloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="browseAssertConfigProductPage" after="waitForConfigurableProductViewloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -323,7 +323,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="cartAssertConfigProduct" after="cartAssertCategory1ForConfigurableProduct"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="cartAssertConfigProduct" after="cartAssertCategory1ForConfigurableProduct"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -332,7 +332,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartGrabConfigProductImageSrc" stepKey="cartAssertConfigProductImageNotDefault" after="cartGrabConfigProductImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName($$createConfigProduct.name$$)}}" stepKey="cartClickCategoryConfigProductAddToCart" after="cartAssertConfigProductImageNotDefault"/> <waitForElement selector="{{StorefrontMessagesSection.message('You need to choose options for your item.')}}" time="30" stepKey="cartWaitForConfigProductPageLoad" after="cartClickCategoryConfigProductAddToCart"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertConfigProductPage" after="cartWaitForConfigProductPageLoad"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertConfigProductPage" after="cartWaitForConfigProductPageLoad"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -341,7 +341,7 @@ <assertNotRegExp expected="'/placeholder\/image\.jpg/'" actual="$cartGrabConfigProductPageImageSrc1" stepKey="cartAssertConfigProductPageImageNotDefault1" after="cartGrabConfigProductPageImageSrc1"/> <selectOption userInput="$$createConfigProductAttributeOption2.option[store_labels][1][label]$$" selector="{{StorefrontProductInfoMainSection.optionByAttributeId($$createConfigProductAttribute.attribute_id$$)}}" stepKey="cartConfigProductFillOption" after="cartAssertConfigProductPageImageNotDefault1"/> <waitForLoadingMaskToDisappear stepKey="waitForConfigurableProductOptionloaded" after="cartConfigProductFillOption"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertConfigProductWithOptionPage" after="waitForConfigurableProductOptionloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertConfigProductWithOptionPage" after="waitForConfigurableProductOptionloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct2$$"/> </actionGroup> @@ -366,7 +366,7 @@ <see userInput="$$createConfigProductAttributeOption2.option[store_labels][1][label]$$" selector="{{StorefrontMinicartSection.productOptionByNameAndAttribute($$createConfigProduct.name$$, $$createConfigProductAttribute.attribute[frontend_labels][0][label]$$)}}" stepKey="cartMinicartCheckConfigProductOption" after="cartMinicartClickConfigProductDetails"/> <click selector="{{StorefrontMinicartSection.productLinkByName($$createConfigProduct.name$$)}}" stepKey="cartMinicartClickConfigProduct" after="cartMinicartCheckConfigProductOption"/> <waitForLoadingMaskToDisappear stepKey="waitForMinicartConfigProductloaded" after="cartMinicartClickConfigProduct"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertMinicartConfigProductPage" after="waitForMinicartConfigProductloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertMinicartConfigProductPage" after="waitForMinicartConfigProductloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -389,7 +389,7 @@ <see userInput="$$createConfigProductAttributeOption2.option[store_labels][1][label]$$" selector="{{CheckoutCartProductSection.ProductOptionByNameAndAttribute($$createConfigProduct.name$$, $$createConfigProductAttribute.attribute[frontend_labels][0][label]$$)}}" stepKey="cartCheckConfigProductOption" after="cartCartAssertConfigProduct2ImageNotDefault"/> <click selector="{{CheckoutCartProductSection.ProductLinkByName($$createConfigProduct.name$$)}}" stepKey="cartClickCartConfigProduct" after="cartCheckConfigProductOption"/> <waitForLoadingMaskToDisappear stepKey="waitForCartConfigProductloaded" after="cartClickCartConfigProduct"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertCartConfigProductPage" after="waitForCartConfigProductloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertCartConfigProductPage" after="waitForCartConfigProductloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -399,7 +399,7 @@ <!-- Add Configurable Product to comparison --> <comment userInput="Add Configurable Product to comparison" stepKey="commentAddConfigurableProductToComparison" after="compareAddSimpleProduct2ToCompare" /> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="compareAssertConfigProduct" after="commentAddConfigurableProductToComparison"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="compareAssertConfigProduct" after="commentAddConfigurableProductToComparison"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml index 6f9ad93a56dc5..dd0673563838e 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml @@ -85,7 +85,7 @@ <!-- Check configurable product in category --> <comment userInput="Verify Configurable Product in category" stepKey="commentVerifyConfigurableProductInCategory" after="browseAssertSimpleProduct2ImageNotDefault" /> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="browseAssertCategoryConfigProduct" after="commentVerifyConfigurableProductInCategory"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="browseAssertCategoryConfigProduct" after="commentVerifyConfigurableProductInCategory"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -98,7 +98,7 @@ <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="clickCategory2" after="commentViewConfigurableProduct"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createConfigProduct.name$$)}}" stepKey="browseClickCategoryConfigProductView" after="clickCategory2"/> <waitForLoadingMaskToDisappear stepKey="waitForConfigurableProductViewloaded" after="browseClickCategoryConfigProductView"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="browseAssertConfigProductPage" after="waitForConfigurableProductViewloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="browseAssertConfigProductPage" after="waitForConfigurableProductViewloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -114,7 +114,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="cartAssertConfigProduct" after="cartAssertCategory1ForConfigurableProduct"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="cartAssertConfigProduct" after="cartAssertCategory1ForConfigurableProduct"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -123,7 +123,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartGrabConfigProductImageSrc" stepKey="cartAssertConfigProductImageNotDefault" after="cartGrabConfigProductImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName($$createConfigProduct.name$$)}}" stepKey="cartClickCategoryConfigProductAddToCart" after="cartAssertConfigProductImageNotDefault"/> <waitForElement selector="{{StorefrontMessagesSection.message('You need to choose options for your item.')}}" time="30" stepKey="cartWaitForConfigProductPageLoad" after="cartClickCategoryConfigProductAddToCart"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertConfigProductPage" after="cartWaitForConfigProductPageLoad"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertConfigProductPage" after="cartWaitForConfigProductPageLoad"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -132,7 +132,7 @@ <assertNotRegExp expected="'/placeholder\/image\.jpg/'" actual="$cartGrabConfigProductPageImageSrc1" stepKey="cartAssertConfigProductPageImageNotDefault1" after="cartGrabConfigProductPageImageSrc1"/> <selectOption userInput="$$createConfigProductAttributeOption2.option[store_labels][1][label]$$" selector="{{StorefrontProductInfoMainSection.optionByAttributeId($$createConfigProductAttribute.attribute_id$$)}}" stepKey="cartConfigProductFillOption" after="cartAssertConfigProductPageImageNotDefault1"/> <waitForLoadingMaskToDisappear stepKey="waitForConfigurableProductOptionloaded" after="cartConfigProductFillOption"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertConfigProductWithOptionPage" after="waitForConfigurableProductOptionloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertConfigProductWithOptionPage" after="waitForConfigurableProductOptionloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct2$$"/> </actionGroup> @@ -157,7 +157,7 @@ <see userInput="$$createConfigProductAttributeOption2.option[store_labels][1][label]$$" selector="{{StorefrontMinicartSection.productOptionByNameAndAttribute($$createConfigProduct.name$$, $$createConfigProductAttribute.attribute[frontend_labels][0][label]$$)}}" stepKey="cartMinicartCheckConfigProductOption" after="cartMinicartClickConfigProductDetails"/> <click selector="{{StorefrontMinicartSection.productLinkByName($$createConfigProduct.name$$)}}" stepKey="cartMinicartClickConfigProduct" after="cartMinicartCheckConfigProductOption"/> <waitForLoadingMaskToDisappear stepKey="waitForMinicartConfigProductloaded" after="cartMinicartClickConfigProduct"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertMinicartConfigProductPage" after="waitForMinicartConfigProductloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertMinicartConfigProductPage" after="waitForMinicartConfigProductloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -180,7 +180,7 @@ <see userInput="$$createConfigProductAttributeOption2.option[store_labels][1][label]$$" selector="{{CheckoutCartProductSection.ProductOptionByNameAndAttribute($$createConfigProduct.name$$, $$createConfigProductAttribute.attribute[frontend_labels][0][label]$$)}}" stepKey="cartCheckConfigProductOption" after="cartCartAssertConfigProduct2ImageNotDefault"/> <click selector="{{CheckoutCartProductSection.ProductLinkByName($$createConfigProduct.name$$)}}" stepKey="cartClickCartConfigProduct" after="cartCheckConfigProductOption"/> <waitForLoadingMaskToDisappear stepKey="waitForCartConfigProductloaded" after="cartClickCartConfigProduct"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="cartAssertCartConfigProductPage" after="waitForCartConfigProductloaded"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="cartAssertCartConfigProductPage" after="waitForCartConfigProductloaded"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -190,7 +190,7 @@ <!-- Add Configurable Product to comparison --> <comment userInput="Add Configurable Product to comparison" stepKey="commentAddConfigurableProductToComparison" after="compareAddSimpleProduct2ToCompare" /> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="compareAssertConfigProduct" after="commentAddConfigurableProductToComparison"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="compareAssertConfigProduct" after="commentAddConfigurableProductToComparison"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml index 2f5ee036b1420..632e066456c4c 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml @@ -24,7 +24,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Create a configurable product via the UI --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> @@ -69,7 +69,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Create a configurable product via the UI --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> @@ -114,7 +114,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Create a configurable product via the UI --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> @@ -156,7 +156,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Create a configurable product via the UI --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> @@ -269,7 +269,7 @@ <argument name="rowIndex" value="3"/> <argument name="quantity" value="1"/> </actionGroup> - <actionGroup ref="saveConfigurableProduct" stepKey="saveConfigurableProduct"> + <actionGroup ref="SaveConfigurableProductActionGroup" stepKey="saveConfigurableProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <scrollTo selector="{{AdminProductSEOSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToAdminProductSEOSection"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest.xml index 65e1d3a74f060..5bebe900ed30d 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest.xml @@ -23,7 +23,7 @@ <createData entity="ApiCategory" stepKey="createCategory"/> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> <!-- Create a configurable product via the UI --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> @@ -65,7 +65,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> <!-- Create a configurable product via the UI --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> @@ -103,7 +103,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> <!-- Create a configurable product via the UI --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml index 4c955f3385643..68a3dc8d437a3 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml @@ -31,14 +31,14 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Create a configurable product via the UI --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="BaseConfigurableProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> <!--Add custom option to configurable product--> <actionGroup ref="AddProductCustomOptionFile" stepKey="addCustomOptionToProduct"/> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/> - + <!--Go to storefront--> <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToHomePage"/> <waitForPageLoad stepKey="waitForHomePageLoad"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml index 749d1bee0661a..af612baed2052 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml @@ -64,7 +64,7 @@ <waitForPageLoad stepKey="waitForProductPageReload"/> <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurations"/> <waitForPageLoad stepKey="waitForFilters"/> - <actionGroup ref="createOptionsForAttribute" stepKey="createOptions"> + <actionGroup ref="CreateOptionsForAttributeActionGroup" stepKey="createOptions"> <argument name="attributeName" value="{{colorProductAttribute.default_label}}"/> <argument name="firstOptionName" value="{{colorConfigurableProductAttribute1.name}}"/> <argument name="secondOptionName" value="{{colorConfigurableProductAttribute2.name}}"/> @@ -73,36 +73,36 @@ <waitForPageLoad stepKey="waitForBulkImagesPriceQuantityPageLoad"/> <!--Add images to configurable product attribute options--> <comment userInput="Add images to configurable product attribute options" stepKey="commentAddImages"/> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImageToConfigurableProductOptionOne"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImageToConfigurableProductOptionOne"> <argument name="image" value="ImageUpload"/> <argument name="frontend_label" value="{{colorProductAttribute.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute1.name}}"/> </actionGroup> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImageToConfigurableProductOptionTwo"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImageToConfigurableProductOptionTwo"> <argument name="image" value="ImageUpload_1"/> <argument name="frontend_label" value="{{colorProductAttribute.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute2.name}}"/> </actionGroup> <!--Add price to product attribute options--> <comment userInput="Add price to product attribute options" stepKey="commentAddPrice"/> - <actionGroup ref="addUniquePriceToConfigurableProductOption" stepKey="addPriceToConfigurableProductOptionFirst"> + <actionGroup ref="AddUniquePriceToConfigurableProductOptionActionGroup" stepKey="addPriceToConfigurableProductOptionFirst"> <argument name="frontend_label" value="{{colorProductAttribute.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute1.name}}"/> <argument name="price" value="{{virtualProductWithRequiredFields.price}}"/> </actionGroup> - <actionGroup ref="addUniquePriceToConfigurableProductOption" stepKey="addPriceToConfigurableProductOptionSecond"> + <actionGroup ref="AddUniquePriceToConfigurableProductOptionActionGroup" stepKey="addPriceToConfigurableProductOptionSecond"> <argument name="frontend_label" value="{{colorProductAttribute.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute2.name}}"/> <argument name="price" value="{{virtualProductWithRequiredFields.price}}"/> </actionGroup> <!--Add quantity to product attribute options--> <comment userInput="Add quantity to product attribute options" stepKey="commentAddQuantity"/> - <actionGroup ref="addUniqueQuantityToConfigurableProductOption" stepKey="addUniqueQtyForFirstOption"> + <actionGroup ref="AddUniqueQuantityToConfigurableProductOptionActionGroup" stepKey="addUniqueQtyForFirstOption"> <argument name="frontend_label" value="{{colorProductAttribute.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute1.name}}"/> <argument name="quantity" value="{{virtualProductBigQty.quantity}}"/> </actionGroup> - <actionGroup ref="addUniqueQuantityToConfigurableProductOption" stepKey="addUniqueQtyForSecondOption"> + <actionGroup ref="AddUniqueQuantityToConfigurableProductOptionActionGroup" stepKey="addUniqueQtyForSecondOption"> <argument name="frontend_label" value="{{colorProductAttribute.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute2.name}}"/> <argument name="quantity" value="{{virtualProductBigQty.quantity}}"/> @@ -146,39 +146,39 @@ <waitForElementVisible selector="{{AdminGridSelectRows.multicheckDropdown}}" stepKey="waitForCreateConfigurationsPageLoad"/> <click selector="{{AdminGridSelectRows.multicheckDropdown}}" stepKey="openMulticheckDropdown"/> <click selector="{{AdminGridSelectRows.multicheckOption('Deselect All')}}" stepKey="DeselectAllAttributes"/> - <actionGroup ref="createOptionsForAttribute" stepKey="createOptionsForDuplicatedProduct"> + <actionGroup ref="CreateOptionsForAttributeActionGroup" stepKey="createOptionsForDuplicatedProduct"> <argument name="attributeName" value="{{productAttributeColor.default_label}}"/> <argument name="firstOptionName" value="{{colorConfigurableProductAttribute1.name}}"/> <argument name="secondOptionName" value="{{colorConfigurableProductAttribute2.name}}"/> </actionGroup> <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnFirstNextButtonForDuplicatedProduct"/> <waitForPageLoad stepKey="waitForBulkImagesPriceQuantityPageLoadForDuplicatedProduct"/> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImgConfigProductOption1DuplicatedProduct"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImgConfigProductOption1DuplicatedProduct"> <argument name="image" value="MagentoLogo"/> <argument name="frontend_label" value="{{productAttributeColor.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute1.name}}"/> </actionGroup> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImgConfigProductOption2DuplicatedProduct"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImgConfigProductOption2DuplicatedProduct"> <argument name="image" value="MagentoLogo"/> <argument name="frontend_label" value="{{productAttributeColor.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute2.name}}"/> </actionGroup> - <actionGroup ref="addUniquePriceToConfigurableProductOption" stepKey="addPriceConfigProductOption1DuplicatedProduct"> + <actionGroup ref="AddUniquePriceToConfigurableProductOptionActionGroup" stepKey="addPriceConfigProductOption1DuplicatedProduct"> <argument name="frontend_label" value="{{productAttributeColor.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute1.name}}"/> <argument name="price" value="{{virtualProductWithRequiredFields.price}}"/> </actionGroup> - <actionGroup ref="addUniquePriceToConfigurableProductOption" stepKey="addPriceConfigProductOption2DuplicatedProduct"> + <actionGroup ref="AddUniquePriceToConfigurableProductOptionActionGroup" stepKey="addPriceConfigProductOption2DuplicatedProduct"> <argument name="frontend_label" value="{{productAttributeColor.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute2.name}}"/> <argument name="price" value="{{virtualProductWithRequiredFields.price}}"/> </actionGroup> - <actionGroup ref="addUniqueQuantityToConfigurableProductOption" stepKey="addUniqueQtyOption1DuplicatedProduct"> + <actionGroup ref="AddUniqueQuantityToConfigurableProductOptionActionGroup" stepKey="addUniqueQtyOption1DuplicatedProduct"> <argument name="frontend_label" value="{{productAttributeColor.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute1.name}}"/> <argument name="quantity" value="{{virtualProductBigQty.quantity}}"/> </actionGroup> - <actionGroup ref="addUniqueQuantityToConfigurableProductOption" stepKey="addUniqueQtyOption2DuplicatedProduct"> + <actionGroup ref="AddUniqueQuantityToConfigurableProductOptionActionGroup" stepKey="addUniqueQtyOption2DuplicatedProduct"> <argument name="frontend_label" value="{{productAttributeColor.default_label}}"/> <argument name="label" value="{{colorConfigurableProductAttribute2.name}}"/> <argument name="quantity" value="{{virtualProductBigQty.quantity}}"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml index f94314fe94806..a342f30b66598 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml @@ -89,7 +89,7 @@ <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Click "Create Configurations" button, select created product attribute using the same Quantity for all products. Click "Generate products" button --> - <actionGroup ref="generateConfigurationsByAttributeCode" stepKey="addAttributeToProduct"> + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="addAttributeToProduct"> <argument name="attributeCode" value="{{VisualSwatchProductAttribute.attribute_code}}"/> </actionGroup> <!-- Using this action to concatenate 2 strings to have unique identifier for grid --> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml index 0a98e7a721c17..c65a24e2c724f 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml @@ -60,59 +60,59 @@ <argument name="option3" value="Large"/> </actionGroup> <!--Create configurable product with two attributes: Color and Size--> - <actionGroup ref="createConfigurableProductWithTwoAttributes" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductWithTwoAttributesActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> <argument name="attribute1" value="ProductColorAttribute"/> <argument name="attribute2" value="ProductSizeAttribute"/> </actionGroup> <!--Set Black-Small product price to 10--> - <actionGroup ref="changeConfigurableProductChildProductPrice" stepKey="changeBlackSmallPrice"> + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changeBlackSmallPrice"> <argument name="productAttributes" value="Color: Black, Size: Small"/> <argument name="productPrice" value="10"/> </actionGroup> <!--Set Black-Medium product price to 11--> - <actionGroup ref="changeConfigurableProductChildProductPrice" stepKey="changeBlackMediumPrice"> + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changeBlackMediumPrice"> <argument name="productAttributes" value="Color: Black, Size: Medium"/> <argument name="productPrice" value="11"/> </actionGroup> <!--Set Black-Large product price to 12--> - <actionGroup ref="changeConfigurableProductChildProductPrice" stepKey="changeBlackLargePrice"> + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changeBlackLargePrice"> <argument name="productAttributes" value="Color: Black, Size: Large"/> <argument name="productPrice" value="12"/> </actionGroup> <!--Set White-Small product price to 14--> - <actionGroup ref="changeConfigurableProductChildProductPrice" stepKey="changeWhiteSmallPrice"> + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changeWhiteSmallPrice"> <argument name="productAttributes" value="Color: White, Size: Small"/> <argument name="productPrice" value="14"/> </actionGroup> <!--Set White-Medium product price to 13--> - <actionGroup ref="changeConfigurableProductChildProductPrice" stepKey="changeWhiteMediumPrice"> + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changeWhiteMediumPrice"> <argument name="productAttributes" value="Color: White, Size: Medium"/> <argument name="productPrice" value="13"/> </actionGroup> <!--Set White-Large product price to 15--> - <actionGroup ref="changeConfigurableProductChildProductPrice" stepKey="changeWhiteLargePrice"> + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changeWhiteLargePrice"> <argument name="productAttributes" value="Color: White, Size: Large"/> <argument name="productPrice" value="15"/> </actionGroup> <!--Set Blue-Small product price to 18--> - <actionGroup ref="changeConfigurableProductChildProductPrice" stepKey="changeBlueSmallPrice"> + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changeBlueSmallPrice"> <argument name="productAttributes" value="Color: Blue, Size: Small"/> <argument name="productPrice" value="18"/> </actionGroup> <!--Set Blue-Medium product price to 17--> - <actionGroup ref="changeConfigurableProductChildProductPrice" stepKey="changeBlueMediumPrice"> + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changeBlueMediumPrice"> <argument name="productAttributes" value="Color: Blue, Size: Medium"/> <argument name="productPrice" value="17"/> </actionGroup> <!--Set Blue-Large product price to 16--> - <actionGroup ref="changeConfigurableProductChildProductPrice" stepKey="changeBlueLargePrice"> + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changeBlueLargePrice"> <argument name="productAttributes" value="Color: Blue, Size: Large"/> <argument name="productPrice" value="16"/> </actionGroup> <!--Save configurable product--> - <actionGroup ref="saveConfigurableProduct" stepKey="saveProduct"> + <actionGroup ref="SaveConfigurableProductActionGroup" stepKey="saveProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml index c9602ddcd127c..e9f5461435449 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml @@ -98,7 +98,7 @@ <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/> <!-- Create configurations based off the visual swatch we created earlier --> - <actionGroup ref="createConfigurationsForAttributeWithImages" stepKey="createConfigurations"> + <actionGroup ref="CreateConfigurationsForAttributeWithImagesActionGroup" stepKey="createConfigurations"> <argument name="attributeCode" value="{{ProductAttributeFrontendLabel.label}}"/> <argument name="image" value="TestImageAdobe"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml index 7bf63d25417e3..f3304e67e5534 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml @@ -78,7 +78,7 @@ <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/> <!-- Create configurations based off the text swatch we created earlier --> - <actionGroup ref="createConfigurationsForAttribute" stepKey="createConfigurations"> + <actionGroup ref="CreateConfigurationsForAttributeActionGroup" stepKey="createConfigurations"> <argument name="attributeCode" value="{{ProductAttributeFrontendLabel.label}}"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml index fd38c48919416..b4028674ee5bd 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml @@ -90,7 +90,7 @@ <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/> <!-- Create configurations based off the visual watch we created earlier --> - <actionGroup ref="createConfigurationsForAttribute" stepKey="createConfigurations"> + <actionGroup ref="CreateConfigurationsForAttributeActionGroup" stepKey="createConfigurations"> <argument name="attributeCode" value="{{ProductAttributeFrontendLabel.label}}"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml index 2928011662864..b46f5753152b6 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml @@ -54,12 +54,12 @@ <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/> <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/> <!--Add images to product attribute options--> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImageToConfigurableProductOptionOne"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImageToConfigurableProductOptionOne"> <argument name="image" value="MagentoLogo"/> <argument name="frontend_label" value="{{visualSwatchAttribute.default_label}}"/> <argument name="label" value="{{visualSwatchOption1.default_label}}"/> </actionGroup> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImageToConfigurableProductOptionTwo"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImageToConfigurableProductOptionTwo"> <argument name="image" value="TestImageNew"/> <argument name="frontend_label" value="{{visualSwatchAttribute.default_label}}"/> <argument name="label" value="{{visualSwatchOption2.default_label}}"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml index 1717b424e4597..bf432b98b3d3a 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml @@ -76,23 +76,23 @@ </actionGroup> <!-- Create configurations based off the visual swatch we created earlier --> - <actionGroup ref="StartCreateConfigurationsForAttribute" stepKey="createConfigurations"> + <actionGroup ref="StartCreateConfigurationsForAttributeActionGroup" stepKey="createConfigurations"> <argument name="attributeCode" value="{{VisualSwatchProductAttribute.attribute_code}}"/> </actionGroup> <!--Add images to configurable product attribute options--> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImageToConfigurableProductOptionOne"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImageToConfigurableProductOptionOne"> <argument name="image" value="TestImageAdobe"/> <argument name="frontend_label" value="{{VisualSwatchProductAttribute.attribute_code}}"/> <argument name="label" value="{{visualSwatchOption1.default_label}}"/> </actionGroup> - <actionGroup ref="addUniqueImageToConfigurableProductOption" stepKey="addImageToConfigurableProductOptionTwo"> + <actionGroup ref="AddUniqueImageToConfigurableProductOptionActionGroup" stepKey="addImageToConfigurableProductOptionTwo"> <argument name="image" value="ImageUpload3"/> <argument name="frontend_label" value="{{VisualSwatchProductAttribute.attribute_code}}"/> <argument name="label" value="{{visualSwatchOption2.default_label}}"/> </actionGroup> - <actionGroup ref="GenerateAndSaveConfiguredProductAfterSettingOptions" stepKey="saveProductForm"/> + <actionGroup ref="GenerateAndSaveConfiguredProductAfterSettingOptionsActionGroup" stepKey="saveProductForm"/> <!-- Go to the category page --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml index 4e6a062c7993d..317e9e9bab3cd 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml @@ -23,7 +23,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> <createData entity="ApiCategory" stepKey="createCategory"/> <!--Create Configurable product--> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml index 0489ec750b7e0..bb4870d294b0c 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml @@ -23,7 +23,7 @@ <createData entity="ApiCategory" stepKey="createCategory"/> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CGuestUserTest.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CGuestUserTest.xml index cac9d0c3cb55f..d38bf90a3a16d 100644 --- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CGuestUserTest.xml +++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CGuestUserTest.xml @@ -11,7 +11,7 @@ <test name="EndToEndB2CGuestUserTest"> <!-- Search configurable product --> <comment userInput="Search configurable product" stepKey="commentSearchConfigurableProduct" after="searchAssertSimpleProduct2ImageNotDefault" /> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="searchAssertFilterCategoryConfigProduct" after="commentSearchConfigurableProduct"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="searchAssertFilterCategoryConfigProduct" after="commentSearchConfigurableProduct"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -19,7 +19,7 @@ <grabAttributeFrom selector="{{StorefrontCategoryProductSection.ProductImageByName($$createConfigProduct.name$$)}}" userInput="src" stepKey="searchGrabConfigProductImageSrc" after="searchAssertFilterCategoryConfigProduct"/> <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$searchGrabConfigProductImageSrc" stepKey="searchAssertConfigProductImageNotDefault" after="searchGrabConfigProductImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createConfigProduct.name$$)}}" stepKey="searchClickConfigProductView" after="searchAssertConfigProductImageNotDefault"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="searchAssertConfigProductPage" after="searchClickConfigProductView"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="searchAssertConfigProductPage" after="searchClickConfigProductView"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -30,7 +30,7 @@ <test name="EndToEndB2CGuestUserMysqlTest"> <!-- Search configurable product --> <comment userInput="Search configurable product" stepKey="commentSearchConfigurableProduct" after="searchAssertSimpleProduct2ImageNotDefault" /> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="searchAssertFilterCategoryConfigProduct" after="commentSearchConfigurableProduct"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="searchAssertFilterCategoryConfigProduct" after="commentSearchConfigurableProduct"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -38,7 +38,7 @@ <grabAttributeFrom selector="{{StorefrontCategoryProductSection.ProductImageByName($$createConfigProduct.name$$)}}" userInput="src" stepKey="searchGrabConfigProductImageSrc" after="searchAssertFilterCategoryConfigProduct"/> <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$searchGrabConfigProductImageSrc" stepKey="searchAssertConfigProductImageNotDefault" after="searchGrabConfigProductImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createConfigProduct.name$$)}}" stepKey="searchClickConfigProductView" after="searchAssertConfigProductImageNotDefault"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="searchAssertConfigProductPage" after="searchClickConfigProductView"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="searchAssertConfigProductPage" after="searchClickConfigProductView"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CLoggedInUserTest.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CLoggedInUserTest.xml index 9fe70c8b4dd3b..f616e46d6f692 100644 --- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CLoggedInUserTest.xml +++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CLoggedInUserTest.xml @@ -11,7 +11,7 @@ <test name="EndToEndB2CLoggedInUserTest"> <!-- Search configurable product --> <comment userInput="Search configurable product" stepKey="commentSearchConfigurableProduct" after="searchAssertSimpleProduct2ImageNotDefault" /> - <actionGroup ref="StorefrontCheckCategoryConfigurableProduct" stepKey="searchAssertFilterCategoryConfigProduct" after="commentSearchConfigurableProduct"> + <actionGroup ref="StorefrontCheckCategoryConfigurableProductActionGroup" stepKey="searchAssertFilterCategoryConfigProduct" after="commentSearchConfigurableProduct"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> @@ -19,7 +19,7 @@ <grabAttributeFrom selector="{{StorefrontCategoryProductSection.ProductImageByName($$createConfigProduct.name$$)}}" userInput="src" stepKey="searchGrabConfigProductImageSrc" after="searchAssertFilterCategoryConfigProduct"/> <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$searchGrabConfigProductImageSrc" stepKey="searchAssertConfigProductImageNotDefault" after="searchGrabConfigProductImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createConfigProduct.name$$)}}" stepKey="searchClickConfigProductView" after="searchAssertConfigProductImageNotDefault"/> - <actionGroup ref="StorefrontCheckConfigurableProduct" stepKey="searchAssertConfigProductPage" after="searchClickConfigProductView"> + <actionGroup ref="StorefrontCheckConfigurableProductActionGroup" stepKey="searchAssertConfigProductPage" after="searchClickConfigProductView"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="optionProduct" value="$$createConfigChildProduct1$$"/> </actionGroup> From 363ecc0c8bc61cbf41ba8f0228c30380571e10e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Fri, 29 Nov 2019 00:22:14 +0100 Subject: [PATCH 338/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../StorefrontBundleProductDetailsTest.xml | 2 +- .../AdminAddImageToWYSIWYGCatalogTest.xml | 4 +- .../AdminAddImageToWYSIWYGProductTest.xml | 4 +- ...reateAndEditVirtualProductSettingsTest.xml | 4 +- ...dminEditTextEditorProductAttributeTest.xml | 4 +- .../AdminRemoveImageAffectsAllScopesTest.xml | 2 +- .../AdminSimpleProductSetEditContentTest.xml | 2 +- .../Mftf/Test/AdminSortingByWebsitesTest.xml | 4 +- ...ductWithCustomOptionsSecondWebsiteTest.xml | 6 +- ...rifyDefaultWYSIWYGToolbarOnProductTest.xml | 8 +- ...yTinyMCEv4IsNativeWYSIWYGOnCatalogTest.xml | 4 +- ...yTinyMCEv4IsNativeWYSIWYGOnProductTest.xml | 4 +- .../CatalogProductListWidgetOperatorsTest.xml | 4 +- .../CatalogProductListWidgetOrderTest.xml | 6 +- .../Test/CheckoutSpecificDestinationsTest.xml | 8 +- ...frontCustomerCheckoutWithoutRegionTest.xml | 4 +- .../Test/AdminAddImageToWYSIWYGBlockTest.xml | 4 +- .../Test/AdminAddImageToWYSIWYGCMSTest.xml | 4 +- .../AdminAddVariableToWYSIWYGBlockTest.xml | 4 +- .../Test/AdminAddVariableToWYSIWYGCMSTest.xml | 4 +- .../Test/AdminAddWidgetToWYSIWYGBlockTest.xml | 4 +- ...WidgetToWYSIWYGWithCMSPageLinkTypeTest.xml | 4 +- ...getToWYSIWYGWithCMSStaticBlockTypeTest.xml | 4 +- ...WYSIWYGWithCatalogCategoryLinkTypeTest.xml | 4 +- ...oWYSIWYGWithCatalogProductLinkTypeTest.xml | 4 +- ...oWYSIWYGWithCatalogProductListTypeTest.xml | 4 +- ...YGWithRecentlyComparedProductsTypeTest.xml | 4 +- ...IWYGWithRecentlyViewedProductsTypeTest.xml | 4 +- .../Mftf/Test/AdminCreateCmsBlockTest.xml | 2 +- .../Test/Mftf/Test/AdminCreateCmsPageTest.xml | 4 +- ...CheckOrderOfProdsInWidgetOnCMSPageTest.xml | 4 +- ...ifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml | 4 +- ...yTinyMCEv4IsNativeWYSIWYGOnCMSPageTest.xml | 4 +- ...lasticSearchAsSearchEngineActionGroup.xml} | 20 +---- .../ConfigAdminAccountSharingActionGroup.xml | 16 ---- .../ConfigSalesTaxClassActionGroup.xml | 78 ------------------- .../ActionGroup/ConfigWYSIWYGActionGroup.xml | 76 ------------------ .../DisableAdminAccountSharingActionGroup.xml | 18 +++++ ...ableTaxApplyOnOriginalPriceActionGroup.xml | 29 +++++++ .../DisabledWYSIWYGActionGroup.xml | 18 +++++ .../EnableAdminAccountSharingActionGroup.xml | 18 +++++ .../EnableWebUrlOptionsActionGroup.xml | 25 ++++++ .../ActionGroup/EnabledWYSIWYGActionGroup.xml | 18 +++++ .../EnabledWYSIWYGEditorActionGroup.xml | 26 +++++++ .../GeneralConfigurationActionGroup.xml | 72 ----------------- ...eToConfigurationGeneralPageActionGroup.xml | 19 +++++ ...gateToDefaultLayoutsSettingActionGroup.xml | 21 +++++ ...etSearchEngineConfigurationActionGroup.xml | 26 +++++++ .../ResetTaxClassForShippingActionGroup.xml | 25 ++++++ ....xml => ResetWebUrlOptionsActionGroup.xml} | 19 +---- ...CountriesWithRequiredRegionActionGroup.xml | 27 +++++++ ...electTopDestinationsCountryActionGroup.xml | 23 ++++++ .../SetTaxApplyOnSettingActionGroup.xml | 29 +++++++ .../SetTaxClassForShippingActionGroup.xml | 25 ++++++ .../SwitchToTinyMCE3ActionGroup.xml | 26 +++++++ ...electTopDestinationsCountryActionGroup.xml | 23 ++++++ ...URLForMediaContentInWYSIWYGActionGroup.xml | 28 +++++++ ...bleProductPriceAdditionalStoreViewTest.xml | 6 +- ...CountriesRestrictionApplyOnBackendTest.xml | 4 +- ...oductQuickSearchUsingElasticSearchTest.xml | 6 +- .../AdminAddImageToWYSIWYGNewsletterTest.xml | 4 +- ...dminAddVariableToWYSIWYGNewsletterTest.xml | 4 +- .../AdminAddWidgetToWYSIWYGNewsletterTest.xml | 4 +- ...erifySubscribedNewsletterDisplayedTest.xml | 4 +- ...nyMCEv4IsNativeWYSIWYGOnNewsletterTest.xml | 4 +- ...editMemoTotalAfterShippingDiscountTest.xml | 4 +- .../AdminTaxCalcWithApplyTaxOnSettingTest.xml | 8 +- .../Test/AdminSwitchWYSIWYGOptionsTest.xml | 4 +- .../Mftf/Test/NewProductsListWidgetTest.xml | 4 +- 69 files changed, 524 insertions(+), 373 deletions(-) rename app/code/Magento/Config/Test/Mftf/ActionGroup/{ConfigAdminCatalogSearchActionGroup.xml => ChooseElasticSearchAsSearchEngineActionGroup.xml} (56%) delete mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigSalesTaxClassActionGroup.xml delete mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigWYSIWYGActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/DisableAdminAccountSharingActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/DisableTaxApplyOnOriginalPriceActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/DisabledWYSIWYGActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/EnableAdminAccountSharingActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/EnableWebUrlOptionsActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/EnabledWYSIWYGActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/EnabledWYSIWYGEditorActionGroup.xml delete mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/GeneralConfigurationActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/NavigateToConfigurationGeneralPageActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/NavigateToDefaultLayoutsSettingActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/ResetSearchEngineConfigurationActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/ResetTaxClassForShippingActionGroup.xml rename app/code/Magento/Config/Test/Mftf/ActionGroup/{ConfigWebUrlOptionsActionGroup.xml => ResetWebUrlOptionsActionGroup.xml} (56%) create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/SelectCountriesWithRequiredRegionActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/SelectTopDestinationsCountryActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/SetTaxApplyOnSettingActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/SetTaxClassForShippingActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/SwitchToTinyMCE3ActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/UnSelectTopDestinationsCountryActionGroup.xml create mode 100644 app/code/Magento/Config/Test/Mftf/ActionGroup/UseStaticURLForMediaContentInWYSIWYGActionGroup.xml diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml index d7394b2dbf32e..c1414b4c96230 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml @@ -26,7 +26,7 @@ <!-- Admin Login--> <actionGroup stepKey="loginToAdminPanel" ref="LoginAsAdmin"/> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> </before> <after> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml index c36c29ce594d0..a59562717d688 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml @@ -10,7 +10,7 @@ <test name="AdminAddImageToWYSIWYGCatalogTest"> <before> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <annotations> @@ -54,7 +54,7 @@ <actionGroup ref="DeleteCategory" stepKey="DeleteCategory"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml index 4044490c92334..450f21b7afd99 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml @@ -19,11 +19,11 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml index 90cbab59bd71d..26043bef51e6d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml @@ -51,7 +51,7 @@ <actionGroup ref="logout" stepKey="adminLogout"/> </after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <!-- Create new virtual product --> <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createVirtualProduct"> @@ -185,6 +185,6 @@ <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> <dontSeeElement selector="{{StorefrontProductCartGiftOptionSection.giftOptions}}" stepKey="dontSeeGiftOptionBtn"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml index 53040993beb8f..eff05fd64a775 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> <createData stepKey="myProductAttributeCreation" entity="productAttributeWysiwyg"/> <createData stepKey="myProductAttributeSetAssign" entity="AddToDefaultSet"> @@ -75,7 +75,7 @@ <seeElement selector="{{ProductAttributeWYSIWYGSection.TinyMCE4($$myProductAttributeCreation.attribute_code$$)}}" stepKey="seePoweredBy"/> <after> <deleteData createDataKey="myProductAttributeCreation" stepKey="deletePreReqProductAttribute" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml index 8316f54c15a52..d92a3622725bf 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml @@ -55,7 +55,7 @@ </before> <after> - <actionGroup ref="ResetWebUrlOptions" stepKey="resetUrlOption"/> + <actionGroup ref="ResetWebUrlOptionsActionGroup" stepKey="resetUrlOption"/> <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> <argument name="websiteName" value="FirstWebSite"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml index f5e5911352c86..2099e95d61ed2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml @@ -22,7 +22,7 @@ <before> <!--Admin Login--> <actionGroup stepKey="loginToAdminPanel" ref="LoginAsAdmin"/> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> </before> <after> <!-- Delete simple product --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml index 5b6207e135796..ddef7beb07b43 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml @@ -30,7 +30,7 @@ <argument name="newWebsiteName" value="{{customWebsite.name}}"/> <argument name="websiteCode" value="{{customWebsite.code}}"/> </actionGroup> - <actionGroup ref="EnableWebUrlOptions" stepKey="addStoreCodeToUrls"/> + <actionGroup ref="EnableWebUrlOptionsActionGroup" stepKey="addStoreCodeToUrls"/> <magentoCLI command="cache:flush" stepKey="flushCacheAfterEnableWebUrlOptions"/> </before> <after> @@ -42,7 +42,7 @@ </actionGroup> <actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/> <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="ResetWebUrlOptions" stepKey="resetUrlOption"/> + <actionGroup ref="ResetWebUrlOptionsActionGroup" stepKey="resetUrlOption"/> <magentoCLI command="indexer:reindex" stepKey="reindex"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> <actionGroup ref="logout" stepKey="logout"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/SaveProductWithCustomOptionsSecondWebsiteTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/SaveProductWithCustomOptionsSecondWebsiteTest.xml index 8092b03c53cba..89e784d67eaea 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/SaveProductWithCustomOptionsSecondWebsiteTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/SaveProductWithCustomOptionsSecondWebsiteTest.xml @@ -49,14 +49,14 @@ <see userInput="You saved the store view." stepKey="seeSaveMessage" /> </before> <after> - <actionGroup ref="ResetWebUrlOptions" stepKey="resetUrlOption"/> + <actionGroup ref="ResetWebUrlOptionsActionGroup" stepKey="resetUrlOption"/> <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteTestWebsite"> <argument name="websiteName" value="Second Website"/> </actionGroup> <actionGroup ref="logout" stepKey="adminLogout"/> </after> - <actionGroup ref="EnableWebUrlOptions" stepKey="addStoreCodeToUrls"/> + <actionGroup ref="EnableWebUrlOptionsActionGroup" stepKey="addStoreCodeToUrls"/> <!--Create a Simple Product with Custom Options --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToCatalogProductGrid"/> <waitForPageLoad stepKey="waitForCatalogProductGrid"/> @@ -103,4 +103,4 @@ <seeNumberOfElements selector=".admin__dynamic-rows[data-index='values'] tr.data-row" userInput="3" stepKey="see4RowsOfOptions"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest.xml index 53bcac5b1d5f0..fe0ed32f39e1e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyDefaultWYSIWYGToolbarOnProductTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToProduct"/> @@ -43,7 +43,7 @@ <seeElement selector="{{ProductDescriptionWYSIWYGToolbarSection.InsertTable}}" stepKey="assertInfo13"/> <seeElement selector="{{ProductDescriptionWYSIWYGToolbarSection.SpecialCharacter}}" stepKey="assertInfo14"/> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> @@ -59,7 +59,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToProduct"/> @@ -82,7 +82,7 @@ <seeElement selector="{{ProductShortDescriptionWYSIWYGToolbarSection.InsertTable}}" stepKey="assertInfo27"/> <seeElement selector="{{ProductShortDescriptionWYSIWYGToolbarSection.SpecialCharacter}}" stepKey="assertInfo28"/> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCatalogTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCatalogTest.xml index aad83cd0c2aff..cc69d0828015f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCatalogTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCatalogTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToNewCatalog"/> @@ -45,7 +45,7 @@ <waitForElementVisible selector="{{StorefrontCategoryMainSection.CatalogDescription}}" stepKey="waitForDesVisible" /> <see userInput="Hello World!" selector="{{StorefrontCategoryMainSection.CatalogDescription}}" stepKey="assertCatalogDescription"/> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnProductTest.xml index 29ed3af4f01d9..5a2728b6532c8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnProductTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToNewProduct"/> @@ -58,7 +58,7 @@ <see userInput="Hello World!" selector="{{StorefrontProductInfoMainSection.productDescription}}" stepKey="assertProductDescription"/> <see userInput="Hello World! Short Content" selector="{{StorefrontProductInfoMainSection.productShortDescription}}" stepKey="assertProductShortDescription"/> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml index 32bea8b604cf8..d4344c5d2fac6 100644 --- a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml +++ b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml @@ -38,7 +38,7 @@ <createData entity="_defaultBlock" stepKey="createPreReqBlock"/> <!--User log in on back-end as admin--> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> </before> <!--Open block with widget.--> @@ -145,7 +145,7 @@ <dontSeeElement selector="{{InsertWidgetSection.checkElementStorefrontByPrice('100')}}" stepKey="dontSeeElementByPrice100s"/> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <deleteData createDataKey="createPreReqBlock" stepKey="deletePreReqBlock" /> <deleteData createDataKey="simplecategory" stepKey="deleteSimpleCategory"/> <deleteData createDataKey="createFirstProduct" stepKey="deleteFirstProduct"/> diff --git a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOrderTest.xml b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOrderTest.xml index 11586207c4d8e..f9e050100bf05 100644 --- a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOrderTest.xml +++ b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOrderTest.xml @@ -38,7 +38,7 @@ </createData> <createData entity="_defaultCmsPage" stepKey="createPreReqPage"/> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> </before> <!--Open created cms page--> <comment userInput="Open created cms page" stepKey="commentOpenCreatedCmsPage"/> @@ -76,7 +76,7 @@ <seeElement selector="{{InsertWidgetSection.checkElementStorefrontByName('2','$$createSecondProduct.name$$')}}" stepKey="seeElementByName2"/> <seeElement selector="{{InsertWidgetSection.checkElementStorefrontByName('3','$$createFirstProduct.name$$')}}" stepKey="seeElementByName3"/> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <deleteData createDataKey="createPreReqPage" stepKey="deletePreReqPage" /> <deleteData createDataKey="simplecategory" stepKey="deleteSimpleCategory"/> <deleteData createDataKey="createFirstProduct" stepKey="deleteFirstProduct"/> @@ -85,4 +85,4 @@ <actionGroup ref="logout" stepKey="logout"/> </after> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml index f3807388399b8..70a4c64558779 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml @@ -28,13 +28,13 @@ </before> <!--Go to configuration general page--> - <actionGroup ref="NavigateToConfigurationGeneralPage" stepKey="navigateToConfigurationGeneralPage"/> + <actionGroup ref="NavigateToConfigurationGeneralPageActionGroup" stepKey="navigateToConfigurationGeneralPage"/> <!--Open country options section--> <conditionalClick selector="{{CountryOptionsSection.countryOptions}}" dependentSelector="{{CountryOptionsSection.countryOptionsOpen}}" visible="false" stepKey="clickOnStoreInformation"/> <!--Select top destinations country--> - <actionGroup ref="SelectTopDestinationsCountry" stepKey="selectTopDestinationsCountry"> + <actionGroup ref="SelectTopDestinationsCountryActionGroup" stepKey="selectTopDestinationsCountry"> <argument name="countries" value="Countries"/> </actionGroup> @@ -57,13 +57,13 @@ </actionGroup> <!--Go to configuration general page--> - <actionGroup ref="NavigateToConfigurationGeneralPage" stepKey="navigateToConfigurationGeneralPage2"/> + <actionGroup ref="NavigateToConfigurationGeneralPageActionGroup" stepKey="navigateToConfigurationGeneralPage2"/> <!--Open country options section--> <conditionalClick selector="{{CountryOptionsSection.countryOptions}}" dependentSelector="{{CountryOptionsSection.countryOptionsOpen}}" visible="false" stepKey="clickOnStoreInformation2"/> <!--Deselect top destinations country--> - <actionGroup ref="UnSelectTopDestinationsCountry" stepKey="unSelectTopDestinationsCountry"> + <actionGroup ref="UnSelectTopDestinationsCountryActionGroup" stepKey="unSelectTopDestinationsCountry"> <argument name="countries" value="Countries"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithoutRegionTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithoutRegionTest.xml index 0cc0dcf38e312..81412451d2941 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithoutRegionTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithoutRegionTest.xml @@ -25,12 +25,12 @@ </createData> <createData entity="Simple_GB_Customer" stepKey="createCustomer"/> <actionGroup stepKey="loginToAdminPanel" ref="LoginAsAdmin"/> - <actionGroup ref="SelectCountriesWithRequiredRegion" stepKey="setCustomCountryWithRequiredRegion"> + <actionGroup ref="SelectCountriesWithRequiredRegionActionGroup" stepKey="setCustomCountryWithRequiredRegion"> <argument name="countries" value="CustomCountryWithRequiredRegion"/> </actionGroup> </before> <after> - <actionGroup ref="SelectCountriesWithRequiredRegion" stepKey="setDefaultCountriesWithRequiredRegion"> + <actionGroup ref="SelectCountriesWithRequiredRegionActionGroup" stepKey="setDefaultCountriesWithRequiredRegion"> <argument name="countries" value="DefaultCountriesWithRequiredRegions"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml index 03edc69e6d625..a972c895160fb 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml @@ -21,7 +21,7 @@ <createData entity="_defaultCmsPage" stepKey="createCMSPage" /> <createData entity="_defaultBlock" stepKey="createPreReqBlock" /> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <actionGroup ref="AssignBlockToCMSPage" stepKey="assignBlockToCMSPage"> @@ -62,7 +62,7 @@ <waitForPageLoad stepKey="waitForGridReload"/> <deleteData createDataKey="createPreReqBlock" stepKey="deletePreReqBlock" /> <deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml index 205850f888797..039bd0c7cbc82 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="_defaultCmsPage" stepKey="createCMSPage" /> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage"> @@ -56,7 +56,7 @@ <seeElementInDOM selector="{{StorefrontCMSPageSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSource"/> <after> <deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml index ce34a8d09c302..6cfe35564297f 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml @@ -21,7 +21,7 @@ <createData entity="_defaultCmsPage" stepKey="createCMSPage" /> <createData entity="_defaultBlock" stepKey="createPreReqBlock" /> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Create Custom Variable--> @@ -142,7 +142,7 @@ <waitForPageLoad stepKey="waitForGridReload"/> <deleteData createDataKey="createPreReqBlock" stepKey="deletePreReqBlock" /> <deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml index 3b501859e606e..92164f34f5a83 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGCMSTest.xml @@ -18,7 +18,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Create Custom Variable--> @@ -94,7 +94,7 @@ <!--see custom variable blank--> <dontSee userInput="{{customVariable.html}}" stepKey="dontSeeCustomVariableName" /> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml index ad5e769c61be4..0242f07edab88 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml @@ -21,7 +21,7 @@ <createData entity="_defaultCmsPage" stepKey="createCMSPage" /> <createData entity="_defaultBlock" stepKey="createPreReqBlock" /> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage"> @@ -80,7 +80,7 @@ <waitForPageLoad stepKey="waitForGridReload"/> <deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage" /> <deleteData createDataKey="createPreReqBlock" stepKey="deletePreReqBlock" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml index 1adb781a67536..53ed63c89bfb6 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Main test--> @@ -66,7 +66,7 @@ <!--see widget on Storefront--> <see userInput="Home page" stepKey="seeHomepageWidget" /> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml index f37038435e109..c199601231a13 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSStaticBlockTypeTest.xml @@ -21,7 +21,7 @@ <before> <createData entity="_defaultBlock" stepKey="createPreReqBlock" /> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Main test--> @@ -68,7 +68,7 @@ <see userInput="$$createPreReqBlock.content$$" stepKey="seeBlockLink"/> <after> <deleteData createDataKey="createPreReqBlock" stepKey="deletePreReqBlock" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml index 552eae407391d..0237d3704f7c1 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogCategoryLinkTypeTest.xml @@ -20,7 +20,7 @@ <before> <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> <actionGroup ref="ConfigAdminAccountSharingActionGroup" stepKey="allowAdminShareAccount"/> </before> @@ -75,7 +75,7 @@ stepKey="seeProductLinkInCategory"/> <after> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCatalog" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 1" stepKey="enableGenerateUrlRewrite"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml index d75d422afa2a4..4e7ecd48a6af4 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductLinkTypeTest.xml @@ -24,7 +24,7 @@ <requiredEntity createDataKey="createPreReqCategory"/> </createData> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Main test--> @@ -82,7 +82,7 @@ <after> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCatalog" /> <deleteData createDataKey="createPreReqProduct" stepKey="deletePreReqProduct" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <magentoCLI command="config:set catalog/seo/generate_category_product_rewrites 1" stepKey="enableGenerateUrlRewrite"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml index 394d79bda1ab3..2cd41eb9d9f7b 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml @@ -26,7 +26,7 @@ <requiredEntity createDataKey="createPreReqCategory"/> </createData> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Main test--> @@ -99,7 +99,7 @@ <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCatalog" /> <deleteData createDataKey="createPreReqProduct1" stepKey="deletePreReqProduct1" /> <deleteData createDataKey="createPreReqProduct2" stepKey="deletePreReqProduct2" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml index 862f51ea72fad..803a3b692dbe2 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml @@ -25,7 +25,7 @@ <requiredEntity createDataKey="createPreReqCategory"/> </createData> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <amOnPage url="{{CmsNewPagePage.url}}" stepKey="navigateToPage"/> @@ -82,7 +82,7 @@ <after> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCatalog" /> <deleteData createDataKey="createPreReqProduct" stepKey="deletePreReqProduct" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml index 298aed917fc18..2c3b060d3bc15 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml @@ -24,7 +24,7 @@ <requiredEntity createDataKey="createPreReqCategory"/> </createData> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Main test--> @@ -72,7 +72,7 @@ <after> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCatalog" /> <deleteData createDataKey="createPreReqProduct" stepKey="deletePreReqProduct" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsBlockTest.xml index 7ab0d9209dde3..ef4a7575c35d3 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsBlockTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> </before> <after> <actionGroup ref="deleteBlock" stepKey="deleteCreatedBlock"> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageTest.xml index b7c7e4a4212fe..81c239a58f03e 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> </before> <after> <actionGroup ref="logout" stepKey="adminLogout"/> @@ -90,7 +90,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> </before> <after> <actionGroup ref="logout" stepKey="logout"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml index ce093144e6a2a..599276db8e615 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml @@ -21,7 +21,7 @@ </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="enableTinyMCE4"/> <waitForPageLoad stepKey="waitConfigToSave"/> <createData entity="ApiCategory" stepKey="createFirstCategory"/> @@ -34,7 +34,7 @@ <createData entity="_defaultCmsPage" stepKey="createCMSPage"/> </before> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <deleteData createDataKey="createFirstCategory" stepKey="deleteCategory"/> <deleteData createDataKey="product1" stepKey="deleteProduct1"/> <deleteData createDataKey="product2" stepKey="deleteProduct2"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml index 9ee2055aae650..944cd02d87b86 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnBlockTest.xml @@ -21,7 +21,7 @@ <before> <createData entity="_defaultCmsPage" stepKey="createPreReqCMSPage" /> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <amOnPage url="{{CmsNewBlock.url}}" stepKey="amOnNewBlockPage"/> @@ -90,7 +90,7 @@ <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> <waitForPageLoad stepKey="waitForGridReload"/> <deleteData createDataKey="createPreReqCMSPage" stepKey="deletePreReqCMSPage" /> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCMSPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCMSPageTest.xml index caad1cabe78c5..24377e92fe083 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCMSPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnCMSPageTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnPagePagesGrid"/> @@ -50,7 +50,7 @@ <see userInput="{{_defaultCmsPage.content_heading}}" stepKey="seeContentHeading"/> <see userInput="Hello World!" stepKey="seeContent" /> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigAdminCatalogSearchActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/ChooseElasticSearchAsSearchEngineActionGroup.xml similarity index 56% rename from app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigAdminCatalogSearchActionGroup.xml rename to app/code/Magento/Config/Test/Mftf/ActionGroup/ChooseElasticSearchAsSearchEngineActionGroup.xml index d700896f08bc0..ad1cf897b4601 100644 --- a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigAdminCatalogSearchActionGroup.xml +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/ChooseElasticSearchAsSearchEngineActionGroup.xml @@ -8,11 +8,11 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="ChooseElasticSearchAsSearchEngine"> + <actionGroup name="ChooseElasticSearchAsSearchEngineActionGroup"> <annotations> <description>Goes to the 'Configuration' page for 'Catalog'. Sets the 'Search Engine' to 'elasticsearch5'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> </annotations> - + <amOnPage url="{{AdminCatalogSearchConfigurationPage.url}}" stepKey="configureSearchEngine"/> <waitForPageLoad stepKey="waitForConfigPage"/> <scrollTo selector="{{AdminCatalogSearchConfigurationSection.catalogSearchTab}}" stepKey="scrollToCatalogSearchTab"/> @@ -25,20 +25,4 @@ <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfiguration"/> <see selector="{{AdminMessagesSection.success}}" userInput="You saved the configuration." stepKey="seeConfigurationSuccessMessage"/> </actionGroup> - - <actionGroup name="ResetSearchEngineConfiguration"> - <annotations> - <description>Goes to the 'Configuration' page for 'Catalog'. Sets the 'Search Engine' to 'mysql'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> - </annotations> - - <amOnPage url="{{AdminCatalogSearchConfigurationPage.url}}" stepKey="resetSearchEngine"/> - <waitForPageLoad stepKey="waitForConfigPage2"/> - <scrollTo selector="{{AdminCatalogSearchConfigurationSection.catalogSearchTab}}" stepKey="scrollToCatalogSearchTab2"/> - <conditionalClick selector="{{AdminCatalogSearchConfigurationSection.catalogSearchTab}}" dependentSelector="{{AdminCatalogSearchConfigurationSection.checkIfCatalogSearchTabExpand}}" visible="true" stepKey="expandCatalogSearchTab2"/> - <waitForElementVisible selector="{{AdminCatalogSearchConfigurationSection.searchEngine}}" stepKey="waitForDropdownToBeVisible2"/> - <selectOption selector="{{AdminCatalogSearchConfigurationSection.searchEngine}}" userInput="mysql" stepKey="chooseMySQL"/> - <checkOption selector="{{AdminCatalogSearchConfigurationSection.searchEngineDefaultSystemValue}}" stepKey="checkUseSystemValue"/> - <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfiguration2"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You saved the configuration." stepKey="seeConfigurationSuccessMessage2"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigAdminAccountSharingActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigAdminAccountSharingActionGroup.xml index 01cfa30ce0e7f..4e11dd6e971de 100644 --- a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigAdminAccountSharingActionGroup.xml +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigAdminAccountSharingActionGroup.xml @@ -22,20 +22,4 @@ <click selector="{{AdminSection.SecurityTab}}" stepKey="clollapseSecurityTab"/> <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig"/> </actionGroup> - - <actionGroup name="EnableAdminAccountSharingActionGroup"> - <annotations> - <description>Enabled 'Admin Account Sharing' via the API.</description> - </annotations> - - <createData stepKey="setConfig" entity="EnableAdminAccountSharing"/> - </actionGroup> - - <actionGroup name="DisableAdminAccountSharingActionGroup"> - <annotations> - <description>Disables 'Admin Account Sharing' via the API.</description> - </annotations> - - <createData stepKey="setConfig" entity="DisableAdminAccountSharing"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigSalesTaxClassActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigSalesTaxClassActionGroup.xml deleted file mode 100644 index bfa42636519a0..0000000000000 --- a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigSalesTaxClassActionGroup.xml +++ /dev/null @@ -1,78 +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="SetTaxClassForShipping"> - <annotations> - <description>Goes to the 'Configuration' page for 'Tax'. Sets 'Tax Class for Shipping' to 'Taxable Goods'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> - </annotations> - - <amOnPage url="{{AdminSalesTaxClassPage.url}}" stepKey="navigateToSalesTaxPage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <conditionalClick selector="{{SalesConfigSection.TaxClassesTab}}" dependentSelector="{{SalesConfigSection.CheckIfTaxClassesTabExpand}}" visible="true" stepKey="expandTaxClassesTab"/> - <waitForElementVisible selector="{{SalesConfigSection.ShippingTaxClass}}" stepKey="seeShippingTaxClass"/> - <uncheckOption selector="{{SalesConfigSection.EnableTaxClassForShipping}}" stepKey="uncheckUseSystemValue"/> - <selectOption selector="{{SalesConfigSection.ShippingTaxClass}}" userInput="Taxable Goods" stepKey="setShippingTaxClass"/> - <click selector="{{SalesConfigSection.TaxClassesTab}}" stepKey="collapseTaxClassesTab"/> - <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig"/> - </actionGroup> - - <actionGroup name="ResetTaxClassForShipping"> - <annotations> - <description>Goes to the 'Configuration' page for 'Tax'. Sets 'Tax Class for Shipping' to 'None'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> - </annotations> - - <amOnPage url="{{AdminSalesTaxClassPage.url}}" stepKey="navigateToSalesTaxConfigPagetoReset"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <conditionalClick selector="{{SalesConfigSection.TaxClassesTab}}" dependentSelector="{{SalesConfigSection.CheckIfTaxClassesTabExpand}}" visible="true" stepKey="openTaxClassTab"/> - <waitForElementVisible selector="{{SalesConfigSection.ShippingTaxClass}}" stepKey="seeShippingTaxClass2"/> - <selectOption selector="{{SalesConfigSection.ShippingTaxClass}}" userInput="None" stepKey="resetShippingTaxClass"/> - <checkOption selector="{{SalesConfigSection.EnableTaxClassForShipping}}" stepKey="useSystemValue"/> - <click selector="{{SalesConfigSection.TaxClassesTab}}" stepKey="collapseTaxClassesTab"/> - <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfiguration"/> - </actionGroup> - - <actionGroup name="SetTaxApplyOnSetting"> - <annotations> - <description>Goes to the 'Configuration' page for 'Tax'. Sets 'Apply Tax On' to the provided value. Clicks on the Save button</description> - </annotations> - <arguments> - <argument name="userInput" type="string"/> - </arguments> - - <conditionalClick selector="{{AdminConfigureTaxSection.taxCalculationSettings}}" dependentSelector="{{AdminConfigureTaxSection.taxCalculationAlgorithm}}" visible="false" stepKey="openTaxCalcSettingsSection"/> - <scrollTo selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOnInherit}}" x="0" y="-80" stepKey="goToCheckbox"/> - <uncheckOption selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOnInherit}}" stepKey="enableApplyTaxOnSetting"/> - <selectOption selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOn}}" userInput="{{userInput}}" stepKey="setApplyTaxOn"/> - <scrollTo selector="{{SalesConfigSection.TaxClassesTab}}" stepKey="scrollToTop"/> - <click selector="{{AdminConfigureTaxSection.taxCalculationSettings}}" stepKey="collapseCalcSettingsTab"/> - <click selector="{{AdminConfigureTaxSection.save}}" stepKey="saveConfig"/> - <waitForPageLoad stepKey="waitForConfigSaved"/> - <see userInput="You saved the configuration." stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="DisableTaxApplyOnOriginalPrice"> - <annotations> - <description>Goes to the 'Configuration' page for 'Tax'. Sets 'Apply Tax On' to the provided value. Clicks on the Save button.</description> - </annotations> - <arguments> - <argument name="userInput" type="string"/> - </arguments> - - <amOnPage url="{{AdminSalesTaxClassPage.url}}" stepKey="navigateToSalesTaxPage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <conditionalClick selector="{{AdminConfigureTaxSection.taxCalculationSettings}}" dependentSelector="{{AdminConfigureTaxSection.taxCalculationAlgorithm}}" visible="false" stepKey="openTaxCalcSettingsSection"/> - <scrollTo selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOnInherit}}" x="0" y="-80" stepKey="goToCheckbox"/> - <selectOption selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOn}}" userInput="{{userInput}}" stepKey="setApplyTaxOff"/> - <checkOption selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOnInherit}}" stepKey="disableApplyTaxOnSetting"/> - <click selector="{{AdminConfigureTaxSection.save}}" stepKey="saveConfig"/> - <waitForPageLoad stepKey="waitForConfigSaved"/> - <see userInput="You saved the configuration." stepKey="seeSuccessMessage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigWYSIWYGActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigWYSIWYGActionGroup.xml deleted file mode 100644 index 342b98a64c828..0000000000000 --- a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigWYSIWYGActionGroup.xml +++ /dev/null @@ -1,76 +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="EnabledWYSIWYG"> - <annotations> - <description>Enables the WYSIWYG Editor via the CLI.</description> - </annotations> - - <magentoCLI stepKey="enableWYSIWYG" command="config:set cms/wysiwyg/enabled enabled"/> - </actionGroup> - - <actionGroup name="SwitchToTinyMCE3"> - <annotations> - <description>Goes to the 'Configuration' page for 'Content Management'. Sets 'WYSIWYG Editor' to 'TinyMCE 3'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> - </annotations> - - <comment userInput="Choose TinyMCE3 as the default editor" stepKey="chooseTinyMCE3AsEditor"/> - <conditionalClick stepKey="expandWYSIWYGOptions1" selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.CheckIfTabExpand}}" visible="true"/> - <waitForElementVisible selector="{{ContentManagementSection.SwitcherSystemValue}}" stepKey="waitForCheckbox2"/> - <uncheckOption selector="{{ContentManagementSection.SwitcherSystemValue}}" stepKey="uncheckUseSystemValue2"/> - <waitForElementVisible selector="{{ContentManagementSection.Switcher}}" stepKey="waitForSwitcherDropdown2"/> - <selectOption selector="{{ContentManagementSection.Switcher}}" userInput="TinyMCE 3" stepKey="switchToVersion3"/> - <click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptions"/> - <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You saved the configuration." stepKey="seeConfigurationSuccessMessage"/> - </actionGroup> - - <actionGroup name="DisabledWYSIWYG"> - <annotations> - <description>Disables the WYSIWYG Editor via the CLI.</description> - </annotations> - - <magentoCLI stepKey="disableWYSIWYG" command="config:set cms/wysiwyg/enabled disabled"/> - </actionGroup> - - <actionGroup name="UseStaticURLForMediaContentInWYSIWYG"> - <annotations> - <description>Goes to the 'Configuration' page for 'Content Management'. Sets 'Use Static URLs for Media Content in WYSIWYG' to the provided value. Clicks on the Save button.</description> - </annotations> - <arguments> - <argument name="value" defaultValue="Yes" type="string"/> - </arguments> - - <amOnPage url="{{ConfigurationStoresPage.url}}" stepKey="navigateToWYSIWYGConfigPage1"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <conditionalClick stepKey="expandWYSIWYGOptions" selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.CheckIfTabExpand}}" visible="true"/> - <waitForElementVisible selector="{{ContentManagementSection.EnableWYSIWYG}}" stepKey="waitForEnableWYSIWYGDropdown1"/> - <selectOption selector="{{ContentManagementSection.StaticURL}}" userInput="{{value}}" stepKey="selectOption1"/> - <click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptions"/> - <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - </actionGroup> - - <actionGroup name="EnabledWYSIWYGEditor"> - <annotations> - <description>Goes to the 'Configuration' page for 'Content Management'. Sets 'Enable WYSIWYG Editor' to 'Enabled by Default'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> - </annotations> - - <amOnPage url="{{AdminContentManagementPage.url}}" stepKey="navigateToConfigurationPage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <conditionalClick selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.EnableWYSIWYG}}" visible="false" stepKey="expandWYSIWYGOptionsTab"/> - <waitForElementVisible selector="{{ContentManagementSection.EnableWYSIWYG}}" stepKey="waitTabToExpand"/> - <uncheckOption selector="{{ContentManagementSection.EnableSystemValue}}" stepKey="enableEnableSystemValue"/> - <selectOption selector="{{ContentManagementSection.EnableWYSIWYG}}" userInput="Enabled by Default" stepKey="enableWYSIWYG"/> - <click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptionsTab"/> - <click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/> - <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/DisableAdminAccountSharingActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/DisableAdminAccountSharingActionGroup.xml new file mode 100644 index 0000000000000..5bc9cca7d171f --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/DisableAdminAccountSharingActionGroup.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="DisableAdminAccountSharingActionGroup"> + <annotations> + <description>Disables 'Admin Account Sharing' via the API.</description> + </annotations> + + <createData stepKey="setConfig" entity="DisableAdminAccountSharing"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/DisableTaxApplyOnOriginalPriceActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/DisableTaxApplyOnOriginalPriceActionGroup.xml new file mode 100644 index 0000000000000..c27fc6a93ca5a --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/DisableTaxApplyOnOriginalPriceActionGroup.xml @@ -0,0 +1,29 @@ +<?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="DisableTaxApplyOnOriginalPriceActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Tax'. Sets 'Apply Tax On' to the provided value. Clicks on the Save button.</description> + </annotations> + <arguments> + <argument name="userInput" type="string"/> + </arguments> + + <amOnPage url="{{AdminSalesTaxClassPage.url}}" stepKey="navigateToSalesTaxPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <conditionalClick selector="{{AdminConfigureTaxSection.taxCalculationSettings}}" dependentSelector="{{AdminConfigureTaxSection.taxCalculationAlgorithm}}" visible="false" stepKey="openTaxCalcSettingsSection"/> + <scrollTo selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOnInherit}}" x="0" y="-80" stepKey="goToCheckbox"/> + <selectOption selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOn}}" userInput="{{userInput}}" stepKey="setApplyTaxOff"/> + <checkOption selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOnInherit}}" stepKey="disableApplyTaxOnSetting"/> + <click selector="{{AdminConfigureTaxSection.save}}" stepKey="saveConfig"/> + <waitForPageLoad stepKey="waitForConfigSaved"/> + <see userInput="You saved the configuration." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/DisabledWYSIWYGActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/DisabledWYSIWYGActionGroup.xml new file mode 100644 index 0000000000000..f1b817711d6b1 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/DisabledWYSIWYGActionGroup.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="DisabledWYSIWYGActionGroup"> + <annotations> + <description>Disables the WYSIWYG Editor via the CLI.</description> + </annotations> + + <magentoCLI stepKey="disableWYSIWYG" command="config:set cms/wysiwyg/enabled disabled"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/EnableAdminAccountSharingActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/EnableAdminAccountSharingActionGroup.xml new file mode 100644 index 0000000000000..5541a1e48a0af --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/EnableAdminAccountSharingActionGroup.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="EnableAdminAccountSharingActionGroup"> + <annotations> + <description>Enabled 'Admin Account Sharing' via the API.</description> + </annotations> + + <createData stepKey="setConfig" entity="EnableAdminAccountSharing"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/EnableWebUrlOptionsActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/EnableWebUrlOptionsActionGroup.xml new file mode 100644 index 0000000000000..2e4fdf0debd79 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/EnableWebUrlOptionsActionGroup.xml @@ -0,0 +1,25 @@ +<?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="EnableWebUrlOptionsActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Url Options'. Enables 'Add Store Code to Urls'. Clicks on the Save button.</description> + </annotations> + + <amOnPage url="{{WebConfigurationPage.url}}" stepKey="navigateToWebConfigurationPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <conditionalClick selector="{{WebSection.UrlOptionsTab}}" dependentSelector="{{WebSection.CheckIfUrlOptionsTabExpand}}" visible="true" stepKey="expandUrlSectionTab"/> + <waitForElementVisible selector="{{UrlOptionsSection.addStoreCodeToUrl}}" stepKey="seeAddStoreCodeToUrl"/> + <uncheckOption selector="{{UrlOptionsSection.systemValueForStoreCode}}" stepKey="uncheckUseSystemValue"/> + <selectOption selector="{{UrlOptionsSection.addStoreCodeToUrl}}" userInput="Yes" stepKey="enableStoreCode"/> + <click selector="{{WebSection.UrlOptionsTab}}" stepKey="collapseUrlOptions"/> + <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/EnabledWYSIWYGActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/EnabledWYSIWYGActionGroup.xml new file mode 100644 index 0000000000000..556b8bdcf9736 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/EnabledWYSIWYGActionGroup.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="EnabledWYSIWYGActionGroup"> + <annotations> + <description>Enables the WYSIWYG Editor via the CLI.</description> + </annotations> + + <magentoCLI stepKey="enableWYSIWYG" command="config:set cms/wysiwyg/enabled enabled"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/EnabledWYSIWYGEditorActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/EnabledWYSIWYGEditorActionGroup.xml new file mode 100644 index 0000000000000..7d23a5d7581c5 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/EnabledWYSIWYGEditorActionGroup.xml @@ -0,0 +1,26 @@ +<?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="EnabledWYSIWYGEditorActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Content Management'. Sets 'Enable WYSIWYG Editor' to 'Enabled by Default'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> + </annotations> + + <amOnPage url="{{AdminContentManagementPage.url}}" stepKey="navigateToConfigurationPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <conditionalClick selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.EnableWYSIWYG}}" visible="false" stepKey="expandWYSIWYGOptionsTab"/> + <waitForElementVisible selector="{{ContentManagementSection.EnableWYSIWYG}}" stepKey="waitTabToExpand"/> + <uncheckOption selector="{{ContentManagementSection.EnableSystemValue}}" stepKey="enableEnableSystemValue"/> + <selectOption selector="{{ContentManagementSection.EnableWYSIWYG}}" userInput="Enabled by Default" stepKey="enableWYSIWYG"/> + <click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptionsTab"/> + <click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/> + <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/GeneralConfigurationActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/GeneralConfigurationActionGroup.xml deleted file mode 100644 index d65376828e2c4..0000000000000 --- a/app/code/Magento/Config/Test/Mftf/ActionGroup/GeneralConfigurationActionGroup.xml +++ /dev/null @@ -1,72 +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="NavigateToDefaultLayoutsSetting"> - <annotations> - <description>Goes to the 'Configuration' page for 'Web'. Expands the 'Default Layouts' section.</description> - </annotations> - - <amOnPage url="{{WebConfigurationPage.url}}" stepKey="navigateToWebConfigurationPage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <conditionalClick stepKey="expandDefaultLayouts" selector="{{WebSection.DefaultLayoutsTab}}" dependentSelector="{{WebSection.CheckIfTabExpand}}" visible="true"/> - <waitForElementVisible selector="{{DefaultLayoutsSection.categoryLayout}}" stepKey="waittForDefaultCategoryLayout"/> - </actionGroup> - - <actionGroup name="NavigateToConfigurationGeneralPage"> - <annotations> - <description>Goes to the 'Configuration' page for 'General'.</description> - </annotations> - - <amOnPage url="{{AdminConfigGeneralPage.url}}" stepKey="navigateToConfigGeneralPage"/> - <waitForPageLoad stepKey="waitForConfigPageLoad"/> - </actionGroup> - <actionGroup name="SelectTopDestinationsCountry"> - <annotations> - <description>Selects the provided Countries under 'Top destinations' on the 'General' section of the 'Configuration' page. Clicks on the Save button.</description> - </annotations> - <arguments> - <argument name="countries" type="entity"/> - </arguments> - - <selectOption selector="{{CountryOptionsSection.topDestinations}}" parameterArray="[{{countries.country}}]" stepKey="selectTopDestinationsCountry"/> - <click selector="#save" stepKey="saveConfig"/> - <waitForPageLoad stepKey="waitForSavingConfig"/> - </actionGroup> - - <actionGroup name="UnSelectTopDestinationsCountry"> - <annotations> - <description>Un-selects the provided Countries under 'Top destinations' on the 'General' section of the 'Configuration' page. Clicks on the Save button.</description> - </annotations> - <arguments> - <argument name="countries" type="entity"/> - </arguments> - - <unselectOption selector="{{CountryOptionsSection.topDestinations}}" parameterArray="[{{countries.country}}]" stepKey="unSelectTopDestinationsCountry"/> - <click selector="#save" stepKey="saveConfig"/> - <waitForPageLoad stepKey="waitForSavingConfig"/> - </actionGroup> - - <actionGroup name="SelectCountriesWithRequiredRegion"> - <annotations> - <description>Goes to the 'Configuration' page for 'General'. Selects the provided Countries under 'State is Required for'. Clicks on the Save button.</description> - </annotations> - <arguments> - <argument name="countries" type="entity"/> - </arguments> - - <amOnPage url="{{AdminConfigGeneralPage.url}}" stepKey="navigateToAdminConfigGeneralPage"/> - <conditionalClick selector="{{StateOptionsSection.stateOptions}}" dependentSelector="{{StateOptionsSection.countriesWithRequiredRegions}}" visible="false" stepKey="expandStateOptionsTab"/> - <waitForAjaxLoad stepKey="waitForAjax"/> - <scrollTo selector="{{StateOptionsSection.countriesWithRequiredRegions}}" stepKey="scrollToForm"/> - <selectOption selector="{{StateOptionsSection.countriesWithRequiredRegions}}" parameterArray="[{{countries.country}}]" stepKey="selectCountriesWithRequiredRegion"/> - <click selector="#save" stepKey="saveConfig"/> - <waitForPageLoad stepKey="waitForSavingConfig"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/NavigateToConfigurationGeneralPageActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/NavigateToConfigurationGeneralPageActionGroup.xml new file mode 100644 index 0000000000000..fb89b406d9f32 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/NavigateToConfigurationGeneralPageActionGroup.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="NavigateToConfigurationGeneralPageActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'General'.</description> + </annotations> + + <amOnPage url="{{AdminConfigGeneralPage.url}}" stepKey="navigateToConfigGeneralPage"/> + <waitForPageLoad stepKey="waitForConfigPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/NavigateToDefaultLayoutsSettingActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/NavigateToDefaultLayoutsSettingActionGroup.xml new file mode 100644 index 0000000000000..c6690632194b3 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/NavigateToDefaultLayoutsSettingActionGroup.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="NavigateToDefaultLayoutsSettingActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Web'. Expands the 'Default Layouts' section.</description> + </annotations> + + <amOnPage url="{{WebConfigurationPage.url}}" stepKey="navigateToWebConfigurationPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <conditionalClick stepKey="expandDefaultLayouts" selector="{{WebSection.DefaultLayoutsTab}}" dependentSelector="{{WebSection.CheckIfTabExpand}}" visible="true"/> + <waitForElementVisible selector="{{DefaultLayoutsSection.categoryLayout}}" stepKey="waittForDefaultCategoryLayout"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/ResetSearchEngineConfigurationActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/ResetSearchEngineConfigurationActionGroup.xml new file mode 100644 index 0000000000000..f6451a4171a59 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/ResetSearchEngineConfigurationActionGroup.xml @@ -0,0 +1,26 @@ +<?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="ResetSearchEngineConfigurationActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Catalog'. Sets the 'Search Engine' to 'mysql'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> + </annotations> + + <amOnPage url="{{AdminCatalogSearchConfigurationPage.url}}" stepKey="resetSearchEngine"/> + <waitForPageLoad stepKey="waitForConfigPage2"/> + <scrollTo selector="{{AdminCatalogSearchConfigurationSection.catalogSearchTab}}" stepKey="scrollToCatalogSearchTab2"/> + <conditionalClick selector="{{AdminCatalogSearchConfigurationSection.catalogSearchTab}}" dependentSelector="{{AdminCatalogSearchConfigurationSection.checkIfCatalogSearchTabExpand}}" visible="true" stepKey="expandCatalogSearchTab2"/> + <waitForElementVisible selector="{{AdminCatalogSearchConfigurationSection.searchEngine}}" stepKey="waitForDropdownToBeVisible2"/> + <selectOption selector="{{AdminCatalogSearchConfigurationSection.searchEngine}}" userInput="mysql" stepKey="chooseMySQL"/> + <checkOption selector="{{AdminCatalogSearchConfigurationSection.searchEngineDefaultSystemValue}}" stepKey="checkUseSystemValue"/> + <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfiguration2"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the configuration." stepKey="seeConfigurationSuccessMessage2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/ResetTaxClassForShippingActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/ResetTaxClassForShippingActionGroup.xml new file mode 100644 index 0000000000000..3f768bdac8055 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/ResetTaxClassForShippingActionGroup.xml @@ -0,0 +1,25 @@ +<?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="ResetTaxClassForShippingActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Tax'. Sets 'Tax Class for Shipping' to 'None'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> + </annotations> + + <amOnPage url="{{AdminSalesTaxClassPage.url}}" stepKey="navigateToSalesTaxConfigPagetoReset"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <conditionalClick selector="{{SalesConfigSection.TaxClassesTab}}" dependentSelector="{{SalesConfigSection.CheckIfTaxClassesTabExpand}}" visible="true" stepKey="openTaxClassTab"/> + <waitForElementVisible selector="{{SalesConfigSection.ShippingTaxClass}}" stepKey="seeShippingTaxClass2"/> + <selectOption selector="{{SalesConfigSection.ShippingTaxClass}}" userInput="None" stepKey="resetShippingTaxClass"/> + <checkOption selector="{{SalesConfigSection.EnableTaxClassForShipping}}" stepKey="useSystemValue"/> + <click selector="{{SalesConfigSection.TaxClassesTab}}" stepKey="collapseTaxClassesTab"/> + <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfiguration"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigWebUrlOptionsActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/ResetWebUrlOptionsActionGroup.xml similarity index 56% rename from app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigWebUrlOptionsActionGroup.xml rename to app/code/Magento/Config/Test/Mftf/ActionGroup/ResetWebUrlOptionsActionGroup.xml index fe297cbf9ad7d..8c403c95cacbc 100644 --- a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigWebUrlOptionsActionGroup.xml +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/ResetWebUrlOptionsActionGroup.xml @@ -8,26 +8,11 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="EnableWebUrlOptions"> - <annotations> - <description>Goes to the 'Configuration' page for 'Url Options'. Enables 'Add Store Code to Urls'. Clicks on the Save button.</description> - </annotations> - - <amOnPage url="{{WebConfigurationPage.url}}" stepKey="navigateToWebConfigurationPage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <conditionalClick selector="{{WebSection.UrlOptionsTab}}" dependentSelector="{{WebSection.CheckIfUrlOptionsTabExpand}}" visible="true" stepKey="expandUrlSectionTab"/> - <waitForElementVisible selector="{{UrlOptionsSection.addStoreCodeToUrl}}" stepKey="seeAddStoreCodeToUrl"/> - <uncheckOption selector="{{UrlOptionsSection.systemValueForStoreCode}}" stepKey="uncheckUseSystemValue"/> - <selectOption selector="{{UrlOptionsSection.addStoreCodeToUrl}}" userInput="Yes" stepKey="enableStoreCode"/> - <click selector="{{WebSection.UrlOptionsTab}}" stepKey="collapseUrlOptions"/> - <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig"/> - </actionGroup> - - <actionGroup name="ResetWebUrlOptions"> + <actionGroup name="ResetWebUrlOptionsActionGroup"> <annotations> <description>Goes to the 'Configuration' page for 'Url Options'. Disables 'Add Store Code to Urls'. Clicks on the Save button.</description> </annotations> - + <amOnPage url="{{WebConfigurationPage.url}}" stepKey="navigateToWebConfigurationPagetoReset"/> <waitForPageLoad stepKey="waitForPageLoad2"/> <conditionalClick selector="{{WebSection.UrlOptionsTab}}" dependentSelector="{{WebSection.CheckIfUrlOptionsTabExpand}}" visible="true" stepKey="closeUrlSectionTab"/> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/SelectCountriesWithRequiredRegionActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/SelectCountriesWithRequiredRegionActionGroup.xml new file mode 100644 index 0000000000000..c1e90c1c835b8 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/SelectCountriesWithRequiredRegionActionGroup.xml @@ -0,0 +1,27 @@ +<?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="SelectCountriesWithRequiredRegionActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'General'. Selects the provided Countries under 'State is Required for'. Clicks on the Save button.</description> + </annotations> + <arguments> + <argument name="countries" type="entity"/> + </arguments> + + <amOnPage url="{{AdminConfigGeneralPage.url}}" stepKey="navigateToAdminConfigGeneralPage"/> + <conditionalClick selector="{{StateOptionsSection.stateOptions}}" dependentSelector="{{StateOptionsSection.countriesWithRequiredRegions}}" visible="false" stepKey="expandStateOptionsTab"/> + <waitForAjaxLoad stepKey="waitForAjax"/> + <scrollTo selector="{{StateOptionsSection.countriesWithRequiredRegions}}" stepKey="scrollToForm"/> + <selectOption selector="{{StateOptionsSection.countriesWithRequiredRegions}}" parameterArray="[{{countries.country}}]" stepKey="selectCountriesWithRequiredRegion"/> + <click selector="#save" stepKey="saveConfig"/> + <waitForPageLoad stepKey="waitForSavingConfig"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/SelectTopDestinationsCountryActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/SelectTopDestinationsCountryActionGroup.xml new file mode 100644 index 0000000000000..8e44bbf912667 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/SelectTopDestinationsCountryActionGroup.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="SelectTopDestinationsCountryActionGroup"> + <annotations> + <description>Selects the provided Countries under 'Top destinations' on the 'General' section of the 'Configuration' page. Clicks on the Save button.</description> + </annotations> + <arguments> + <argument name="countries" type="entity"/> + </arguments> + + <selectOption selector="{{CountryOptionsSection.topDestinations}}" parameterArray="[{{countries.country}}]" stepKey="selectTopDestinationsCountry"/> + <click selector="#save" stepKey="saveConfig"/> + <waitForPageLoad stepKey="waitForSavingConfig"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/SetTaxApplyOnSettingActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/SetTaxApplyOnSettingActionGroup.xml new file mode 100644 index 0000000000000..f91575b052ac7 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/SetTaxApplyOnSettingActionGroup.xml @@ -0,0 +1,29 @@ +<?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="SetTaxApplyOnSettingActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Tax'. Sets 'Apply Tax On' to the provided value. Clicks on the Save button</description> + </annotations> + <arguments> + <argument name="userInput" type="string"/> + </arguments> + + <conditionalClick selector="{{AdminConfigureTaxSection.taxCalculationSettings}}" dependentSelector="{{AdminConfigureTaxSection.taxCalculationAlgorithm}}" visible="false" stepKey="openTaxCalcSettingsSection"/> + <scrollTo selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOnInherit}}" x="0" y="-80" stepKey="goToCheckbox"/> + <uncheckOption selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOnInherit}}" stepKey="enableApplyTaxOnSetting"/> + <selectOption selector="{{AdminConfigureTaxSection.taxCalculationApplyTaxOn}}" userInput="{{userInput}}" stepKey="setApplyTaxOn"/> + <scrollTo selector="{{SalesConfigSection.TaxClassesTab}}" stepKey="scrollToTop"/> + <click selector="{{AdminConfigureTaxSection.taxCalculationSettings}}" stepKey="collapseCalcSettingsTab"/> + <click selector="{{AdminConfigureTaxSection.save}}" stepKey="saveConfig"/> + <waitForPageLoad stepKey="waitForConfigSaved"/> + <see userInput="You saved the configuration." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/SetTaxClassForShippingActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/SetTaxClassForShippingActionGroup.xml new file mode 100644 index 0000000000000..a0f05405ba0c9 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/SetTaxClassForShippingActionGroup.xml @@ -0,0 +1,25 @@ +<?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="SetTaxClassForShippingActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Tax'. Sets 'Tax Class for Shipping' to 'Taxable Goods'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> + </annotations> + + <amOnPage url="{{AdminSalesTaxClassPage.url}}" stepKey="navigateToSalesTaxPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <conditionalClick selector="{{SalesConfigSection.TaxClassesTab}}" dependentSelector="{{SalesConfigSection.CheckIfTaxClassesTabExpand}}" visible="true" stepKey="expandTaxClassesTab"/> + <waitForElementVisible selector="{{SalesConfigSection.ShippingTaxClass}}" stepKey="seeShippingTaxClass"/> + <uncheckOption selector="{{SalesConfigSection.EnableTaxClassForShipping}}" stepKey="uncheckUseSystemValue"/> + <selectOption selector="{{SalesConfigSection.ShippingTaxClass}}" userInput="Taxable Goods" stepKey="setShippingTaxClass"/> + <click selector="{{SalesConfigSection.TaxClassesTab}}" stepKey="collapseTaxClassesTab"/> + <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/SwitchToTinyMCE3ActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/SwitchToTinyMCE3ActionGroup.xml new file mode 100644 index 0000000000000..b725610b7b2ee --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/SwitchToTinyMCE3ActionGroup.xml @@ -0,0 +1,26 @@ +<?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="SwitchToTinyMCE3ActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Content Management'. Sets 'WYSIWYG Editor' to 'TinyMCE 3'. Clicks on the Save button. PLEASE NOTE: The value is Hardcoded.</description> + </annotations> + + <comment userInput="Choose TinyMCE3 as the default editor" stepKey="chooseTinyMCE3AsEditor"/> + <conditionalClick stepKey="expandWYSIWYGOptions1" selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.CheckIfTabExpand}}" visible="true"/> + <waitForElementVisible selector="{{ContentManagementSection.SwitcherSystemValue}}" stepKey="waitForCheckbox2"/> + <uncheckOption selector="{{ContentManagementSection.SwitcherSystemValue}}" stepKey="uncheckUseSystemValue2"/> + <waitForElementVisible selector="{{ContentManagementSection.Switcher}}" stepKey="waitForSwitcherDropdown2"/> + <selectOption selector="{{ContentManagementSection.Switcher}}" userInput="TinyMCE 3" stepKey="switchToVersion3"/> + <click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptions"/> + <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the configuration." stepKey="seeConfigurationSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/UnSelectTopDestinationsCountryActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/UnSelectTopDestinationsCountryActionGroup.xml new file mode 100644 index 0000000000000..54e4024be5f34 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/UnSelectTopDestinationsCountryActionGroup.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="UnSelectTopDestinationsCountryActionGroup"> + <annotations> + <description>Un-selects the provided Countries under 'Top destinations' on the 'General' section of the 'Configuration' page. Clicks on the Save button.</description> + </annotations> + <arguments> + <argument name="countries" type="entity"/> + </arguments> + + <unselectOption selector="{{CountryOptionsSection.topDestinations}}" parameterArray="[{{countries.country}}]" stepKey="unSelectTopDestinationsCountry"/> + <click selector="#save" stepKey="saveConfig"/> + <waitForPageLoad stepKey="waitForSavingConfig"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/UseStaticURLForMediaContentInWYSIWYGActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/UseStaticURLForMediaContentInWYSIWYGActionGroup.xml new file mode 100644 index 0000000000000..b7c7ea2067db2 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/UseStaticURLForMediaContentInWYSIWYGActionGroup.xml @@ -0,0 +1,28 @@ +<?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="UseStaticURLForMediaContentInWYSIWYGActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Content Management'. Sets 'Use Static URLs for Media Content in WYSIWYG' to the provided value. Clicks on the Save button.</description> + </annotations> + <arguments> + <argument name="value" defaultValue="Yes" type="string"/> + </arguments> + + <amOnPage url="{{ConfigurationStoresPage.url}}" stepKey="navigateToWYSIWYGConfigPage1"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <conditionalClick stepKey="expandWYSIWYGOptions" selector="{{ContentManagementSection.WYSIWYGOptions}}" dependentSelector="{{ContentManagementSection.CheckIfTabExpand}}" visible="true"/> + <waitForElementVisible selector="{{ContentManagementSection.EnableWYSIWYG}}" stepKey="waitForEnableWYSIWYGDropdown1"/> + <selectOption selector="{{ContentManagementSection.StaticURL}}" userInput="{{value}}" stepKey="selectOption1"/> + <click selector="{{ContentManagementSection.WYSIWYGOptions}}" stepKey="collapseWYSIWYGOptions"/> + <click selector="{{ContentManagementSection.Save}}" stepKey="saveConfig"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductPriceAdditionalStoreViewTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductPriceAdditionalStoreViewTest.xml index 83d9bbe8c270a..0b078bc7d2a98 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductPriceAdditionalStoreViewTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ConfigurableProductPriceAdditionalStoreViewTest.xml @@ -19,7 +19,7 @@ <group value="ConfigurableProduct"/> </annotations> <before> - + <createData entity="ApiCategory" stepKey="createCategory"/> <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> <requiredEntity createDataKey="createCategory"/> @@ -73,14 +73,14 @@ <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <actionGroup ref="ResetWebUrlOptions" stepKey="resetUrlOption"/> + <actionGroup ref="ResetWebUrlOptionsActionGroup" stepKey="resetUrlOption"/> <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteSecondWebsite"> <argument name="websiteName" value="Second Website"/> </actionGroup> <actionGroup ref="logout" stepKey="adminLogout"/> </after> - <actionGroup ref="EnableWebUrlOptions" stepKey="addStoreCodeToUrls"/> + <actionGroup ref="EnableWebUrlOptionsActionGroup" stepKey="addStoreCodeToUrls"/> <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="addNewWebsite"> <argument name="newWebsiteName" value="Second Website"/> <argument name="websiteCode" value="second_website"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AllowedCountriesRestrictionApplyOnBackendTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AllowedCountriesRestrictionApplyOnBackendTest.xml index 6de03e225ae08..194c6e6164f8c 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AllowedCountriesRestrictionApplyOnBackendTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AllowedCountriesRestrictionApplyOnBackendTest.xml @@ -53,7 +53,7 @@ <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteTestWebsite"> <argument name="websiteName" value="{{NewWebSiteData.name}}"/> </actionGroup> - <actionGroup ref="NavigateToConfigurationGeneralPage" stepKey="navigateToConfigGeneralPage2"/> + <actionGroup ref="NavigateToConfigurationGeneralPageActionGroup" stepKey="navigateToConfigGeneralPage2"/> <actionGroup ref="AdminSwitchWebsiteActionGroup" stepKey="adminSwitchWebsiteActionGroup"> <argument name="website" value="_defaultWebsite"/> </actionGroup> @@ -65,7 +65,7 @@ </after> <!--Check that all countries are allowed initially and get amount--> <comment userInput="Check that all countries are allowed initially and get amount" stepKey="checkAllCountriesAreAllowed"/> - <actionGroup ref="NavigateToConfigurationGeneralPage" stepKey="navigateToConfigGeneralPage"/> + <actionGroup ref="NavigateToConfigurationGeneralPageActionGroup" stepKey="navigateToConfigGeneralPage"/> <createData entity="DisableAdminAccountAllowCountry" stepKey="setDefaultValueForAllowCountries"/> <executeJS function="return document.querySelectorAll('{{CountryOptionsSection.allowedCountries}} option').length" stepKey="countriesAmount"/> <!-- Create customer for US --> diff --git a/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml b/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml index d8ce091fba76f..d8abea9196265 100644 --- a/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml +++ b/app/code/Magento/Elasticsearch/Test/Mftf/Test/ProductQuickSearchUsingElasticSearchTest.xml @@ -28,7 +28,7 @@ <after> <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> <deleteData createDataKey="categoryFirst" stepKey="deleteCategory"/> - <actionGroup ref="ResetSearchEngineConfiguration" stepKey="resetCatalogSearchConfiguration"/> + <actionGroup ref="ResetSearchEngineConfigurationActionGroup" stepKey="resetCatalogSearchConfiguration"/> <actionGroup ref="updateIndexerOnSave" stepKey="resetIndexerBackToOriginalState"> <argument name="indexerName" value="catalogsearch_fulltext"/> </actionGroup> @@ -37,7 +37,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <comment userInput="Change Catalog search engine option to Elastic Search 5.0+" stepKey="chooseElasticSearch5"/> - <actionGroup ref="ChooseElasticSearchAsSearchEngine" stepKey="chooseES5"/> + <actionGroup ref="ChooseElasticSearchAsSearchEngineActionGroup" stepKey="chooseES5"/> <actionGroup ref="ClearPageCacheActionGroup" stepKey="clearing"/> <actionGroup ref="updateIndexerBySchedule" stepKey="updateAnIndexerBySchedule"> <argument name="indexerName" value="catalogsearch_fulltext"/> @@ -57,4 +57,4 @@ <comment userInput="End of searching products" stepKey="endOfSearchingProducts"/> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin2"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml index 0371c0265d149..7ced9d206a28c 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Create a newsletter template that contains an image--> @@ -57,7 +57,7 @@ <seeElementInDOM selector="{{StorefrontNewsletterSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSource"/> <closeTab stepKey="closeTab"/> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddVariableToWYSIWYGNewsletterTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddVariableToWYSIWYGNewsletterTest.xml index b6f78b6f33792..958340671ac43 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddVariableToWYSIWYGNewsletterTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddVariableToWYSIWYGNewsletterTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <!--Create Custom Variable--> @@ -99,7 +99,7 @@ <dontSee userInput="{{customVariable.html}}" stepKey="dontSeeCustomVariableName" /> <closeTab stepKey="closeTab"/> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml index 273a39a312132..29c125a52c9e2 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddWidgetToWYSIWYGNewsletterTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="login"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <amOnPage url="{{NewsletterTemplateForm.url}}" stepKey="amOnNewsletterTemplatePage"/> @@ -54,7 +54,7 @@ <see userInput="Home page" stepKey="seeHomePageCMSPage"/> <closeTab stepKey="closeTab"/> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml index 4d60b7676605e..15ce00cd11471 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml @@ -37,13 +37,13 @@ <argument name="StoreGroup" value="staticStoreGroup"/> <argument name="customStore" value="staticStore"/> </actionGroup> - <actionGroup ref="EnableWebUrlOptions" stepKey="addStoreCodeToUrls"/> + <actionGroup ref="EnableWebUrlOptionsActionGroup" stepKey="addStoreCodeToUrls"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <!--Delete created data and set Default Configuration--> - <actionGroup ref="ResetWebUrlOptions" stepKey="resetUrlOption"/> + <actionGroup ref="ResetWebUrlOptionsActionGroup" stepKey="resetUrlOption"/> <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> <argument name="websiteName" value="Second"/> </actionGroup> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnNewsletterTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnNewsletterTest.xml index 722a0dd22119d..0c20357127e6d 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnNewsletterTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifyTinyMCEv4IsNativeWYSIWYGOnNewsletterTest.xml @@ -19,7 +19,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> <amOnPage url="{{NewsletterTemplateForm.url}}" stepKey="amOnNewsletterTemplatePage"/> @@ -48,7 +48,7 @@ <see userInput="Hello World From Newsletter Template!" stepKey="seeContent" /> <closeTab stepKey="closeTab"/> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml index ec0f97e418c8c..86b55f854d593 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml @@ -25,10 +25,10 @@ </createData> <actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/> <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearOrderFilters"/> - <actionGroup ref="SetTaxClassForShipping" stepKey="setShippingTaxClass"/> + <actionGroup ref="SetTaxClassForShippingActionGroup" stepKey="setShippingTaxClass"/> </before> <after> - <actionGroup ref="ResetTaxClassForShipping" stepKey="resetTaxClassForShipping"/> + <actionGroup ref="ResetTaxClassForShippingActionGroup" stepKey="resetTaxClassForShipping"/> <actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteSalesRule"> <argument name="ruleName" value="{{ApiSalesRule.name}}"/> </actionGroup> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxCalcWithApplyTaxOnSettingTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxCalcWithApplyTaxOnSettingTest.xml index d249af983f715..a225144afea34 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxCalcWithApplyTaxOnSettingTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxCalcWithApplyTaxOnSettingTest.xml @@ -28,8 +28,8 @@ <requiredEntity createDataKey="createCategory"/> </createData> <actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/> - <actionGroup ref="SetTaxClassForShipping" stepKey="setTaxClass"/> - <actionGroup ref="SetTaxApplyOnSetting" stepKey="setApplyTaxOnSetting"> + <actionGroup ref="SetTaxClassForShippingActionGroup" stepKey="setTaxClass"/> + <actionGroup ref="SetTaxApplyOnSettingActionGroup" stepKey="setApplyTaxOnSetting"> <argument name="userInput" value="Original price only"/> </actionGroup> <amOnPage url="{{AdminEditTaxRulePage.url($$createTaxRule.id$$)}}" stepKey="navigateToEditTaxRulePage"/> @@ -45,10 +45,10 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createTaxRule" stepKey="deleteTaxRule"/> <deleteData stepKey="deleteTaxRate" createDataKey="initialTaxRate" /> - <actionGroup ref="DisableTaxApplyOnOriginalPrice" stepKey="setApplyTaxOffSetting"> + <actionGroup ref="DisableTaxApplyOnOriginalPriceActionGroup" stepKey="setApplyTaxOffSetting"> <argument name="userInput" value="Custom price if available"/> </actionGroup> - <actionGroup ref="ResetTaxClassForShipping" stepKey="resetTaxClassForShipping"/> + <actionGroup ref="ResetTaxClassForShippingActionGroup" stepKey="resetTaxClassForShipping"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml b/app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml index e15886e026c4c..deb94a7f30d34 100644 --- a/app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml +++ b/app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> - <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> + <actionGroup ref="EnabledWYSIWYGActionGroup" stepKey="enableWYSIWYG"/> </before> <amOnPage url="{{ConfigurationStoresPage.url}}" stepKey="navigateToWYSIWYGConfigPage1"/> <waitForPageLoad stepKey="wait1"/> @@ -80,7 +80,7 @@ <see userInput="Hello TinyMCE3!" stepKey="seeContent2"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> <after> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml index c63e76d851933..e2fb9cb50f88a 100644 --- a/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml +++ b/app/code/Magento/Widget/Test/Mftf/Test/NewProductsListWidgetTest.xml @@ -23,7 +23,7 @@ <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> + <actionGroup ref="DisabledWYSIWYGActionGroup" stepKey="disableWYSIWYG"/> </before> <after> @@ -49,4 +49,4 @@ <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_newDefaultCmsPage.identifier}}" stepKey="fillPageUrlKey"/> <click selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="clickSaveCmsPage"/> </test> -</tests> \ No newline at end of file +</tests> From 6f35328696700008a49e0387e726cb3734b0b0d7 Mon Sep 17 00:00:00 2001 From: Subash Natarajan <subash.natarajan@ziffity.com> Date: Fri, 29 Nov 2019 09:40:09 +0530 Subject: [PATCH 339/595] Useless method overriding issue fix --- .../Magento/Customer/Controller/Adminhtml/GroupTest.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/GroupTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/GroupTest.php index 8daf74d037249..d584fb46cda02 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/GroupTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/GroupTest.php @@ -39,15 +39,6 @@ public function setUp() $this->groupRepository = $objectManager->get(\Magento\Customer\Api\GroupRepositoryInterface::class); } - /** - * @inheritDoc - */ - public function tearDown() - { - parent::tearDown(); - //$this->session->unsCustomerGroupData(); - } - /** * Test new group form. */ From 0c35eb76e1de680f349de67a4f004f21222a408c Mon Sep 17 00:00:00 2001 From: Sergii Ivashchenko <serg.ivashchenko@gmail.com> Date: Fri, 29 Nov 2019 10:33:53 +0100 Subject: [PATCH 340/595] Fixed static tests --- .../Test/Unit/Model/DataExtractorTest.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/app/code/Magento/MediaGallery/Test/Unit/Model/DataExtractorTest.php b/app/code/Magento/MediaGallery/Test/Unit/Model/DataExtractorTest.php index b64834e5decee..30f355a9298fe 100644 --- a/app/code/Magento/MediaGallery/Test/Unit/Model/DataExtractorTest.php +++ b/app/code/Magento/MediaGallery/Test/Unit/Model/DataExtractorTest.php @@ -175,21 +175,7 @@ public function assetProvider() 'method' => 'getKeyword', ], ], - ], - 'Test case keyword 2' => [ - Keyword::class, - KeywordInterface::class, - [ - 'id' => [ - 'value' => 3, - 'method' => 'getId', - ], - 'keyword' => [ - 'value' => 'keyword2', - 'method' => 'getKeyword', - ], - ], - ], + ] ]; } } From 86f46bb62423949fc808a492c1c75d416bf24a86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Fri, 29 Nov 2019 10:45:04 +0100 Subject: [PATCH 341/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../AdminAddImageToWYSIWYGCatalogTest.xml | 16 +- .../CatalogProductListWidgetOperatorsTest.xml | 8 +- .../CatalogProductListWidgetOrderTest.xml | 4 +- .../AddStoreViewToCmsPageActionGroup.xml | 30 ++++ .../AssertCMSPageContentActionGroup.xml | 19 +- .../AssertStoreFrontCMSPageActionGroup.xml | 25 +++ .../ActionGroup/AttachImageActionGroup.xml | 25 +++ .../Test/Mftf/ActionGroup/CMSActionGroup.xml | 170 ------------------ ...ePageContentWYSIWYGDisabledActionGroup.xml | 20 +++ .../ClearWidgetsFromCMSContentActionGroup.xml | 13 +- ...ClickBrowseBtnOnUploadPopupActionGroup.xml | 19 ++ .../CreateImageFolderActionGroup.xml | 31 ++++ .../CreateNewPageWithAllValuesActionGroup.xml | 8 +- ...PageWithAllValuesAndContentActionGroup.xml | 17 ++ .../ActionGroup/DeleteCMSBlockActionGroup.xml | 25 +++ .../ActionGroup/DeleteImageActionGroup.xml | 23 +++ .../FillOutUploadImagePopupActionGroup.xml | 22 +++ ...vigateToCreatedCMSBlockPageActionGroup.xml | 34 ++++ .../NavigateToCreatedCMSPageActionGroup.xml | 35 ++++ ...eToStorefrontForCreatedPageActionGroup.xml | 22 +++ ...loseCMSBlockWithSplitButtonActionGroup.xml | 22 +++ .../SaveAndContinueEditCmsPageActionGroup.xml | 22 +++ .../ActionGroup/SaveCMSBlockActionGroup.xml | 21 +++ .../ActionGroup/SaveCmsPageActionGroup.xml | 23 +++ .../Mftf/ActionGroup/SaveImageActionGroup.xml | 20 +++ ...SelectImageFromMediaStorageActionGroup.xml | 120 ------------- .../Mftf/ActionGroup/SetLayoutActionGroup.xml | 26 +++ .../VerifyMagentoEntityActionGroup.xml | 19 ++ ...yMediaGalleryStorageActionsActionGroup.xml | 22 +++ ...VerifyOversizeValidationMsgActionGroup.xml | 19 ++ .../ActionGroup/VerifyTinyMCEActionGroup.xml | 11 +- ...WrongExtensionValidationMsgActionGroup.xml | 19 ++ .../AdminAddImageToCMSPageTinyMCE3Test.xml | 8 +- .../Test/AdminAddImageToWYSIWYGBlockTest.xml | 18 +- .../Test/AdminAddImageToWYSIWYGCMSTest.xml | 18 +- .../AdminAddVariableToWYSIWYGBlockTest.xml | 2 +- .../Test/AdminAddWidgetToWYSIWYGBlockTest.xml | 4 +- .../Test/Mftf/Test/AdminCreateCmsPageTest.xml | 2 +- ...lleryPopupUploadImagesWithoutErrorTest.xml | 2 +- ...CheckOrderOfProdsInWidgetOnCMSPageTest.xml | 4 +- .../StoreViewLanguageCorrectSwitchTest.xml | 2 +- .../AdminAddImageToWYSIWYGNewsletterTest.xml | 12 +- ...esignConfigMediaGalleryImageUploadTest.xml | 6 +- ...eUrlRewriteAndAddPermanentRedirectTest.xml | 10 +- ...eUrlRewriteAndAddTemporaryRedirectTest.xml | 10 +- 45 files changed, 610 insertions(+), 398 deletions(-) create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/AddStoreViewToCmsPageActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertStoreFrontCMSPageActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/AttachImageActionGroup.xml delete mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/CMSActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/ClearWidgetsForCMSHomePageContentWYSIWYGDisabledActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/ClickBrowseBtnOnUploadPopupActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateImageFolderActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesAndContentActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/DeleteCMSBlockActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/DeleteImageActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutUploadImagePopupActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToCreatedCMSBlockPageActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToCreatedCMSPageActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToStorefrontForCreatedPageActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndCloseCMSBlockWithSplitButtonActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndContinueEditCmsPageActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCMSBlockActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCmsPageActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveImageActionGroup.xml delete mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/SelectImageFromMediaStorageActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/SetLayoutActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyMagentoEntityActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyMediaGalleryStorageActionsActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyOversizeValidationMsgActionGroup.xml create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyWrongExtensionValidationMsgActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml index c36c29ce594d0..81694749fa79b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml @@ -31,20 +31,20 @@ <waitForElementVisible selector="{{CatalogWYSIWYGSection.TinyMCE4}}" stepKey="waitForTinyMCE4" /> <click selector="{{CatalogWYSIWYGSection.InsertImageIcon}}" stepKey="clickInsertImageIcon" /> <waitForPageLoad stepKey="waitForPageLoad" /> - <actionGroup ref="clickBrowseBtnOnUploadPopup" stepKey="clickBrowserBtn"/> - <actionGroup ref="VerifyMediaGalleryStorageActions" stepKey="VerifyMediaGalleryStorageBtn"/> - <actionGroup ref="CreateImageFolder" stepKey="CreateImageFolder"> + <actionGroup ref="ClickBrowseBtnOnUploadPopupActionGroup" stepKey="clickBrowserBtn"/> + <actionGroup ref="VerifyMediaGalleryStorageActionsActionGroup" stepKey="VerifyMediaGalleryStorageBtn"/> + <actionGroup ref="CreateImageFolderActionGroup" stepKey="CreateImageFolder"> <argument name="ImageFolder" value="ImageFolder"/> </actionGroup> - <actionGroup ref="attachImage" stepKey="attachImage1"> + <actionGroup ref="AttachImageActionGroup" stepKey="attachImage1"> <argument name="Image" value="ImageUpload3"/> </actionGroup> - <actionGroup ref="deleteImage" stepKey="deleteImage"/> - <actionGroup ref="attachImage" stepKey="attachImage2"> + <actionGroup ref="DeleteImageActionGroup" stepKey="deleteImage"/> + <actionGroup ref="AttachImageActionGroup" stepKey="attachImage2"> <argument name="Image" value="ImageUpload3"/> </actionGroup> - <actionGroup ref="saveImage" stepKey="insertImage"/> - <actionGroup ref="fillOutUploadImagePopup" stepKey="fillOutUploadImagePopup" /> + <actionGroup ref="SaveImageActionGroup" stepKey="insertImage"/> + <actionGroup ref="FillOutUploadImagePopupActionGroup" stepKey="fillOutUploadImagePopup" /> <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCatalog"/> <amOnPage url="/{{SimpleSubCategory.name_lwr}}.html" stepKey="goToCategoryFrontPage"/> <waitForPageLoad stepKey="waitForPageLoad2"/> diff --git a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml index 32bea8b604cf8..bc1542cd2ea28 100644 --- a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml +++ b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOperatorsTest.xml @@ -42,7 +42,7 @@ </before> <!--Open block with widget.--> - <actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage1"> + <actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage1"> <argument name="CMSBlockPage" value="$$createPreReqBlock$$"/> </actionGroup> @@ -85,7 +85,7 @@ <seeElement selector="{{InsertWidgetSection.checkElementStorefrontByPrice('100')}}" stepKey="seeElementByPrice100"/> <!--Open block with widget.--> - <actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage2"> + <actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage2"> <argument name="CMSBlockPage" value="$$createPreReqBlock$$"/> </actionGroup> @@ -105,7 +105,7 @@ <dontSeeElement selector="{{InsertWidgetSection.checkElementStorefrontByPrice('100')}}" stepKey="dontSeeElementByPrice100"/> <!--Open block with widget.--> - <actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage3"> + <actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage3"> <argument name="CMSBlockPage" value="$$createPreReqBlock$$"/> </actionGroup> @@ -125,7 +125,7 @@ <seeElement selector="{{InsertWidgetSection.checkElementStorefrontByPrice('100')}}" stepKey="seeElementByPrice100s"/> <!--Open block with widget.--> - <actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage4"> + <actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage4"> <argument name="CMSBlockPage" value="$$createPreReqBlock$$"/> </actionGroup> diff --git a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOrderTest.xml b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOrderTest.xml index 11586207c4d8e..cceb25ecebe21 100644 --- a/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOrderTest.xml +++ b/app/code/Magento/CatalogWidget/Test/Mftf/Test/CatalogProductListWidgetOrderTest.xml @@ -42,7 +42,7 @@ </before> <!--Open created cms page--> <comment userInput="Open created cms page" stepKey="commentOpenCreatedCmsPage"/> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage1"> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage1"> <argument name="CMSPage" value="$$createPreReqPage$$"/> </actionGroup> <!--Add widget to cms page--> @@ -85,4 +85,4 @@ <actionGroup ref="logout" stepKey="logout"/> </after> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AddStoreViewToCmsPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AddStoreViewToCmsPageActionGroup.xml new file mode 100644 index 0000000000000..505f3bebbf70c --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AddStoreViewToCmsPageActionGroup.xml @@ -0,0 +1,30 @@ +<?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="AddStoreViewToCmsPageActionGroup" extends="NavigateToCreatedCMSPageActionGroup"> + <annotations> + <description>EXTENDS: navigateToCreatedCMSPage. Adds the provided Store View to a Page.</description> + </annotations> + <arguments> + <argument name="storeViewName" type="string"/> + </arguments> + + <remove keyForRemoval="clickExpandContentTabForPage"/> + <remove keyForRemoval="waitForLoadingMaskOfStagingSection"/> + <click selector="{{CmsNewPagePiwSection.header}}" stepKey="clickPageInWebsites" after="waitForPageLoad3"/> + <waitForElementVisible selector="{{CmsNewPagePiwSection.selectStoreView(storeViewName)}}" stepKey="waitForStoreGridReload"/> + <clickWithLeftButton selector="{{CmsNewPagePiwSection.selectStoreView(storeViewName)}}" stepKey="clickStoreView"/> + <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> + <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> + <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <see userInput="You saved the page." stepKey="seeMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageContentActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageContentActionGroup.xml index 336ed8ea495ec..7697931a24176 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageContentActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageContentActionGroup.xml @@ -8,11 +8,11 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AssertCMSPageContent"> + <actionGroup name="AssertCMSPageContentActionGroup"> <annotations> <description>Validates that the CMS Page details are present and correct. PLEASE NOTE: The CMS Page data is Hardcoded, using '_duplicatedCMSPage'.</description> </annotations> - + <grabValueFrom selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" stepKey="grabTextFromTitle"/> <assertEquals stepKey="assertTitle" message="pass"> <expectedResult type="string">{{_duplicatedCMSPage.title}}</expectedResult> @@ -28,19 +28,4 @@ <executeJS function="(el = document.querySelector('[name=\'identifier\']')) && el['se' + 'tAt' + 'tribute']('data-value', el.value.split('-')[0]);" stepKey="setAttribute"/> <seeElement selector="{{CmsNewPagePageBasicFieldsSection.duplicatedURLKey(_duplicatedCMSPage.title)}}" stepKey="see"/> </actionGroup> - - <actionGroup name="AssertStoreFrontCMSPage"> - <annotations> - <description>Validates that the provided CMS Page Title, Content and Heading are present and correct on a Storefront CMS Page.</description> - </annotations> - <arguments> - <argument name="cmsTitle" type="string"/> - <argument name="cmsContent" type="string"/> - <argument name="cmsContentHeading" type="string"/> - </arguments> - - <see selector="{{StorefrontCMSPageSection.title}}" userInput="{{cmsTitle}}" stepKey="seeTitle"/> - <see selector="{{StorefrontCMSPageSection.mainTitle}}" userInput="{{cmsContentHeading}}" stepKey="seeContentHeading"/> - <see selector="{{StorefrontCMSPageSection.mainContent}}" userInput="{{cmsContent}}" stepKey="seeContent"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertStoreFrontCMSPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertStoreFrontCMSPageActionGroup.xml new file mode 100644 index 0000000000000..136fecbab5d8b --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertStoreFrontCMSPageActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AssertStoreFrontCMSPageActionGroup"> + <annotations> + <description>Validates that the provided CMS Page Title, Content and Heading are present and correct on a Storefront CMS Page.</description> + </annotations> + <arguments> + <argument name="cmsTitle" type="string"/> + <argument name="cmsContent" type="string"/> + <argument name="cmsContentHeading" type="string"/> + </arguments> + + <see selector="{{StorefrontCMSPageSection.title}}" userInput="{{cmsTitle}}" stepKey="seeTitle"/> + <see selector="{{StorefrontCMSPageSection.mainTitle}}" userInput="{{cmsContentHeading}}" stepKey="seeContentHeading"/> + <see selector="{{StorefrontCMSPageSection.mainContent}}" userInput="{{cmsContent}}" stepKey="seeContent"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AttachImageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AttachImageActionGroup.xml new file mode 100644 index 0000000000000..f4eb3ced2a203 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AttachImageActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AttachImageActionGroup"> + <annotations> + <description>Uploads the provided Image to Media Gallery. + If you use this action group, you MUST add steps to delete the image in the "after" steps.</description> + </annotations> + <arguments> + <argument name="Image"/> + </arguments> + + <attachFile selector="{{MediaGallerySection.BrowseUploadImage}}" userInput="{{Image.value}}" stepKey="uploadImage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/> + <waitForElementVisible selector="{{MediaGallerySection.imageOrImageCopy(Image.fileName, Image.extension)}}" stepKey="waitForUploadImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CMSActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CMSActionGroup.xml deleted file mode 100644 index a75090179460b..0000000000000 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CMSActionGroup.xml +++ /dev/null @@ -1,170 +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="navigateToCreatedCMSPage"> - <annotations> - <description>Goes to the Admin CMS Pages page. </description> - </annotations> - <arguments> - <argument name="CMSPage" defaultValue=""/> - </arguments> - - <amOnPage url="{{CmsPagesPage.url}}" stepKey="navigateToCMSPagesGrid"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <conditionalClick selector="//div[contains(@data-role, 'grid-wrapper')]/table/thead/tr/th/span[contains(text(), 'ID')]" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="clickToAttemptSortByIdDescending" visible="true"/> - <waitForLoadingMaskToDisappear stepKey="waitForFirstIdSortDescendingToFinish"/> - - <!-- Conditional Click again in case it goes from default state to ascending on first click --> - <conditionalClick selector="//div[contains(@data-role, 'grid-wrapper')]/table/thead/tr/th/span[contains(text(), 'ID')]" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="secondClickToAttemptSortByIdDescending" visible="true"/> - <waitForLoadingMaskToDisappear stepKey="waitForSecondIdSortDescendingToFinish"/> - <click selector="{{CmsPagesPageActionsSection.select(CMSPage.identifier)}}" stepKey="clickSelectCreatedCMSPage"/> - <click selector="{{CmsPagesPageActionsSection.edit(CMSPage.identifier)}}" stepKey="navigateToCreatedCMSPage"/> - <waitForPageLoad stepKey="waitForPageLoad3"/> - <click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickExpandContentTabForPage"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskOfStagingSection"/> - </actionGroup> - - <actionGroup name="navigateToCreatedCMSBlockPage"> - <annotations> - <description>Goes to the Admin Blocks page. Clicks on 'Edit' for the provided Block.</description> - </annotations> - <arguments> - <argument name="CMSBlockPage" defaultValue=""/> - </arguments> - - <amOnPage url="{{CmsBlocksPage.url}}" stepKey="navigateToCMSBlocksGrid"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <conditionalClick selector="{{BlockPageActionsSection.idColumn}}" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="clickToAttemptSortByIdDescending" visible="true"/> - <waitForLoadingMaskToDisappear stepKey="waitForFirstIdSortDescendingToFinish"/> - - <!-- Conditional Click again in case it goes from default state to ascending on first click --> - <conditionalClick selector="{{BlockPageActionsSection.idColumn}}" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="secondClickToAttemptSortByIdDescending" visible="true"/> - <waitForLoadingMaskToDisappear stepKey="waitForSecondIdSortDescendingToFinish"/> - <click selector="{{BlockPageActionsSection.select(CMSBlockPage.identifier)}}" stepKey="clickSelectCreatedCMSBlock"/> - <click selector="{{BlockPageActionsSection.edit(CMSBlockPage.identifier)}}" stepKey="navigateToCreatedCMSBlock"/> - <waitForPageLoad stepKey="waitForPageLoad3"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskOfStagingSection"/> - </actionGroup> - - <actionGroup name="DeleteCMSBlockActionGroup"> - <annotations> - <description>Goes to the Admin CMS Blocks page. Deletes the '_defaultBlock' Block. Validates that the Success Message is present and correct. PLEASE NOTE: The Block that is deleted it Hardcoded.</description> - </annotations> - - <amOnPage url="{{CmsBlocksPage.url}}" stepKey="navigateToCMSPagesGrid"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <click selector="{{CmsPagesPageActionsSection.select(_defaultBlock.title)}}" stepKey="ClickOnSelect"/> - <click selector="{{CmsPagesPageActionsSection.delete(_defaultBlock.title)}}" stepKey="ClickOnEdit"/> - <waitForPageLoad stepKey="waitForPageLoad3"/> - <click selector="{{CmsPagesPageActionsSection.deleteConfirm}}" stepKey="ClickToConfirm"/> - <waitForPageLoad stepKey="waitForPageLoad4"/> - <see userInput="You deleted the block." stepKey="VerifyBlockIsDeleted"/> - </actionGroup> - - <actionGroup name="AddStoreViewToCmsPage" extends="navigateToCreatedCMSPage"> - <annotations> - <description>EXTENDS: navigateToCreatedCMSPage. Adds the provided Store View to a Page.</description> - </annotations> - <arguments> - <argument name="storeViewName" type="string"/> - </arguments> - - <remove keyForRemoval="clickExpandContentTabForPage"/> - <remove keyForRemoval="waitForLoadingMaskOfStagingSection"/> - <click selector="{{CmsNewPagePiwSection.header}}" stepKey="clickPageInWebsites" after="waitForPageLoad3"/> - <waitForElementVisible selector="{{CmsNewPagePiwSection.selectStoreView(storeViewName)}}" stepKey="waitForStoreGridReload"/> - <clickWithLeftButton selector="{{CmsNewPagePiwSection.selectStoreView(storeViewName)}}" stepKey="clickStoreView"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <see userInput="You saved the page." stepKey="seeMessage"/> - </actionGroup> - - <actionGroup name="saveAndCloseCMSBlockWithSplitButton"> - <annotations> - <description>Clicks on the Save and Close button.</description> - </annotations> - - <waitForElementVisible selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="waitForExpandSplitButtonToBeVisible"/> - <click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/> - <click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveBlock"/> - <waitForPageLoad stepKey="waitForPageLoadAfterClickingSave"/> - <see userInput="You saved the block." stepKey="assertSaveBlockSuccessMessage"/> - </actionGroup> - - <actionGroup name="navigateToStorefrontForCreatedPage"> - <annotations> - <description>Goes to the provided Page on the Storefront.</description> - </annotations> - <arguments> - <argument name="page" type="string"/> - </arguments> - - <amOnPage url="{{page}}" stepKey="goToStorefront"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <actionGroup name="saveCMSBlock"> - <annotations> - <description>Clicks on the Save button. Validates that the Save message is present and correct. PLEASE NOTE: The message is Hardcoded.</description> - </annotations> - - <waitForElementVisible selector="{{CmsNewBlockBlockActionsSection.savePage}}" stepKey="waitForSaveButton"/> - <click selector="{{CmsNewBlockBlockActionsSection.savePage}}" stepKey="clickSaveButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <see userInput="You saved the block." stepKey="seeSuccessfulSaveMessage"/> - </actionGroup> - - <actionGroup name="saveAndContinueEditCmsPage"> - <annotations> - <description>Clicks on the Save and Continue button.</description> - </annotations> - - <waitForElementVisible time="10" selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="waitForSaveAndContinueVisibility"/> - <click selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="clickSaveAndContinueEditCmsPage"/> - <waitForPageLoad stepKey="waitForCmsPageLoad"/> - <waitForElementVisible time="1" selector="{{CmsNewPagePageActionsSection.cmsPageTitle}}" stepKey="waitForCmsPageSaveButton"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> - </actionGroup> - - <actionGroup name="saveCmsPage"> - <annotations> - <description>Clicks on the Save button. Validates that the Success Message is present.</description> - </annotations> - - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="waitForSplitButton"/> - <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/> - <waitForElementVisible selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="waitForSaveCmsPage"/> - <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSaveCmsPage"/> - <waitForElementVisible time="1" selector="{{CmsPagesPageActionsSection.addNewPageButton}}" stepKey="waitForCmsPageSaveButton"/> - <see userInput="You saved the page." selector="{{CmsPagesPageActionsSection.savePageSuccessMessage}}" stepKey="assertSavePageSuccessMessage"/> - </actionGroup> - - <actionGroup name="setLayout"> - <annotations> - <description>Sets the provided option for 'Layout', under 'Design' on the Page creation/edit page. </description> - </annotations> - <arguments> - <argument name="designSection"/> - <argument name="layoutOption"/> - </arguments> - - <waitForElementVisible selector="{{designSection.DesignTab}}" stepKey="waitForDesignTabVisible"/> - <conditionalClick selector="{{designSection.DesignTab}}" dependentSelector="{{designSection.LayoutDropdown}}" visible="false" stepKey="clickOnDesignTab"/> - <waitForPageLoad stepKey="waitForPageLoadDesignTab"/> - <waitForElementVisible selector="{{designSection.LayoutDropdown}}" stepKey="waitForLayoutDropDown"/> - <selectOption selector="{{designSection.LayoutDropdown}}" userInput="{{layoutOption}}" stepKey="selectLayout"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClearWidgetsForCMSHomePageContentWYSIWYGDisabledActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClearWidgetsForCMSHomePageContentWYSIWYGDisabledActionGroup.xml new file mode 100644 index 0000000000000..adaeb8c90ff0b --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClearWidgetsForCMSHomePageContentWYSIWYGDisabledActionGroup.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="ClearWidgetsForCMSHomePageContentWYSIWYGDisabledActionGroup"> + <amOnPage url="{{CmsPageEditPage.url('2')}}" stepKey="navigateToEditHomePagePage"/> + <waitForPageLoad stepKey="waitForCmsPageEditPage"/> + <conditionalClick selector="{{CmsNewPagePageActionsSection.contentSectionName}}" dependentSelector="{{CatalogWidgetSection.insertWidgetButton}}" visible="false" stepKey="clickShowHideEditorIfVisible"/> + <waitForElementVisible selector="{{CmsNewPagePageContentSection.content}}" stepKey="waitForContentField"/> + <fillField selector="{{CmsNewPagePageContentSection.content}}" userInput="CMS homepage content goes here." stepKey="resetCMSPageToDefaultContent"/> + <click selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="clickSave"/> + <waitForPageLoad stepKey="waitForSettingsApply"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClearWidgetsFromCMSContentActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClearWidgetsFromCMSContentActionGroup.xml index b176de3748282..98de51574aa4b 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClearWidgetsFromCMSContentActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClearWidgetsFromCMSContentActionGroup.xml @@ -8,11 +8,11 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="ClearWidgetsFromCMSContent"> + <actionGroup name="ClearWidgetsFromCMSContentActionGroup"> <annotations> <description>Goes to the Admin CMS Page Edit page for the Page ID number 2. Clears the Widget and replaces it with Text. PLEASE NOTE: The Page ID/Text are Hardcoded.</description> </annotations> - + <amOnPage url="{{CmsPageEditPage.url('2')}}" stepKey="navigateToEditHomePagePage"/> <waitForPageLoad stepKey="waitEditHomePagePageToLoad"/> <click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickContentTab"/> @@ -26,13 +26,4 @@ <waitForPageLoad stepKey="waitSaveToBeApplied"/> <see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the page." stepKey="seeSaveSuccess"/> </actionGroup> - <actionGroup name="ClearWidgetsForCMSHomePageContentWYSIWYGDisabled"> - <amOnPage url="{{CmsPageEditPage.url('2')}}" stepKey="navigateToEditHomePagePage"/> - <waitForPageLoad stepKey="waitForCmsPageEditPage"/> - <conditionalClick selector="{{CmsNewPagePageActionsSection.contentSectionName}}" dependentSelector="{{CatalogWidgetSection.insertWidgetButton}}" visible="false" stepKey="clickShowHideEditorIfVisible"/> - <waitForElementVisible selector="{{CmsNewPagePageContentSection.content}}" stepKey="waitForContentField"/> - <fillField selector="{{CmsNewPagePageContentSection.content}}" userInput="CMS homepage content goes here." stepKey="resetCMSPageToDefaultContent"/> - <click selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="clickSave"/> - <waitForPageLoad stepKey="waitForSettingsApply"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClickBrowseBtnOnUploadPopupActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClickBrowseBtnOnUploadPopupActionGroup.xml new file mode 100644 index 0000000000000..b0c0278f0c1a5 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/ClickBrowseBtnOnUploadPopupActionGroup.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="ClickBrowseBtnOnUploadPopupActionGroup"> + <annotations> + <description>Clicks on the Browse button in the 'Insert/edit image' model.</description> + </annotations> + + <click selector="{{MediaGallerySection.Browse}}" stepKey="clickBrowse"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateImageFolderActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateImageFolderActionGroup.xml new file mode 100644 index 0000000000000..e39263debd127 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateImageFolderActionGroup.xml @@ -0,0 +1,31 @@ +<?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="CreateImageFolderActionGroup"> + <annotations> + <description>Creates a folder in the Media Gallery based on the provided Folder.</description> + </annotations> + <arguments> + <argument name="ImageFolder" defaultValue="ImageFolder"/> + </arguments> + + <click selector="{{MediaGallerySection.CreateFolder}}" stepKey="createFolder"/> + <waitForElementVisible selector="{{MediaGallerySection.FolderName}}" stepKey="waitForPopUp"/> + <fillField selector="{{MediaGallerySection.FolderName}}" userInput="{{ImageFolder.name}}" stepKey="fillFolderName"/> + <click selector="{{MediaGallerySection.AcceptFolderName}}" stepKey="acceptFolderName"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoading3"/> + <waitForPageLoad stepKey="waitForLoadingArrowToExpand" time="15"/> + <conditionalClick selector="{{MediaGallerySection.StorageRootArrow}}" dependentSelector="{{MediaGallerySection.checkIfArrowExpand}}" stepKey="clickArrowIfClosed" visible="true"/> + <conditionalClick selector="{{MediaGallerySection.WysiwygArrow}}" dependentSelector="{{MediaGallerySection.checkIfWysiwygArrowExpand}}" stepKey="clickWysiwygArrowIfClosed" visible="true"/> + <waitForText userInput="{{ImageFolder.name}}" stepKey="waitForNewFolder"/> + <click userInput="{{ImageFolder.name}}" stepKey="clickOnCreatedFolder"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoading5"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesActionGroup.xml index fa5cccafccd54..fb8250ae00f27 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="CreateNewPageWithAllValues"> + <actionGroup name="CreateNewPageWithAllValuesActionGroup"> <annotations> <description>Goes to the Admin CMS creation page. Fills in the provided Page details (Title, Heading, URL, Store View and Hierarchy).</description> </annotations> @@ -33,10 +33,4 @@ <click selector="{{CmsNewPageHierarchySection.header}}" stepKey="clickHierarchy"/> <click selector="{{CmsNewPageHierarchySection.selectHierarchy(selectHierarchyOpt)}}" stepKey="clickPageCheckBoxes"/> </actionGroup> - <actionGroup name="CreateNewPageWithAllValuesAndContent" extends="CreateNewPageWithAllValues"> - <arguments> - <argument name="pageContent" type="string"/> - </arguments> - <fillField selector="{{CmsNewPagePageContentSection.content}}" userInput="{{pageContent}}" stepKey="fillContentField" after="fillFieldContentHeading"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesAndContentActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesAndContentActionGroup.xml new file mode 100644 index 0000000000000..201e78fff6dbe --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesAndContentActionGroup.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="CreateNewPageWithAllValuesAndContentActionGroup" extends="CreateNewPageWithAllValues"> + <arguments> + <argument name="pageContent" type="string"/> + </arguments> + <fillField selector="{{CmsNewPagePageContentSection.content}}" userInput="{{pageContent}}" stepKey="fillContentField" after="fillFieldContentHeading"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/DeleteCMSBlockActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/DeleteCMSBlockActionGroup.xml new file mode 100644 index 0000000000000..2f9b03f1e33b3 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/DeleteCMSBlockActionGroup.xml @@ -0,0 +1,25 @@ +<?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="DeleteCMSBlockActionGroup"> + <annotations> + <description>Goes to the Admin CMS Blocks page. Deletes the '_defaultBlock' Block. Validates that the Success Message is present and correct. PLEASE NOTE: The Block that is deleted it Hardcoded.</description> + </annotations> + + <amOnPage url="{{CmsBlocksPage.url}}" stepKey="navigateToCMSPagesGrid"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <click selector="{{CmsPagesPageActionsSection.select(_defaultBlock.title)}}" stepKey="ClickOnSelect"/> + <click selector="{{CmsPagesPageActionsSection.delete(_defaultBlock.title)}}" stepKey="ClickOnEdit"/> + <waitForPageLoad stepKey="waitForPageLoad3"/> + <click selector="{{CmsPagesPageActionsSection.deleteConfirm}}" stepKey="ClickToConfirm"/> + <waitForPageLoad stepKey="waitForPageLoad4"/> + <see userInput="You deleted the block." stepKey="VerifyBlockIsDeleted"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/DeleteImageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/DeleteImageActionGroup.xml new file mode 100644 index 0000000000000..3bf2c6795bcb6 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/DeleteImageActionGroup.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="DeleteImageActionGroup"> + <annotations> + <description>Deletes the selected Image from the Media Gallery.</description> + </annotations> + + <see selector="{{MediaGallerySection.DeleteSelectedBtn}}" userInput="Delete Selected" stepKey="seeDeleteBtn"/> + <click selector="{{MediaGallerySection.DeleteSelectedBtn}}" stepKey="clickDeleteSelected"/> + <waitForText userInput="OK" stepKey="waitForConfirm"/> + <click selector="{{MediaGallerySection.confirmDelete}}" stepKey="confirmDelete"/> + <waitForElementNotVisible selector="{{MediaGallerySection.image(ImageUpload.file)}}" stepKey="waitForImageDeleted"/> + <dontSeeElement selector="{{MediaGallerySection.image(ImageUpload.file)}}" stepKey="dontSeeImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutUploadImagePopupActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutUploadImagePopupActionGroup.xml new file mode 100644 index 0000000000000..dc4abe9a5115a --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/FillOutUploadImagePopupActionGroup.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="FillOutUploadImagePopupActionGroup"> + <annotations> + <description>Fills in the Image Description and Height fields. PLEASE NOTE: The values are Hardcoded using 'ImageUpload'.</description> + </annotations> + + <waitForElementVisible selector="{{MediaGallerySection.OkBtn}}" stepKey="waitForOkBtn"/> + <fillField selector="{{MediaGallerySection.ImageDescription}}" userInput="{{ImageUpload.content}}" stepKey="fillImageDescription"/> + <fillField selector="{{MediaGallerySection.Height}}" userInput="{{ImageUpload.height}}" stepKey="fillImageHeight"/> + <click selector="{{MediaGallerySection.OkBtn}}" stepKey="clickOkBtn"/> + <waitForPageLoad stepKey="wait3"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToCreatedCMSBlockPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToCreatedCMSBlockPageActionGroup.xml new file mode 100644 index 0000000000000..06bc3787579e4 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToCreatedCMSBlockPageActionGroup.xml @@ -0,0 +1,34 @@ +<?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="NavigateToCreatedCMSBlockPageActionGroup"> + <annotations> + <description>Goes to the Admin Blocks page. Clicks on 'Edit' for the provided Block.</description> + </annotations> + <arguments> + <argument name="CMSBlockPage" defaultValue=""/> + </arguments> + + <amOnPage url="{{CmsBlocksPage.url}}" stepKey="navigateToCMSBlocksGrid"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <conditionalClick selector="{{BlockPageActionsSection.idColumn}}" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="clickToAttemptSortByIdDescending" visible="true"/> + <waitForLoadingMaskToDisappear stepKey="waitForFirstIdSortDescendingToFinish"/> + + <!-- Conditional Click again in case it goes from default state to ascending on first click --> + <conditionalClick selector="{{BlockPageActionsSection.idColumn}}" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="secondClickToAttemptSortByIdDescending" visible="true"/> + <waitForLoadingMaskToDisappear stepKey="waitForSecondIdSortDescendingToFinish"/> + <click selector="{{BlockPageActionsSection.select(CMSBlockPage.identifier)}}" stepKey="clickSelectCreatedCMSBlock"/> + <click selector="{{BlockPageActionsSection.edit(CMSBlockPage.identifier)}}" stepKey="navigateToCreatedCMSBlock"/> + <waitForPageLoad stepKey="waitForPageLoad3"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskOfStagingSection"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToCreatedCMSPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToCreatedCMSPageActionGroup.xml new file mode 100644 index 0000000000000..3b763d3f44125 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToCreatedCMSPageActionGroup.xml @@ -0,0 +1,35 @@ +<?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="NavigateToCreatedCMSPageActionGroup"> + <annotations> + <description>Goes to the Admin CMS Pages page. </description> + </annotations> + <arguments> + <argument name="CMSPage" defaultValue=""/> + </arguments> + + <amOnPage url="{{CmsPagesPage.url}}" stepKey="navigateToCMSPagesGrid"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <conditionalClick selector="{{CmsPagesPageActionsSection.clearAllButton}}" dependentSelector="{{CmsPagesPageActionsSection.activeFilters}}" stepKey="clickToResetFilter" visible="true"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <conditionalClick selector="//div[contains(@data-role, 'grid-wrapper')]/table/thead/tr/th/span[contains(text(), 'ID')]" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="clickToAttemptSortByIdDescending" visible="true"/> + <waitForLoadingMaskToDisappear stepKey="waitForFirstIdSortDescendingToFinish"/> + + <!-- Conditional Click again in case it goes from default state to ascending on first click --> + <conditionalClick selector="//div[contains(@data-role, 'grid-wrapper')]/table/thead/tr/th/span[contains(text(), 'ID')]" dependentSelector="//span[contains(text(), 'ID')]/parent::th[not(contains(@class, '_descend'))]/parent::tr/parent::thead/parent::table/parent::div[contains(@data-role, 'grid-wrapper')]" stepKey="secondClickToAttemptSortByIdDescending" visible="true"/> + <waitForLoadingMaskToDisappear stepKey="waitForSecondIdSortDescendingToFinish"/> + <click selector="{{CmsPagesPageActionsSection.select(CMSPage.identifier)}}" stepKey="clickSelectCreatedCMSPage"/> + <click selector="{{CmsPagesPageActionsSection.edit(CMSPage.identifier)}}" stepKey="navigateToCreatedCMSPage"/> + <waitForPageLoad stepKey="waitForPageLoad3"/> + <click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickExpandContentTabForPage"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskOfStagingSection"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToStorefrontForCreatedPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToStorefrontForCreatedPageActionGroup.xml new file mode 100644 index 0000000000000..7576c61e2391c --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/NavigateToStorefrontForCreatedPageActionGroup.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="NavigateToStorefrontForCreatedPageActionGroup"> + <annotations> + <description>Goes to the provided Page on the Storefront.</description> + </annotations> + <arguments> + <argument name="page" type="string"/> + </arguments> + + <amOnPage url="{{page}}" stepKey="goToStorefront"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndCloseCMSBlockWithSplitButtonActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndCloseCMSBlockWithSplitButtonActionGroup.xml new file mode 100644 index 0000000000000..95ce3c499b6b8 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndCloseCMSBlockWithSplitButtonActionGroup.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="SaveAndCloseCMSBlockWithSplitButtonActionGroup"> + <annotations> + <description>Clicks on the Save and Close button.</description> + </annotations> + + <waitForElementVisible selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="waitForExpandSplitButtonToBeVisible"/> + <click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/> + <click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveBlock"/> + <waitForPageLoad stepKey="waitForPageLoadAfterClickingSave"/> + <see userInput="You saved the block." stepKey="assertSaveBlockSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndContinueEditCmsPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndContinueEditCmsPageActionGroup.xml new file mode 100644 index 0000000000000..a8dce19153a98 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveAndContinueEditCmsPageActionGroup.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="SaveAndContinueEditCmsPageActionGroup"> + <annotations> + <description>Clicks on the Save and Continue button.</description> + </annotations> + + <waitForElementVisible time="10" selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="waitForSaveAndContinueVisibility"/> + <click selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="clickSaveAndContinueEditCmsPage"/> + <waitForPageLoad stepKey="waitForCmsPageLoad"/> + <waitForElementVisible time="1" selector="{{CmsNewPagePageActionsSection.cmsPageTitle}}" stepKey="waitForCmsPageSaveButton"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCMSBlockActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCMSBlockActionGroup.xml new file mode 100644 index 0000000000000..2f86df70ae8c8 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCMSBlockActionGroup.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="SaveCMSBlockActionGroup"> + <annotations> + <description>Clicks on the Save button. Validates that the Save message is present and correct. PLEASE NOTE: The message is Hardcoded.</description> + </annotations> + + <waitForElementVisible selector="{{CmsNewBlockBlockActionsSection.savePage}}" stepKey="waitForSaveButton"/> + <click selector="{{CmsNewBlockBlockActionsSection.savePage}}" stepKey="clickSaveButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <see userInput="You saved the block." stepKey="seeSuccessfulSaveMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCmsPageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCmsPageActionGroup.xml new file mode 100644 index 0000000000000..5b3b0460edbdb --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveCmsPageActionGroup.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="SaveCmsPageActionGroup"> + <annotations> + <description>Clicks on the Save button. Validates that the Success Message is present.</description> + </annotations> + + <waitForElementVisible selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="waitForSplitButton"/> + <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/> + <waitForElementVisible selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="waitForSaveCmsPage"/> + <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSaveCmsPage"/> + <waitForElementVisible time="1" selector="{{CmsPagesPageActionsSection.addNewPageButton}}" stepKey="waitForCmsPageSaveButton"/> + <see userInput="You saved the page." selector="{{CmsPagesPageActionsSection.savePageSuccessMessage}}" stepKey="assertSavePageSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveImageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveImageActionGroup.xml new file mode 100644 index 0000000000000..612cc1c485b08 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SaveImageActionGroup.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="SaveImageActionGroup"> + <annotations> + <description>Clicks on Insert File in the Media Gallery.</description> + </annotations> + + <click selector="{{MediaGallerySection.InsertFile}}" stepKey="clickInsertBtn"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SelectImageFromMediaStorageActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SelectImageFromMediaStorageActionGroup.xml deleted file mode 100644 index 073c299c240e9..0000000000000 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SelectImageFromMediaStorageActionGroup.xml +++ /dev/null @@ -1,120 +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="clickBrowseBtnOnUploadPopup"> - <annotations> - <description>Clicks on the Browse button in the 'Insert/edit image' model.</description> - </annotations> - - <click selector="{{MediaGallerySection.Browse}}" stepKey="clickBrowse"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - </actionGroup> - - <actionGroup name="VerifyMediaGalleryStorageActions"> - <annotations> - <description>Validates that the Media Gallery 'Cancel'/'Create Folder' buttons are present.</description> - </annotations> - - <waitForPageLoad stepKey="waitForPageLoad1"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoading1"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoading2"/> - <see selector="{{MediaGallerySection.CancelBtn}}" userInput="Cancel" stepKey="seeCancelBtn"/> - <see selector="{{MediaGallerySection.CreateFolder}}" userInput="Create Folder" stepKey="seeCreateFolderBtn"/> - </actionGroup> - - <actionGroup name="CreateImageFolder"> - <annotations> - <description>Creates a folder in the Media Gallery based on the provided Folder.</description> - </annotations> - <arguments> - <argument name="ImageFolder" defaultValue="ImageFolder"/> - </arguments> - - <click selector="{{MediaGallerySection.CreateFolder}}" stepKey="createFolder"/> - <waitForElementVisible selector="{{MediaGallerySection.FolderName}}" stepKey="waitForPopUp"/> - <fillField selector="{{MediaGallerySection.FolderName}}" userInput="{{ImageFolder.name}}" stepKey="fillFolderName"/> - <click selector="{{MediaGallerySection.AcceptFolderName}}" stepKey="acceptFolderName"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoading3"/> - <waitForPageLoad stepKey="waitForLoadingArrowToExpand" time="15"/> - <conditionalClick selector="{{MediaGallerySection.StorageRootArrow}}" dependentSelector="{{MediaGallerySection.checkIfArrowExpand}}" stepKey="clickArrowIfClosed" visible="true"/> - <conditionalClick selector="{{MediaGallerySection.WysiwygArrow}}" dependentSelector="{{MediaGallerySection.checkIfWysiwygArrowExpand}}" stepKey="clickWysiwygArrowIfClosed" visible="true"/> - <waitForText userInput="{{ImageFolder.name}}" stepKey="waitForNewFolder"/> - <click userInput="{{ImageFolder.name}}" stepKey="clickOnCreatedFolder"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoading5"/> - </actionGroup> - - <actionGroup name="attachImage"> - <annotations> - <description>Uploads the provided Image to Media Gallery. - If you use this action group, you MUST add steps to delete the image in the "after" steps.</description> - </annotations> - <arguments> - <argument name="Image"/> - </arguments> - - <attachFile selector="{{MediaGallerySection.BrowseUploadImage}}" userInput="{{Image.value}}" stepKey="uploadImage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/> - <waitForElementVisible selector="{{MediaGallerySection.imageOrImageCopy(Image.fileName, Image.extension)}}" stepKey="waitForUploadImage"/> - </actionGroup> - - <actionGroup name="deleteImage"> - <annotations> - <description>Deletes the selected Image from the Media Gallery.</description> - </annotations> - - <see selector="{{MediaGallerySection.DeleteSelectedBtn}}" userInput="Delete Selected" stepKey="seeDeleteBtn"/> - <click selector="{{MediaGallerySection.DeleteSelectedBtn}}" stepKey="clickDeleteSelected"/> - <waitForText userInput="OK" stepKey="waitForConfirm"/> - <click selector="{{MediaGallerySection.confirmDelete}}" stepKey="confirmDelete"/> - <waitForElementNotVisible selector="{{MediaGallerySection.image(ImageUpload.file)}}" stepKey="waitForImageDeleted"/> - <dontSeeElement selector="{{MediaGallerySection.image(ImageUpload.file)}}" stepKey="dontSeeImage"/> - </actionGroup> - - <actionGroup name="saveImage"> - <annotations> - <description>Clicks on Insert File in the Media Gallery.</description> - </annotations> - - <click selector="{{MediaGallerySection.InsertFile}}" stepKey="clickInsertBtn"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/> - </actionGroup> - - <actionGroup name="fillOutUploadImagePopup"> - <annotations> - <description>Fills in the Image Description and Height fields. PLEASE NOTE: The values are Hardcoded using 'ImageUpload'.</description> - </annotations> - - <waitForElementVisible selector="{{MediaGallerySection.OkBtn}}" stepKey="waitForOkBtn"/> - <fillField selector="{{MediaGallerySection.ImageDescription}}" userInput="{{ImageUpload.content}}" stepKey="fillImageDescription"/> - <fillField selector="{{MediaGallerySection.Height}}" userInput="{{ImageUpload.height}}" stepKey="fillImageHeight"/> - <click selector="{{MediaGallerySection.OkBtn}}" stepKey="clickOkBtn"/> - <waitForPageLoad stepKey="wait3"/> - </actionGroup> - - <actionGroup name="verifyOversizeValidationMsg"> - <annotations> - <description>Validates that the Oversize validation message is present and correct.</description> - </annotations> - - <see userInput="this is oversize" stepKey="seeValidationMsg"/> - <click selector="#OK" stepKey="clickOKBtn"/> - </actionGroup> - - <actionGroup name="verifyWrongExtensionValidationMsg"> - <annotations> - <description>Validates that the Wrong Extensions validation message is present and correct.</description> - </annotations> - - <see userInput="this is wrong extension" stepKey="seeValidationMsg"/> - <click selector="#OK" stepKey="clickOKBtn"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/SetLayoutActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SetLayoutActionGroup.xml new file mode 100644 index 0000000000000..23f4cccd33118 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/SetLayoutActionGroup.xml @@ -0,0 +1,26 @@ +<?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="SetLayoutActionGroup"> + <annotations> + <description>Sets the provided option for 'Layout', under 'Design' on the Page creation/edit page. </description> + </annotations> + <arguments> + <argument name="designSection"/> + <argument name="layoutOption"/> + </arguments> + + <waitForElementVisible selector="{{designSection.DesignTab}}" stepKey="waitForDesignTabVisible"/> + <conditionalClick selector="{{designSection.DesignTab}}" dependentSelector="{{designSection.LayoutDropdown}}" visible="false" stepKey="clickOnDesignTab"/> + <waitForPageLoad stepKey="waitForPageLoadDesignTab"/> + <waitForElementVisible selector="{{designSection.LayoutDropdown}}" stepKey="waitForLayoutDropDown"/> + <selectOption selector="{{designSection.LayoutDropdown}}" userInput="{{layoutOption}}" stepKey="selectLayout"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyMagentoEntityActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyMagentoEntityActionGroup.xml new file mode 100644 index 0000000000000..717c0dbb83dd2 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyMagentoEntityActionGroup.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="VerifyMagentoEntityActionGroup"> + <annotations> + <description>Validates that the Insert Widget and Insert Variables buttons are present.</description> + </annotations> + + <seeElement selector="{{TinyMCESection.InsertWidgetIcon}}" stepKey="assertInfo15"/> + <seeElement selector="{{TinyMCESection.InsertVariableIcon}}" stepKey="assertInfo16"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyMediaGalleryStorageActionsActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyMediaGalleryStorageActionsActionGroup.xml new file mode 100644 index 0000000000000..4410be84485d0 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyMediaGalleryStorageActionsActionGroup.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="VerifyMediaGalleryStorageActionsActionGroup"> + <annotations> + <description>Validates that the Media Gallery 'Cancel'/'Create Folder' buttons are present.</description> + </annotations> + + <waitForPageLoad stepKey="waitForPageLoad1"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoading1"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoading2"/> + <see selector="{{MediaGallerySection.CancelBtn}}" userInput="Cancel" stepKey="seeCancelBtn"/> + <see selector="{{MediaGallerySection.CreateFolder}}" userInput="Create Folder" stepKey="seeCreateFolderBtn"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyOversizeValidationMsgActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyOversizeValidationMsgActionGroup.xml new file mode 100644 index 0000000000000..6a4d49fcd6eb7 --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyOversizeValidationMsgActionGroup.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="VerifyOversizeValidationMsgActionGroup"> + <annotations> + <description>Validates that the Oversize validation message is present and correct.</description> + </annotations> + + <see userInput="this is oversize" stepKey="seeValidationMsg"/> + <click selector="#OK" stepKey="clickOKBtn"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyTinyMCEActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyTinyMCEActionGroup.xml index c1682e32c28c6..7ba0fcdf0d605 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyTinyMCEActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyTinyMCEActionGroup.xml @@ -12,7 +12,7 @@ <annotations> <description>Goes to Admin CMS Page creation page. Validates that all of the Tiny MCE buttons are present.</description> </annotations> - + <seeElement selector="{{TinyMCESection.Style}}" stepKey="assertInfo2"/> <seeElement selector="{{TinyMCESection.Bold}}" stepKey="assertInfo3"/> <seeElement selector="{{TinyMCESection.Italic}}" stepKey="assertInfo4"/> @@ -27,13 +27,4 @@ <seeElement selector="{{TinyMCESection.InsertTable}}" stepKey="assertInfo13"/> <seeElement selector="{{TinyMCESection.SpecialCharacter}}" stepKey="assertInfo14"/> </actionGroup> - - <actionGroup name="VerifyMagentoEntityActionGroup"> - <annotations> - <description>Validates that the Insert Widget and Insert Variables buttons are present.</description> - </annotations> - - <seeElement selector="{{TinyMCESection.InsertWidgetIcon}}" stepKey="assertInfo15"/> - <seeElement selector="{{TinyMCESection.InsertVariableIcon}}" stepKey="assertInfo16"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyWrongExtensionValidationMsgActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyWrongExtensionValidationMsgActionGroup.xml new file mode 100644 index 0000000000000..bfd43bf0d9e1d --- /dev/null +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/VerifyWrongExtensionValidationMsgActionGroup.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="VerifyWrongExtensionValidationMsgActionGroup"> + <annotations> + <description>Validates that the Wrong Extensions validation message is present and correct.</description> + </annotations> + + <see userInput="this is wrong extension" stepKey="seeValidationMsg"/> + <click selector="#OK" stepKey="clickOKBtn"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToCMSPageTinyMCE3Test.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToCMSPageTinyMCE3Test.xml index 11bf03c1d5ee9..69f9d24699db0 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToCMSPageTinyMCE3Test.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToCMSPageTinyMCE3Test.xml @@ -47,13 +47,13 @@ <click selector="{{MediaGallerySection.browseForImage}}" stepKey="clickBrowse"/> <switchToIFrame stepKey="switchOutOfIFrame"/> <waitForPageLoad stepKey="waitForPageToLoad" /> - <actionGroup ref="CreateImageFolder" stepKey="CreateImageFolder"> + <actionGroup ref="CreateImageFolderActionGroup" stepKey="CreateImageFolder"> <argument name="ImageFolder" value="ImageFolder"/> </actionGroup> - <actionGroup ref="attachImage" stepKey="attachImage1"> + <actionGroup ref="AttachImageActionGroup" stepKey="attachImage1"> <argument name="Image" value="ImageUpload"/> </actionGroup> - <actionGroup ref="saveImage" stepKey="insertImage"/> + <actionGroup ref="SaveImageActionGroup" stepKey="insertImage"/> <!-- Switching back to the Edit/Insert Image iFrame--> <comment userInput="switching back to iFrame" stepKey="switchBackToIFrame"/> <executeJS function="document.querySelector('.clearlooks2 iframe').setAttribute('name', 'insert-image');" stepKey="makeIFrameInteractable2"/> @@ -67,4 +67,4 @@ <click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/> <see userInput="You saved the page." stepKey="seeSuccessMessage"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml index 03edc69e6d625..23f43ed21367c 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml @@ -28,27 +28,27 @@ <argument name="Block" value="$$createPreReqBlock$$"/> <argument name="CmsPage" value="$$createCMSPage$$"/> </actionGroup> - <actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage1"> + <actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage1"> <argument name="CMSBlockPage" value="$$createPreReqBlock$$"/> </actionGroup> <selectOption selector="{{BlockNewPageBasicFieldsSection.storeView}}" userInput="All Store View" stepKey="selectAllStoreView" /> <waitForElementVisible selector="{{TinyMCESection.TinyMCE4}}" stepKey="waitForTinyMCE" /> <click selector="{{TinyMCESection.InsertImageIcon}}" stepKey="clickInsertImageIcon" /> <waitForPageLoad stepKey="waitForPageLoad2" /> - <actionGroup ref="clickBrowseBtnOnUploadPopup" stepKey="clickBrowserBtn"/> - <actionGroup ref="VerifyMediaGalleryStorageActions" stepKey="VerifyMediaGalleryStorageBtn"/> - <actionGroup ref="CreateImageFolder" stepKey="CreateImageFolder"> + <actionGroup ref="ClickBrowseBtnOnUploadPopupActionGroup" stepKey="clickBrowserBtn"/> + <actionGroup ref="VerifyMediaGalleryStorageActionsActionGroup" stepKey="VerifyMediaGalleryStorageBtn"/> + <actionGroup ref="CreateImageFolderActionGroup" stepKey="CreateImageFolder"> <argument name="ImageFolder" value="ImageFolder"/> </actionGroup> - <actionGroup ref="attachImage" stepKey="attachImage1"> + <actionGroup ref="AttachImageActionGroup" stepKey="attachImage1"> <argument name="Image" value="ImageUpload"/> </actionGroup> - <actionGroup ref="deleteImage" stepKey="deleteImage"/> - <actionGroup ref="attachImage" stepKey="attachImage2"> + <actionGroup ref="DeleteImageActionGroup" stepKey="deleteImage"/> + <actionGroup ref="AttachImageActionGroup" stepKey="attachImage2"> <argument name="Image" value="ImageUpload"/> </actionGroup> - <actionGroup ref="saveImage" stepKey="insertImage"/> - <actionGroup ref="fillOutUploadImagePopup" stepKey="fillOutUploadImagePopup" /> + <actionGroup ref="SaveImageActionGroup" stepKey="insertImage"/> + <actionGroup ref="FillOutUploadImagePopupActionGroup" stepKey="fillOutUploadImagePopup" /> <click selector="{{BlockNewPagePageActionsSection.saveBlock}}" stepKey="clickSaveBlock"/> <amOnPage url="$$createCMSPage.identifier$$" stepKey="amOnPageTestPage"/> <waitForPageLoad stepKey="waitForPageLoad11" /> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml index 205850f888797..a244e4bc7f525 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGCMSTest.xml @@ -23,27 +23,27 @@ <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage"> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickExpandContent"/> <waitForElementVisible selector="{{TinyMCESection.TinyMCE4}}" stepKey="waitForTinyMCE4" /> <click selector="{{TinyMCESection.InsertImageIcon}}" stepKey="clickInsertImageIcon" /> <waitForPageLoad stepKey="waitForPageLoad" /> - <actionGroup ref="clickBrowseBtnOnUploadPopup" stepKey="clickBrowserBtn"/> - <actionGroup ref="VerifyMediaGalleryStorageActions" stepKey="VerifyMediaGalleryStorageBtn"/> - <actionGroup ref="CreateImageFolder" stepKey="CreateImageFolder"> + <actionGroup ref="ClickBrowseBtnOnUploadPopupActionGroup" stepKey="clickBrowserBtn"/> + <actionGroup ref="VerifyMediaGalleryStorageActionsActionGroup" stepKey="VerifyMediaGalleryStorageBtn"/> + <actionGroup ref="CreateImageFolderActionGroup" stepKey="CreateImageFolder"> <argument name="ImageFolder" value="ImageFolder"/> </actionGroup> - <actionGroup ref="attachImage" stepKey="attachImage1"> + <actionGroup ref="AttachImageActionGroup" stepKey="attachImage1"> <argument name="Image" value="ImageUpload3"/> </actionGroup> - <actionGroup ref="deleteImage" stepKey="deleteImage"/> - <actionGroup ref="attachImage" stepKey="attachImage2"> + <actionGroup ref="DeleteImageActionGroup" stepKey="deleteImage"/> + <actionGroup ref="AttachImageActionGroup" stepKey="attachImage2"> <argument name="Image" value="ImageUpload3"/> </actionGroup> - <actionGroup ref="saveImage" stepKey="insertImage"/> - <actionGroup ref="fillOutUploadImagePopup" stepKey="fillOutUploadImagePopup" /> + <actionGroup ref="SaveImageActionGroup" stepKey="insertImage"/> + <actionGroup ref="FillOutUploadImagePopupActionGroup" stepKey="fillOutUploadImagePopup" /> <click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/> <fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="$$createCMSPage.identifier$$" stepKey="fillFieldUrlKey"/> <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml index ce34a8d09c302..4ff5f314662b3 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddVariableToWYSIWYGBlockTest.xml @@ -38,7 +38,7 @@ <argument name="Block" value="$$createPreReqBlock$$"/> <argument name="CmsPage" value="$$createCMSPage$$"/> </actionGroup> - <actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage1"> + <actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage1"> <argument name="CMSBlockPage" value="$$createPreReqBlock$$"/> </actionGroup> <selectOption selector="{{BlockNewPageBasicFieldsSection.storeView}}" userInput="All Store View" stepKey="selectAllStoreView" /> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml index ad5e769c61be4..0253e62b40a56 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGBlockTest.xml @@ -24,7 +24,7 @@ <actionGroup ref="EnabledWYSIWYG" stepKey="enableWYSIWYG"/> <actionGroup ref="SwitchToVersion4ActionGroup" stepKey="switchToTinyMCE4" /> </before> - <actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage"> + <actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage"> <argument name="CMSBlockPage" value="$$createPreReqBlock$$"/> </actionGroup> <selectOption selector="{{BlockNewPageBasicFieldsSection.storeView}}" userInput="All Store View" stepKey="selectAllStoreView" /> @@ -45,7 +45,7 @@ <waitForElementNotVisible selector="{{WidgetSection.InsertWidgetTitle}}" stepKey="waitForSlideOutCloses1" /> <click selector="{{BlockNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitButton"/> <click selector="{{BlockNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveBlock"/> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage"> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <waitForElementVisible selector="{{TinyMCESection.TinyMCE4}}" stepKey="waitForTinyMCE4"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageTest.xml index b7c7e4a4212fe..6d5adc65fb1df 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageTest.xml @@ -110,7 +110,7 @@ <see userInput="You duplicated the page." stepKey="seeDuplicatedPageMsg"/> <!--Verify duplicated CMS Page--> <seeElement selector="{{BlockNewPageBasicFieldsSection.isActive('0')}}" stepKey="seeBlockNotEnable" /> - <actionGroup ref="AssertCMSPageContent" stepKey="assertContent"/> + <actionGroup ref="AssertCMSPageContentActionGroup" stepKey="assertContent"/> <click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandSplitBtn3" /> <click selector="{{CmsNewPagePageActionsSection.saveAndClose}}" stepKey="clickSaveAndClose"/> <see userInput="You saved the page." stepKey="seeSavedCMSPageMsgOnGrid"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminMediaGalleryPopupUploadImagesWithoutErrorTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminMediaGalleryPopupUploadImagesWithoutErrorTest.xml index bc1688c9d692b..ff389a6ce2965 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminMediaGalleryPopupUploadImagesWithoutErrorTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminMediaGalleryPopupUploadImagesWithoutErrorTest.xml @@ -37,7 +37,7 @@ </after> <!--Open created block page and add image--> <comment userInput="Open create block page and add image" stepKey="commentOpenBlockPage"/> - <actionGroup ref="navigateToCreatedCMSBlockPage" stepKey="navigateToCreatedCMSBlockPage1"> + <actionGroup ref="NavigateToCreatedCMSBlockPageActionGroup" stepKey="navigateToCreatedCMSBlockPage1"> <argument name="CMSBlockPage" value="$$createBlock$$"/> </actionGroup> <actionGroup ref="AdminAddImageToCMSBlockContent" stepKey="addImage"> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml index ce093144e6a2a..cfb765656dbd1 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/CheckOrderOfProdsInWidgetOnCMSPageTest.xml @@ -41,7 +41,7 @@ <deleteData createDataKey="createCMSPage" stepKey="deletePreReqCMSPage"/> <actionGroup ref="logout" stepKey="logoutOfAdmin"/> </after> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage1"> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage1"> <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <conditionalClick selector="{{CmsNewPagePageContentSection.header}}" @@ -99,7 +99,7 @@ <argument name="product_1" value="$$product1$$"/> <argument name="product_2" value="$$product2$$"/> </actionGroup> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage2"> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage2"> <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <conditionalClick selector="{{CmsNewPagePageContentSection.header}}" diff --git a/app/code/Magento/Cms/Test/Mftf/Test/StoreViewLanguageCorrectSwitchTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/StoreViewLanguageCorrectSwitchTest.xml index d4796b2ef7d43..6569c07f4580a 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/StoreViewLanguageCorrectSwitchTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/StoreViewLanguageCorrectSwitchTest.xml @@ -41,7 +41,7 @@ </actionGroup> <!-- Add StoreView To Cms Page--> - <actionGroup ref="AddStoreViewToCmsPage" stepKey="gotToCmsPage"> + <actionGroup ref="AddStoreViewToCmsPageActionGroup" stepKey="gotToCmsPage"> <argument name="CMSPage" value="$$createSecondCmsPage$$"/> <argument name="storeViewName" value="{{NewStoreViewData.name}}"/> </actionGroup> diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml index 0371c0265d149..a62933d7ecb9e 100644 --- a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml +++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminAddImageToWYSIWYGNewsletterTest.xml @@ -33,16 +33,16 @@ <waitForElementVisible selector="{{NewsletterWYSIWYGSection.TinyMCE4}}" stepKey="waitForTinyMCE4"/> <click selector="{{TinyMCESection.InsertImageIcon}}" stepKey="clickInsertImageIcon" /> <waitForPageLoad stepKey="waitForPageLoad" /> - <actionGroup ref="clickBrowseBtnOnUploadPopup" stepKey="clickBrowserBtn"/> - <actionGroup ref="VerifyMediaGalleryStorageActions" stepKey="VerifyMediaGalleryStorageBtn"/> - <actionGroup ref="CreateImageFolder" stepKey="CreateImageFolder"> + <actionGroup ref="ClickBrowseBtnOnUploadPopupActionGroup" stepKey="clickBrowserBtn"/> + <actionGroup ref="VerifyMediaGalleryStorageActionsActionGroup" stepKey="VerifyMediaGalleryStorageBtn"/> + <actionGroup ref="CreateImageFolderActionGroup" stepKey="CreateImageFolder"> <argument name="ImageFolder" value="ImageFolder"/> </actionGroup> - <actionGroup ref="attachImage" stepKey="attachImage1"> + <actionGroup ref="AttachImageActionGroup" stepKey="attachImage1"> <argument name="Image" value="ImageUpload3"/> </actionGroup> - <actionGroup ref="saveImage" stepKey="insertImage"/> - <actionGroup ref="fillOutUploadImagePopup" stepKey="fillOutUploadImagePopup" /> + <actionGroup ref="SaveImageActionGroup" stepKey="insertImage"/> + <actionGroup ref="FillOutUploadImagePopupActionGroup" stepKey="fillOutUploadImagePopup" /> <click selector="{{BasicFieldNewsletterSection.save}}" stepKey="clickSaveTemplate"/> <waitForPageLoad stepKey="waitForPageLoad10" /> <!--Preview the newsletter template--> diff --git a/app/code/Magento/Theme/Test/Mftf/Test/AdminDesignConfigMediaGalleryImageUploadTest.xml b/app/code/Magento/Theme/Test/Mftf/Test/AdminDesignConfigMediaGalleryImageUploadTest.xml index f46328ac151b1..201f8eba3376b 100644 --- a/app/code/Magento/Theme/Test/Mftf/Test/AdminDesignConfigMediaGalleryImageUploadTest.xml +++ b/app/code/Magento/Theme/Test/Mftf/Test/AdminDesignConfigMediaGalleryImageUploadTest.xml @@ -35,14 +35,14 @@ <!--Upload Image--> <comment userInput="Upload Image" stepKey="uploadImageComment"/> <click selector="{{AdminDesignConfigSection.selectFromGalleryByFieldsetName('Head')}}" stepKey="openMediaGallery"/> - <actionGroup ref="VerifyMediaGalleryStorageActions" stepKey="verifyMediaGalleryStorageBtn"/> + <actionGroup ref="VerifyMediaGalleryStorageActionsActionGroup" stepKey="verifyMediaGalleryStorageBtn"/> <actionGroup ref="NavigateToMediaFolderActionGroup" stepKey="navigateToFolder"> <argument name="FolderName" value="Storage Root"/> </actionGroup> - <actionGroup ref="attachImage" stepKey="selectImageFromMediaStorage"> + <actionGroup ref="AttachImageActionGroup" stepKey="selectImageFromMediaStorage"> <argument name="Image" value="ImageUpload3"/> </actionGroup> - <actionGroup ref="saveImage" stepKey="insertImage"/> + <actionGroup ref="SaveImageActionGroup" stepKey="insertImage"/> <click selector="{{AdminDesignConfigSection.saveConfiguration}}" stepKey="saveConfiguration"/> <waitForElementVisible selector="{{AdminDesignConfigSection.successNotification}}" stepKey="waitForSuccessNotification"/> <waitForPageLoad stepKey="waitForPageloadSuccess"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml index 358aa58aba0f7..3329dd61e0352 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml @@ -30,7 +30,7 @@ </after> <!--Open CMS Edit Page and Get the CMS ID --> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage"> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> @@ -60,24 +60,24 @@ </actionGroup> <!-- Assert Updated Request Path redirects to the CMS Page on Store Front --> - <actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFront"> + <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToTheStoreFront"> <argument name="page" value="{{defaultCmsPage.title}}"/> </actionGroup> <!-- Assert updated CMS redirect in Store Front --> - <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage"> + <actionGroup ref="AssertStoreFrontCMSPageActionGroup" stepKey="assertCMSPage"> <argument name="cmsTitle" value="$$createCMSPage.title$$"/> <argument name="cmsContent" value="$$createCMSPage.content$$"/> <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> </actionGroup> <!-- Assert initial request path directs to the CMS Page on Store Front --> - <actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFront1"> + <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToTheStoreFront1"> <argument name="page" value="$$createCMSPage.identifier$$"/> </actionGroup> <!-- Assert initial CMS redirect in Store Front --> - <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage1"> + <actionGroup ref="AssertStoreFrontCMSPageActionGroup" stepKey="assertCMSPage1"> <argument name="cmsTitle" value="$$createCMSPage.title$$"/> <argument name="cmsContent" value="$$createCMSPage.content$$"/> <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml index e6ee9b484059d..cf66d7a06f0d0 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml @@ -30,7 +30,7 @@ </after> <!--Open CMS Edit Page and Get the CMS ID --> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage"> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> @@ -60,24 +60,24 @@ </actionGroup> <!-- Assert Updated Request Path redirects to the CMS Page on Store Front --> - <actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFront"> + <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToTheStoreFront"> <argument name="page" value="{{defaultCmsPage.title}}"/> </actionGroup> <!--Assert updated CMS redirect in Store Front--> - <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage"> + <actionGroup ref="AssertStoreFrontCMSPageActionGroup" stepKey="assertCMSPage"> <argument name="cmsTitle" value="$$createCMSPage.title$$"/> <argument name="cmsContent" value="$$createCMSPage.content$$"/> <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> </actionGroup> <!-- Assert initial request path directs to the CMS Page on Store Front --> - <actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFront1"> + <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToTheStoreFront1"> <argument name="page" value="$$createCMSPage.identifier$$"/> </actionGroup> <!--Assert initial CMS redirect in Store Front--> - <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage1"> + <actionGroup ref="AssertStoreFrontCMSPageActionGroup" stepKey="assertCMSPage1"> <argument name="cmsTitle" value="$$createCMSPage.title$$"/> <argument name="cmsContent" value="$$createCMSPage.content$$"/> <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> From acd42b86af5425d799750f0ceb6c529cd17abba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20K=C3=B6pcke?= <marco.koepcke@tudock.de> Date: Thu, 28 Nov 2019 13:15:59 +0100 Subject: [PATCH 342/595] magento/magento2#24229: Don't disable FPC for maintenance, instead don't set public cache headers - Removes the observer for disabling and re-enabling the FPC during maintenande mode switch - Disables setting public cache headers, if maintenance mode is enabled - phpcs:ignore entries were added in places where no actual code was changed by this commit, but static tests failed --- .../PageCache/Model/Layout/LayoutPlugin.php | 16 +- .../Observer/SwitchPageCacheOnMaintenance.php | 108 ------------ .../PageCacheState.php | 1 + .../Unit/Model/Layout/LayoutPluginTest.php | 26 ++- .../SwitchPageCacheOnMaintenanceTest.php | 164 ------------------ app/code/Magento/PageCache/etc/events.xml | 3 - 6 files changed, 33 insertions(+), 285 deletions(-) delete mode 100644 app/code/Magento/PageCache/Observer/SwitchPageCacheOnMaintenance.php delete mode 100644 app/code/Magento/PageCache/Test/Unit/Observer/SwitchPageCacheOnMaintenanceTest.php diff --git a/app/code/Magento/PageCache/Model/Layout/LayoutPlugin.php b/app/code/Magento/PageCache/Model/Layout/LayoutPlugin.php index ef85d6faf2371..68cd0eb8cc1e9 100644 --- a/app/code/Magento/PageCache/Model/Layout/LayoutPlugin.php +++ b/app/code/Magento/PageCache/Model/Layout/LayoutPlugin.php @@ -20,22 +20,31 @@ class LayoutPlugin */ protected $response; + /** + * @var \Magento\Framework\App\MaintenanceMode + */ + private $maintenanceMode; + /** * Constructor * * @param \Magento\Framework\App\ResponseInterface $response - * @param \Magento\PageCache\Model\Config $config + * @param \Magento\PageCache\Model\Config $config + * @param \Magento\Framework\App\MaintenanceMode $maintenanceMode */ public function __construct( \Magento\Framework\App\ResponseInterface $response, - \Magento\PageCache\Model\Config $config + \Magento\PageCache\Model\Config $config, + \Magento\Framework\App\MaintenanceMode $maintenanceMode ) { $this->response = $response; $this->config = $config; + $this->maintenanceMode = $maintenanceMode; } /** * Set appropriate Cache-Control headers + * * We have to set public headers in order to tell Varnish and Builtin app that page should be cached * * @param \Magento\Framework\View\Layout $subject @@ -44,7 +53,7 @@ public function __construct( */ public function afterGenerateXml(\Magento\Framework\View\Layout $subject, $result) { - if ($subject->isCacheable() && $this->config->isEnabled()) { + if ($subject->isCacheable() && !$this->maintenanceMode->isOn() && $this->config->isEnabled()) { $this->response->setPublicHeaders($this->config->getTtl()); } return $result; @@ -68,6 +77,7 @@ public function afterGetOutput(\Magento\Framework\View\Layout $subject, $result) if ($isVarnish && $isEsiBlock) { continue; } + // phpcs:ignore $tags = array_merge($tags, $block->getIdentities()); } } diff --git a/app/code/Magento/PageCache/Observer/SwitchPageCacheOnMaintenance.php b/app/code/Magento/PageCache/Observer/SwitchPageCacheOnMaintenance.php deleted file mode 100644 index 7017da27eee93..0000000000000 --- a/app/code/Magento/PageCache/Observer/SwitchPageCacheOnMaintenance.php +++ /dev/null @@ -1,108 +0,0 @@ -<?php -/** - * - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -declare(strict_types=1); - -namespace Magento\PageCache\Observer; - -use Magento\Framework\Event\ObserverInterface; -use Magento\Framework\Event\Observer; -use Magento\Framework\App\Cache\Manager; -use Magento\PageCache\Model\Cache\Type as PageCacheType; -use Magento\PageCache\Observer\SwitchPageCacheOnMaintenance\PageCacheState; - -/** - * Switch Page Cache on maintenance. - */ -class SwitchPageCacheOnMaintenance implements ObserverInterface -{ - /** - * @var Manager - */ - private $cacheManager; - - /** - * @var PageCacheState - */ - private $pageCacheStateStorage; - - /** - * @param Manager $cacheManager - * @param PageCacheState $pageCacheStateStorage - */ - public function __construct(Manager $cacheManager, PageCacheState $pageCacheStateStorage) - { - $this->cacheManager = $cacheManager; - $this->pageCacheStateStorage = $pageCacheStateStorage; - } - - /** - * Switches Full Page Cache. - * - * Depending on enabling or disabling Maintenance Mode it turns off or restores Full Page Cache state. - * - * @param Observer $observer - * @return void - */ - public function execute(Observer $observer): void - { - if ($observer->getData('isOn')) { - $this->pageCacheStateStorage->save($this->isFullPageCacheEnabled()); - $this->turnOffFullPageCache(); - } else { - $this->restoreFullPageCacheState(); - } - } - - /** - * Turns off Full Page Cache. - * - * @return void - */ - private function turnOffFullPageCache(): void - { - if (!$this->isFullPageCacheEnabled()) { - return; - } - - $this->cacheManager->clean([PageCacheType::TYPE_IDENTIFIER]); - $this->cacheManager->setEnabled([PageCacheType::TYPE_IDENTIFIER], false); - } - - /** - * Full Page Cache state. - * - * @return bool - */ - private function isFullPageCacheEnabled(): bool - { - $cacheStatus = $this->cacheManager->getStatus(); - - if (!array_key_exists(PageCacheType::TYPE_IDENTIFIER, $cacheStatus)) { - return false; - } - - return (bool)$cacheStatus[PageCacheType::TYPE_IDENTIFIER]; - } - - /** - * Restores Full Page Cache state. - * - * Returns FPC to previous state that was before maintenance mode turning on. - * - * @return void - */ - private function restoreFullPageCacheState(): void - { - $storedPageCacheState = $this->pageCacheStateStorage->isEnabled(); - $this->pageCacheStateStorage->flush(); - - if ($storedPageCacheState) { - $this->cacheManager->setEnabled([PageCacheType::TYPE_IDENTIFIER], true); - } - } -} diff --git a/app/code/Magento/PageCache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php b/app/code/Magento/PageCache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php index e4cadf728f2ea..91a305003002e 100644 --- a/app/code/Magento/PageCache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php +++ b/app/code/Magento/PageCache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php @@ -14,6 +14,7 @@ /** * Page Cache state. + * @deprecated Originally used by now removed observer SwitchPageCacheOnMaintenance */ class PageCacheState { diff --git a/app/code/Magento/PageCache/Test/Unit/Model/Layout/LayoutPluginTest.php b/app/code/Magento/PageCache/Test/Unit/Model/Layout/LayoutPluginTest.php index 6c39fe1e7979c..e2bc7f237ab0a 100644 --- a/app/code/Magento/PageCache/Test/Unit/Model/Layout/LayoutPluginTest.php +++ b/app/code/Magento/PageCache/Test/Unit/Model/Layout/LayoutPluginTest.php @@ -27,6 +27,11 @@ class LayoutPluginTest extends \PHPUnit\Framework\TestCase */ protected $configMock; + /** + * @var \Magento\Framework\App\MaintenanceMode|\PHPUnit\Framework\MockObject\MockObject + */ + private $maintenanceModeMock; + protected function setUp() { $this->layoutMock = $this->getMockForAbstractClass( @@ -40,27 +45,33 @@ protected function setUp() ); $this->responseMock = $this->createMock(\Magento\Framework\App\Response\Http::class); $this->configMock = $this->createMock(\Magento\PageCache\Model\Config::class); + $this->maintenanceModeMock = $this->createMock(\Magento\Framework\App\MaintenanceMode::class); $this->model = new \Magento\PageCache\Model\Layout\LayoutPlugin( $this->responseMock, - $this->configMock + $this->configMock, + $this->maintenanceModeMock ); } /** * @param $cacheState * @param $layoutIsCacheable + * @param $maintenanceModeIsEnabled + * * @dataProvider afterGenerateXmlDataProvider */ - public function testAfterGenerateXml($cacheState, $layoutIsCacheable) + public function testAfterGenerateXml($cacheState, $layoutIsCacheable, $maintenanceModeIsEnabled) { $maxAge = 180; $result = 'test'; $this->layoutMock->expects($this->once())->method('isCacheable')->will($this->returnValue($layoutIsCacheable)); $this->configMock->expects($this->any())->method('isEnabled')->will($this->returnValue($cacheState)); + $this->maintenanceModeMock->expects($this->any())->method('isOn') + ->will($this->returnValue($maintenanceModeIsEnabled)); - if ($layoutIsCacheable && $cacheState) { + if ($layoutIsCacheable && $cacheState && !$maintenanceModeIsEnabled) { $this->configMock->expects($this->once())->method('getTtl')->will($this->returnValue($maxAge)); $this->responseMock->expects($this->once())->method('setPublicHeaders')->with($maxAge); } else { @@ -76,10 +87,11 @@ public function testAfterGenerateXml($cacheState, $layoutIsCacheable) public function afterGenerateXmlDataProvider() { return [ - 'Full_cache state is true, Layout is cache-able' => [true, true], - 'Full_cache state is true, Layout is not cache-able' => [true, false], - 'Full_cache state is false, Layout is not cache-able' => [false, false], - 'Full_cache state is false, Layout is cache-able' => [false, true] + 'Full_cache state is true, Layout is cache-able' => [true, true, false], + 'Full_cache state is true, Layout is not cache-able' => [true, false, false], + 'Full_cache state is false, Layout is not cache-able' => [false, false, false], + 'Full_cache state is false, Layout is cache-able' => [false, true, false], + 'Full_cache state is true, Layout is cache-able, Maintenance mode is enabled' => [true, true, true], ]; } diff --git a/app/code/Magento/PageCache/Test/Unit/Observer/SwitchPageCacheOnMaintenanceTest.php b/app/code/Magento/PageCache/Test/Unit/Observer/SwitchPageCacheOnMaintenanceTest.php deleted file mode 100644 index 2dbb815c70925..0000000000000 --- a/app/code/Magento/PageCache/Test/Unit/Observer/SwitchPageCacheOnMaintenanceTest.php +++ /dev/null @@ -1,164 +0,0 @@ -<?php -/** - * - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -declare(strict_types=1); - -namespace Magento\PageCache\Test\Unit\Observer; - -use PHPUnit\Framework\TestCase; -use Magento\PageCache\Observer\SwitchPageCacheOnMaintenance; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -use Magento\Framework\App\Cache\Manager; -use Magento\Framework\Event\Observer; -use Magento\PageCache\Model\Cache\Type as PageCacheType; -use Magento\PageCache\Observer\SwitchPageCacheOnMaintenance\PageCacheState; - -/** - * SwitchPageCacheOnMaintenance observer test. - */ -class SwitchPageCacheOnMaintenanceTest extends TestCase -{ - /** - * @var SwitchPageCacheOnMaintenance - */ - private $model; - - /** - * @var Manager|\PHPUnit\Framework\MockObject\MockObject - */ - private $cacheManager; - - /** - * @var PageCacheState|\PHPUnit\Framework\MockObject\MockObject - */ - private $pageCacheStateStorage; - - /** - * @var Observer|\PHPUnit\Framework\MockObject\MockObject - */ - private $observer; - - /** - * @inheritdoc - */ - protected function setUp(): void - { - $objectManager = new ObjectManager($this); - $this->cacheManager = $this->createMock(Manager::class); - $this->pageCacheStateStorage = $this->createMock(PageCacheState::class); - $this->observer = $this->createMock(Observer::class); - - $this->model = $objectManager->getObject(SwitchPageCacheOnMaintenance::class, [ - 'cacheManager' => $this->cacheManager, - 'pageCacheStateStorage' => $this->pageCacheStateStorage, - ]); - } - - /** - * Tests execute when setting maintenance mode to on. - * - * @param array $cacheStatus - * @param bool $cacheState - * @param int $flushCacheCalls - * @return void - * @dataProvider enablingPageCacheStateProvider - */ - public function testExecuteWhileMaintenanceEnabling( - array $cacheStatus, - bool $cacheState, - int $flushCacheCalls - ): void { - $this->observer->method('getData') - ->with('isOn') - ->willReturn(true); - $this->cacheManager->method('getStatus') - ->willReturn($cacheStatus); - - // Page Cache state will be stored. - $this->pageCacheStateStorage->expects($this->once()) - ->method('save') - ->with($cacheState); - - // Page Cache will be cleaned and disabled - $this->cacheManager->expects($this->exactly($flushCacheCalls)) - ->method('clean') - ->with([PageCacheType::TYPE_IDENTIFIER]); - $this->cacheManager->expects($this->exactly($flushCacheCalls)) - ->method('setEnabled') - ->with([PageCacheType::TYPE_IDENTIFIER], false); - - $this->model->execute($this->observer); - } - - /** - * Tests execute when setting Maintenance Mode to off. - * - * @param bool $storedCacheState - * @param int $enableCacheCalls - * @return void - * @dataProvider disablingPageCacheStateProvider - */ - public function testExecuteWhileMaintenanceDisabling(bool $storedCacheState, int $enableCacheCalls): void - { - $this->observer->method('getData') - ->with('isOn') - ->willReturn(false); - - $this->pageCacheStateStorage->method('isEnabled') - ->willReturn($storedCacheState); - - // Nullify Page Cache state. - $this->pageCacheStateStorage->expects($this->once()) - ->method('flush'); - - // Page Cache will be enabled. - $this->cacheManager->expects($this->exactly($enableCacheCalls)) - ->method('setEnabled') - ->with([PageCacheType::TYPE_IDENTIFIER]); - - $this->model->execute($this->observer); - } - - /** - * Page Cache state data provider. - * - * @return array - */ - public function enablingPageCacheStateProvider(): array - { - return [ - 'page_cache_is_enable' => [ - 'cache_status' => [PageCacheType::TYPE_IDENTIFIER => 1], - 'cache_state' => true, - 'flush_cache_calls' => 1, - ], - 'page_cache_is_missing_in_system' => [ - 'cache_status' => [], - 'cache_state' => false, - 'flush_cache_calls' => 0, - ], - 'page_cache_is_disable' => [ - 'cache_status' => [PageCacheType::TYPE_IDENTIFIER => 0], - 'cache_state' => false, - 'flush_cache_calls' => 0, - ], - ]; - } - - /** - * Page Cache state data provider. - * - * @return array - */ - public function disablingPageCacheStateProvider(): array - { - return [ - ['stored_cache_state' => true, 'enable_cache_calls' => 1], - ['stored_cache_state' => false, 'enable_cache_calls' => 0], - ]; - } -} diff --git a/app/code/Magento/PageCache/etc/events.xml b/app/code/Magento/PageCache/etc/events.xml index 3f0a2532ae60a..7584f5f36d69c 100644 --- a/app/code/Magento/PageCache/etc/events.xml +++ b/app/code/Magento/PageCache/etc/events.xml @@ -57,7 +57,4 @@ <event name="customer_logout"> <observer name="FlushFormKey" instance="Magento\PageCache\Observer\FlushFormKey"/> </event> - <event name="maintenance_mode_changed"> - <observer name="page_cache_switcher_for_maintenance" instance="Magento\PageCache\Observer\SwitchPageCacheOnMaintenance"/> - </event> </config> From d1b81aa514224b25f1c0fea43400a6ab24e1caeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20K=C3=B6pcke?= <marco.koepcke@tudock.de> Date: Fri, 29 Nov 2019 11:38:55 +0100 Subject: [PATCH 343/595] magento/magento2#24229: Code Style fix --- .../Observer/SwitchPageCacheOnMaintenance/PageCacheState.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/PageCache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php b/app/code/Magento/PageCache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php index 91a305003002e..5c52aa055ef16 100644 --- a/app/code/Magento/PageCache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php +++ b/app/code/Magento/PageCache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php @@ -14,6 +14,7 @@ /** * Page Cache state. + * * @deprecated Originally used by now removed observer SwitchPageCacheOnMaintenance */ class PageCacheState From 50805d4bf94ab71230d5c42d005075b67db68bc5 Mon Sep 17 00:00:00 2001 From: Sergii Ivashchenko <serg.ivashchenko@gmail.com> Date: Fri, 29 Nov 2019 11:39:42 +0100 Subject: [PATCH 344/595] Fixed static tests --- .../Test/Unit/Model/DataExtractorTest.php | 46 +------------------ 1 file changed, 2 insertions(+), 44 deletions(-) diff --git a/app/code/Magento/MediaGallery/Test/Unit/Model/DataExtractorTest.php b/app/code/Magento/MediaGallery/Test/Unit/Model/DataExtractorTest.php index 30f355a9298fe..7d57f32449f56 100644 --- a/app/code/Magento/MediaGallery/Test/Unit/Model/DataExtractorTest.php +++ b/app/code/Magento/MediaGallery/Test/Unit/Model/DataExtractorTest.php @@ -78,49 +78,7 @@ protected function checkValues(array $expectedData, array $data, $model) public function assetProvider() { return [ - 'Test case asset 1' => [ - Asset::class, - null, - [ - 'id' => [ - 'value' => 1, - 'method' => 'getId', - ], - 'path' => [ - 'value' => 'path', - 'method' => 'getPath', - ], - 'title' => [ - 'value' => 'title', - 'method' => 'getTitle', - ], - 'source' => [ - 'value' => 'source', - 'method' => 'getSource', - ], - 'content_type' => [ - 'value' => 'content_type', - 'method' => 'getContentType', - ], - 'width' => [ - 'value' => 1, - 'method' => 'getWidth', - ], - 'height' => [ - 'value' => 2, - 'method' => 'getHeight', - ], - 'created_at' => [ - 'value' => '2019-11-28 10:40:09', - 'method' => 'getCreatedAt', - ], - 'updated_at' => [ - 'value' => '2019-11-28 10:41:08', - 'method' => 'getUpdatedAt', - ], - ], - ], - 'Test case asset 2' => [ + 'Asset conversion with interface' => [ Asset::class, AssetInterface::class, [ @@ -162,7 +120,7 @@ public function assetProvider() ], ], ], - 'Test case keyword 1' => [ + 'Keyword conversion without interface' => [ Keyword::class, null, [ From a5f6167b9f8a35ebdbdd55e5d477c4802fdac51c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Fri, 29 Nov 2019 12:20:08 +0100 Subject: [PATCH 345/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../Test/AdminApplyTierPriceToProductTest.xml | 2 +- ...inConfigureProductImagePlaceholderTest.xml | 8 +- ...IncrementsWorkWithDecimalinventoryTest.xml | 2 +- .../AssertMiniCartEmptyActionGroup.xml | 20 + ...ertOneProductNameInMiniCartActionGroup.xml | 23 + ...ckoutPaymentSummarySubtotalActionGroup.xml | 19 + ...CheckoutPaymentSummaryTotalActionGroup.xml | 19 + ...tPaymentSummaryTotalMissingActionGroup.xml | 15 + ...sertStorefrontMiniCartItemsActionGroup.xml | 13 - ...iniCartProductDetailsAbsentActionGroup.xml | 23 + .../ChangeSummaryQuoteAddressActionGroup.xml | 25 + ...eckBillingAddressInCheckoutActionGroup.xml | 29 ++ ...BillingAddressOnPaymentPageActionGroup.xml | 29 ++ ...CheckOrderSummaryInCheckoutActionGroup.xml | 28 ++ ...kProductInCheckoutCartItemsActionGroup.xml | 25 + ...edShippingAddressInCheckoutActionGroup.xml | 28 ++ ...ShipToInformationInCheckoutActionGroup.xml | 29 ++ ...eckShippingMethodInCheckoutActionGroup.xml | 22 + ...lsSortOrderInSummarySectionActionGroup.xml | 22 + .../Mftf/ActionGroup/CheckoutActionGroup.xml | 433 ------------------ .../CheckoutPlaceOrderActionGroup.xml | 25 + ...electCheckMoneyOrderPaymentActionGroup.xml | 21 + ...electFlatRateShippingMethodActionGroup.xml | 20 + .../ClickPlaceOrderActionGroup.xml | 20 + ...ViewAndEditCartFromMiniCartActionGroup.xml | 23 + ...CheckoutShippingAddressFormActionGroup.xml | 5 +- ...tShippingAddressWithCountryActionGroup.xml | 14 + .../GoToCheckoutFromCartActionGroup.xml | 22 + .../GoToCheckoutFromMinicartActionGroup.xml | 21 + ...eckoutFillNewBillingAddressActionGroup.xml | 70 --- ...illShippingNoWaitForPaymentActionGroup.xml | 19 + ...ckoutFillingShippingSectionActionGroup.xml | 38 ++ ...ngSectionUnavailablePaymentActionGroup.xml | 36 ++ ...hippingSectionWithoutRegionActionGroup.xml | 35 ++ ...entAndFillNewBillingAddressActionGroup.xml | 22 + ...untryOptionForPaymentMethodActionGroup.xml | 22 + ...eckoutFillNewBillingAddressActionGroup.xml | 34 ++ ...dressFieldWithoutStateFieldActionGroup.xml | 19 + ...hippingSectionWithoutRegionActionGroup.xml | 35 ++ ...ckoutFillingShippingSectionActionGroup.xml | 34 ++ .../PlaceOrderWithLoggedUserActionGroup.xml | 31 ++ .../RemoveProductFromMiniCartActionGroup.xml | 27 ++ ...ontAddCategoryProductToCartActionGroup.xml | 28 ++ ...ryProductToCartWithQuantityActionGroup.xml | 32 ++ .../StorefrontAddProductToCartActionGroup.xml | 26 ++ .../StorefrontCheckCartActionGroup.xml | 35 ++ ...frontCheckCartSimpleProductActionGroup.xml | 24 + ...rtTotalWithDiscountCategoryActionGroup.xml | 21 + ...eckoutFillNewBillingAddressActionGroup.xml | 15 + ...koutForwardFromShippingStepActionGroup.xml | 18 + .../StorefrontMiniCartActionGroup.xml | 65 --- ...refrontOpenCartFromMinicartActionGroup.xml | 21 + ...nicartAndCheckSimpleProductActionGroup.xml | 23 + .../StorefrontProductCartActionGroup.xml | 161 ------- .../StorefrontSignOutActionGroup.xml | 21 + ...CheckoutPaymentOrderSummaryActionGroup.xml | 23 - ...erifyTopDestinationsCountryActionGroup.xml | 23 + ...rCheckoutAddressPopupFieldsActionGroup.xml | 30 ++ .../CheckNotVisibleProductInMinicartTest.xml | 6 +- .../Test/CheckoutSpecificDestinationsTest.xml | 4 +- ...ddressShouldBeCheckedOnPaymentPageTest.xml | 2 +- ...ckoutAsCustomerUsingDefaultAddressTest.xml | 2 +- ...eCheckoutAsCustomerUsingNewAddressTest.xml | 2 +- ...utAsCustomerUsingNonDefaultAddressTest.xml | 2 +- .../OnePageCheckoutUsingSignInLinkTest.xml | 2 +- ...OnePageCheckoutWithAllProductTypesTest.xml | 2 +- ...CartAndMiniShoppingCartPerCustomerTest.xml | 4 +- ...ateShoppingCartWhileUpdateMinicartTest.xml | 2 +- ...BundleDynamicProductToShoppingCartTest.xml | 2 +- ...dConfigurableProductToShoppingCartTest.xml | 2 +- ...dDownloadableProductToShoppingCartTest.xml | 2 +- ...ontAddGroupedProductToShoppingCartTest.xml | 2 +- ...MultiSelectOptionToTheShoppingCartTest.xml | 2 +- ...ultiSelectOptionsToTheShoppingCartTest.xml | 2 +- ...ingAddressAndProductWithTierPricesTest.xml | 4 +- ...ssAndRegisterCustomerAfterCheckoutTest.xml | 4 +- ...ntCheckoutWithSpecialPriceProductsTest.xml | 4 +- ...erCheckoutDisabledProductAndCouponTest.xml | 2 +- ...OnLoginWhenGuestCheckoutIsDisabledTest.xml | 4 +- ...egistrationAndDisableGuestCheckoutTest.xml | 6 +- ...refrontCustomerLoginDuringCheckoutTest.xml | 2 +- ...OrderWithNewAddressesThatWasEditedTest.xml | 2 +- ...eBundleProductFromMiniShoppingCartTest.xml | 6 +- ...gurableProductFromMiniShoppingCartTest.xml | 8 +- ...oadableProductFromMiniShoppingCartTest.xml | 8 +- ...aultLimitationFromMiniShoppingCartTest.xml | 24 +- ...VirtualProductFromMiniShoppingCartTest.xml | 12 +- ...eSimpleProductFromMiniShoppingCartTest.xml | 8 +- ...tCheckoutUsingFreeShippingAndTaxesTest.xml | 4 +- ...tCheckoutWithCouponAndZeroSubtotalTest.xml | 4 +- ...ippingMethodInReviewAndPaymentStepTest.xml | 8 +- ...ngesInBackendAfterCustomerCheckoutTest.xml | 4 +- ...rontRefreshPageDuringGuestCheckoutTest.xml | 2 +- ...aultShippingAddressForVirtualQuoteTest.xml | 2 +- ...efrontUKCustomerCheckoutWithCouponTest.xml | 2 +- ...uctQuantityEqualsToOrderedQuantityTest.xml | 4 +- ...CouponAndBankTransferPaymentMethodTest.xml | 4 +- ...UpdateShoppingCartSimpleProductQtyTest.xml | 2 +- ...tSimpleWithCustomOptionsProductQtyTest.xml | 2 +- .../Mftf/Test/AdminRelatedProductsTest.xml | 4 +- ...ingCartBehaviorAfterSessionExpiredTest.xml | 2 +- .../ShippingQuotePersistedForGuestTest.xml | 4 +- ...CartPersistenceUnderLongTermCookieTest.xml | 20 +- ...eConditionAndFreeShippingIsAppliedTest.xml | 2 +- ...AndVerifyRuleConditionIsNotAppliedTest.xml | 2 +- ...talAndVerifyRuleConditionIsAppliedTest.xml | 2 +- ...oryAndVerifyRuleConditionIsAppliedTest.xml | 2 +- ...ghtAndVerifyRuleConditionIsAppliedTest.xml | 2 +- ...artPriceRuleForConfigurableProductTest.xml | 4 +- ...frontCartRuleCouponForFreeShippingTest.xml | 2 +- ...yRulesShouldApplyToComplexProductsTest.xml | 4 +- ...ductWithInvisibleIndividualProductTest.xml | 4 +- ...oppingCartForCustomerPhysicalQuoteTest.xml | 2 +- ...hoppingCartForCustomerVirtualQuoteTest.xml | 2 +- ...nShoppingCartForGuestPhysicalQuoteTest.xml | 2 +- ...InShoppingCartForGuestVirtualQuoteTest.xml | 2 +- .../Mftf/Test/StorefrontTaxQuoteCartTest.xml | 16 +- 117 files changed, 1323 insertions(+), 900 deletions(-) create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertMiniCartEmptyActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertOneProductNameInMiniCartActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummarySubtotalActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummaryTotalActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummaryTotalMissingActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontMiniCartProductDetailsAbsentActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/ChangeSummaryQuoteAddressActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckBillingAddressInCheckoutActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckBillingAddressInCheckoutWithBillingAddressOnPaymentPageActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckOrderSummaryInCheckoutActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckProductInCheckoutCartItemsActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckSelectedShippingAddressInCheckoutActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShipToInformationInCheckoutActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShippingMethodInCheckoutActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckTotalsSortOrderInSummarySectionActionGroup.xml delete mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutPlaceOrderActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutSelectCheckMoneyOrderPaymentActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutSelectFlatRateShippingMethodActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickPlaceOrderActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickViewAndEditCartFromMiniCartActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressWithCountryActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/GoToCheckoutFromCartActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/GoToCheckoutFromMinicartActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillShippingNoWaitForPaymentActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionUnavailablePaymentActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionWithoutRegionActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutSelectPaymentAndFillNewBillingAddressActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutWithSpecificCountryOptionForPaymentMethodActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInCheckoutFillNewBillingAddressActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInCheckoutWithOneAddressFieldWithoutStateFieldActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInUserCheckoutAddNewShippingSectionWithoutRegionActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInUserCheckoutFillingShippingSectionActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/PlaceOrderWithLoggedUserActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/RemoveProductFromMiniCartActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCartActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCartWithQuantityActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddProductToCartActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartSimpleProductActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartTotalWithDiscountCategoryActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckoutFillNewBillingAddressActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckoutForwardFromShippingStepActionGroup.xml delete mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontMiniCartActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontOpenCartFromMinicartActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontOpenMinicartAndCheckSimpleProductActionGroup.xml delete mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontSignOutActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/VerifyTopDestinationsCountryActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/clearCheckoutAddressPopupFieldsActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest.xml index 545e7c10379bf..8aeb85aa3d2c6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest.xml @@ -135,7 +135,7 @@ <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToCheckoutFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToCheckoutFromMinicart"/> <seeInField userInput="10" selector="{{CheckoutCartProductSection.ProductQuantityByName($$createSimpleProduct.name$$)}}" stepKey="seeInQtyField10"/> <grabTextFrom selector="{{CheckoutCartProductSection.productSubtotalByName($$createSimpleProduct.name$$)}}" stepKey="grabTextFromSubtotalField1"/> <assertEquals message="Shopping cart should contain subtotal $1,000" stepKey="assertSubtotalField1"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminConfigureProductImagePlaceholderTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminConfigureProductImagePlaceholderTest.xml index 4d97dee56f059..b5ab36729c7fe 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminConfigureProductImagePlaceholderTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminConfigureProductImagePlaceholderTest.xml @@ -62,9 +62,9 @@ <deleteData createDataKey="productNoImages" stepKey="deleteProductNoImages"/> <deleteData createDataKey="productWithImages" stepKey="deleteProductWithImages"/> </after> - + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminArea"/> - + <!--Admin area: configure Product Image Placeholders--> <comment userInput="Configure product image placeholders in store config" stepKey="configurePlaceholderComment"/> <amOnPage url="{{CatalogConfigPage.url}}" stepKey="goToCatalogConfigurationPage"/> @@ -120,7 +120,7 @@ <actualResult type="variable">$getThumbnailPlaceholderImageSrc</actualResult> <expectedResult type="string">{{placeholderThumbnailImage.name}}</expectedResult> </assertContains> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProductFromCart1"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProductFromCart1"> <argument name="productName" value="$$productNoImages.name$$"/> </actionGroup> <!--Product which is NOT using placeholder--> @@ -138,7 +138,7 @@ <actualResult type="variable">$getThumbnailImageSrc</actualResult> <expectedResult type="string">{{placeholderThumbnailImage.name}}</expectedResult> </assertNotContains> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProductFromCart2"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProductFromCart2"> <argument name="productName" value="$$productWithImages.name$$"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/TieredPricingAndQuantityIncrementsWorkWithDecimalinventoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/TieredPricingAndQuantityIncrementsWorkWithDecimalinventoryTest.xml index 4d7c97b26457c..0413018128491 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/TieredPricingAndQuantityIncrementsWorkWithDecimalinventoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/TieredPricingAndQuantityIncrementsWorkWithDecimalinventoryTest.xml @@ -79,7 +79,7 @@ <waitForElementVisible selector="{{StorefrontProductPageSection.successMsg}}" time="30" stepKey="waitForProductAdded"/> <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added $$createPreReqSimpleProduct.name$$ to your shopping cart." stepKey="seeAddedToCartMessage"/> <!--Step9. Click on *Cart* icon. Click on *View and Edit Cart* link. Change *Qty* value to *5.5*--> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <fillField selector="{{CheckoutCartProductSection.ProductQuantityByName(('$$createPreReqSimpleProduct.name$$'))}}" userInput="5.5" stepKey="fillQty2"/> <click selector="{{CheckoutCartProductSection.updateShoppingCartButton}}" stepKey="clickOnUpdateShoppingCartButton"/> <seeInField userInput="5.5" selector="{{CheckoutCartProductSection.ProductQuantityByName(('$$createPreReqSimpleProduct.name$$'))}}" stepKey="seeInField2"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertMiniCartEmptyActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertMiniCartEmptyActionGroup.xml new file mode 100644 index 0000000000000..649421a53040b --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertMiniCartEmptyActionGroup.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="AssertMiniCartEmptyActionGroup"> + <annotations> + <description>Validates that the provided Product Count appears in the Storefront Header next to the Shopping Cart icon. Clicks on the Mini Shopping Cart icon. Validates that the 'No Items' message is present and correct in the Storefront Mini Shopping Cart.</description> + </annotations> + + <dontSeeElement selector="{{StorefrontMinicartSection.productCount}}" stepKey="dontSeeMinicartProductCount"/> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="expandMinicart"/> + <see selector="{{StorefrontMinicartSection.minicartContent}}" userInput="You have no items in your shopping cart." stepKey="seeEmptyCartMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertOneProductNameInMiniCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertOneProductNameInMiniCartActionGroup.xml new file mode 100644 index 0000000000000..de54c78fc28ff --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertOneProductNameInMiniCartActionGroup.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="AssertOneProductNameInMiniCartActionGroup"> + <annotations> + <description>Validates that the provided Product Name is present in the Storefront Mini Shopping Cart.</description> + </annotations> + <arguments> + <argument name="productName"/> + </arguments> + + <conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/> + <waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForViewAndEditCartVisible"/> + <see selector="{{StorefrontMinicartSection.miniCartItemsText}}" userInput="{{productName}}" stepKey="seeInMiniCart"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummarySubtotalActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummarySubtotalActionGroup.xml new file mode 100644 index 0000000000000..bbf578fb8ca8f --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummarySubtotalActionGroup.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="AssertStorefrontCheckoutPaymentSummarySubtotalActionGroup"> + <arguments> + <argument name="orderSubtotal" type="string"/> + </arguments> + <waitForPageLoad time="30" stepKey="waitForCartFullyLoaded"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.orderSummarySubtotal}}" time="30" stepKey="waitForOrderSummaryBlock"/> + <see selector="{{CheckoutPaymentSection.orderSummarySubtotal}}" userInput="{{orderSubtotal}}" stepKey="seeCorrectSubtotal"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummaryTotalActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummaryTotalActionGroup.xml new file mode 100644 index 0000000000000..626e9d7a98183 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummaryTotalActionGroup.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="AssertStorefrontCheckoutPaymentSummaryTotalActionGroup"> + <arguments> + <argument name="orderTotal" type="string"/> + </arguments> + <waitForPageLoad time="30" stepKey="waitForCartFullyLoaded"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.orderSummaryTotal}}" time="30" stepKey="waitForOrderSummaryBlock"/> + <see selector="{{CheckoutPaymentSection.orderSummaryTotal}}" userInput="{{orderTotal}}" stepKey="seeCorrectOrderTotal"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummaryTotalMissingActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummaryTotalMissingActionGroup.xml new file mode 100644 index 0000000000000..874d2921022b1 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontCheckoutPaymentSummaryTotalMissingActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AssertStorefrontCheckoutPaymentSummaryTotalMissingActionGroup"> + <waitForPageLoad time="30" stepKey="waitForCartFullyLoaded"/> + <dontSeeElement selector="{{CheckoutPaymentSection.orderSummaryTotal}}" stepKey="seeTotalElement"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontMiniCartItemsActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontMiniCartItemsActionGroup.xml index 8933ebbc1dd84..5545d7ad437a1 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontMiniCartItemsActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontMiniCartItemsActionGroup.xml @@ -25,17 +25,4 @@ <seeElement selector="{{StorefrontMinicartSection.productImage}}" stepKey="seeProductImage"/> <see selector="{{StorefrontMinicartSection.productSubTotal}}" userInput="{{cartSubtotal}}" stepKey="seeSubTotal"/> </actionGroup> - - <actionGroup name="AssertStorefrontMiniCartProductDetailsAbsentActionGroup"> - <annotations> - <description>Validates that the provided Product details (Name, Price) are - not present in the Storefront Mini Shopping Cart.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - <argument name="productPrice" type="string"/> - </arguments> - - <dontSee selector="{{StorefrontMinicartSection.productPriceByName(productName)}}" userInput="{{productPrice}}" stepKey="dontSeeProductPriceInMiniCart"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontMiniCartProductDetailsAbsentActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontMiniCartProductDetailsAbsentActionGroup.xml new file mode 100644 index 0000000000000..5d52feeaad9cc --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontMiniCartProductDetailsAbsentActionGroup.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="AssertStorefrontMiniCartProductDetailsAbsentActionGroup"> + <annotations> + <description>Validates that the provided Product details (Name, Price) are + not present in the Storefront Mini Shopping Cart.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="productPrice" type="string"/> + </arguments> + + <dontSee selector="{{StorefrontMinicartSection.productPriceByName(productName)}}" userInput="{{productPrice}}" stepKey="dontSeeProductPriceInMiniCart"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ChangeSummaryQuoteAddressActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ChangeSummaryQuoteAddressActionGroup.xml new file mode 100644 index 0000000000000..041d3530a7e82 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ChangeSummaryQuoteAddressActionGroup.xml @@ -0,0 +1,25 @@ +<?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="ChangeSummaryQuoteAddressActionGroup"> + <annotations> + <description>Fills in the provided Address details (Country, State and Zip Code) under the 'Summary' section on the Storefront Shopping Cart page.</description> + </annotations> + <arguments> + <argument name="taxCode"/> + </arguments> + + <conditionalClick stepKey="openShippingDetails" selector="{{CheckoutCartSummarySection.shippingHeading}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false"/> + <selectOption stepKey="selectCountry" selector="{{CheckoutCartSummarySection.country}}" userInput="{{taxCode.country}}"/> + <selectOption stepKey="selectStateProvince" selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{taxCode.state}}"/> + <fillField stepKey="fillZip" selector="{{CheckoutCartSummarySection.postcode}}" userInput="{{taxCode.zip}}"/> + <waitForPageLoad stepKey="waitForFormUpdate"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckBillingAddressInCheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckBillingAddressInCheckoutActionGroup.xml new file mode 100644 index 0000000000000..d0128a9913fe9 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckBillingAddressInCheckoutActionGroup.xml @@ -0,0 +1,29 @@ +<?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="CheckBillingAddressInCheckoutActionGroup"> + <annotations> + <description>Validates that the provided Customer and Address details are present on the Storefront Checkout page under the 'Payment Method' section.</description> + </annotations> + <arguments> + <argument name="customerVar"/> + <argument name="customerAddressVar"/> + </arguments> + + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <see userInput="{{customerVar.firstName}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressFirstName"/> + <see userInput="{{customerVar.lastName}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressLastName"/> + <see userInput="{{customerAddressVar.street[0]}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressStreet"/> + <see userInput="{{customerAddressVar.city}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressCity"/> + <see userInput="{{customerAddressVar.state}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressState"/> + <see userInput="{{customerAddressVar.postcode}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressPostcode"/> + <see userInput="{{customerAddressVar.telephone}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressTelephone"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckBillingAddressInCheckoutWithBillingAddressOnPaymentPageActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckBillingAddressInCheckoutWithBillingAddressOnPaymentPageActionGroup.xml new file mode 100644 index 0000000000000..adba81138c17d --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckBillingAddressInCheckoutWithBillingAddressOnPaymentPageActionGroup.xml @@ -0,0 +1,29 @@ +<?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="CheckBillingAddressInCheckoutWithBillingAddressOnPaymentPageActionGroup"> + <annotations> + <description>Validates that the provided Customer and Address details appear on the Storefront Checkout page under the 'Billing Address' section.</description> + </annotations> + <arguments> + <argument name="customerVar"/> + <argument name="customerAddressVar"/> + </arguments> + + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <see userInput="{{customerVar.firstName}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsFirstName"/> + <see userInput="{{customerVar.lastName}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsLastName"/> + <see userInput="{{customerAddressVar.street[0]}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsStreet"/> + <see userInput="{{customerAddressVar.city}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsCity"/> + <see userInput="{{customerAddressVar.state}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsState"/> + <see userInput="{{customerAddressVar.postcode}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsPostcode"/> + <see userInput="{{customerAddressVar.telephone}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsTelephone"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckOrderSummaryInCheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckOrderSummaryInCheckoutActionGroup.xml new file mode 100644 index 0000000000000..9db5021e97322 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckOrderSummaryInCheckoutActionGroup.xml @@ -0,0 +1,28 @@ +<?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="CheckOrderSummaryInCheckoutActionGroup"> + <annotations> + <description>Validates that the provided Subtotal, Shipping Total, Shipping Method and Total are present and correct on the Storefront Checkout page under the 'Order Summary' section.</description> + </annotations> + <arguments> + <argument name="subtotal" type="string"/> + <argument name="shippingTotal" type="string"/> + <argument name="shippingMethod" type="string"/> + <argument name="total" type="string"/> + </arguments> + + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <see userInput="{{subtotal}}" selector="{{CheckoutPaymentSection.orderSummarySubtotal}}" stepKey="assertSubtotal"/> + <see userInput="{{shippingTotal}}" selector="{{CheckoutPaymentSection.orderSummaryShippingTotal}}" stepKey="assertShipping"/> + <see userInput="{{shippingMethod}}" selector="{{CheckoutPaymentSection.orderSummaryShippingMethod}}" stepKey="assertShippingMethod"/> + <see userInput="{{total}}" selector="{{CheckoutPaymentSection.orderSummaryTotal}}" stepKey="assertTotal"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckProductInCheckoutCartItemsActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckProductInCheckoutCartItemsActionGroup.xml new file mode 100644 index 0000000000000..85ec765ecd64f --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckProductInCheckoutCartItemsActionGroup.xml @@ -0,0 +1,25 @@ +<?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="CheckProductInCheckoutCartItemsActionGroup"> + <annotations> + <description>Validates the provided Product appears in the Storefront Checkout 'Order Summary' section.</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <conditionalClick selector="{{CheckoutPaymentSection.cartItemsArea}}" dependentSelector="{{CheckoutPaymentSection.cartItemsArea}}" visible="true" stepKey="exposeMiniCart"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskForCartItem"/> + <waitForElement selector="{{CheckoutPaymentSection.cartItemsAreaActive}}" time="30" stepKey="waitForCartItemsAreaActive"/> + <see selector="{{CheckoutPaymentSection.cartItems}}" userInput="{{productVar.name}}" stepKey="seeProductInCart"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckSelectedShippingAddressInCheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckSelectedShippingAddressInCheckoutActionGroup.xml new file mode 100644 index 0000000000000..0c952af6d53fa --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckSelectedShippingAddressInCheckoutActionGroup.xml @@ -0,0 +1,28 @@ +<?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="CheckSelectedShippingAddressInCheckoutActionGroup"> + <annotations> + <description>Validates that the provided Customer and Address details are listed on the Storefront Checkout page under the 'Shipping Address' section when multiple Addresses are present for a Customer.</description> + </annotations> + <arguments> + <argument name="customerVar"/> + <argument name="customerAddressVar"/> + </arguments> + + <waitForElement selector="{{CheckoutShippingSection.shippingTab}}" time="30" stepKey="waitForShippingSectionLoaded"/> + <see stepKey="VerifyFirstNameInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerVar.firstname}}"/> + <see stepKey="VerifyLastNameInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerVar.lastname}}"/> + <see stepKey="VerifyStreetInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.street[0]}}"/> + <see stepKey="VerifyCityInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.city}}"/> + <see stepKey="VerifyZipInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.postcode}}"/> + <see stepKey="VerifyPhoneInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.telephone}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShipToInformationInCheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShipToInformationInCheckoutActionGroup.xml new file mode 100644 index 0000000000000..f2ededd7f4b17 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShipToInformationInCheckoutActionGroup.xml @@ -0,0 +1,29 @@ +<?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="CheckShipToInformationInCheckoutActionGroup"> + <annotations> + <description>Validates that the provided Customer and Address details are present and correct on the Storefront Checkout page under the 'Ship To' section.</description> + </annotations> + <arguments> + <argument name="customerVar"/> + <argument name="customerAddressVar"/> + </arguments> + + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <see userInput="{{customerVar.firstname}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationFirstName"/> + <see userInput="{{customerVar.lastname}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationLastName"/> + <see userInput="{{customerAddressVar.street[0]}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationStreet"/> + <see userInput="{{customerAddressVar.city}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationCity"/> + <see userInput="{{customerAddressVar.state}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationState"/> + <see userInput="{{customerAddressVar.postcode}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationPostcode"/> + <see userInput="{{customerAddressVar.telephone}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationTelephone"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShippingMethodInCheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShippingMethodInCheckoutActionGroup.xml new file mode 100644 index 0000000000000..968ee8b46d0ba --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckShippingMethodInCheckoutActionGroup.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="CheckShippingMethodInCheckoutActionGroup"> + <annotations> + <description>Validates that the provided Shipping Method Name is present on the Storefront Checkout page under the 'Shipping Method' section.</description> + </annotations> + <arguments> + <argument name="shippingMethod"/> + </arguments> + + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <see userInput="{{shippingMethod}}" selector="{{CheckoutPaymentSection.shippingMethodInformation}}" stepKey="assertshippingMethodInformation"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckTotalsSortOrderInSummarySectionActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckTotalsSortOrderInSummarySectionActionGroup.xml new file mode 100644 index 0000000000000..4bd2d40ab94f1 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckTotalsSortOrderInSummarySectionActionGroup.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="CheckTotalsSortOrderInSummarySectionActionGroup"> + <annotations> + <description>Validates that the provided Element Name appears at the provided Position in the Storefront Checkout 'Order Summary' section.</description> + </annotations> + <arguments> + <argument name="elementName" type="string"/> + <argument name="positionNumber" type="string"/> + </arguments> + + <see userInput="{{elementName}}" selector="{{CheckoutCartSummarySection.elementPosition(positionNumber)}}" stepKey="assertElementPosition"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml deleted file mode 100644 index 4c7d4e31b2d6f..0000000000000 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutActionGroup.xml +++ /dev/null @@ -1,433 +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"> - <!-- Checkout select Flat Rate shipping method --> - <actionGroup name="CheckoutSelectFlatRateShippingMethodActionGroup"> - <annotations> - <description>Clicks on the 'Flat Rate' Shipping Method on the Storefront Checkout page.</description> - </annotations> - - <conditionalClick selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('Flat Rate')}}" dependentSelector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('Flat Rate')}}" visible="true" stepKey="selectFlatRateShippingMethod"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskForNextButton"/> - </actionGroup> - - <!-- Go to checkout from minicart --> - <actionGroup name="GoToCheckoutFromMinicartActionGroup"> - <annotations> - <description>Clicks on the Storefront Mini Shopping Cart icon. Clicks on 'Proceed to Checkout'.</description> - </annotations> - - <waitForElementNotVisible selector="{{StorefrontMinicartSection.emptyCart}}" stepKey="waitUpdateQuantity"/> - <wait time="5" stepKey="waitMinicartRendering"/> - <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/> - <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/> - </actionGroup> - - <!-- Go to checkout from cart --> - <actionGroup name="GoToCheckoutFromCartActionGroup"> - <annotations> - <description>Clicks on the 'View and Edit Cart' link in the Storefront Mini Shopping Cart. Validates that the Storefront Shopping Cart URL is present and correct. Clicks on 'Proceed to Checkout'.</description> - </annotations> - - <waitForElementNotVisible selector="{{StorefrontMinicartSection.emptyCart}}" stepKey="waitUpdateQuantity"/> - <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> - <seeInCurrentUrl url="{{CheckoutCartPage.url}}" stepKey="assertCheckoutCartUrl"/> - <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/> - </actionGroup> - - <!-- Guest checkout filling shipping section --> - <actionGroup name="GuestCheckoutFillingShippingSectionActionGroup"> - <annotations> - <description>Fills in the provided Customer/Address (Including Region) details on the Storefront Checkout page under the 'Shipping Address' section. Selects the provided Shipping Method. Clicks on Next. Validates that the URL is present and correct.</description> - </annotations> - <arguments> - <argument name="customerVar" defaultValue="CustomerEntityOne"/> - <argument name="customerAddressVar" defaultValue="CustomerAddressSimple"/> - <!--First available shipping method will be selected if value is not passed for shippingMethod--> - <argument name="shippingMethod" defaultValue="" type="string"/> - </arguments> - - <fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customerVar.email}}" stepKey="enterEmail"/> - <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/> - <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customerVar.lastname}}" stepKey="enterLastName"/> - <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{customerAddressVar.street[0]}}" stepKey="enterStreet"/> - <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{customerAddressVar.city}}" stepKey="enterCity"/> - <selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{customerAddressVar.state}}" stepKey="selectRegion"/> - <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/> - <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> - <waitForElement selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('shippingMethod')}}" stepKey="waitForShippingMethod"/> - <click selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('shippingMethod')}}" stepKey="selectShippingMethod"/> - <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> - <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> - <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> - </actionGroup> - - <actionGroup name="GuestCheckoutFillShippingNoWaitForPaymentActionGroup" extends="GuestCheckoutFillingShippingSectionActionGroup"> - <annotations> - <description>EXTENDS: GuestCheckoutFillingShippingSectionActionGroup. Removed 'waitForPaymentSectionLoaded' and 'assertCheckoutPaymentUrl'.</description> - </annotations> - - <remove keyForRemoval="waitForPaymentSectionLoaded"/> - <remove keyForRemoval="assertCheckoutPaymentUrl"/> - </actionGroup> - - <!-- Guest checkout filling shipping section without region --> - <actionGroup name="GuestCheckoutFillingShippingSectionWithoutRegionActionGroup"> - <annotations> - <description>Fills in the provided Customer/Address (Excluding Region) details on the Storefront Checkout page under the 'Shipping Address' section. Selects the provided Shipping Method. Clicks on Next. Validates that the URL is present and correct.</description> - </annotations> - <arguments> - <argument name="customerVar"/> - <argument name="customerAddressVar"/> - </arguments> - - <fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customerVar.email}}" stepKey="enterEmail"/> - <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/> - <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customerVar.lastname}}" stepKey="enterLastName"/> - <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{customerAddressVar.street[0]}}" stepKey="enterStreet"/> - <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{customerAddressVar.city}}" stepKey="enterCity"/> - <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/> - <selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{customerAddressVar.country_id}}" stepKey="enterCountry"/> - <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> - <click selector="{{CheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> - <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> - <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> - <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> - </actionGroup> - - <!-- Guest checkout filling shipping section with unavailable payments--> - <actionGroup name="GuestCheckoutFillingShippingSectionUnavailablePaymentActionGroup"> - <annotations> - <description>Fills in the provided Customer/Address (Including Region) details on the Storefront Checkout page under the 'Shipping Address' section. Selects the 1st Shipping Method. Clicks on Next. Validates that the Payment Error Message and URL are present and correct.</description> - </annotations> - <arguments> - <argument name="customerVar"/> - <argument name="customerAddressVar"/> - </arguments> - - <fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customerVar.email}}" stepKey="enterEmail"/> - <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/> - <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customerVar.lastname}}" stepKey="enterLastName"/> - <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{customerAddressVar.street[0]}}" stepKey="enterStreet"/> - <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{customerAddressVar.city}}" stepKey="enterCity"/> - <selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{customerAddressVar.state}}" stepKey="selectRegion"/> - <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/> - <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> - <click selector="{{CheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> - <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> - <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> - <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> - <waitForElementVisible selector="{{CheckoutPaymentSection.noQuotes}}" stepKey="waitMessage"/> - <see userInput="No Payment method available." stepKey="checkMessage"/> - </actionGroup> - - <actionGroup name="GuestCheckoutWithSpecificCountryOptionForPaymentMethodActionGroup" extends="GuestCheckoutFillingShippingSectionUnavailablePaymentActionGroup"> - <annotations> - <description>EXTENDS: GuestCheckoutFillingShippingSectionUnavailablePaymentActionGroup. Removes 'checkMessage'. Validates that the provided Payment Method Name is NOT present on the Storefront Checkout page.</description> - </annotations> - <arguments> - <argument name="paymentMethod" type="string"/> - </arguments> - - <remove keyForRemoval="checkMessage"/> - <dontSee selector="{{CheckoutPaymentSection.paymentMethodByName(paymentMethod)}}" stepKey="paymentMethodDoesNotAvailable"/> - </actionGroup> - - <!-- Logged in user checkout filling shipping section --> - <actionGroup name="LoggedInUserCheckoutFillingShippingSectionActionGroup"> - <annotations> - <description>Fills in the provided Customer/Address (Including Region) details on the Storefront Checkout page under the 'Shipping Address' section. Selects the 1st Shipping Method. Clicks on Next. Validates that the Payment Error Message and URL are present and correct.</description> - </annotations> - <arguments> - <argument name="customerVar" defaultValue="CustomerEntityOne"/> - <argument name="customerAddressVar" defaultValue="CustomerAddressSimple"/> - </arguments> - - <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/> - <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customerVar.lastname}}" stepKey="enterLastName"/> - <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{customerAddressVar.street[0]}}" stepKey="enterStreet"/> - <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{customerAddressVar.city}}" stepKey="enterCity"/> - <selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{customerAddressVar.state}}" stepKey="selectRegion"/> - <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/> - <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> - <click selector="{{CheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> - <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> - <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> - <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> - </actionGroup> - - <!-- Submit Shipping Address on Checkout Shipping page --> - <actionGroup name="StorefrontCheckoutForwardFromShippingStep"> - <annotations> - <description>Clicks next on Checkout Shipping step</description> - </annotations> - <waitForElementVisible selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> - <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> - </actionGroup> - - <!-- Logged in user checkout filling shipping section --> - <actionGroup name="LoggedInUserCheckoutAddNewShippingSectionWithoutRegionActionGroup"> - <annotations> - <description>Fills in the provided Customer/Address (Excluding Region) details on the Storefront Checkout page under the 'Shipping Address' section. Selects the 1st Shipping Method. Clicks on Next. Validates that the Payment Error Message and URL are present and correct.</description> - </annotations> - <arguments> - <argument name="customerVar"/> - <argument name="customerAddressVar"/> - </arguments> - - <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/> - <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customerVar.lastname}}" stepKey="enterLastName"/> - <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{customerAddressVar.street[0]}}" stepKey="enterStreet"/> - <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{customerAddressVar.city}}" stepKey="enterCity"/> - <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/> - <selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{customerAddressVar.country_id}}" stepKey="enterCountry"/> - <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/> - <click selector="{{CheckoutShippingSection.saveAddress}}" stepKey="clickSaveAddress"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> - <click selector="{{CheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> - <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> - <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> - <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> - </actionGroup> - - <!-- Place order with logged the user --> - <actionGroup name="PlaceOrderWithLoggedUserActionGroup"> - <annotations> - <description>Clicks on 'Proceed to Checkout' on the Storefront Shopping Cart page. Selects the provided Shipping Method. Clicks on Next. Clicks on Place Order. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <!--First available shipping method will be selected if value is not passed for shippingMethod--> - <argument name="shippingMethod" defaultValue="" type="string"/> - </arguments> - - <waitForElementVisible selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="waitProceedToCheckout"/> - <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="clickProceedToCheckout"/> - <click selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('shippingMethod')}}" stepKey="selectShippingMethod"/> - <waitForElement selector="{{CheckoutShippingSection.next}}" stepKey="waitForNextButton"/> - <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> - <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> - <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/> - </actionGroup> - - <!-- Check product in checkout cart items --> - <actionGroup name="CheckProductInCheckoutCartItemsActionGroup"> - <annotations> - <description>Validates the provided Product appears in the Storefront Checkout 'Order Summary' section.</description> - </annotations> - <arguments> - <argument name="productVar"/> - </arguments> - - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> - <conditionalClick selector="{{CheckoutPaymentSection.cartItemsArea}}" dependentSelector="{{CheckoutPaymentSection.cartItemsArea}}" visible="true" stepKey="exposeMiniCart"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskForCartItem"/> - <waitForElement selector="{{CheckoutPaymentSection.cartItemsAreaActive}}" time="30" stepKey="waitForCartItemsAreaActive"/> - <see selector="{{CheckoutPaymentSection.cartItems}}" userInput="{{productVar.name}}" stepKey="seeProductInCart"/> - </actionGroup> - - <!-- Check order summary in checkout --> - <actionGroup name="CheckOrderSummaryInCheckoutActionGroup"> - <annotations> - <description>Validates that the provided Subtotal, Shipping Total, Shipping Method and Total are present and correct on the Storefront Checkout page under the 'Order Summary' section.</description> - </annotations> - <arguments> - <argument name="subtotal" type="string"/> - <argument name="shippingTotal" type="string"/> - <argument name="shippingMethod" type="string"/> - <argument name="total" type="string"/> - </arguments> - - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> - <see userInput="{{subtotal}}" selector="{{CheckoutPaymentSection.orderSummarySubtotal}}" stepKey="assertSubtotal"/> - <see userInput="{{shippingTotal}}" selector="{{CheckoutPaymentSection.orderSummaryShippingTotal}}" stepKey="assertShipping"/> - <see userInput="{{shippingMethod}}" selector="{{CheckoutPaymentSection.orderSummaryShippingMethod}}" stepKey="assertShippingMethod"/> - <see userInput="{{total}}" selector="{{CheckoutPaymentSection.orderSummaryTotal}}" stepKey="assertTotal"/> - </actionGroup> - - <actionGroup name="CheckTotalsSortOrderInSummarySection"> - <annotations> - <description>Validates that the provided Element Name appears at the provided Position in the Storefront Checkout 'Order Summary' section.</description> - </annotations> - <arguments> - <argument name="elementName" type="string"/> - <argument name="positionNumber" type="string"/> - </arguments> - - <see userInput="{{elementName}}" selector="{{CheckoutCartSummarySection.elementPosition(positionNumber)}}" stepKey="assertElementPosition"/> - </actionGroup> - - <!-- Check ship to information in checkout --> - <actionGroup name="CheckShipToInformationInCheckoutActionGroup"> - <annotations> - <description>Validates that the provided Customer and Address details are present and correct on the Storefront Checkout page under the 'Ship To' section.</description> - </annotations> - <arguments> - <argument name="customerVar"/> - <argument name="customerAddressVar"/> - </arguments> - - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> - <see userInput="{{customerVar.firstname}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationFirstName"/> - <see userInput="{{customerVar.lastname}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationLastName"/> - <see userInput="{{customerAddressVar.street[0]}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationStreet"/> - <see userInput="{{customerAddressVar.city}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationCity"/> - <see userInput="{{customerAddressVar.state}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationState"/> - <see userInput="{{customerAddressVar.postcode}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationPostcode"/> - <see userInput="{{customerAddressVar.telephone}}" selector="{{CheckoutPaymentSection.shipToInformation}}" stepKey="assertShipToInformationTelephone"/> - </actionGroup> - - <!-- Check shipping method in checkout --> - <actionGroup name="CheckShippingMethodInCheckoutActionGroup"> - <annotations> - <description>Validates that the provided Shipping Method Name is present on the Storefront Checkout page under the 'Shipping Method' section.</description> - </annotations> - <arguments> - <argument name="shippingMethod"/> - </arguments> - - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> - <see userInput="{{shippingMethod}}" selector="{{CheckoutPaymentSection.shippingMethodInformation}}" stepKey="assertshippingMethodInformation"/> - </actionGroup> - - <!-- Checkout select Check/Money Order payment --> - <actionGroup name="CheckoutSelectCheckMoneyOrderPaymentActionGroup"> - <annotations> - <description>Selects the 'Check / Money Order' Payment Method on the Storefront Checkout page.</description> - </annotations> - - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <conditionalClick selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" dependentSelector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" visible="true" stepKey="selectCheckmoPaymentMethod"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskAfterPaymentMethodSelection"/> - </actionGroup> - - <!-- Check selected shipping address information on shipping information step --> - <actionGroup name="CheckSelectedShippingAddressInCheckoutActionGroup"> - <annotations> - <description>Validates that the provided Customer and Address details are listed on the Storefront Checkout page under the 'Shipping Address' section when multiple Addresses are present for a Customer.</description> - </annotations> - <arguments> - <argument name="customerVar"/> - <argument name="customerAddressVar"/> - </arguments> - - <waitForElement selector="{{CheckoutShippingSection.shippingTab}}" time="30" stepKey="waitForShippingSectionLoaded"/> - <see stepKey="VerifyFirstNameInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerVar.firstname}}"/> - <see stepKey="VerifyLastNameInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerVar.lastname}}"/> - <see stepKey="VerifyStreetInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.street[0]}}"/> - <see stepKey="VerifyCityInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.city}}"/> - <see stepKey="VerifyZipInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.postcode}}"/> - <see stepKey="VerifyPhoneInSelectedAddress" selector="{{CheckoutShippingSection.selectedShippingAddress}}" userInput="{{customerAddressVar.telephone}}"/> - </actionGroup> - - <!-- Check billing address in checkout --> - <actionGroup name="CheckBillingAddressInCheckoutActionGroup"> - <annotations> - <description>Validates that the provided Customer and Address details are present on the Storefront Checkout page under the 'Payment Method' section.</description> - </annotations> - <arguments> - <argument name="customerVar"/> - <argument name="customerAddressVar"/> - </arguments> - - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> - <see userInput="{{customerVar.firstName}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressFirstName"/> - <see userInput="{{customerVar.lastName}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressLastName"/> - <see userInput="{{customerAddressVar.street[0]}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressStreet"/> - <see userInput="{{customerAddressVar.city}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressCity"/> - <see userInput="{{customerAddressVar.state}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressState"/> - <see userInput="{{customerAddressVar.postcode}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressPostcode"/> - <see userInput="{{customerAddressVar.telephone}}" selector="{{CheckoutPaymentSection.billingAddress}}" stepKey="assertBillingAddressTelephone"/> - </actionGroup> - - <!-- Check billing address in checkout with billing address on payment page --> - <actionGroup name="CheckBillingAddressInCheckoutWithBillingAddressOnPaymentPageActionGroup"> - <annotations> - <description>Validates that the provided Customer and Address details appear on the Storefront Checkout page under the 'Billing Address' section.</description> - </annotations> - <arguments> - <argument name="customerVar"/> - <argument name="customerAddressVar"/> - </arguments> - - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> - <see userInput="{{customerVar.firstName}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsFirstName"/> - <see userInput="{{customerVar.lastName}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsLastName"/> - <see userInput="{{customerAddressVar.street[0]}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsStreet"/> - <see userInput="{{customerAddressVar.city}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsCity"/> - <see userInput="{{customerAddressVar.state}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsState"/> - <see userInput="{{customerAddressVar.postcode}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsPostcode"/> - <see userInput="{{customerAddressVar.telephone}}" selector="{{CheckoutPaymentWithDisplayBillingAddressOnPaymentPageSection.billingAddressDetails}}" stepKey="assertBillingAddressDetailsTelephone"/> - </actionGroup> - - <!-- Checkout place order --> - <actionGroup name="CheckoutPlaceOrderActionGroup"> - <annotations> - <description>Clicks on 'Place Order'. Validates that the provided Order ID and Email You messages are present and correct.</description> - </annotations> - <arguments> - <argument name="orderNumberMessage"/> - <argument name="emailYouMessage"/> - </arguments> - - <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <see selector="{{CheckoutSuccessMainSection.success}}" userInput="{{orderNumberMessage}}" stepKey="seeOrderNumber"/> - <see selector="{{CheckoutSuccessMainSection.success}}" userInput="{{emailYouMessage}}" stepKey="seeEmailYou"/> - </actionGroup> - - <!--Verify country options in checkout top destination section--> - <actionGroup name="VerifyTopDestinationsCountry"> - <annotations> - <description>Validates that the provided Country is listed at the provided Index in 'Country' drop down menu on the Storefront Shopping Cart page under the 'Summary' section.</description> - </annotations> - <arguments> - <argument name="country" type="string"/> - <argument name="placeNumber"/> - </arguments> - - <conditionalClick selector="{{CheckoutCartSummarySection.shippingHeading}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="openShippingDetails"/> - <see selector="{{CheckoutCartSummarySection.countryParameterized('placeNumber')}}" userInput="{{country}}" stepKey="seeCountry"/> - </actionGroup> - - <actionGroup name="StorefrontSignOutActionGroup"> - <annotations> - <description>Clicks on the Customer Account link. Clicks on 'Sign Out'. Validates that the Signed Out message is present and correct.</description> - </annotations> - - <click selector="{{StoreFrontSignOutSection.customerAccount}}" stepKey="clickCustomerButton"/> - <click selector="{{StoreFrontSignOutSection.signOut}}" stepKey="clickToSignOut"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <see userInput="You are signed out" stepKey="signOut"/> - </actionGroup> - - <!--Click Place Order button--> - <actionGroup name="ClickPlaceOrderActionGroup"> - <annotations> - <description>Clicks on the 'Place Order' button. Validates that the Success Message is present and correct.</description> - </annotations> - - <waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> - <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutPlaceOrderActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutPlaceOrderActionGroup.xml new file mode 100644 index 0000000000000..48c515a3dd197 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutPlaceOrderActionGroup.xml @@ -0,0 +1,25 @@ +<?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="CheckoutPlaceOrderActionGroup"> + <annotations> + <description>Clicks on 'Place Order'. Validates that the provided Order ID and Email You messages are present and correct.</description> + </annotations> + <arguments> + <argument name="orderNumberMessage"/> + <argument name="emailYouMessage"/> + </arguments> + + <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/> + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> + <see selector="{{CheckoutSuccessMainSection.success}}" userInput="{{orderNumberMessage}}" stepKey="seeOrderNumber"/> + <see selector="{{CheckoutSuccessMainSection.success}}" userInput="{{emailYouMessage}}" stepKey="seeEmailYou"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutSelectCheckMoneyOrderPaymentActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutSelectCheckMoneyOrderPaymentActionGroup.xml new file mode 100644 index 0000000000000..04e987fd10d98 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutSelectCheckMoneyOrderPaymentActionGroup.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="CheckoutSelectCheckMoneyOrderPaymentActionGroup"> + <annotations> + <description>Selects the 'Check / Money Order' Payment Method on the Storefront Checkout page.</description> + </annotations> + + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <conditionalClick selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" dependentSelector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Check / Money order')}}" visible="true" stepKey="selectCheckmoPaymentMethod"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskAfterPaymentMethodSelection"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutSelectFlatRateShippingMethodActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutSelectFlatRateShippingMethodActionGroup.xml new file mode 100644 index 0000000000000..a5dcec3b7cb37 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutSelectFlatRateShippingMethodActionGroup.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"> + <!-- Checkout select Flat Rate shipping method --> + <actionGroup name="CheckoutSelectFlatRateShippingMethodActionGroup"> + <annotations> + <description>Clicks on the 'Flat Rate' Shipping Method on the Storefront Checkout page.</description> + </annotations> + + <conditionalClick selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('Flat Rate')}}" dependentSelector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('Flat Rate')}}" visible="true" stepKey="selectFlatRateShippingMethod"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskForNextButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickPlaceOrderActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickPlaceOrderActionGroup.xml new file mode 100644 index 0000000000000..079b89a879b77 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickPlaceOrderActionGroup.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="ClickPlaceOrderActionGroup"> + <annotations> + <description>Clicks on the 'Place Order' button. Validates that the Success Message is present and correct.</description> + </annotations> + + <waitForElement selector="{{CheckoutPaymentSection.placeOrder}}" time="30" stepKey="waitForPlaceOrderButton"/> + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> + <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickViewAndEditCartFromMiniCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickViewAndEditCartFromMiniCartActionGroup.xml new file mode 100644 index 0000000000000..70aa5b49e4b98 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/ClickViewAndEditCartFromMiniCartActionGroup.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="ClickViewAndEditCartFromMiniCartActionGroup"> + <annotations> + <description>Clicks on the Storefront Mini Shopping Cart icon. Clicks on the 'View and Edit Cart' link. Validates that the URL is present and correct. PLEASE NOTE: The URL is Hardcoded.</description> + </annotations> + + <scrollTo selector="{{StorefrontMinicartSection.showCart}}" stepKey="scrollToMiniCart"/> + <conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/> + <waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForViewAndEditCartVisible"/> + <click selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="viewAndEditCart"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <seeInCurrentUrl url="checkout/cart" stepKey="seeInCurrentUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressFormActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressFormActionGroup.xml index 80fd604e752e9..527afdc26a5f4 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressFormActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressFormActionGroup.xml @@ -21,7 +21,4 @@ <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddress.postcode}}" stepKey="SetCustomerZipCode"/> <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddress.telephone}}" stepKey="SetCustomerPhoneNumber"/> </actionGroup> - <actionGroup name="FillGuestCheckoutShippingAddressWithCountryActionGroup" extends="FillGuestCheckoutShippingAddressFormActionGroup"> - <selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{customerAddress.country_id}}" stepKey="selectCustomerCountry" after="SetCustomerCity"/> - </actionGroup> -</actionGroups> \ No newline at end of file +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressWithCountryActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressWithCountryActionGroup.xml new file mode 100644 index 0000000000000..c5685f4a3a31f --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressWithCountryActionGroup.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="FillGuestCheckoutShippingAddressWithCountryActionGroup" extends="FillGuestCheckoutShippingAddressFormActionGroup"> + <selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{customerAddress.country_id}}" stepKey="selectCustomerCountry" after="SetCustomerCity"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GoToCheckoutFromCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GoToCheckoutFromCartActionGroup.xml new file mode 100644 index 0000000000000..66db3895483c7 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GoToCheckoutFromCartActionGroup.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="GoToCheckoutFromCartActionGroup"> + <annotations> + <description>Clicks on the 'View and Edit Cart' link in the Storefront Mini Shopping Cart. Validates that the Storefront Shopping Cart URL is present and correct. Clicks on 'Proceed to Checkout'.</description> + </annotations> + + <waitForElementNotVisible selector="{{StorefrontMinicartSection.emptyCart}}" stepKey="waitUpdateQuantity"/> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + <seeInCurrentUrl url="{{CheckoutCartPage.url}}" stepKey="assertCheckoutCartUrl"/> + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GoToCheckoutFromMinicartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GoToCheckoutFromMinicartActionGroup.xml new file mode 100644 index 0000000000000..d6bc6b6a0acb0 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GoToCheckoutFromMinicartActionGroup.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="GoToCheckoutFromMinicartActionGroup"> + <annotations> + <description>Clicks on the Storefront Mini Shopping Cart icon. Clicks on 'Proceed to Checkout'.</description> + </annotations> + + <waitForElementNotVisible selector="{{StorefrontMinicartSection.emptyCart}}" stepKey="waitUpdateQuantity"/> + <wait time="5" stepKey="waitMinicartRendering"/> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/> + <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillNewBillingAddressActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillNewBillingAddressActionGroup.xml index 77734cc75497f..22f9f100ed08f 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillNewBillingAddressActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillNewBillingAddressActionGroup.xml @@ -28,74 +28,4 @@ <fillField selector="{{CheckoutPaymentSection.guestPostcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/> <fillField selector="{{CheckoutPaymentSection.guestTelephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/> </actionGroup> - <actionGroup name="StorefrontCheckoutFillNewBillingAddressActionGroup" extends="GuestCheckoutFillNewBillingAddressActionGroup"> - <remove keyForRemoval="enterEmail"/> - <remove keyForRemoval="waitForLoading3"/> - </actionGroup> - - <actionGroup name="LoggedInCheckoutFillNewBillingAddressActionGroup"> - <annotations> - <description>Fills in the provided Address details on the Storefront Checkout Address sections based on the provided Class Prefix (i.e. '._show', '[aria-hidden=false]').</description> - </annotations> - <arguments> - <argument name="Address"/> - <!-- the classPrefix argument is to specifically select the inputs of the correct form - this is to prevent having 3 action groups doing essentially the same thing --> - <argument name="classPrefix" type="string" defaultValue=""/> - </arguments> - - <fillField stepKey="fillFirstName" selector="{{classPrefix}} {{CheckoutShippingSection.firstName}}" userInput="{{Address.firstname}}"/> - <fillField stepKey="fillLastName" selector="{{classPrefix}} {{CheckoutShippingSection.lastName}}" userInput="{{Address.lastname}}"/> - <fillField stepKey="fillCompany" selector="{{classPrefix}} {{CheckoutShippingSection.company}}" userInput="{{Address.company}}"/> - <fillField stepKey="fillPhoneNumber" selector="{{classPrefix}} {{CheckoutShippingSection.telephone}}" userInput="{{Address.telephone}}"/> - <fillField stepKey="fillStreetAddress1" selector="{{classPrefix}} {{CheckoutShippingSection.street}}" userInput="{{Address.street[0]}}"/> - <fillField stepKey="fillStreetAddress2" selector="{{classPrefix}} {{CheckoutShippingSection.street2}}" userInput="{{Address.street[1]}}"/> - <fillField stepKey="fillCityName" selector="{{classPrefix}} {{CheckoutShippingSection.city}}" userInput="{{Address.city}}"/> - <selectOption stepKey="selectState" selector="{{classPrefix}} {{CheckoutShippingSection.region}}" userInput="{{Address.state}}"/> - <fillField stepKey="fillZip" selector="{{classPrefix}} {{CheckoutShippingSection.postcode}}" userInput="{{Address.postcode}}"/> - <selectOption stepKey="selectCounty" selector="{{classPrefix}} {{CheckoutShippingSection.country}}" userInput="{{Address.country_id}}"/> - <waitForPageLoad stepKey="waitForFormUpdate2"/> - </actionGroup> - - <!--Filling address without second address field and without state field--> - <actionGroup name="LoggedInCheckoutWithOneAddressFieldWithoutStateField" extends="LoggedInCheckoutFillNewBillingAddressActionGroup"> - <annotations> - <description>EXTENDS: LoggedInCheckoutFillNewBillingAddressActionGroup. Removes 'fillStreetAddress2' and 'selectState'.</description> - </annotations> - - <remove keyForRemoval="fillStreetAddress2"/> - <remove keyForRemoval="selectState"/> - </actionGroup> - - <actionGroup name="clearCheckoutAddressPopupFieldsActionGroup"> - <annotations> - <description>Clears the fields for the Customer/Address fields on the Storefront Checkout Address sections based on the provided Class Prefix (i.e. '._show', '[aria-hidden=false]').</description> - </annotations> - <arguments> - <argument name="classPrefix" type="string" defaultValue=""/> - </arguments> - - <clearField selector="{{classPrefix}} {{CheckoutShippingSection.firstName}}" stepKey="clearFieldFirstName"/> - <clearField selector="{{classPrefix}} {{CheckoutShippingSection.lastName}}" stepKey="clearFieldLastName"/> - <clearField selector="{{classPrefix}} {{CheckoutShippingSection.company}}" stepKey="clearFieldCompany"/> - <clearField selector="{{classPrefix}} {{CheckoutShippingSection.street}}" stepKey="clearFieldStreetAddress1"/> - <clearField selector="{{classPrefix}} {{CheckoutShippingSection.street2}}" stepKey="clearFieldStreetAddress2"/> - <clearField selector="{{classPrefix}} {{CheckoutShippingSection.city}}" stepKey="clearFieldCityName"/> - <selectOption selector="{{classPrefix}} {{CheckoutShippingSection.region}}" userInput="" stepKey="clearFieldRegion"/> - <clearField selector="{{classPrefix}} {{CheckoutShippingSection.postcode}}" stepKey="clearFieldZip"/> - <selectOption selector="{{classPrefix}} {{CheckoutShippingSection.country}}" userInput="" stepKey="clearFieldCounty"/> - <clearField selector="{{classPrefix}} {{CheckoutShippingSection.telephone}}" stepKey="clearFieldPhoneNumber"/> - </actionGroup> - - <actionGroup name="GuestCheckoutSelectPaymentAndFillNewBillingAddressActionGroup" extends="GuestCheckoutFillNewBillingAddressActionGroup"> - <annotations> - <description>EXTENDS: GuestCheckoutFillNewBillingAddressActionGroup. Clicks on the provided Payment Method on the Storefront Checkout page.</description> - </annotations> - <arguments> - <argument name="paymentMethod" type="string"/> - </arguments> - - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" after="waitForLoading3" stepKey="waitForPaymentSectionLoaded"/> - <conditionalClick selector="{{CheckoutPaymentSection.paymentMethodByName(paymentMethod)}}" dependentSelector="{{CheckoutPaymentSection.billingAddress}}" visible="false" before="enterFirstName" stepKey="clickCheckMoneyOrderPayment"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillShippingNoWaitForPaymentActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillShippingNoWaitForPaymentActionGroup.xml new file mode 100644 index 0000000000000..ca9b7adf6c387 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillShippingNoWaitForPaymentActionGroup.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="GuestCheckoutFillShippingNoWaitForPaymentActionGroup" extends="GuestCheckoutFillingShippingSectionActionGroup"> + <annotations> + <description>EXTENDS: GuestCheckoutFillingShippingSectionActionGroup. Removed 'waitForPaymentSectionLoaded' and 'assertCheckoutPaymentUrl'.</description> + </annotations> + + <remove keyForRemoval="waitForPaymentSectionLoaded"/> + <remove keyForRemoval="assertCheckoutPaymentUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionActionGroup.xml new file mode 100644 index 0000000000000..f020cb42725c8 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionActionGroup.xml @@ -0,0 +1,38 @@ +<?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="GuestCheckoutFillingShippingSectionActionGroup"> + <annotations> + <description>Fills in the provided Customer/Address (Including Region) details on the Storefront Checkout page under the 'Shipping Address' section. Selects the provided Shipping Method. Clicks on Next. Validates that the URL is present and correct.</description> + </annotations> + <arguments> + <argument name="customerVar" defaultValue="CustomerEntityOne"/> + <argument name="customerAddressVar" defaultValue="CustomerAddressSimple"/> + <!--First available shipping method will be selected if value is not passed for shippingMethod--> + <argument name="shippingMethod" defaultValue="" type="string"/> + </arguments> + + <fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customerVar.email}}" stepKey="enterEmail"/> + <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/> + <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customerVar.lastname}}" stepKey="enterLastName"/> + <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{customerAddressVar.street[0]}}" stepKey="enterStreet"/> + <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{customerAddressVar.city}}" stepKey="enterCity"/> + <selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{customerAddressVar.state}}" stepKey="selectRegion"/> + <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/> + <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + <waitForElement selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('shippingMethod')}}" stepKey="waitForShippingMethod"/> + <click selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('shippingMethod')}}" stepKey="selectShippingMethod"/> + <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionUnavailablePaymentActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionUnavailablePaymentActionGroup.xml new file mode 100644 index 0000000000000..9ce14338f1223 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionUnavailablePaymentActionGroup.xml @@ -0,0 +1,36 @@ +<?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="GuestCheckoutFillingShippingSectionUnavailablePaymentActionGroup"> + <annotations> + <description>Fills in the provided Customer/Address (Including Region) details on the Storefront Checkout page under the 'Shipping Address' section. Selects the 1st Shipping Method. Clicks on Next. Validates that the Payment Error Message and URL are present and correct.</description> + </annotations> + <arguments> + <argument name="customerVar"/> + <argument name="customerAddressVar"/> + </arguments> + + <fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customerVar.email}}" stepKey="enterEmail"/> + <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/> + <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customerVar.lastname}}" stepKey="enterLastName"/> + <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{customerAddressVar.street[0]}}" stepKey="enterStreet"/> + <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{customerAddressVar.city}}" stepKey="enterCity"/> + <selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{customerAddressVar.state}}" stepKey="selectRegion"/> + <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/> + <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + <click selector="{{CheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> + <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> + <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.noQuotes}}" stepKey="waitMessage"/> + <see userInput="No Payment method available." stepKey="checkMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionWithoutRegionActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionWithoutRegionActionGroup.xml new file mode 100644 index 0000000000000..3db019c44dd0d --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillingShippingSectionWithoutRegionActionGroup.xml @@ -0,0 +1,35 @@ +<?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="GuestCheckoutFillingShippingSectionWithoutRegionActionGroup"> + <annotations> + <description>Fills in the provided Customer/Address (Excluding Region) details on the Storefront Checkout page under the 'Shipping Address' section. Selects the provided Shipping Method. Clicks on Next. Validates that the URL is present and correct.</description> + </annotations> + <arguments> + <argument name="customerVar"/> + <argument name="customerAddressVar"/> + </arguments> + + <fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customerVar.email}}" stepKey="enterEmail"/> + <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/> + <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customerVar.lastname}}" stepKey="enterLastName"/> + <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{customerAddressVar.street[0]}}" stepKey="enterStreet"/> + <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{customerAddressVar.city}}" stepKey="enterCity"/> + <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/> + <selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{customerAddressVar.country_id}}" stepKey="enterCountry"/> + <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + <click selector="{{CheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> + <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutSelectPaymentAndFillNewBillingAddressActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutSelectPaymentAndFillNewBillingAddressActionGroup.xml new file mode 100644 index 0000000000000..73de73a2d1ed6 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutSelectPaymentAndFillNewBillingAddressActionGroup.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="GuestCheckoutSelectPaymentAndFillNewBillingAddressActionGroup" extends="GuestCheckoutFillNewBillingAddressActionGroup"> + <annotations> + <description>EXTENDS: GuestCheckoutFillNewBillingAddressActionGroup. Clicks on the provided Payment Method on the Storefront Checkout page.</description> + </annotations> + <arguments> + <argument name="paymentMethod" type="string"/> + </arguments> + + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" after="waitForLoading3" stepKey="waitForPaymentSectionLoaded"/> + <conditionalClick selector="{{CheckoutPaymentSection.paymentMethodByName(paymentMethod)}}" dependentSelector="{{CheckoutPaymentSection.billingAddress}}" visible="false" before="enterFirstName" stepKey="clickCheckMoneyOrderPayment"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutWithSpecificCountryOptionForPaymentMethodActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutWithSpecificCountryOptionForPaymentMethodActionGroup.xml new file mode 100644 index 0000000000000..afa09150cfccd --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutWithSpecificCountryOptionForPaymentMethodActionGroup.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="GuestCheckoutWithSpecificCountryOptionForPaymentMethodActionGroup" extends="GuestCheckoutFillingShippingSectionUnavailablePaymentActionGroup"> + <annotations> + <description>EXTENDS: GuestCheckoutFillingShippingSectionUnavailablePaymentActionGroup. Removes 'checkMessage'. Validates that the provided Payment Method Name is NOT present on the Storefront Checkout page.</description> + </annotations> + <arguments> + <argument name="paymentMethod" type="string"/> + </arguments> + + <remove keyForRemoval="checkMessage"/> + <dontSee selector="{{CheckoutPaymentSection.paymentMethodByName(paymentMethod)}}" stepKey="paymentMethodDoesNotAvailable"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInCheckoutFillNewBillingAddressActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInCheckoutFillNewBillingAddressActionGroup.xml new file mode 100644 index 0000000000000..29a71ac938ef6 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInCheckoutFillNewBillingAddressActionGroup.xml @@ -0,0 +1,34 @@ +<?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="LoggedInCheckoutFillNewBillingAddressActionGroup"> + <annotations> + <description>Fills in the provided Address details on the Storefront Checkout Address sections based on the provided Class Prefix (i.e. '._show', '[aria-hidden=false]').</description> + </annotations> + <arguments> + <argument name="Address"/> + <!-- the classPrefix argument is to specifically select the inputs of the correct form + this is to prevent having 3 action groups doing essentially the same thing --> + <argument name="classPrefix" type="string" defaultValue=""/> + </arguments> + + <fillField stepKey="fillFirstName" selector="{{classPrefix}} {{CheckoutShippingSection.firstName}}" userInput="{{Address.firstname}}"/> + <fillField stepKey="fillLastName" selector="{{classPrefix}} {{CheckoutShippingSection.lastName}}" userInput="{{Address.lastname}}"/> + <fillField stepKey="fillCompany" selector="{{classPrefix}} {{CheckoutShippingSection.company}}" userInput="{{Address.company}}"/> + <fillField stepKey="fillPhoneNumber" selector="{{classPrefix}} {{CheckoutShippingSection.telephone}}" userInput="{{Address.telephone}}"/> + <fillField stepKey="fillStreetAddress1" selector="{{classPrefix}} {{CheckoutShippingSection.street}}" userInput="{{Address.street[0]}}"/> + <fillField stepKey="fillStreetAddress2" selector="{{classPrefix}} {{CheckoutShippingSection.street2}}" userInput="{{Address.street[1]}}"/> + <fillField stepKey="fillCityName" selector="{{classPrefix}} {{CheckoutShippingSection.city}}" userInput="{{Address.city}}"/> + <selectOption stepKey="selectState" selector="{{classPrefix}} {{CheckoutShippingSection.region}}" userInput="{{Address.state}}"/> + <fillField stepKey="fillZip" selector="{{classPrefix}} {{CheckoutShippingSection.postcode}}" userInput="{{Address.postcode}}"/> + <selectOption stepKey="selectCounty" selector="{{classPrefix}} {{CheckoutShippingSection.country}}" userInput="{{Address.country_id}}"/> + <waitForPageLoad stepKey="waitForFormUpdate2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInCheckoutWithOneAddressFieldWithoutStateFieldActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInCheckoutWithOneAddressFieldWithoutStateFieldActionGroup.xml new file mode 100644 index 0000000000000..208dfc37cec74 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInCheckoutWithOneAddressFieldWithoutStateFieldActionGroup.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="LoggedInCheckoutWithOneAddressFieldWithoutStateFieldActionGroup" extends="LoggedInCheckoutFillNewBillingAddressActionGroup"> + <annotations> + <description>EXTENDS: LoggedInCheckoutFillNewBillingAddressActionGroup. Removes 'fillStreetAddress2' and 'selectState'.</description> + </annotations> + + <remove keyForRemoval="fillStreetAddress2"/> + <remove keyForRemoval="selectState"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInUserCheckoutAddNewShippingSectionWithoutRegionActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInUserCheckoutAddNewShippingSectionWithoutRegionActionGroup.xml new file mode 100644 index 0000000000000..0c4cea142b4e6 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInUserCheckoutAddNewShippingSectionWithoutRegionActionGroup.xml @@ -0,0 +1,35 @@ +<?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="LoggedInUserCheckoutAddNewShippingSectionWithoutRegionActionGroup"> + <annotations> + <description>Fills in the provided Customer/Address (Excluding Region) details on the Storefront Checkout page under the 'Shipping Address' section. Selects the 1st Shipping Method. Clicks on Next. Validates that the Payment Error Message and URL are present and correct.</description> + </annotations> + <arguments> + <argument name="customerVar"/> + <argument name="customerAddressVar"/> + </arguments> + + <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/> + <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customerVar.lastname}}" stepKey="enterLastName"/> + <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{customerAddressVar.street[0]}}" stepKey="enterStreet"/> + <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{customerAddressVar.city}}" stepKey="enterCity"/> + <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/> + <selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{customerAddressVar.country_id}}" stepKey="enterCountry"/> + <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/> + <click selector="{{CheckoutShippingSection.saveAddress}}" stepKey="clickSaveAddress"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + <click selector="{{CheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> + <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInUserCheckoutFillingShippingSectionActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInUserCheckoutFillingShippingSectionActionGroup.xml new file mode 100644 index 0000000000000..60188224871eb --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/LoggedInUserCheckoutFillingShippingSectionActionGroup.xml @@ -0,0 +1,34 @@ +<?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="LoggedInUserCheckoutFillingShippingSectionActionGroup"> + <annotations> + <description>Fills in the provided Customer/Address (Including Region) details on the Storefront Checkout page under the 'Shipping Address' section. Selects the 1st Shipping Method. Clicks on Next. Validates that the Payment Error Message and URL are present and correct.</description> + </annotations> + <arguments> + <argument name="customerVar" defaultValue="CustomerEntityOne"/> + <argument name="customerAddressVar" defaultValue="CustomerAddressSimple"/> + </arguments> + + <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/> + <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customerVar.lastname}}" stepKey="enterLastName"/> + <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{customerAddressVar.street[0]}}" stepKey="enterStreet"/> + <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{customerAddressVar.city}}" stepKey="enterCity"/> + <selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{customerAddressVar.state}}" stepKey="selectRegion"/> + <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddressVar.postcode}}" stepKey="enterPostcode"/> + <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddressVar.telephone}}" stepKey="enterTelephone"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + <click selector="{{CheckoutShippingSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> + <waitForElement selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" time="30" stepKey="waitForPaymentSectionLoaded"/> + <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/PlaceOrderWithLoggedUserActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/PlaceOrderWithLoggedUserActionGroup.xml new file mode 100644 index 0000000000000..2bd1ee0f7d809 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/PlaceOrderWithLoggedUserActionGroup.xml @@ -0,0 +1,31 @@ +<?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="PlaceOrderWithLoggedUserActionGroup"> + <annotations> + <description>Clicks on 'Proceed to Checkout' on the Storefront Shopping Cart page. Selects the provided Shipping Method. Clicks on Next. Clicks on Place Order. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <!--First available shipping method will be selected if value is not passed for shippingMethod--> + <argument name="shippingMethod" defaultValue="" type="string"/> + </arguments> + + <waitForElementVisible selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="waitProceedToCheckout"/> + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="clickProceedToCheckout"/> + <click selector="{{CheckoutShippingMethodsSection.checkShippingMethodByName('shippingMethod')}}" stepKey="selectShippingMethod"/> + <waitForElement selector="{{CheckoutShippingSection.next}}" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> + <seeInCurrentUrl url="{{CheckoutPage.url}}/#payment" stepKey="assertCheckoutPaymentUrl"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="waitForPlaceOrderButton"/> + <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> + <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/RemoveProductFromMiniCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/RemoveProductFromMiniCartActionGroup.xml new file mode 100644 index 0000000000000..e6626ec357d0e --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/RemoveProductFromMiniCartActionGroup.xml @@ -0,0 +1,27 @@ +<?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="RemoveProductFromMiniCartActionGroup"> + <annotations> + <description>Removed the provided Product from the Storefront Mini Shopping Cart.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + + <conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/> + <waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForMiniCartOpen"/> + <click selector="{{StorefrontMinicartSection.deleteMiniCartItemByName(productName)}}" stepKey="clickDelete"/> + <waitForElementVisible selector="{{StoreFrontRemoveItemModalSection.message}}" stepKey="waitForConfirmationModal"/> + <see selector="{{StoreFrontRemoveItemModalSection.message}}" userInput="Are you sure you would like to remove this item from the shopping cart?" stepKey="seeDeleteConfirmationMessage"/> + <click selector="{{StoreFrontRemoveItemModalSection.ok}}" stepKey="confirmDelete"/> + <waitForPageLoad stepKey="waitForDeleteToFinish"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCartActionGroup.xml new file mode 100644 index 0000000000000..7fbcb96c20d9e --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCartActionGroup.xml @@ -0,0 +1,28 @@ +<?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"> + <!-- Add Product to Cart from the category page and check message and product count in Minicart --> + <actionGroup name="StorefrontAddCategoryProductToCartActionGroup"> + <annotations> + <description>Adds the provided Product to the Cart from a Storefront Category page. Validates that the Success Message is present and correct. Validates that the Mini Shopping Cart contains the provided Product Count.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="productCount"/> + </arguments> + + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> + <click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="clickAddToCart"/> + <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" stepKey="waitForSuccessMessage"/> + <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added {{product.name}} to your shopping cart." stepKey="assertSuccessMessage"/> + <seeLink stepKey="assertLinkToShoppingCart" url="{{_ENV.MAGENTO_BASE_URL}}checkout/cart/" userInput="shopping cart"/> + <waitForText userInput="{{productCount}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCartWithQuantityActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCartWithQuantityActionGroup.xml new file mode 100644 index 0000000000000..c4fe115b70ae4 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCartWithQuantityActionGroup.xml @@ -0,0 +1,32 @@ +<?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="StorefrontAddCategoryProductToCartWithQuantityActionGroup"> + <annotations> + <description>Adds the provided Product to the Cart from a Storefront Category page. Validates that the Success Message is present and correct. Updates the Product Quantity using the provided Product Quantity. Validates that the provided Quantity is present and correct in the Mini Shopping Cart.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="quantity" defaultValue="1" type="string"/> + <argument name="checkQuantity" defaultValue="1" type="string"/> + </arguments> + + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> + <click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="clickAddToCart"/> + <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" stepKey="waitForSuccessMessage"/> + <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added {{product.name}} to your shopping cart." stepKey="assertSuccessMessage"/> + <seeLink stepKey="assertLinkToShoppingCart" url="{{_ENV.MAGENTO_BASE_URL}}checkout/cart/" userInput="shopping cart"/> + <waitForText userInput="{{checkQuantity}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/> + <conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/> + <waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForViewAndEditCartVisible"/> + <fillField selector="{{StorefrontMinicartSection.itemQuantity(product.name)}}" userInput="{{quantity}}" stepKey="setProductQtyToFiftyInMiniCart"/> + <click selector="{{StorefrontMinicartSection.itemQuantityUpdate(product.name)}}" stepKey="updateQtyInMiniCart"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddProductToCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddProductToCartActionGroup.xml new file mode 100644 index 0000000000000..8c1ef9d973297 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddProductToCartActionGroup.xml @@ -0,0 +1,26 @@ +<?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="StorefrontAddProductToCartActionGroup"> + <annotations> + <description>Clicks on Add to Cart on a Storefront Product page. Validates that the Success Message is present and correct. Validates that the provided Product Count is present and correct in the Mini Shopping Cart.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="productCount" type="string"/> + </arguments> + + <click selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="clickAddToCart"/> + <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" stepKey="waitForSuccessMessage"/> + <see selector="{{StorefrontProductPageSection.messagesBlock}}" userInput="You added {{product.name}} to your shopping cart." stepKey="assertSuccessMessage"/> + <seeLink stepKey="assertLinkToShoppingCart" url="{{_ENV.MAGENTO_BASE_URL}}checkout/cart/" userInput="shopping cart"/> + <waitForText userInput="{{productCount}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartActionGroup.xml new file mode 100644 index 0000000000000..bbad2579a47d2 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartActionGroup.xml @@ -0,0 +1,35 @@ +<?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="StorefrontCheckCartActionGroup"> + <annotations> + <description>Goes to the Storefront Shopping Cart page. Validates that the provided Subtotal, Shipping, Shipping Method and Total are present and correct.</description> + </annotations> + <arguments> + <argument name="subtotal" type="string"/> + <argument name="shipping" type="string"/> + <argument name="shippingMethod" type="string" defaultValue="Flat Rate - Fixed"/> + <argument name="total" type="string"/> + </arguments> + + <seeInCurrentUrl url="{{CheckoutCartPage.url}}" stepKey="assertUrl"/> + <waitForPageLoad stepKey="waitForCartPage"/> + <conditionalClick selector="{{CheckoutCartSummarySection.shippingHeading}}" dependentSelector="{{CheckoutCartSummarySection.shippingMethodForm}}" visible="false" stepKey="openEstimateShippingSection"/> + <waitForElementVisible selector="{{CheckoutCartSummarySection.flatRateShippingMethod}}" stepKey="waitForShippingSection"/> + <checkOption selector="{{CheckoutCartSummarySection.flatRateShippingMethod}}" stepKey="selectShippingMethod"/> + <scrollTo selector="{{CheckoutCartSummarySection.subtotal}}" stepKey="scrollToSummary"/> + <see userInput="{{subtotal}}" selector="{{CheckoutCartSummarySection.subtotal}}" stepKey="assertSubtotal"/> + <see userInput="({{shippingMethod}})" selector="{{CheckoutCartSummarySection.shippingMethod}}" stepKey="assertShippingMethod"/> + <reloadPage stepKey="reloadPage" after="assertShippingMethod" /> + <waitForPageLoad stepKey="WaitForPageLoaded" after="reloadPage" /> + <waitForText userInput="{{shipping}}" selector="{{CheckoutCartSummarySection.shipping}}" time="45" stepKey="assertShipping" after="WaitForPageLoaded"/> + <see userInput="{{total}}" selector="{{CheckoutCartSummarySection.total}}" stepKey="assertTotal" after="assertShipping"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartSimpleProductActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartSimpleProductActionGroup.xml new file mode 100644 index 0000000000000..083963f4cc487 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartSimpleProductActionGroup.xml @@ -0,0 +1,24 @@ +<?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="StorefrontCheckCartSimpleProductActionGroup"> + <annotations> + <description>Validates that the provided Product details (Name and Price) are present and correct in the Mini Shopping Cart. Validates that the provided Product Quantity is present and correct in the Mini Shopping Cart.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="productQuantity"/> + </arguments> + + <seeElement selector="{{CheckoutCartProductSection.ProductLinkByName(product.name)}}" stepKey="assertProductName"/> + <see userInput="${{product.price}}.00" selector="{{CheckoutCartProductSection.ProductPriceByName(product.name)}}" stepKey="assertProductPrice"/> + <seeInField userInput="{{productQuantity}}" selector="{{CheckoutCartProductSection.ProductQuantityByName(product.name)}}" stepKey="assertProductQuantity"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartTotalWithDiscountCategoryActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartTotalWithDiscountCategoryActionGroup.xml new file mode 100644 index 0000000000000..c5d2d054f2e8f --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckCartTotalWithDiscountCategoryActionGroup.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="StorefrontCheckCartTotalWithDiscountCategoryActionGroup" extends="StorefrontCheckCartActionGroup"> + <annotations> + <description>EXTENDS: StorefrontCheckCartActionGroup. Validates that the provided Discount is present in the Storefront Shopping Cart.</description> + </annotations> + <arguments> + <argument name="discount" type="string" defaultValue="0"/> + </arguments> + <waitForElementVisible selector="{{CheckoutCartSummarySection.discountAmount}}" stepKey="waitForDiscount"/> + <see selector="{{CheckoutCartSummarySection.discountAmount}}" userInput="-${{discount}}" stepKey="assertDiscount"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckoutFillNewBillingAddressActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckoutFillNewBillingAddressActionGroup.xml new file mode 100644 index 0000000000000..e8949a1864663 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckoutFillNewBillingAddressActionGroup.xml @@ -0,0 +1,15 @@ +<?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="StorefrontCheckoutFillNewBillingAddressActionGroup" extends="GuestCheckoutFillNewBillingAddressActionGroup"> + <remove keyForRemoval="enterEmail"/> + <remove keyForRemoval="waitForLoading3"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckoutForwardFromShippingStepActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckoutForwardFromShippingStepActionGroup.xml new file mode 100644 index 0000000000000..524e3f784ed3f --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckoutForwardFromShippingStepActionGroup.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="StorefrontCheckoutForwardFromShippingStepActionGroup"> + <annotations> + <description>Clicks next on Checkout Shipping step</description> + </annotations> + <waitForElementVisible selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontMiniCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontMiniCartActionGroup.xml deleted file mode 100644 index 6dc5cfd044924..0000000000000 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontMiniCartActionGroup.xml +++ /dev/null @@ -1,65 +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="clickViewAndEditCartFromMiniCart"> - <annotations> - <description>Clicks on the Storefront Mini Shopping Cart icon. Clicks on the 'View and Edit Cart' link. Validates that the URL is present and correct. PLEASE NOTE: The URL is Hardcoded.</description> - </annotations> - - <scrollTo selector="{{StorefrontMinicartSection.showCart}}" stepKey="scrollToMiniCart"/> - <conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/> - <waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForViewAndEditCartVisible"/> - <click selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="viewAndEditCart"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <seeInCurrentUrl url="checkout/cart" stepKey="seeInCurrentUrl"/> - </actionGroup> - - <actionGroup name="assertOneProductNameInMiniCart"> - <annotations> - <description>Validates that the provided Product Name is present in the Storefront Mini Shopping Cart.</description> - </annotations> - <arguments> - <argument name="productName"/> - </arguments> - - <conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/> - <waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForViewAndEditCartVisible"/> - <see selector="{{StorefrontMinicartSection.miniCartItemsText}}" userInput="{{productName}}" stepKey="seeInMiniCart"/> - </actionGroup> - - <!--Remove an item from the cart using minicart--> - <actionGroup name="removeProductFromMiniCart"> - <annotations> - <description>Removed the provided Product from the Storefront Mini Shopping Cart.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - </arguments> - - <conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/> - <waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForMiniCartOpen"/> - <click selector="{{StorefrontMinicartSection.deleteMiniCartItemByName(productName)}}" stepKey="clickDelete"/> - <waitForElementVisible selector="{{StoreFrontRemoveItemModalSection.message}}" stepKey="waitForConfirmationModal"/> - <see selector="{{StoreFrontRemoveItemModalSection.message}}" userInput="Are you sure you would like to remove this item from the shopping cart?" stepKey="seeDeleteConfirmationMessage"/> - <click selector="{{StoreFrontRemoveItemModalSection.ok}}" stepKey="confirmDelete"/> - <waitForPageLoad stepKey="waitForDeleteToFinish"/> - </actionGroup> - - <!--Check that the minicart is empty--> - <actionGroup name="assertMiniCartEmpty"> - <annotations> - <description>Validates that the provided Product Count appears in the Storefront Header next to the Shopping Cart icon. Clicks on the Mini Shopping Cart icon. Validates that the 'No Items' message is present and correct in the Storefront Mini Shopping Cart.</description> - </annotations> - - <dontSeeElement selector="{{StorefrontMinicartSection.productCount}}" stepKey="dontSeeMinicartProductCount"/> - <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="expandMinicart"/> - <see selector="{{StorefrontMinicartSection.minicartContent}}" userInput="You have no items in your shopping cart." stepKey="seeEmptyCartMessage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontOpenCartFromMinicartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontOpenCartFromMinicartActionGroup.xml new file mode 100644 index 0000000000000..3161d1a63b6f8 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontOpenCartFromMinicartActionGroup.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="StorefrontOpenCartFromMinicartActionGroup"> + <annotations> + <description>Clicks on the Storefront Mini Shopping Cart icon. Click on 'View and Edit Cart'.</description> + </annotations> + + <waitForElement selector="{{StorefrontMinicartSection.showCart}}" stepKey="waitForShowMinicart"/> + <waitForElement selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForCartLink"/> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickShowMinicart"/> + <click selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="clickCart"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontOpenMinicartAndCheckSimpleProductActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontOpenMinicartAndCheckSimpleProductActionGroup.xml new file mode 100644 index 0000000000000..28e97dfca5158 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontOpenMinicartAndCheckSimpleProductActionGroup.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="StorefrontOpenMinicartAndCheckSimpleProductActionGroup"> + <annotations> + <description>Clicks on the Storefront Mini Shopping Cart icon. Validates that the provided Product is present and correct in the Mini Shopping Cart.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <waitForElement selector="{{StorefrontMinicartSection.productLinkByName(product.name)}}" stepKey="waitForMinicartProduct"/> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickShowMinicart"/> + <see userInput="${{product.price}}.00" selector="{{StorefrontMinicartSection.productPriceByName(product.name)}}" stepKey="assertProductPrice"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml deleted file mode 100644 index b07bcdccce674..0000000000000 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml +++ /dev/null @@ -1,161 +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"> - <!-- Add Product to Cart from the category page and check message and product count in Minicart --> - <actionGroup name="StorefrontAddCategoryProductToCartActionGroup"> - <annotations> - <description>Adds the provided Product to the Cart from a Storefront Category page. Validates that the Success Message is present and correct. Validates that the Mini Shopping Cart contains the provided Product Count.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="productCount"/> - </arguments> - - <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> - <click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="clickAddToCart"/> - <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" stepKey="waitForSuccessMessage"/> - <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added {{product.name}} to your shopping cart." stepKey="assertSuccessMessage"/> - <seeLink stepKey="assertLinkToShoppingCart" url="{{_ENV.MAGENTO_BASE_URL}}checkout/cart/" userInput="shopping cart"/> - <waitForText userInput="{{productCount}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/> - </actionGroup> - - <!-- Add Product to Cart from the category page with specified quantity and check message and product count in Minicart --> - <actionGroup name="StorefrontAddCategoryProductToCartWithQuantityActionGroup"> - <annotations> - <description>Adds the provided Product to the Cart from a Storefront Category page. Validates that the Success Message is present and correct. Updates the Product Quantity using the provided Product Quantity. Validates that the provided Quantity is present and correct in the Mini Shopping Cart.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="quantity" defaultValue="1" type="string"/> - <argument name="checkQuantity" defaultValue="1" type="string"/> - </arguments> - - <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> - <click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="clickAddToCart"/> - <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" stepKey="waitForSuccessMessage"/> - <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added {{product.name}} to your shopping cart." stepKey="assertSuccessMessage"/> - <seeLink stepKey="assertLinkToShoppingCart" url="{{_ENV.MAGENTO_BASE_URL}}checkout/cart/" userInput="shopping cart"/> - <waitForText userInput="{{checkQuantity}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/> - <conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/> - <waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForViewAndEditCartVisible"/> - <fillField selector="{{StorefrontMinicartSection.itemQuantity(product.name)}}" userInput="{{quantity}}" stepKey="setProductQtyToFiftyInMiniCart"/> - <click selector="{{StorefrontMinicartSection.itemQuantityUpdate(product.name)}}" stepKey="updateQtyInMiniCart"/> - </actionGroup> - - <!-- Add Product to Cart from the product page and check message and product count in Minicart --> - <actionGroup name="StorefrontAddProductToCartActionGroup"> - <annotations> - <description>Clicks on Add to Cart on a Storefront Product page. Validates that the Success Message is present and correct. Validates that the provided Product Count is present and correct in the Mini Shopping Cart.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="productCount" type="string"/> - </arguments> - - <click selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="clickAddToCart"/> - <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" stepKey="waitForSuccessMessage"/> - <see selector="{{StorefrontProductPageSection.messagesBlock}}" userInput="You added {{product.name}} to your shopping cart." stepKey="assertSuccessMessage"/> - <seeLink stepKey="assertLinkToShoppingCart" url="{{_ENV.MAGENTO_BASE_URL}}checkout/cart/" userInput="shopping cart"/> - <waitForText userInput="{{productCount}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/> - </actionGroup> - - <!-- Open the Minicart and check Simple Product --> - <actionGroup name="StorefrontOpenMinicartAndCheckSimpleProductActionGroup"> - <annotations> - <description>Clicks on the Storefront Mini Shopping Cart icon. Validates that the provided Product is present and correct in the Mini Shopping Cart.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <waitForElement selector="{{StorefrontMinicartSection.productLinkByName(product.name)}}" stepKey="waitForMinicartProduct"/> - <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickShowMinicart"/> - <see userInput="${{product.price}}.00" selector="{{StorefrontMinicartSection.productPriceByName(product.name)}}" stepKey="assertProductPrice"/> - </actionGroup> - - <!-- Check Simple Product in the Cart --> - <actionGroup name="StorefrontCheckCartSimpleProductActionGroup"> - <annotations> - <description>Validates that the provided Product details (Name and Price) are present and correct in the Mini Shopping Cart. Validates that the provided Product Quantity is present and correct in the Mini Shopping Cart.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="productQuantity"/> - </arguments> - - <seeElement selector="{{CheckoutCartProductSection.ProductLinkByName(product.name)}}" stepKey="assertProductName"/> - <see userInput="${{product.price}}.00" selector="{{CheckoutCartProductSection.ProductPriceByName(product.name)}}" stepKey="assertProductPrice"/> - <seeInField userInput="{{productQuantity}}" selector="{{CheckoutCartProductSection.ProductQuantityByName(product.name)}}" stepKey="assertProductQuantity"/> - </actionGroup> - - <!-- Check the Cart --> - <actionGroup name="StorefrontCheckCartActionGroup"> - <annotations> - <description>Goes to the Storefront Shopping Cart page. Validates that the provided Subtotal, Shipping, Shipping Method and Total are present and correct.</description> - </annotations> - <arguments> - <argument name="subtotal" type="string"/> - <argument name="shipping" type="string"/> - <argument name="shippingMethod" type="string" defaultValue="Flat Rate - Fixed"/> - <argument name="total" type="string"/> - </arguments> - - <seeInCurrentUrl url="{{CheckoutCartPage.url}}" stepKey="assertUrl"/> - <waitForPageLoad stepKey="waitForCartPage"/> - <conditionalClick selector="{{CheckoutCartSummarySection.shippingHeading}}" dependentSelector="{{CheckoutCartSummarySection.shippingMethodForm}}" visible="false" stepKey="openEstimateShippingSection"/> - <waitForElementVisible selector="{{CheckoutCartSummarySection.flatRateShippingMethod}}" stepKey="waitForShippingSection"/> - <checkOption selector="{{CheckoutCartSummarySection.flatRateShippingMethod}}" stepKey="selectShippingMethod"/> - <scrollTo selector="{{CheckoutCartSummarySection.subtotal}}" stepKey="scrollToSummary"/> - <see userInput="{{subtotal}}" selector="{{CheckoutCartSummarySection.subtotal}}" stepKey="assertSubtotal"/> - <see userInput="({{shippingMethod}})" selector="{{CheckoutCartSummarySection.shippingMethod}}" stepKey="assertShippingMethod"/> - <reloadPage stepKey="reloadPage" after="assertShippingMethod" /> - <waitForPageLoad stepKey="WaitForPageLoaded" after="reloadPage" /> - <waitForText userInput="{{shipping}}" selector="{{CheckoutCartSummarySection.shipping}}" time="45" stepKey="assertShipping" after="WaitForPageLoaded"/> - <see userInput="{{total}}" selector="{{CheckoutCartSummarySection.total}}" stepKey="assertTotal" after="assertShipping"/> - </actionGroup> - - <!-- Open the Cart from Minicart--> - <actionGroup name="StorefrontOpenCartFromMinicartActionGroup"> - <annotations> - <description>Clicks on the Storefront Mini Shopping Cart icon. Click on 'View and Edit Cart'.</description> - </annotations> - - <waitForElement selector="{{StorefrontMinicartSection.showCart}}" stepKey="waitForShowMinicart"/> - <waitForElement selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForCartLink"/> - <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickShowMinicart"/> - <click selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="clickCart"/> - </actionGroup> - - <actionGroup name="changeSummaryQuoteAddress"> - <annotations> - <description>Fills in the provided Address details (Country, State and Zip Code) under the 'Summary' section on the Storefront Shopping Cart page.</description> - </annotations> - <arguments> - <argument name="taxCode"/> - </arguments> - - <conditionalClick stepKey="openShippingDetails" selector="{{CheckoutCartSummarySection.shippingHeading}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false"/> - <selectOption stepKey="selectCountry" selector="{{CheckoutCartSummarySection.country}}" userInput="{{taxCode.country}}"/> - <selectOption stepKey="selectStateProvince" selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{taxCode.state}}"/> - <fillField stepKey="fillZip" selector="{{CheckoutCartSummarySection.postcode}}" userInput="{{taxCode.zip}}"/> - <waitForPageLoad stepKey="waitForFormUpdate"/> - </actionGroup> - - <actionGroup name="StorefrontCheckCartTotalWithDiscountCategoryActionGroup" extends="StorefrontCheckCartActionGroup"> - <annotations> - <description>EXTENDS: StorefrontCheckCartActionGroup. Validates that the provided Discount is present in the Storefront Shopping Cart.</description> - </annotations> - <arguments> - <argument name="discount" type="string" defaultValue="0"/> - </arguments> - <waitForElementVisible selector="{{CheckoutCartSummarySection.discountAmount}}" stepKey="waitForDiscount"/> - <see selector="{{CheckoutCartSummarySection.discountAmount}}" userInput="-${{discount}}" stepKey="assertDiscount"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontSignOutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontSignOutActionGroup.xml new file mode 100644 index 0000000000000..8eac90fff2268 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontSignOutActionGroup.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="StorefrontSignOutActionGroup"> + <annotations> + <description>Clicks on the Customer Account link. Clicks on 'Sign Out'. Validates that the Signed Out message is present and correct.</description> + </annotations> + + <click selector="{{StoreFrontSignOutSection.customerAccount}}" stepKey="clickCustomerButton"/> + <click selector="{{StoreFrontSignOutSection.signOut}}" stepKey="clickToSignOut"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <see userInput="You are signed out" stepKey="signOut"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/VerifyCheckoutPaymentOrderSummaryActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/VerifyCheckoutPaymentOrderSummaryActionGroup.xml index 6d8d390d36701..0ae71884745c6 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/VerifyCheckoutPaymentOrderSummaryActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/VerifyCheckoutPaymentOrderSummaryActionGroup.xml @@ -23,27 +23,4 @@ <see selector="{{CheckoutPaymentSection.orderSummaryShippingTotal}}" userInput="{{orderSummaryShippingTotal}}" stepKey="seeCorrectShipping"/> <see selector="{{CheckoutPaymentSection.orderSummaryTotal}}" userInput="{{orderSummaryTotal}}" stepKey="seeCorrectOrderTotal"/> </actionGroup> - <!-- Assert Order Summary SubTotal You should be on checkout page --> - <actionGroup name="AssertStorefrontCheckoutPaymentSummarySubtotalActionGroup"> - <arguments> - <argument name="orderSubtotal" type="string"/> - </arguments> - <waitForPageLoad time="30" stepKey="waitForCartFullyLoaded"/> - <waitForElementVisible selector="{{CheckoutPaymentSection.orderSummarySubtotal}}" time="30" stepKey="waitForOrderSummaryBlock"/> - <see selector="{{CheckoutPaymentSection.orderSummarySubtotal}}" userInput="{{orderSubtotal}}" stepKey="seeCorrectSubtotal"/> - </actionGroup> - <!-- Assert Order Summary Total You should be on checkout page --> - <actionGroup name="AssertStorefrontCheckoutPaymentSummaryTotalActionGroup"> - <arguments> - <argument name="orderTotal" type="string"/> - </arguments> - <waitForPageLoad time="30" stepKey="waitForCartFullyLoaded"/> - <waitForElementVisible selector="{{CheckoutPaymentSection.orderSummaryTotal}}" time="30" stepKey="waitForOrderSummaryBlock"/> - <see selector="{{CheckoutPaymentSection.orderSummaryTotal}}" userInput="{{orderTotal}}" stepKey="seeCorrectOrderTotal"/> - </actionGroup> - <!-- Assert Order Summary Total Is Not Shown You should be on checkout page --> - <actionGroup name="AssertStorefrontCheckoutPaymentSummaryTotalMissingActionGroup"> - <waitForPageLoad time="30" stepKey="waitForCartFullyLoaded"/> - <dontSeeElement selector="{{CheckoutPaymentSection.orderSummaryTotal}}" stepKey="seeTotalElement"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/VerifyTopDestinationsCountryActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/VerifyTopDestinationsCountryActionGroup.xml new file mode 100644 index 0000000000000..74f48ff2fc155 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/VerifyTopDestinationsCountryActionGroup.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="VerifyTopDestinationsCountryActionGroup"> + <annotations> + <description>Validates that the provided Country is listed at the provided Index in 'Country' drop down menu on the Storefront Shopping Cart page under the 'Summary' section.</description> + </annotations> + <arguments> + <argument name="country" type="string"/> + <argument name="placeNumber"/> + </arguments> + + <conditionalClick selector="{{CheckoutCartSummarySection.shippingHeading}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="openShippingDetails"/> + <see selector="{{CheckoutCartSummarySection.countryParameterized('placeNumber')}}" userInput="{{country}}" stepKey="seeCountry"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/clearCheckoutAddressPopupFieldsActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/clearCheckoutAddressPopupFieldsActionGroup.xml new file mode 100644 index 0000000000000..f19d5b5e9cd41 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/clearCheckoutAddressPopupFieldsActionGroup.xml @@ -0,0 +1,30 @@ +<?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="clearCheckoutAddressPopupFieldsActionGroup"> + <annotations> + <description>Clears the fields for the Customer/Address fields on the Storefront Checkout Address sections based on the provided Class Prefix (i.e. '._show', '[aria-hidden=false]').</description> + </annotations> + <arguments> + <argument name="classPrefix" type="string" defaultValue=""/> + </arguments> + + <clearField selector="{{classPrefix}} {{CheckoutShippingSection.firstName}}" stepKey="clearFieldFirstName"/> + <clearField selector="{{classPrefix}} {{CheckoutShippingSection.lastName}}" stepKey="clearFieldLastName"/> + <clearField selector="{{classPrefix}} {{CheckoutShippingSection.company}}" stepKey="clearFieldCompany"/> + <clearField selector="{{classPrefix}} {{CheckoutShippingSection.street}}" stepKey="clearFieldStreetAddress1"/> + <clearField selector="{{classPrefix}} {{CheckoutShippingSection.street2}}" stepKey="clearFieldStreetAddress2"/> + <clearField selector="{{classPrefix}} {{CheckoutShippingSection.city}}" stepKey="clearFieldCityName"/> + <selectOption selector="{{classPrefix}} {{CheckoutShippingSection.region}}" userInput="" stepKey="clearFieldRegion"/> + <clearField selector="{{classPrefix}} {{CheckoutShippingSection.postcode}}" stepKey="clearFieldZip"/> + <selectOption selector="{{classPrefix}} {{CheckoutShippingSection.country}}" userInput="" stepKey="clearFieldCounty"/> + <clearField selector="{{classPrefix}} {{CheckoutShippingSection.telephone}}" stepKey="clearFieldPhoneNumber"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/CheckNotVisibleProductInMinicartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/CheckNotVisibleProductInMinicartTest.xml index 4b4ca1935fd78..952e4460faa00 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/CheckNotVisibleProductInMinicartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/CheckNotVisibleProductInMinicartTest.xml @@ -33,7 +33,7 @@ <!--Check simple product1 in minicart--> <comment userInput="Check simple product 1 in minicart" stepKey="commentCheckSimpleProduct1InMinicart" after="addToCartFromStorefrontProductPage1"/> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="assertProduct1NameInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="assertProduct1NameInMiniCart"> <argument name="productName" value="$$createSimpleProduct1.name$$"/> </actionGroup> @@ -53,13 +53,13 @@ <!--Check simple product1 in minicart--> <comment userInput="Check hidden simple product 1 in minicart" stepKey="commentCheckHiddenSimpleProduct1InMinicart" after="addToCartFromStorefrontProductPage2"/> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="assertHiddenProduct1NameInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="assertHiddenProduct1NameInMiniCart"> <argument name="productName" value="$$createSimpleProduct1.name$$"/> </actionGroup> <!--Check simple product2 in minicart--> <comment userInput="Check hidden simple product 2 in minicart" stepKey="commentCheckSimpleProduct2InMinicart" after="addToCartFromStorefrontProductPage2"/> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="assertProduct2NameInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="assertProduct2NameInMiniCart"> <argument name="productName" value="$$createSimpleProduct2.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml index f3807388399b8..8d069828c097c 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml @@ -51,7 +51,7 @@ <amOnPage url="{{CheckoutCartPage.url}}" stepKey="amOnPageShoppingCart"/> <!--Verify country options in checkout top destination section--> - <actionGroup ref="VerifyTopDestinationsCountry" stepKey="verifyTopDestinationsCountry"> + <actionGroup ref="VerifyTopDestinationsCountryActionGroup" stepKey="verifyTopDestinationsCountry"> <argument name="country" value="Bahamas"/> <argument name="placeNumber" value="2"/> </actionGroup> @@ -71,7 +71,7 @@ <amOnPage url="{{CheckoutCartPage.url}}" stepKey="amOnPageShoppingCart2"/> <!--Verify country options is shown by default--> - <actionGroup ref="VerifyTopDestinationsCountry" stepKey="verifyTopDestinationsCountry2"> + <actionGroup ref="VerifyTopDestinationsCountryActionGroup" stepKey="verifyTopDestinationsCountry2"> <argument name="country" value="Afghanistan"/> <argument name="placeNumber" value="2"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml index 166f5022d5aeb..08534351906ee 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml @@ -44,7 +44,7 @@ <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> <!-- Click "+ New Address" and Fill new address--> <click selector="{{CheckoutShippingSection.newAddressButton}}" stepKey="addAddress"/> - <actionGroup ref="LoggedInCheckoutWithOneAddressFieldWithoutStateField" stepKey="changeAddress"> + <actionGroup ref="LoggedInCheckoutWithOneAddressFieldWithoutStateFieldActionGroup" stepKey="changeAddress"> <argument name="Address" value="UK_Not_Default_Address"/> <argument name="classPrefix" value="._show"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml index aa3665a81bbde..6202477f23f49 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml @@ -50,7 +50,7 @@ </actionGroup> <!-- Go to shopping cart --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <actionGroup ref="FillShippingZipForm" stepKey="fillShippingZipForm"> <argument name="address" value="US_Address_CA"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml index bafad6f28a680..961780a329dea 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml @@ -50,7 +50,7 @@ </actionGroup> <!-- Go to shopping cart --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <actionGroup ref="FillShippingZipForm" stepKey="fillShippingZipForm"> <argument name="address" value="US_Address_CA"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml index 2c341a5c4c1ab..3fc825f0d6405 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml @@ -50,7 +50,7 @@ </actionGroup> <!-- Go to shopping cart --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <actionGroup ref="FillShippingZipForm" stepKey="fillShippingZipForm"> <argument name="address" value="US_Address_CA"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml index 990459d7c81b7..adb6120800a1e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml @@ -50,7 +50,7 @@ </actionGroup> <!-- Go to shopping cart --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <actionGroup ref="FillShippingZipForm" stepKey="fillShippingZipForm"> <argument name="address" value="US_Address_CA"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml index e85a47ab7a91d..f21e211193b26 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml @@ -159,7 +159,7 @@ </actionGroup> <!--Go to shopping cart--> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <actionGroup ref="FillShippingZipForm" stepKey="fillShippingZipForm"> <argument name="address" value="US_Address_CA"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml index 84cdb8abd9344..f85264db07da6 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml @@ -137,10 +137,10 @@ <!-- Assert products in mini cart for first customer --> <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToStoreFrontHomePage"/> <waitForPageLoad stepKey="waitForHomePageLoad"/> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="assertFirstProductInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="assertFirstProductInMiniCart"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="assertSecondProductInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="assertSecondProductInMiniCart"> <argument name="productName" value="$$createSimpleProductWithCustomOptions.name$$"/> </actionGroup> <actionGroup ref="AssertMiniShoppingCartSubTotalActionGroup" stepKey="assertMiniCartSubTotal"> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml index fb80b4880a6f4..9c5aef12237d7 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml @@ -37,7 +37,7 @@ </actionGroup> <!--Go to Shopping cart and check Qty--> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCart"/> <grabValueFrom selector="{{CheckoutCartProductSection.ProductQuantityByName($$createProduct.name$$)}}" stepKey="grabQtyShoppingCart"/> <assertEquals expected="1" actual="$grabQtyShoppingCart" stepKey="assertQtyShoppingCart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml index 071311b78b3fa..bd2bad402d25e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml @@ -82,7 +82,7 @@ </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!--Assert Shopping Cart Summary--> <actionGroup ref="AssertStorefrontShoppingCartSummaryWithShippingActionGroup" stepKey="AssertCartSummary" > diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml index e3090d6cb311b..e716ba294f578 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddConfigurableProductToShoppingCartTest.xml @@ -131,7 +131,7 @@ </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!--Assert Shopping Cart Summary --> <actionGroup ref="AssertStorefrontShoppingCartSummaryWithShippingActionGroup" stepKey="AssertCartSummary" > diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddDownloadableProductToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddDownloadableProductToShoppingCartTest.xml index ec9852a6a939d..3c1421f2616aa 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddDownloadableProductToShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddDownloadableProductToShoppingCartTest.xml @@ -47,7 +47,7 @@ </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!--Assert Shopping Cart Summary--> <actionGroup ref="AssertStorefrontShoppingCartSummaryItemsActionGroup" stepKey="AssertCartSummary" > diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddGroupedProductToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddGroupedProductToShoppingCartTest.xml index b3762c7a582b7..0fc4cee5e0582 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddGroupedProductToShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddGroupedProductToShoppingCartTest.xml @@ -64,7 +64,7 @@ </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!--Assert Product1 items in cart --> <actionGroup ref="AssertStorefrontCheckoutCartItemsActionGroup" stepKey="assertSimpleProduct1ItemsInCheckOutCart"> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml index 9b8e5a4521115..c7cd69bf8b01a 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml @@ -81,7 +81,7 @@ </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!--Assert Shopping Cart Summary--> <actionGroup ref="AssertStorefrontShoppingCartSummaryWithShippingActionGroup" stepKey="AssertCartSummary" > diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml index 71e99f41f79e1..2dd9ed0907c90 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml @@ -79,7 +79,7 @@ </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!--Assert Shopping Cart Summary--> <actionGroup ref="AssertStorefrontShoppingCartSummaryWithShippingActionGroup" stepKey="AssertCartSummary" > diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml index c5d1c34a93b32..20cd28b148df0 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml @@ -59,7 +59,7 @@ </actionGroup> <!--Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/> <!-- Fill the Estimate Shipping and Tax section --> <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> @@ -127,4 +127,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml index 34dc6617d25d5..87d5b9de911cb 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml @@ -45,7 +45,7 @@ </actionGroup> <!--Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/> <!-- Fill the Estimate Shipping and Tax section --> <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> @@ -98,4 +98,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml index 6ccb05bf4c4f7..5efeef7922a53 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml @@ -123,7 +123,7 @@ </actionGroup> <!--Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/> <!-- Fill the Estimate Shipping and Tax section --> <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> @@ -168,4 +168,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml index 0e704e5336db9..a35e503a3958a 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml @@ -52,7 +52,7 @@ </actionGroup> <!-- Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart1"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart1"/> <!-- Fill the Estimate Shipping and Tax section --> <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml index b0b72515611e8..50631ad6c4c3f 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml @@ -49,7 +49,7 @@ </actionGroup> <!--Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/> <!-- Fill the Estimate Shipping and Tax section --> <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> @@ -91,4 +91,4 @@ <!-- Ship the order and assert the shipping status --> <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml index f7e54867b1ae4..4907bc6672663 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml @@ -49,7 +49,7 @@ </actionGroup> <!--Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/> <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/> <waitForPageLoad stepKey="waitForPageToLoad"/> @@ -83,7 +83,7 @@ <see userInput="You saved the address." stepKey="verifyAddressAdded"/> <!-- Open Edit and View from cart --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="openViewAndEditOption"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="openViewAndEditOption"/> <!-- Proceed to checkout --> <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout1"/> @@ -129,4 +129,4 @@ <!-- Ship the order and assert the shipping status --> <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerLoginDuringCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerLoginDuringCheckoutTest.xml index 3a0ba2302a6dc..afefbff5ea59a 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerLoginDuringCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerLoginDuringCheckoutTest.xml @@ -55,7 +55,7 @@ </actionGroup> <!-- Go to Checkout page --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="clickProceedToCheckout"/> <waitForPageLoad stepKey="waitForProceedToCheckout"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml index 651c5bd8d4375..f4dad72616038 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml @@ -46,7 +46,7 @@ <!-- Click "+ New Address" and Fill new address--> <click selector="{{CheckoutShippingSection.newAddressButton}}" stepKey="addAddress"/> - <actionGroup ref="LoggedInCheckoutWithOneAddressFieldWithoutStateField" stepKey="changeAddress"> + <actionGroup ref="LoggedInCheckoutWithOneAddressFieldWithoutStateFieldActionGroup" stepKey="changeAddress"> <argument name="Address" value="UK_Not_Default_Address"/> <argument name="classPrefix" value="._show"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml index 8f3ddbb27f62f..a8aa61dd40366 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml @@ -75,18 +75,18 @@ </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="seeProductInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="seeProductInMiniCart"> <argument name="productName" value="$$createBundleProduct.name$$"/> </actionGroup> <!--Remove an item from the cart using minicart--> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProductFromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProductFromMiniCart"> <argument name="productName" value="$$createBundleProduct.name$$"/> </actionGroup> <reloadPage stepKey="reloadPage"/> <!--Check the minicart is empty and verify AssertProductAbsentInMiniShoppingCart--> - <actionGroup ref="assertMiniCartEmpty" stepKey="miniCartEnpty"/> + <actionGroup ref="AssertMiniCartEmptyActionGroup" stepKey="miniCartEnpty"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$createBundleProduct.name$$)}}" stepKey="verifyAssertProductAbsentInMiniShoppingCart"/> </test> </tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromMiniShoppingCartTest.xml index f6357bcf4caa2..34264e5982651 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteConfigurableProductFromMiniShoppingCartTest.xml @@ -83,18 +83,18 @@ </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="seeProductInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="seeProductInMiniCart"> <argument name="productName" value="$$createConfigProduct.name$$"/> </actionGroup> <!--Remove an item from the cart using minicart--> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProductFromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProductFromMiniCart"> <argument name="productName" value="$$createConfigProduct.name$$"/> </actionGroup> <reloadPage stepKey="reloadPage"/> <!--Check the minicart is empty and verify AssertProductAbsentInMiniShoppingCart--> - <actionGroup ref="assertMiniCartEmpty" stepKey="miniCartEnpty"/> + <actionGroup ref="AssertMiniCartEmptyActionGroup" stepKey="miniCartEnpty"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$createConfigProduct.name$$)}}" stepKey="verifyAssertProductAbsentInMiniShoppingCart"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteDownloadableProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteDownloadableProductFromMiniShoppingCartTest.xml index 0fa503e1783b5..dd9259833cbc4 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteDownloadableProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteDownloadableProductFromMiniShoppingCartTest.xml @@ -46,7 +46,7 @@ </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!-- Assert product details in Mini Cart --> <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickOnMiniCart"/> @@ -59,18 +59,18 @@ </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="seeProductInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="seeProductInMiniCart"> <argument name="productName" value="$$createDownloadableProduct.name$$"/> </actionGroup> <!--Remove an item from the cart using minicart--> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProductFromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProductFromMiniCart"> <argument name="productName" value="$$createDownloadableProduct.name$$"/> </actionGroup> <reloadPage stepKey="reloadPage"/> <!--Check the minicart is empty and verify AssertProductAbsentInMiniShoppingCart--> - <actionGroup ref="assertMiniCartEmpty" stepKey="miniCartEnpty"/> + <actionGroup ref="AssertMiniCartEmptyActionGroup" stepKey="miniCartEnpty"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$createDownloadableProduct.name$$)}}" stepKey="verifyAssertProductAbsentInMiniShoppingCart"/> </test> </tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest.xml index cca5268564b12..65f29dcd126d3 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest.xml @@ -237,40 +237,40 @@ </actionGroup> <!--Remove products from minicart--> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct1FromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProduct1FromMiniCart"> <argument name="productName" value="$$simpleProduct10.name$$"/> </actionGroup> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct2FromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProduct2FromMiniCart"> <argument name="productName" value="$$simpleProduct9.name$$"/> </actionGroup> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct3FromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProduct3FromMiniCart"> <argument name="productName" value="$$simpleProduct8.name$$"/> </actionGroup> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct4FromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProduct4FromMiniCart"> <argument name="productName" value="$$simpleProduct7.name$$"/> </actionGroup> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct5FromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProduct5FromMiniCart"> <argument name="productName" value="$$simpleProduct6.name$$"/> </actionGroup> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct6FromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProduct6FromMiniCart"> <argument name="productName" value="$$simpleProduct5.name$$"/> </actionGroup> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct7FromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProduct7FromMiniCart"> <argument name="productName" value="$$simpleProduct4.name$$"/> </actionGroup> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct8FromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProduct8FromMiniCart"> <argument name="productName" value="$$simpleProduct3.name$$"/> </actionGroup> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct9FromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProduct9FromMiniCart"> <argument name="productName" value="$$simpleProduct2.name$$"/> </actionGroup> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProduct10FromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProduct10FromMiniCart"> <argument name="productName" value="$$simpleProduct1.name$$"/> </actionGroup> <reloadPage stepKey="reloadPage"/> <!--Check the minicart is empty and verify EmptyCartMessage and AssertProductAbsentInMiniShoppingCart--> - <actionGroup ref="assertMiniCartEmpty" stepKey="miniCartEnpty"/> + <actionGroup ref="AssertMiniCartEmptyActionGroup" stepKey="miniCartEnpty"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct1.name$$)}}" stepKey="verifyAssertProduct1AbsentInMiniShoppingCart"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct2.name$$)}}" stepKey="verifyAssertProduct2AbsentInMiniShoppingCart"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct3.name$$)}}" stepKey="verifyAssertProduct3AbsentInMiniShoppingCart"/> @@ -282,4 +282,4 @@ <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct9.name$$)}}" stepKey="verifyAssertProduct9AbsentInMiniShoppingCart"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct10.name$$)}}" stepKey="verifyAssertProduct10AbsentInMiniShoppingCart"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml index b8092ccdcdce7..c2c939a19cc76 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml @@ -64,25 +64,25 @@ </actionGroup> <!-- Select mini Cart and verify Simple and Virtual products names in cart--> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="seeSimpleProductInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="seeSimpleProductInMiniCart"> <argument name="productName" value="$$simpleProduct.name$$"/> </actionGroup> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="seeVirtualProductInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="seeVirtualProductInMiniCart"> <argument name="productName" value="$$virtualProduct.name$$"/> </actionGroup> <!--Remove Simple and Virtual products from mini cart--> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProductFromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProductFromMiniCart"> <argument name="productName" value="$$simpleProduct.name$$"/> </actionGroup> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeVirtualProductFromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeVirtualProductFromMiniCart"> <argument name="productName" value="$$virtualProduct.name$$"/> </actionGroup> <reloadPage stepKey="reloadPage"/> <!--Check the minicart is empty and verify EmptyCartMessage and AssertProductAbsentInMiniShoppingCart--> - <actionGroup ref="assertMiniCartEmpty" stepKey="miniCartEnpty"/> + <actionGroup ref="AssertMiniCartEmptyActionGroup" stepKey="miniCartEnpty"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct.name$$)}}" stepKey="verifyAssertSimpleProductAbsentInMiniShoppingCart"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$virtualProduct.name$$)}}" stepKey="verifyAssertVirtualProductAbsentInMiniShoppingCart"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleProductFromMiniShoppingCartTest.xml index 05198060f5de4..02943b7f203f7 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleProductFromMiniShoppingCartTest.xml @@ -46,18 +46,18 @@ </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="seeProductInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="seeProductInMiniCart"> <argument name="productName" value="$$simpleProduct.name$$"/> </actionGroup> <!--Remove an item from the cart using minicart--> - <actionGroup ref="removeProductFromMiniCart" stepKey="removeProductFromMiniCart"> + <actionGroup ref="RemoveProductFromMiniCartActionGroup" stepKey="removeProductFromMiniCart"> <argument name="productName" value="$$simpleProduct.name$$"/> </actionGroup> <reloadPage stepKey="reloadPage"/> <!--Check the minicart is empty and verify AssertProductAbsentInMiniShoppingCart--> - <actionGroup ref="assertMiniCartEmpty" stepKey="miniCartEnpty"/> + <actionGroup ref="AssertMiniCartEmptyActionGroup" stepKey="miniCartEnpty"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct.name$$)}}" stepKey="verifyAssertProductAbsentInMiniShoppingCart"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml index 2226e1ebc8292..fdcdcb1cbd9e3 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml @@ -161,7 +161,7 @@ </actionGroup> <!--Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/> <!-- Fill the Estimate Shipping and Tax section --> <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"> @@ -220,4 +220,4 @@ <argument name="customerGroup" value=""/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml index 33ec099aa2ace..45e1d2c10e8d2 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml @@ -41,7 +41,7 @@ </actionGroup> <!--Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/> <!-- Fill the Estimate Shipping and Tax section --> <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> @@ -90,4 +90,4 @@ <see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$0.00" stepKey="seeGrandTotal"/> <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderStatus"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontNotApplicableShippingMethodInReviewAndPaymentStepTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontNotApplicableShippingMethodInReviewAndPaymentStepTest.xml index 0f07549ff7885..8a4d8944a1e11 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontNotApplicableShippingMethodInReviewAndPaymentStepTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontNotApplicableShippingMethodInReviewAndPaymentStepTest.xml @@ -112,7 +112,7 @@ </actionGroup> <!-- Go to Order review --> - <actionGroup ref="StorefrontCheckoutForwardFromShippingStep" stepKey="goToCheckoutReview"/> + <actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="goToCheckoutReview"/> <!-- Checkout select Check/Money Order payment --> <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment"/> @@ -142,7 +142,7 @@ </actionGroup> <!-- Go to Order review --> - <actionGroup ref="StorefrontCheckoutForwardFromShippingStep" stepKey="goToCheckoutReview2"/> + <actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="goToCheckoutReview2"/> <!-- Place order assert succeed --> <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="checkoutPlaceOrder"/> @@ -167,7 +167,7 @@ </actionGroup> <!-- Go to Order review --> - <actionGroup ref="StorefrontCheckoutForwardFromShippingStep" stepKey="goToCheckoutReview3"/> + <actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="goToCheckoutReview3"/> <!-- Checkout select Check/Money Order payment --> <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyPayment2"/> @@ -198,7 +198,7 @@ </actionGroup> <!-- Go to Order review --> - <actionGroup ref="StorefrontCheckoutForwardFromShippingStep" stepKey="goToCheckoutReview4"/> + <actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="goToCheckoutReview4"/> <!-- Place order assert succeed --> <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="checkoutPlaceOrder2"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml index 285dc28cb520e..3404bb4baac54 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml @@ -42,7 +42,7 @@ </actionGroup> <!--Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/> <!-- Fill the Estimate Shipping and Tax section --> <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> @@ -102,4 +102,4 @@ </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="Out Of Stock" stepKey="seeProductDisplayedAsOutOfStock"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontRefreshPageDuringGuestCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontRefreshPageDuringGuestCheckoutTest.xml index 1db460de44996..bb74726330b68 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontRefreshPageDuringGuestCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontRefreshPageDuringGuestCheckoutTest.xml @@ -41,7 +41,7 @@ </actionGroup> <!-- Go to Checkout page --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="clickProceedToCheckout"/> <waitForPageLoad stepKey="waitForProceedToCheckout"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontShoppingCartCheckCustomerDefaultShippingAddressForVirtualQuoteTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontShoppingCartCheckCustomerDefaultShippingAddressForVirtualQuoteTest.xml index b0e1dead1fff9..89e974892427d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontShoppingCartCheckCustomerDefaultShippingAddressForVirtualQuoteTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontShoppingCartCheckCustomerDefaultShippingAddressForVirtualQuoteTest.xml @@ -39,7 +39,7 @@ <argument name="productCount" value="1"/> </actionGroup> <!-- Step 3: Go to Shopping Cart --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingcart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingcart"/> <!-- Step 4: Open Estimate Tax section --> <click selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" stepKey="openEstimateTaxSection"/> <seeOptionIsSelected selector="{{CheckoutCartSummarySection.country}}" userInput="{{US_Address_CA.country}}" stepKey="checkCountry"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml index 482e2fb6233a6..bf9c8e9e68a1b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml @@ -67,7 +67,7 @@ </actionGroup> <!--Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/> <!-- Apply Coupon --> <actionGroup ref="StorefrontApplyCouponActionGroup" stepKey="applyDiscount"> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml index deab32aede324..7b7d4202c3cd4 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml @@ -39,7 +39,7 @@ </actionGroup> <!--Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/> <!-- Fill the Estimate Shipping and Tax section --> <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> @@ -97,4 +97,4 @@ </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="Out Of Stock" stepKey="seeProductDisplayedAsOutOfStock"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml index 6d5f79f3aadf4..c55e47a5a1ed1 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml @@ -46,7 +46,7 @@ </actionGroup> <!-- Open View and edit --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/> <!-- Fill the Estimate Shipping and Tax section --> <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> @@ -94,4 +94,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleProductQtyTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleProductQtyTest.xml index 72f6cf95a6fbe..372d763bf2fb7 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleProductQtyTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleProductQtyTest.xml @@ -56,7 +56,7 @@ <see userInput="{{quoteQty3Price123.currency}}{{quoteQty3Price123.subtotal}}" selector="{{CheckoutCartSummarySection.subtotal}}" stepKey="assertCartSubtotal"/> <!-- Minicart product price and subtotal should be updated --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="openMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="openMinicart"/> <grabValueFrom selector="{{StorefrontMinicartSection.itemQuantity($$createProduct.name$$)}}" stepKey="grabProductQtyInMinicart"/> <assertEquals stepKey="assertProductQtyInMinicart"> <actualResult type="variable">grabProductQtyInMinicart</actualResult> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleWithCustomOptionsProductQtyTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleWithCustomOptionsProductQtyTest.xml index 7a653f13c4ee5..0b52b08980ded 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleWithCustomOptionsProductQtyTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleWithCustomOptionsProductQtyTest.xml @@ -61,7 +61,7 @@ <see userInput="{{quoteQty11Subtotal1320.currency}}{{quoteQty11Subtotal1320.subtotal}}" selector="{{CheckoutCartSummarySection.subtotal}}" stepKey="assertSubtotal"/> <!-- Minicart product price and subtotal should be updated --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="openMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="openMinicart"/> <grabValueFrom selector="{{StorefrontMinicartSection.itemQuantity($$createProduct.name$$)}}" stepKey="grabProductQtyInMinicart"/> <assertEquals stepKey="assertProductQtyInMinicart"> <expectedResult type="string">{{quoteQty11Subtotal1320.qty}}</expectedResult> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRelatedProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRelatedProductsTest.xml index aa34693ed82f0..7f85224933da2 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRelatedProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRelatedProductsTest.xml @@ -193,11 +193,11 @@ <see selector="{{StorefrontMinicartSection.quantity}}" userInput="2" stepKey="seeItemCounterInMiniCart"/> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="assertOneProductNameInMiniCart"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="assertOneProductNameInMiniCart"> <argument name="productName" value="$$baseConfigProductHandle.name$$"/> </actionGroup> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="assertOneProductNameInMiniCart2"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="assertOneProductNameInMiniCart2"> <argument name="productName" value="$$simple2Handle.name$$"/> </actionGroup> </test> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/CheckShoppingCartBehaviorAfterSessionExpiredTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/CheckShoppingCartBehaviorAfterSessionExpiredTest.xml index c66a2979aa7f5..9169023bbf2e0 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/CheckShoppingCartBehaviorAfterSessionExpiredTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/CheckShoppingCartBehaviorAfterSessionExpiredTest.xml @@ -46,7 +46,7 @@ <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart1"> <argument name="product" value="$$createProduct$$"/> </actionGroup> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <!--Reset cookies and refresh the page--> <resetCookie userInput="PHPSESSID" stepKey="resetCookieForCart"/> <reloadPage stepKey="reloadPage"/> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml index d508ebaa26885..40c9d59dc766b 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml @@ -59,7 +59,7 @@ <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToCartAsGuestUser"> <argument name="productName" value="$$createProduct.name$$"/> </actionGroup> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartBeforeChangeShippingAndTaxSection"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartBeforeChangeShippingAndTaxSection"/> <!--Step 5: Open Estimate Shipping and Tax block and fill the sections--> <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingAndTax" /> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> @@ -69,7 +69,7 @@ <!--Step 6: Go to Homepage--> <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToHomePageAfterChangingShippingAndTaxSection"/> <!--Step 7: Go to shopping cart and check "Estimate Shipping and Tax" fields values are saved--> - <actionGroup ref="clickViewAndEditCartFromMiniCart" after="goToHomePageAfterChangingShippingAndTaxSection" stepKey="goToShoppingCartAfterChangingShippingAndTaxSection"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" after="goToHomePageAfterChangingShippingAndTaxSection" stepKey="goToShoppingCartAfterChangingShippingAndTaxSection"/> <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingAndTaxAfterChanging" /> <seeOptionIsSelected selector="{{CheckoutCartSummarySection.country}}" userInput="{{US_Address_CA.country}}" stepKey="checkCustomerCountry" /> <seeOptionIsSelected selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{US_Address_CA.state}}" stepKey="checkCustomerRegion" /> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml index e50fc4af83107..aaba09b8088d6 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml @@ -67,7 +67,7 @@ <actionGroup ref="AddSimpleProductToCart" stepKey="addSimple1ProductToCartForJohnSmithCustomer"> <argument name="product" value="$$createSimple1$$"/> </actionGroup> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="checkSimple1InMiniCartForJohnSmithCustomer"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="checkSimple1InMiniCartForJohnSmithCustomer"> <argument name="productName" value="$$createSimple1.name$$"/> </actionGroup> @@ -79,7 +79,7 @@ <actionGroup ref="StorefrontAssertPersistentCustomerWelcomeMessageNotPresentActionGroup" stepKey="dontSeeWelcomeJohnSmithCustomerNotYouMessage"> <argument name="customerFullName" value="{{John_Smith_Customer.fullname}}"/> </actionGroup> - <actionGroup ref="assertMiniCartEmpty" stepKey="assertMiniCartEmptyAfterJohnSmithSignOut" /> + <actionGroup ref="AssertMiniCartEmptyActionGroup" stepKey="assertMiniCartEmptyAfterJohnSmithSignOut" /> <!-- 5. Click the Create an Account link again and fill fields for registration of another customer, set password and check the Remember Me checkbox --> <amOnPage url="{{StorefrontCustomerCreatePage.url}}" stepKey="amOnCustomerAccountCreatePage"/> @@ -96,7 +96,7 @@ <argument name="product" value="$$createSimple1$$"/> </actionGroup> <see selector="{{StorefrontMinicartSection.productCount}}" userInput="1" stepKey="miniCartContainsOneProductForJohnDoeCustomer"/> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="checkSimple1InMiniCartForJohnDoeCustomer"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="checkSimple1InMiniCartForJohnDoeCustomer"> <argument name="productName" value="$$createSimple1.name$$"/> </actionGroup> @@ -110,22 +110,22 @@ <waitForText selector="{{StorefrontCMSPageSection.mainContent}}" userInput="CMS homepage content goes here." stepKey="waitForLoadContentMessageOnHomePage"/> <waitForElementVisible selector="{{StorefrontMinicartSection.productCount}}" stepKey="waitForCartCounterVisible"/> <see selector="{{StorefrontMinicartSection.productCount}}" userInput="1" stepKey="miniCartContainsOneProductForGuest"/> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="checkSimple1InMiniCartForGuestCustomer"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="checkSimple1InMiniCartForGuestCustomer"> <argument name="productName" value="$$createSimple1.name$$"/> </actionGroup> <!-- 8. Go to Shopping Cart and verify Simple Product 1 is present there --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCart" /> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCart" /> <see selector="{{CheckoutCartProductSection.productName}}" userInput="$$createSimple1.name$$" stepKey="checkSimple1InShoppingCart"/> <!-- 9. Add Simple Product 2 to Shopping Cart --> <actionGroup ref="AddSimpleProductToCart" stepKey="addSimple2ProductToCartForGuest"> <argument name="product" value="$$createSimple2$$"/> </actionGroup> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="checkSimple1InMiniCartForGuestCustomerSecondTime"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="checkSimple1InMiniCartForGuestCustomerSecondTime"> <argument name="productName" value="$$createSimple1.name$$"/> </actionGroup> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="checkSimple2InMiniCartForGuestCustomer"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="checkSimple2InMiniCartForGuestCustomer"> <argument name="productName" value="$$createSimple2.name$$"/> </actionGroup> <see selector="{{StorefrontMinicartSection.productCount}}" userInput="2" stepKey="miniCartContainsTwoProductForGuest"/> @@ -140,10 +140,10 @@ <argument name="Customer" value="Simple_Customer_Without_Address"/> </actionGroup> <see selector="{{StorefrontMinicartSection.productCount}}" userInput="2" stepKey="miniCartContainsTwoProductForJohnDoeCustomer"/> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="checkSimple1InMiniCartForJohnDoeCustomerSecondTime"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="checkSimple1InMiniCartForJohnDoeCustomerSecondTime"> <argument name="productName" value="$$createSimple1.name$$"/> </actionGroup> - <actionGroup ref="assertOneProductNameInMiniCart" stepKey="checkSimple2InMiniCartForJohnDoeCustomer"> + <actionGroup ref="AssertOneProductNameInMiniCartActionGroup" stepKey="checkSimple2InMiniCartForJohnDoeCustomer"> <argument name="productName" value="$$createSimple2.name$$"/> </actionGroup> @@ -154,6 +154,6 @@ <waitForText selector="{{StorefrontCMSPageSection.mainContent}}" userInput="CMS homepage content goes here." stepKey="waitForLoadMainContentMessageOnHomePage"/> <click selector="{{StorefrontPanelHeaderSection.notYouLink}}" stepKey="clickOnNotYouLink" /> <waitForPageLoad stepKey="waitForCustomerLoginPageLoad"/> - <actionGroup ref="assertMiniCartEmpty" stepKey="assertMiniCartEmptyAfterJohnDoeSignOut" /> + <actionGroup ref="AssertMiniCartEmptyActionGroup" stepKey="assertMiniCartEmptyAfterJohnDoeSignOut" /> </test> </tests> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionAndFreeShippingIsAppliedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionAndFreeShippingIsAppliedTest.xml index b51027d51fd53..c35311e1948c1 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionAndFreeShippingIsAppliedTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionAndFreeShippingIsAppliedTest.xml @@ -91,7 +91,7 @@ </actionGroup> <!--Click on view and edit cart link--> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <waitForPageLoad stepKey="waitForViewAndEditCartToOpen"/> <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" visible="true" stepKey="clickEstimateShippingAndTaxToOpen"/> <waitForPageLoad stepKey="waitForEstimateShippingAndTaxToOpen"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionIsNotAppliedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionIsNotAppliedTest.xml index 8969e9d9d4ceb..3ceff9dc23d4b 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionIsNotAppliedTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionIsNotAppliedTest.xml @@ -103,7 +103,7 @@ </actionGroup> <!--Click on view and edit cart link--> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <waitForPageLoad stepKey="waitForViewAndEditCartToOpen"/> <!--Verify AssertCartPriceRuleConditionIsNotApplied(Shopping cart subtotal equals to grand total - price rule has not been applied)--> <actionGroup ref="StorefrontCheckCartActionGroup" stepKey="cartAssert"> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForMatchingSubtotalAndVerifyRuleConditionIsAppliedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForMatchingSubtotalAndVerifyRuleConditionIsAppliedTest.xml index ab62e51414e85..04570742cd31c 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForMatchingSubtotalAndVerifyRuleConditionIsAppliedTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForMatchingSubtotalAndVerifyRuleConditionIsAppliedTest.xml @@ -101,7 +101,7 @@ </actionGroup> <!--Click on view and edit cart link--> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <waitForPageLoad stepKey="waitForViewAndEditCartToOpen"/> <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" visible="true" stepKey="clickEstimateShippingAndTaxToOpen"/> <waitForPageLoad stepKey="waitForEstimateShippingAndTaxToOpen"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml index 00f104885e0f0..bab2212e37892 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml @@ -110,7 +110,7 @@ </actionGroup> <!--Click on view and edit cart link--> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <waitForPageLoad stepKey="waitForViewAndEditToOpen"/> <!--Verify AssertCartPriceRuleConditionIsApplied if condition category id is matching--> <actionGroup ref="StorefrontCheckCartActionGroup" stepKey="cartAssert"> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingTotalWeightAndVerifyRuleConditionIsAppliedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingTotalWeightAndVerifyRuleConditionIsAppliedTest.xml index 43b92ee938978..ebb5aa97e4212 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingTotalWeightAndVerifyRuleConditionIsAppliedTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingTotalWeightAndVerifyRuleConditionIsAppliedTest.xml @@ -98,7 +98,7 @@ </actionGroup> <!--Click on view and edit cart link--> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <waitForPageLoad stepKey="waitForViewAndEditCartToOpen"/> <!--Verify AssertCartPriceRuleConditionIsApplied if condition Total Weight equals 200 is true--> <actionGroup ref="StorefrontCheckCartActionGroup" stepKey="cartAssert"> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml index 1eba06126ff6f..27b42d2f77dfd 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml @@ -88,7 +88,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteApiCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> - + <!-- Create the rule --> <amOnPage url="{{AdminCartPriceRulesPage.url}}" stepKey="amOnCartPriceList"/> <waitForPageLoad stepKey="waitForRulesPage"/> @@ -131,7 +131,7 @@ <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage2"/> <!--View and edit cart--> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickViewAndEditCartFromMiniCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickViewAndEditCartFromMiniCart"/> <click selector="{{DiscountSection.DiscountTab}}" stepKey="scrollToDiscountTab" /> <fillField selector="{{DiscountSection.CouponInput}}" userInput="ABCD" stepKey="fillCouponCode" /> <click selector="{{DiscountSection.ApplyCodeBtn}}" stepKey="applyCode"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartRuleCouponForFreeShippingTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartRuleCouponForFreeShippingTest.xml index 9e95e39e4791e..3526ab20aa6b4 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartRuleCouponForFreeShippingTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCartRuleCouponForFreeShippingTest.xml @@ -56,7 +56,7 @@ <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckout"/> <!-- Go to Order review --> - <actionGroup ref="StorefrontCheckoutForwardFromShippingStep" stepKey="goToCheckoutReview"/> + <actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="goToCheckoutReview"/> <!-- Apply Discount Coupon to the Order --> <actionGroup ref="StorefrontApplyDiscountCodeActionGroup" stepKey="applyDiscountCoupon"> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml index d8c5b42dbaaaf..717325ab89e6d 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml @@ -94,7 +94,7 @@ <argument name="product" value="$$createConfigProductCreateConfigurableProduct1$$"/> <argument name="productCount" value="2"/> </actionGroup> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToCart"/> <!-- Discount amount is not applied --> <dontSee selector="{{CheckoutCartSummarySection.discountLabel}}" stepKey="discountIsNotApply"/> <!-- 3: Open configurable product 2 and add all his child products to cart --> @@ -110,7 +110,7 @@ <argument name="productCount" value="4"/> </actionGroup> <!-- Discount amount is applied --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToCart2"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToCart2"/> <see selector="{{CheckoutCartSummarySection.discountTotal}}" userInput="-$100.00" stepKey="discountIsApply"/> </test> </tests> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToGroupedProductWithInvisibleIndividualProductTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToGroupedProductWithInvisibleIndividualProductTest.xml index 8900d838fb825..6a08724953395 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToGroupedProductWithInvisibleIndividualProductTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToGroupedProductWithInvisibleIndividualProductTest.xml @@ -90,7 +90,7 @@ <argument name="linkedProduct1Name" value="$createThirdSimpleProduct.name$"/> <argument name="linkedProduct2Name" value="$createFourthSimpleProduct.name$"/> </actionGroup> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="openTheCartWithSecondGroupedProduct"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="openTheCartWithSecondGroupedProduct"/> <!-- Discount amount is not applied --> <actionGroup ref="StorefrontCheckCartActionGroup" stepKey="checkDiscountIsNotApplied"> <argument name="subtotal" value="$700.00"/> @@ -105,7 +105,7 @@ <argument name="linkedProduct1Name" value="$createFirstSimpleProduct.name$"/> <argument name="linkedProduct2Name" value="$createSecondSimpleProduct.name$"/> </actionGroup> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="openTheCartWithFirstAndSecondGroupedProducts"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="openTheCartWithFirstAndSecondGroupedProducts"/> <!-- Discount amount is applied for product from first category only --> <actionGroup ref="StorefrontCheckCartTotalWithDiscountCategoryActionGroup" stepKey="checkDiscountIsApplied"> <argument name="subtotal" value="$1,000.00"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml index aa44593400a89..a329a3871b1a0 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml @@ -86,7 +86,7 @@ <argument name="productCount" value="1"/> </actionGroup> <!-- Step 3: Go to Shopping Cart --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <!-- Step 4: Open Estimate Shipping and Tax section --> <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingandTax" /> <seeOptionIsSelected selector="{{CheckoutCartSummarySection.country}}" userInput="{{US_Address_CA.country}}" stepKey="checkCustomerCountry" /> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerVirtualQuoteTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerVirtualQuoteTest.xml index ac090fd4fe9c0..c62fc59a52e68 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerVirtualQuoteTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerVirtualQuoteTest.xml @@ -58,7 +58,7 @@ <argument name="productCount" value="1"/> </actionGroup> <!-- Step 3: Go to Shopping Cart --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <!-- Step 4: Open Estimate Shipping and Tax section --> <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingandTax" /> <seeOptionIsSelected selector="{{CheckoutCartSummarySection.country}}" userInput="{{US_Address_NY.country}}" stepKey="checkCustomerCountry" /> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml index bce9d895e311e..06ef58f400598 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml @@ -81,7 +81,7 @@ <argument name="productCount" value="1"/> </actionGroup> <!-- Step 3: Go to Shopping Cart --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <!-- Step 4: Open Estimate Shipping and Tax section --> <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingandTax" /> <selectOption selector="{{CheckoutCartSummarySection.country}}" userInput="United States" stepKey="selectUSCountry"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml index 74233bbff4a64..4b911cd6db32f 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestVirtualQuoteTest.xml @@ -53,7 +53,7 @@ <argument name="productCount" value="1"/> </actionGroup> <!-- Step 3: Go to Shopping Cart --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> <!-- Step 4: Open Estimate Shipping and Tax section --> <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingandTax" /> <selectOption selector="{{CheckoutCartSummarySection.country}}" userInput="United States" stepKey="selectUSCountry"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml index 05ced7e61b3b7..12cdba459f2ec 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml @@ -103,7 +103,7 @@ <see stepKey="seeTotalExcl" selector="{{CheckoutPaymentSection.orderSummaryTotalExcluding}}" userInput="$128.00"/> <!-- Change the address --> - <actionGroup ref="changeSummaryQuoteAddress" stepKey="changeAddress"> + <actionGroup ref="ChangeSummaryQuoteAddressActionGroup" stepKey="changeAddress"> <argument name="taxCode" value="SimpleTaxSwiss"/> </actionGroup> @@ -113,7 +113,7 @@ <see stepKey="seeTotalExcl2" selector="{{CheckoutPaymentSection.orderSummaryTotalExcluding}}" userInput="$128.00"/> <!-- Change the address --> - <actionGroup ref="changeSummaryQuoteAddress" stepKey="changeAddress2"> + <actionGroup ref="ChangeSummaryQuoteAddressActionGroup" stepKey="changeAddress2"> <argument name="taxCode" value="SimpleTaxCA"/> </actionGroup> @@ -220,7 +220,7 @@ <see stepKey="seeTotalExcl" selector="{{CheckoutPaymentSection.orderSummaryTotalExcluding}}" userInput="$$virtualProduct1.price$$"/> <!-- Change the address --> - <actionGroup ref="changeSummaryQuoteAddress" stepKey="changeAddress"> + <actionGroup ref="ChangeSummaryQuoteAddressActionGroup" stepKey="changeAddress"> <argument name="taxCode" value="SimpleTaxSwiss"/> </actionGroup> @@ -230,7 +230,7 @@ <see stepKey="seeTotalExcl2" selector="{{CheckoutPaymentSection.orderSummaryTotalExcluding}}" userInput="$$$virtualProduct1.price$$"/> <!-- Change the address --> - <actionGroup ref="changeSummaryQuoteAddress" stepKey="changeAddress2"> + <actionGroup ref="ChangeSummaryQuoteAddressActionGroup" stepKey="changeAddress2"> <argument name="taxCode" value="SimpleTaxCA"/> </actionGroup> @@ -330,7 +330,7 @@ <see stepKey="seeTotalExcl3" selector="{{CheckoutPaymentSection.orderSummaryTotalExcluding}}" userInput="$128.00"/> <!-- Change the address --> - <actionGroup ref="changeSummaryQuoteAddress" stepKey="changeAddress"> + <actionGroup ref="ChangeSummaryQuoteAddressActionGroup" stepKey="changeAddress"> <argument name="taxCode" value="SimpleTaxSwiss"/> </actionGroup> @@ -340,7 +340,7 @@ <see stepKey="seeTotalExcl2" selector="{{CheckoutPaymentSection.orderSummaryTotalExcluding}}" userInput="$128.00"/> <!-- Change the address --> - <actionGroup ref="changeSummaryQuoteAddress" stepKey="changeAddress2"> + <actionGroup ref="ChangeSummaryQuoteAddressActionGroup" stepKey="changeAddress2"> <argument name="taxCode" value="SimpleTaxNY"/> </actionGroup> @@ -441,7 +441,7 @@ <see stepKey="seeTotalExcl3" selector="{{CheckoutPaymentSection.orderSummaryTotalExcluding}}" userInput="$$virtualProduct1.price$$"/> <!-- Change the address --> - <actionGroup ref="changeSummaryQuoteAddress" stepKey="changeAddress"> + <actionGroup ref="ChangeSummaryQuoteAddressActionGroup" stepKey="changeAddress"> <argument name="taxCode" value="SimpleTaxSwiss"/> </actionGroup> @@ -451,7 +451,7 @@ <see stepKey="seeTotalExcl2" selector="{{CheckoutPaymentSection.orderSummaryTotalExcluding}}" userInput="$$$virtualProduct1.price$$"/> <!-- Change the address --> - <actionGroup ref="changeSummaryQuoteAddress" stepKey="changeAddress2"> + <actionGroup ref="ChangeSummaryQuoteAddressActionGroup" stepKey="changeAddress2"> <argument name="taxCode" value="SimpleTaxNY"/> </actionGroup> From 686502a0dd168287672488d307f6a242a6d5b69a Mon Sep 17 00:00:00 2001 From: Maximilian Fickers <m.fickers@basecom.de> Date: Fri, 29 Nov 2019 12:20:57 +0100 Subject: [PATCH 346/595] #20463 Fix view details label misalign on order summary for Blank theme --- .../blank/Magento_Checkout/web/css/source/module/_minicart.less | 1 + 1 file changed, 1 insertion(+) diff --git a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less index 5f69db5acec4b..133dd0fe721bb 100644 --- a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less +++ b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less @@ -263,6 +263,7 @@ ); cursor: pointer; position: relative; + white-space: nowrap; &:after { position: static; From 54160b744adb3f03e9716f0dd813616bd922a015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Fri, 29 Nov 2019 12:45:14 +0100 Subject: [PATCH 347/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...omerSearchBundleProductsByKeywordsTest.xml | 36 +-- .../AdminCatalogSearchTermActionGroup.xml | 73 ----- .../AssertSearchTermNotInGridActionGroup.xml | 28 ++ ...ertSearchTermNotOnFrontendActionGroup.xml} | 18 +- .../AssertSearchTermOnFrontendActionGroup.xml | 26 ++ ...earchTermSaveSuccessMessageActionGroup.xml | 33 +++ ...rchTermSuccessDeleteMessageActionGroup.xml | 32 ++ ...reViewAdvancedCatalogSearchActionGroup.xml | 19 ++ ...ontAddToCartFromQuickSearchActionGroup.xml | 25 ++ ...dCatalogSearchByDescriptionActionGroup.xml | 23 ++ ...dCatalogSearchByProductNameActionGroup.xml | 23 ++ ...ByProductNameAndDescriptionActionGroup.xml | 25 ++ ...SearchByProductNameAndPriceActionGroup.xml | 27 ++ ...edCatalogSearchByProductSkuActionGroup.xml | 23 ++ ...logSearchByShortDescriptionActionGroup.xml | 23 ++ .../StorefrontCatalogSearchActionGroup.xml | 273 ------------------ ...ntCheckAdvancedSearchResultActionGroup.xml | 20 ++ .../StorefrontCheckQuickSearchActionGroup.xml | 26 ++ ...frontCheckQuickSearchStringActionGroup.xml | 26 ++ ...torefrontCheckSearchIsEmptyActionGroup.xml | 18 ++ ...torefrontOpenAdvancedSearchActionGroup.xml | 21 ++ ...tOpenProductFromQuickSearchActionGroup.xml | 26 ++ ...earchCheckProductNameInGridActionGroup.xml | 22 ++ ...chCheckProductNameNotInGridActionGroup.xml | 21 ++ ...chRelatedSearchTermsAppearsActionGroup.xml | 20 ++ ...QuickSearchSeeProductByNameActionGroup.xml | 17 ++ ...ntQuickSearchTooShortStringActionGroup.xml | 21 ++ ...tSelectSearchFilterCategoryActionGroup.xml | 23 ++ .../Test/AdminCreateSearchTermEntityTest.xml | 6 +- .../Mftf/Test/AdminDeleteSearchTermTest.xml | 10 +- .../Mftf/Test/SearchEntityResultsTest.xml | 30 +- ...ntElasticsearch6SearchInvalidValueTest.xml | 6 +- .../AdminMassDeleteSearchTermEntityTest.xml | 12 +- 33 files changed, 619 insertions(+), 413 deletions(-) delete mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AdminCatalogSearchTermActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermNotInGridActionGroup.xml rename app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/{StorefrontCatalogSearchTermActionGroup.xml => AssertSearchTermNotOnFrontendActionGroup.xml} (61%) create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermOnFrontendActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermSaveSuccessMessageActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermSuccessDeleteMessageActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/GoToStoreViewAdvancedCatalogSearchActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAddToCartFromQuickSearchActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByDescriptionActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameAndPriceActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductSkuActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByShortDescriptionActionGroup.xml delete mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckAdvancedSearchResultActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckQuickSearchActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckQuickSearchStringActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckSearchIsEmptyActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontOpenAdvancedSearchActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontOpenProductFromQuickSearchActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchCheckProductNameInGridActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchCheckProductNameNotInGridActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchRelatedSearchTermsAppearsActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchSeeProductByNameActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchTooShortStringActionGroup.xml create mode 100644 app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontSelectSearchFilterCategoryActionGroup.xml diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml index 9ea0480e540ba..ae9d01a50f46e 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml @@ -53,84 +53,84 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchDynamic"> <argument name="phrase" value="Dynamic"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="assertDynamicBundleInSearchResultByDynamic"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="assertDynamicBundleInSearchResultByDynamic"> <argument name="productName" value="$createDynamicBundle.name$"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="assertFixedBundleInSearchResultByDynamic"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="assertFixedBundleInSearchResultByDynamic"> <argument name="productName" value="$createFixedBundle.name$"/> </actionGroup> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByDescription"> <argument name="phrase" value="Dynamicscription"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="assertDynamicBundleInSearchResultByDescription"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="assertDynamicBundleInSearchResultByDescription"> <argument name="productName" value="$createDynamicBundle.name$"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeFixedBundleInSearchResultByDescription"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="dontSeeFixedBundleInSearchResultByDescription"> <argument name="productName" value="$createFixedBundle.name$"/> </actionGroup> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchShortDescription"> <argument name="phrase" value="Dynamictest"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="assertDynamicBundleInSearchResultByShortDescription"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="assertDynamicBundleInSearchResultByShortDescription"> <argument name="productName" value="$createDynamicBundle.name$"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeFixedBundleInSearchResultByShortDescription"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="dontSeeFixedBundleInSearchResultByShortDescription"> <argument name="productName" value="$createFixedBundle.name$"/> </actionGroup> <!-- 3. Fill quick search bar with test values mutual for both products and click search --> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchTest123"> <argument name="phrase" value="Test 123"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeDynamicBundleByTest123"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeDynamicBundleByTest123"> <argument name="productName" value="$createDynamicBundle.name$"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByTest123"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeFixedBundleByTest123"> <argument name="productName" value="$createFixedBundle.name$"/> </actionGroup> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchTesting321"> <argument name="phrase" value="Testing 321"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeDynamicBundleByTesting321"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeDynamicBundleByTesting321"> <argument name="productName" value="$createDynamicBundle.name$"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByTesting321"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeFixedBundleByTesting321"> <argument name="productName" value="$createFixedBundle.name$"/> </actionGroup> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchShort555"> <argument name="phrase" value="Short 555"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeDynamicBundleByShort555"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeDynamicBundleByShort555"> <argument name="productName" value="$createDynamicBundle.name$"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByShort555"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeFixedBundleByShort555"> <argument name="productName" value="$createFixedBundle.name$"/> </actionGroup> <!-- 4. Fill quick search bar with test values unique for fixed bundle product and click search --> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByFixed"> <argument name="phrase" value="Fixed"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByFixed"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeFixedBundleByFixed"> <argument name="productName" value="$createFixedBundle.name$"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeDynamicBundleByFixed"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="dontSeeDynamicBundleByFixed"> <argument name="productName" value="$createDynamicBundle.name$"/> </actionGroup> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByDescriptionForFixed"> <argument name="phrase" value="Fixedscription"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByDescriptionForFixed"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeFixedBundleByDescriptionForFixed"> <argument name="productName" value="$createFixedBundle.name$"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeDynamicProductByDescriptionForFixed"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="dontSeeDynamicProductByDescriptionForFixed"> <argument name="productName" value="$createDynamicBundle.name$"/> </actionGroup> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByShortDescriptionForFixed"> <argument name="phrase" value="Fixedtest"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByShortDescriptionForFixed"> + <actionGroup ref="StorefrontQuickSearchSeeProductByNameActionGroup" stepKey="seeFixedBundleByShortDescriptionForFixed"> <argument name="productName" value="$createFixedBundle.name$"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeDynamicBundleByShortDescriptionForFixed"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="dontSeeDynamicBundleByShortDescriptionForFixed"> <argument name="productName" value="$createDynamicBundle.name$"/> </actionGroup> </test> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AdminCatalogSearchTermActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AdminCatalogSearchTermActionGroup.xml deleted file mode 100644 index 932c45c0d5aeb..0000000000000 --- a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AdminCatalogSearchTermActionGroup.xml +++ /dev/null @@ -1,73 +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="AssertSearchTermSaveSuccessMessage"> - <annotations> - <description>Goes to the Catalog Search Term grid page. Adds the provided Search Term. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="searchQuery" type="string"/> - <argument name="storeValue" type="string"/> - <argument name="redirectUrl" type="string"/> - <argument name="displayInSuggestedTerm" type="string"/> - </arguments> - - <amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openAdminCatalogSearchTermIndexPage"/> - <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> - <click selector="{{AdminCatalogSearchTermIndexSection.addNewSearchTermButton}}" stepKey="clickAddNewSearchTermButton"/> - <waitForPageLoad stepKey="waitForAdminCatalogSearchTermNewPageLoad"/> - <fillField selector="{{AdminCatalogSearchTermNewSection.searchQuery}}" userInput="{{searchQuery}}" stepKey="fillSearchQueryTextBox"/> - <selectOption selector="{{AdminCatalogSearchTermNewSection.store}}" userInput="{{storeValue}}" stepKey="selectStoreValue"/> - <fillField selector="{{AdminCatalogSearchTermNewSection.redirectUrl}}" userInput="{{redirectUrl}}" stepKey="fillRedirectUrl"/> - <selectOption selector="{{AdminCatalogSearchTermNewSection.displayInSuggestedTerm}}" userInput="{{displayInSuggestedTerm}}" stepKey="selectDisplayInSuggestedTerm"/> - <click selector="{{AdminCatalogSearchTermNewSection.saveSearchButton}}" stepKey="clickSaveSearchButton"/> - <see selector="{{AdminCatalogSearchTermMessagesSection.successMessage}}" userInput="You saved the search term." stepKey="seeSaveSuccessMessage"/> - </actionGroup> - - <actionGroup name="AssertSearchTermSuccessDeleteMessage"> - <annotations> - <description>Goes to the Catalog Search Term grid page. Deletes the provided Search Term. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="searchQuery" type="string"/> - </arguments> - - <amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openCatalogSearchIndexPage"/> - <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> - <click selector="{{AdminCatalogSearchTermIndexSection.resetFilterButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminCatalogSearchTermIndexSection.searchQuery}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/> - <click selector="{{AdminCatalogSearchTermIndexSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForSearchResultLoad"/> - <click selector="{{AdminCatalogSearchTermIndexSection.nthRow('1')}}" stepKey="checkFirstRow"/> - <selectOption selector="{{AdminCatalogSearchTermIndexSection.massActions}}" userInput="delete" stepKey="selectDeleteOption"/> - <click selector="{{AdminCatalogSearchTermIndexSection.submit}}" stepKey="clickSubmitButton"/> - <click selector="{{AdminCatalogSearchTermIndexSection.okButton}}" stepKey="clickOkButton"/> - <see selector="{{AdminCatalogSearchTermMessagesSection.successMessage}}" userInput="Total of 1 record(s) were deleted." stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="AssertSearchTermNotInGrid"> - <annotations> - <description>Goes to the Catalog Search Term grid page. Searches for the provided Search Term. Validates that it is NOT present in the grid.</description> - </annotations> - <arguments> - <argument name="searchQuery" type="string"/> - </arguments> - - <amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openCatalogSearchIndexPage"/> - <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> - <click selector="{{AdminCatalogSearchTermIndexSection.resetFilterButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminCatalogSearchTermIndexSection.searchQuery}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/> - <click selector="{{AdminCatalogSearchTermIndexSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForSearchResultToLoad"/> - <see selector="{{AdminCatalogSearchTermIndexSection.emptyRecords}}" userInput="We couldn't find any records." stepKey="seeEmptyRecordMessage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermNotInGridActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermNotInGridActionGroup.xml new file mode 100644 index 0000000000000..6b8b94931b3f9 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermNotInGridActionGroup.xml @@ -0,0 +1,28 @@ +<?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="AssertSearchTermNotInGridActionGroup"> + <annotations> + <description>Goes to the Catalog Search Term grid page. Searches for the provided Search Term. Validates that it is NOT present in the grid.</description> + </annotations> + <arguments> + <argument name="searchQuery" type="string"/> + </arguments> + + <amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openCatalogSearchIndexPage"/> + <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> + <click selector="{{AdminCatalogSearchTermIndexSection.resetFilterButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminCatalogSearchTermIndexSection.searchQuery}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/> + <click selector="{{AdminCatalogSearchTermIndexSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForSearchResultToLoad"/> + <see selector="{{AdminCatalogSearchTermIndexSection.emptyRecords}}" userInput="We couldn't find any records." stepKey="seeEmptyRecordMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchTermActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermNotOnFrontendActionGroup.xml similarity index 61% rename from app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchTermActionGroup.xml rename to app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermNotOnFrontendActionGroup.xml index e1f0396b68c15..67e60a1603a9b 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchTermActionGroup.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermNotOnFrontendActionGroup.xml @@ -9,7 +9,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <!--Verify AssertSearchTermNotOnFrontend--> - <actionGroup name="AssertSearchTermNotOnFrontend"> + <actionGroup name="AssertSearchTermNotOnFrontendActionGroup"> <annotations> <description>Goes to the Storefront. Fills the Search field with the provided Search Query. Clicks on Search. Validates that there are no results.</description> </annotations> @@ -26,20 +26,4 @@ <waitForPageLoad stepKey="waitForSearch"/> <see selector="{{StorefrontMessagesSection.noticeMessage}}" userInput="Your search returned no results." stepKey="seeAssertSearchTermNotOnFrontendNoticeMessage"/> </actionGroup> - - <actionGroup name="AssertSearchTermOnFrontend"> - <annotations> - <description>Fills the Storefront Search field with the provided Search Query. Clicks on Search. Validates that the URL is correct.</description> - </annotations> - <arguments> - <argument name="searchQuery" type="string"/> - <argument name="redirectUrl" type="string"/> - </arguments> - - <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/> - <waitForPageLoad stepKey="waitForFillField"/> - <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> - <waitForPageLoad stepKey="waitForSearch"/> - <seeInCurrentUrl url="{{redirectUrl}}" stepKey="checkUrl"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermOnFrontendActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermOnFrontendActionGroup.xml new file mode 100644 index 0000000000000..cb2ce92531af8 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermOnFrontendActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AssertSearchTermOnFrontendActionGroup"> + <annotations> + <description>Fills the Storefront Search field with the provided Search Query. Clicks on Search. Validates that the URL is correct.</description> + </annotations> + <arguments> + <argument name="searchQuery" type="string"/> + <argument name="redirectUrl" type="string"/> + </arguments> + + <fillField selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/> + <waitForPageLoad stepKey="waitForFillField"/> + <click selector="{{StorefrontQuickSearchResultsSection.searchTextBoxButton}}" stepKey="clickSearchTextBoxButton"/> + <waitForPageLoad stepKey="waitForSearch"/> + <seeInCurrentUrl url="{{redirectUrl}}" stepKey="checkUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermSaveSuccessMessageActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermSaveSuccessMessageActionGroup.xml new file mode 100644 index 0000000000000..4291bbff88aae --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermSaveSuccessMessageActionGroup.xml @@ -0,0 +1,33 @@ +<?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="AssertSearchTermSaveSuccessMessageActionGroup"> + <annotations> + <description>Goes to the Catalog Search Term grid page. Adds the provided Search Term. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="searchQuery" type="string"/> + <argument name="storeValue" type="string"/> + <argument name="redirectUrl" type="string"/> + <argument name="displayInSuggestedTerm" type="string"/> + </arguments> + + <amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openAdminCatalogSearchTermIndexPage"/> + <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> + <click selector="{{AdminCatalogSearchTermIndexSection.addNewSearchTermButton}}" stepKey="clickAddNewSearchTermButton"/> + <waitForPageLoad stepKey="waitForAdminCatalogSearchTermNewPageLoad"/> + <fillField selector="{{AdminCatalogSearchTermNewSection.searchQuery}}" userInput="{{searchQuery}}" stepKey="fillSearchQueryTextBox"/> + <selectOption selector="{{AdminCatalogSearchTermNewSection.store}}" userInput="{{storeValue}}" stepKey="selectStoreValue"/> + <fillField selector="{{AdminCatalogSearchTermNewSection.redirectUrl}}" userInput="{{redirectUrl}}" stepKey="fillRedirectUrl"/> + <selectOption selector="{{AdminCatalogSearchTermNewSection.displayInSuggestedTerm}}" userInput="{{displayInSuggestedTerm}}" stepKey="selectDisplayInSuggestedTerm"/> + <click selector="{{AdminCatalogSearchTermNewSection.saveSearchButton}}" stepKey="clickSaveSearchButton"/> + <see selector="{{AdminCatalogSearchTermMessagesSection.successMessage}}" userInput="You saved the search term." stepKey="seeSaveSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermSuccessDeleteMessageActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermSuccessDeleteMessageActionGroup.xml new file mode 100644 index 0000000000000..3d32b3c292305 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/AssertSearchTermSuccessDeleteMessageActionGroup.xml @@ -0,0 +1,32 @@ +<?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="AssertSearchTermSuccessDeleteMessageActionGroup"> + <annotations> + <description>Goes to the Catalog Search Term grid page. Deletes the provided Search Term. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="searchQuery" type="string"/> + </arguments> + + <amOnPage url="{{AdminCatalogSearchTermIndexPage.url}}" stepKey="openCatalogSearchIndexPage"/> + <waitForPageLoad stepKey="waitForAdminCatalogSearchTermIndexPageLoad"/> + <click selector="{{AdminCatalogSearchTermIndexSection.resetFilterButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminCatalogSearchTermIndexSection.searchQuery}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/> + <click selector="{{AdminCatalogSearchTermIndexSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForSearchResultLoad"/> + <click selector="{{AdminCatalogSearchTermIndexSection.nthRow('1')}}" stepKey="checkFirstRow"/> + <selectOption selector="{{AdminCatalogSearchTermIndexSection.massActions}}" userInput="delete" stepKey="selectDeleteOption"/> + <click selector="{{AdminCatalogSearchTermIndexSection.submit}}" stepKey="clickSubmitButton"/> + <click selector="{{AdminCatalogSearchTermIndexSection.okButton}}" stepKey="clickOkButton"/> + <see selector="{{AdminCatalogSearchTermMessagesSection.successMessage}}" userInput="Total of 1 record(s) were deleted." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/GoToStoreViewAdvancedCatalogSearchActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/GoToStoreViewAdvancedCatalogSearchActionGroup.xml new file mode 100644 index 0000000000000..65ba0719af496 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/GoToStoreViewAdvancedCatalogSearchActionGroup.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="GoToStoreViewAdvancedCatalogSearchActionGroup"> + <annotations> + <description>Goes to the Storefront 'Advanced Search' page.</description> + </annotations> + + <amOnPage url="{{StorefrontCatalogSearchAdvancedFormPage.url}}" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroup"/> + <waitForPageLoad time="90" stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAddToCartFromQuickSearchActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAddToCartFromQuickSearchActionGroup.xml new file mode 100644 index 0000000000000..1ee9003a6bdb6 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAddToCartFromQuickSearchActionGroup.xml @@ -0,0 +1,25 @@ +<?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="StorefrontAddToCartFromQuickSearchActionGroup"> + <annotations> + <description>Adds the provided Product Name to the Shopping Cart from the Storefront Quick Search Results page. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + + <scrollTo selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}}" stepKey="scrollToProduct"/> + <moveMouseOver stepKey="hoverOverProduct" selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}}"/> + <click selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}} {{StorefrontQuickSearchResultsSection.addToCartBtn}}" stepKey="addToCart"/> + <waitForElementVisible selector="{{StorefrontQuickSearchResultsSection.messageSection}}" time="30" stepKey="waitForProductAdded"/> + <see selector="{{StorefrontQuickSearchResultsSection.messageSection}}" userInput="You added {{productName}} to your shopping cart." stepKey="seeAddedToCartMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByDescriptionActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByDescriptionActionGroup.xml new file mode 100644 index 0000000000000..d342909d54723 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByDescriptionActionGroup.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="StorefrontAdvancedCatalogSearchByDescriptionActionGroup"> + <annotations> + <description>Fills the Product Description field on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> + </annotations> + <arguments> + <argument name="description" type="string"/> + </arguments> + + <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.Description}}" userInput="{{description}}" stepKey="fill"/> + <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameActionGroup.xml new file mode 100644 index 0000000000000..491817dc6391c --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameActionGroup.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="StorefrontAdvancedCatalogSearchByProductNameActionGroup"> + <annotations> + <description>Fills the Product Name field on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> + </annotations> + <arguments> + <argument name="name" type="string"/> + </arguments> + + <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.ProductName}}" userInput="{{name}}" stepKey="fill"/> + <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup.xml new file mode 100644 index 0000000000000..377098dfc372a --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup.xml @@ -0,0 +1,25 @@ +<?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="StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup"> + <annotations> + <description>Fills the Product Name and Description fields on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> + </annotations> + <arguments> + <argument name="name" type="string"/> + <argument name="description" type="string"/> + </arguments> + + <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.ProductName}}" userInput="{{name}}" stepKey="fillName"/> + <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.Description}}" userInput="{{description}}" stepKey="fillDescription"/> + <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameAndPriceActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameAndPriceActionGroup.xml new file mode 100644 index 0000000000000..89e454db95615 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductNameAndPriceActionGroup.xml @@ -0,0 +1,27 @@ +<?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="StorefrontAdvancedCatalogSearchByProductNameAndPriceActionGroup"> + <annotations> + <description>Fills the Product Name, Price From and Price To fields on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> + </annotations> + <arguments> + <argument name="name" type="string"/> + <argument name="priceFrom" type="string"/> + <argument name="priceTo" type="string"/> + </arguments> + + <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.ProductName}}" userInput="{{name}}" stepKey="fillName"/> + <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.PriceFrom}}" userInput="{{priceFrom}}" stepKey="fillPriceFrom"/> + <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.PriceTo}}" userInput="{{priceTo}}" stepKey="fillPriceTo"/> + <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductSkuActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductSkuActionGroup.xml new file mode 100644 index 0000000000000..328b57e8ca080 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByProductSkuActionGroup.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="StorefrontAdvancedCatalogSearchByProductSkuActionGroup"> + <annotations> + <description>Fills the Product SKU field on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> + </annotations> + <arguments> + <argument name="sku" type="string"/> + </arguments> + + <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.SKU}}" userInput="{{sku}}" stepKey="fill"/> + <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByShortDescriptionActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByShortDescriptionActionGroup.xml new file mode 100644 index 0000000000000..28b2be68018f4 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontAdvancedCatalogSearchByShortDescriptionActionGroup.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="StorefrontAdvancedCatalogSearchByShortDescriptionActionGroup"> + <annotations> + <description>Fills the Product Short Description field on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> + </annotations> + <arguments> + <argument name="shortDescription" type="string"/> + </arguments> + + <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.ShortDescription}}" userInput="{{shortDescription}}" stepKey="fill"/> + <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml deleted file mode 100644 index 2022f809139ec..0000000000000 --- a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml +++ /dev/null @@ -1,273 +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"> - <!-- Quick search the phrase and check if the result page contains correct information --> - <actionGroup name="StorefrontCheckQuickSearchActionGroup"> - <annotations> - <description>Submits Form POST for the Storefront Search feature. Validates that the URL is correct. Validates that the Title is present and correct.</description> - </annotations> - <arguments> - <argument name="phrase"/> - </arguments> - - <submitForm selector="{{StorefrontQuickSearchSection.searchMiniForm}}" parameterArray="['q' => {{phrase}}]" stepKey="fillQuickSearch"/> - <seeInCurrentUrl url="{{StorefrontCatalogSearchPage.url}}" stepKey="checkUrl"/> - <dontSeeInCurrentUrl url="form_key=" stepKey="checkUrlFormKey"/> - <seeInTitle userInput="Search results for: '{{phrase}}'" stepKey="assertQuickSearchTitle"/> - <see userInput="Search results for: '{{phrase}}'" selector="{{StorefrontCatalogSearchMainSection.SearchTitle}}" stepKey="assertQuickSearchName"/> - </actionGroup> - - <!-- Quick search the phrase and check if the result page contains correct information, usable with type="string" --> - <actionGroup name="StorefrontCheckQuickSearchStringActionGroup"> - <annotations> - <description>Fill the Storefront Search field. Submits the Form. Validates that the provided Search Phrase is present and correct.</description> - </annotations> - <arguments> - <argument name="phrase" type="string"/> - </arguments> - - <fillField stepKey="fillInput" selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{phrase}}"/> - <submitForm selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" parameterArray="[]" stepKey="submitQuickSearch"/> - <seeInCurrentUrl url="{{StorefrontCatalogSearchPage.url}}" stepKey="checkUrl"/> - <dontSeeInCurrentUrl url="form_key=" stepKey="checkUrlFormKey"/> - <seeInTitle userInput="Search results for: '{{phrase}}'" stepKey="assertQuickSearchTitle"/> - <see userInput="Search results for: '{{phrase}}'" selector="{{StorefrontCatalogSearchMainSection.SearchTitle}}" stepKey="assertQuickSearchName"/> - </actionGroup> - - <actionGroup name="StorefrontQuickSearchTooShortStringActionGroup" extends="StorefrontCheckQuickSearchStringActionGroup"> - <annotations> - <description>Fill the Storefront Search field. Submits the Form. Validates that 'Minimum Search query length' warning appears.</description> - </annotations> - <arguments> - <argument name="minQueryLength" type="string"/> - </arguments> - - <see selector="{{StorefrontQuickSearchResultsSection.messageSection}}" userInput="Minimum Search query length is {{minQueryLength}}" stepKey="assertQuickSearchNeedThreeOrMoreChars"/> - </actionGroup> - - <actionGroup name="StorefrontQuickSearchRelatedSearchTermsAppearsActionGroup"> - <arguments> - <argument name="term" type="string"/> - </arguments> - - <waitForElementVisible selector="{{StorefrontCatalogSearchMainSection.relatedSearchTermsTitle}}" stepKey="waitMessageAppears"/> - <see selector="{{StorefrontCatalogSearchMainSection.relatedSearchTermsTitle}}" userInput="Related search terms" stepKey="checkRelatedTermsTitle"/> - <see selector="{{StorefrontCatalogSearchMainSection.relatedSearchTerm}}" userInput="{{term}}" stepKey="checkRelatedTermExists"/> - </actionGroup> - - <!-- Opens product from QuickSearch and performs assertions--> - <actionGroup name="StorefrontOpenProductFromQuickSearch"> - <annotations> - <description>Clicks on the provided Product Name from the Storefront Quick Search Results page.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - <argument name="productUrlKey" type="string"/> - </arguments> - - <scrollTo selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}}" stepKey="scrollToProduct"/> - <click stepKey="openProduct" selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}}"/> - <waitForPageLoad stepKey="waitForProductLoad"/> - <seeInCurrentUrl url="{{productUrlKey}}" stepKey="checkUrl"/> - <see stepKey="checkName" selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{productName}}"/> - </actionGroup> - - <!-- Adds product from Quick Search page and perform assertions--> - <actionGroup name="StorefrontAddToCartFromQuickSearch"> - <annotations> - <description>Adds the provided Product Name to the Shopping Cart from the Storefront Quick Search Results page. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - </arguments> - - <scrollTo selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}}" stepKey="scrollToProduct"/> - <moveMouseOver stepKey="hoverOverProduct" selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}}"/> - <click selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}} {{StorefrontQuickSearchResultsSection.addToCartBtn}}" stepKey="addToCart"/> - <waitForElementVisible selector="{{StorefrontQuickSearchResultsSection.messageSection}}" time="30" stepKey="waitForProductAdded"/> - <see selector="{{StorefrontQuickSearchResultsSection.messageSection}}" userInput="You added {{productName}} to your shopping cart." stepKey="seeAddedToCartMessage"/> - </actionGroup> - - <actionGroup name="StorefrontQuickSearchCheckProductNameInGrid"> - <annotations> - <description>Validates that the provided Product Name appears at the correct index on the Storefront Quick Search page.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - <argument name="index" type="string"/> - </arguments> - - <see selector="{{StorefrontQuickSearchResultsSection.productByIndex(index)}}" userInput="{{productName}}" stepKey="seeProductName"/> - </actionGroup> - - <actionGroup name="StorefrontQuickSearchSeeProductByName"> - <arguments> - <argument name="productName" type="string"/> - </arguments> - <see selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}}" userInput="{{productName}}" stepKey="seeProductName"/> - </actionGroup> - - <actionGroup name="StorefrontQuickSearchCheckProductNameNotInGrid"> - <annotations> - <description>Validates that the provided Product Name does NOT appear on the Storefront Quick Search page.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - </arguments> - - <dontSee selector="{{StorefrontQuickSearchResultsSection.allResults}}" userInput="{{productName}}" stepKey="dontSeeProductName"/> - </actionGroup> - - <!-- Open advanced search page --> - <actionGroup name="StorefrontOpenAdvancedSearchActionGroup"> - <annotations> - <description>Clicks on 'Advanced Search' in the Storefront Footer. Validates that the URL and Title are present and correct.</description> - </annotations> - - <click selector="{{StorefrontFooterSection.AdvancedSearch}}" stepKey="clickAdvancedSearchLink"/> - <seeInCurrentUrl url="{{StorefrontCatalogSearchAdvancedFormPage.url}}" stepKey="checkUrl"/> - <seeInTitle userInput="Advanced Search" stepKey="assertAdvancedSearchTitle1"/> - <see userInput="Advanced Search" selector="{{StorefrontCatalogSearchAdvancedFormSection.SearchTitle}}" stepKey="assertAdvancedSearchTitle2"/> - </actionGroup> - - <!-- Check that Advanced Search result page contains correct information --> - <actionGroup name="StorefrontCheckAdvancedSearchResultActionGroup"> - <annotations> - <description>Validates that the URL and Title are present and correct on the Storefront Advanced Search Results page.</description> - </annotations> - - <seeInCurrentUrl url="{{StorefrontCatalogSearchAdvancedResultPage.url}}" stepKey="checkUrl"/> - <seeInTitle userInput="Advanced Search Results" stepKey="assertAdvancedSearchTitle"/> - <see userInput="Catalog Advanced Search" selector="{{StorefrontCatalogSearchMainSection.SearchTitle}}" stepKey="assertAdvancedSearchName"/> - </actionGroup> - - <!-- Select the category in the filter --> - <actionGroup name="StorefrontSelectSearchFilterCategoryActionGroup"> - <annotations> - <description>Clicks on Category Filter. Clicks on the provided Category.</description> - </annotations> - <arguments> - <argument name="category"/> - </arguments> - - <click selector="{{StorefrontCategoryFilterSection.CategoryFilter}}" stepKey="clickCategoryFilterTitle"/> - <scrollTo selector="{{StorefrontCategoryFilterSection.CategoryByName(category.name)}}" stepKey="scrollToClickCategoryFilter"/> - <click selector="{{StorefrontCategoryFilterSection.CategoryByName(category.name)}}" stepKey="clickCategoryFilter"/> - </actionGroup> - - <!-- Go to store's advanced catalog search page --> - <actionGroup name="GoToStoreViewAdvancedCatalogSearchActionGroup"> - <annotations> - <description>Goes to the Storefront 'Advanced Search' page.</description> - </annotations> - - <amOnPage url="{{StorefrontCatalogSearchAdvancedFormPage.url}}" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroup"/> - <waitForPageLoad time="90" stepKey="waitForPageLoad"/> - </actionGroup> - - <!-- Storefront advanced catalog search by product name --> - <actionGroup name="StorefrontAdvancedCatalogSearchByProductNameActionGroup"> - <annotations> - <description>Fills the Product Name field on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> - </annotations> - <arguments> - <argument name="name" type="string"/> - </arguments> - - <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.ProductName}}" userInput="{{name}}" stepKey="fill"/> - <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <!-- Storefront advanced catalog search by product sku --> - <actionGroup name="StorefrontAdvancedCatalogSearchByProductSkuActionGroup"> - <annotations> - <description>Fills the Product SKU field on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> - </annotations> - <arguments> - <argument name="sku" type="string"/> - </arguments> - - <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.SKU}}" userInput="{{sku}}" stepKey="fill"/> - <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <!-- Storefront advanced catalog search by product description --> - <actionGroup name="StorefrontAdvancedCatalogSearchByDescriptionActionGroup"> - <annotations> - <description>Fills the Product Description field on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> - </annotations> - <arguments> - <argument name="description" type="string"/> - </arguments> - - <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.Description}}" userInput="{{description}}" stepKey="fill"/> - <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <!-- Storefront advanced catalog search by product short description --> - <actionGroup name="StorefrontAdvancedCatalogSearchByShortDescriptionActionGroup"> - <annotations> - <description>Fills the Product Short Description field on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> - </annotations> - <arguments> - <argument name="shortDescription" type="string"/> - </arguments> - - <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.ShortDescription}}" userInput="{{shortDescription}}" stepKey="fill"/> - <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <!-- Storefront advanced catalog search by product name and price --> - <actionGroup name="StorefrontAdvancedCatalogSearchByProductNameAndPriceActionGroup"> - <annotations> - <description>Fills the Product Name, Price From and Price To fields on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> - </annotations> - <arguments> - <argument name="name" type="string"/> - <argument name="priceFrom" type="string"/> - <argument name="priceTo" type="string"/> - </arguments> - - <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.ProductName}}" userInput="{{name}}" stepKey="fillName"/> - <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.PriceFrom}}" userInput="{{priceFrom}}" stepKey="fillPriceFrom"/> - <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.PriceTo}}" userInput="{{priceTo}}" stepKey="fillPriceTo"/> - <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <!-- Storefront advanced catalog search by product name and description --> - <actionGroup name="StorefrontAdvancedCatalogSearchByProductNameAndDescriptionActionGroup"> - <annotations> - <description>Fills the Product Name and Description fields on the Storefront 'Advanced Search' page. Clicks on the Submit button.</description> - </annotations> - <arguments> - <argument name="name" type="string"/> - <argument name="description" type="string"/> - </arguments> - - <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.ProductName}}" userInput="{{name}}" stepKey="fillName"/> - <fillField selector="{{StorefrontCatalogSearchAdvancedFormSection.Description}}" userInput="{{description}}" stepKey="fillDescription"/> - <click selector="{{StorefrontCatalogSearchAdvancedFormSection.SubmitButton}}" stepKey="clickSubmit"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <!-- Asserts that search results do not contain any results--> - <actionGroup name="StorefrontCheckSearchIsEmpty"> - <annotations> - <description>Validates that the 'No Results' message is present and correct on the Storefront Search Results page. PLEASE NOTE: The expected message is Hardcoded.</description> - </annotations> - - <see stepKey="checkEmpty" selector="{{StorefrontQuickSearchResultsSection.messageSection}}" userInput="Your search returned no results"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckAdvancedSearchResultActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckAdvancedSearchResultActionGroup.xml new file mode 100644 index 0000000000000..e26405bbafbea --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckAdvancedSearchResultActionGroup.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="StorefrontCheckAdvancedSearchResultActionGroup"> + <annotations> + <description>Validates that the URL and Title are present and correct on the Storefront Advanced Search Results page.</description> + </annotations> + + <seeInCurrentUrl url="{{StorefrontCatalogSearchAdvancedResultPage.url}}" stepKey="checkUrl"/> + <seeInTitle userInput="Advanced Search Results" stepKey="assertAdvancedSearchTitle"/> + <see userInput="Catalog Advanced Search" selector="{{StorefrontCatalogSearchMainSection.SearchTitle}}" stepKey="assertAdvancedSearchName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckQuickSearchActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckQuickSearchActionGroup.xml new file mode 100644 index 0000000000000..4d97c2d37e7a1 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckQuickSearchActionGroup.xml @@ -0,0 +1,26 @@ +<?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"> + <!-- Quick search the phrase and check if the result page contains correct information --> + <actionGroup name="StorefrontCheckQuickSearchActionGroup"> + <annotations> + <description>Submits Form POST for the Storefront Search feature. Validates that the URL is correct. Validates that the Title is present and correct.</description> + </annotations> + <arguments> + <argument name="phrase"/> + </arguments> + + <submitForm selector="{{StorefrontQuickSearchSection.searchMiniForm}}" parameterArray="['q' => {{phrase}}]" stepKey="fillQuickSearch"/> + <seeInCurrentUrl url="{{StorefrontCatalogSearchPage.url}}" stepKey="checkUrl"/> + <dontSeeInCurrentUrl url="form_key=" stepKey="checkUrlFormKey"/> + <seeInTitle userInput="Search results for: '{{phrase}}'" stepKey="assertQuickSearchTitle"/> + <see userInput="Search results for: '{{phrase}}'" selector="{{StorefrontCatalogSearchMainSection.SearchTitle}}" stepKey="assertQuickSearchName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckQuickSearchStringActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckQuickSearchStringActionGroup.xml new file mode 100644 index 0000000000000..097a02a81679d --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckQuickSearchStringActionGroup.xml @@ -0,0 +1,26 @@ +<?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="StorefrontCheckQuickSearchStringActionGroup"> + <annotations> + <description>Fill the Storefront Search field. Submits the Form. Validates that the provided Search Phrase is present and correct.</description> + </annotations> + <arguments> + <argument name="phrase" type="string"/> + </arguments> + + <fillField stepKey="fillInput" selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" userInput="{{phrase}}"/> + <submitForm selector="{{StorefrontQuickSearchResultsSection.searchTextBox}}" parameterArray="[]" stepKey="submitQuickSearch"/> + <seeInCurrentUrl url="{{StorefrontCatalogSearchPage.url}}" stepKey="checkUrl"/> + <dontSeeInCurrentUrl url="form_key=" stepKey="checkUrlFormKey"/> + <seeInTitle userInput="Search results for: '{{phrase}}'" stepKey="assertQuickSearchTitle"/> + <see userInput="Search results for: '{{phrase}}'" selector="{{StorefrontCatalogSearchMainSection.SearchTitle}}" stepKey="assertQuickSearchName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckSearchIsEmptyActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckSearchIsEmptyActionGroup.xml new file mode 100644 index 0000000000000..c1df5d029d284 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCheckSearchIsEmptyActionGroup.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="StorefrontCheckSearchIsEmptyActionGroup"> + <annotations> + <description>Validates that the 'No Results' message is present and correct on the Storefront Search Results page. PLEASE NOTE: The expected message is Hardcoded.</description> + </annotations> + + <see stepKey="checkEmpty" selector="{{StorefrontQuickSearchResultsSection.messageSection}}" userInput="Your search returned no results"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontOpenAdvancedSearchActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontOpenAdvancedSearchActionGroup.xml new file mode 100644 index 0000000000000..84e4cb29b884d --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontOpenAdvancedSearchActionGroup.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="StorefrontOpenAdvancedSearchActionGroup"> + <annotations> + <description>Clicks on 'Advanced Search' in the Storefront Footer. Validates that the URL and Title are present and correct.</description> + </annotations> + + <click selector="{{StorefrontFooterSection.AdvancedSearch}}" stepKey="clickAdvancedSearchLink"/> + <seeInCurrentUrl url="{{StorefrontCatalogSearchAdvancedFormPage.url}}" stepKey="checkUrl"/> + <seeInTitle userInput="Advanced Search" stepKey="assertAdvancedSearchTitle1"/> + <see userInput="Advanced Search" selector="{{StorefrontCatalogSearchAdvancedFormSection.SearchTitle}}" stepKey="assertAdvancedSearchTitle2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontOpenProductFromQuickSearchActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontOpenProductFromQuickSearchActionGroup.xml new file mode 100644 index 0000000000000..348c5dabc65e0 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontOpenProductFromQuickSearchActionGroup.xml @@ -0,0 +1,26 @@ +<?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="StorefrontOpenProductFromQuickSearchActionGroup"> + <annotations> + <description>Clicks on the provided Product Name from the Storefront Quick Search Results page.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="productUrlKey" type="string"/> + </arguments> + + <scrollTo selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}}" stepKey="scrollToProduct"/> + <click stepKey="openProduct" selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}}"/> + <waitForPageLoad stepKey="waitForProductLoad"/> + <seeInCurrentUrl url="{{productUrlKey}}" stepKey="checkUrl"/> + <see stepKey="checkName" selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{productName}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchCheckProductNameInGridActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchCheckProductNameInGridActionGroup.xml new file mode 100644 index 0000000000000..4f68d9b004c79 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchCheckProductNameInGridActionGroup.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="StorefrontQuickSearchCheckProductNameInGridActionGroup"> + <annotations> + <description>Validates that the provided Product Name appears at the correct index on the Storefront Quick Search page.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="index" type="string"/> + </arguments> + + <see selector="{{StorefrontQuickSearchResultsSection.productByIndex(index)}}" userInput="{{productName}}" stepKey="seeProductName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchCheckProductNameNotInGridActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchCheckProductNameNotInGridActionGroup.xml new file mode 100644 index 0000000000000..493b266e2c368 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchCheckProductNameNotInGridActionGroup.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="StorefrontQuickSearchCheckProductNameNotInGridActionGroup"> + <annotations> + <description>Validates that the provided Product Name does NOT appear on the Storefront Quick Search page.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + + <dontSee selector="{{StorefrontQuickSearchResultsSection.allResults}}" userInput="{{productName}}" stepKey="dontSeeProductName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchRelatedSearchTermsAppearsActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchRelatedSearchTermsAppearsActionGroup.xml new file mode 100644 index 0000000000000..00a4f3e5d3917 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchRelatedSearchTermsAppearsActionGroup.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="StorefrontQuickSearchRelatedSearchTermsAppearsActionGroup"> + <arguments> + <argument name="term" type="string"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontCatalogSearchMainSection.relatedSearchTermsTitle}}" stepKey="waitMessageAppears"/> + <see selector="{{StorefrontCatalogSearchMainSection.relatedSearchTermsTitle}}" userInput="Related search terms" stepKey="checkRelatedTermsTitle"/> + <see selector="{{StorefrontCatalogSearchMainSection.relatedSearchTerm}}" userInput="{{term}}" stepKey="checkRelatedTermExists"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchSeeProductByNameActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchSeeProductByNameActionGroup.xml new file mode 100644 index 0000000000000..a900dfce9c1fa --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchSeeProductByNameActionGroup.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="StorefrontQuickSearchSeeProductByNameActionGroup"> + <arguments> + <argument name="productName" type="string"/> + </arguments> + <see selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}}" userInput="{{productName}}" stepKey="seeProductName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchTooShortStringActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchTooShortStringActionGroup.xml new file mode 100644 index 0000000000000..58ef412410c74 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontQuickSearchTooShortStringActionGroup.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="StorefrontQuickSearchTooShortStringActionGroup" extends="StorefrontCheckQuickSearchStringActionGroup"> + <annotations> + <description>Fill the Storefront Search field. Submits the Form. Validates that 'Minimum Search query length' warning appears.</description> + </annotations> + <arguments> + <argument name="minQueryLength" type="string"/> + </arguments> + + <see selector="{{StorefrontQuickSearchResultsSection.messageSection}}" userInput="Minimum Search query length is {{minQueryLength}}" stepKey="assertQuickSearchNeedThreeOrMoreChars"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontSelectSearchFilterCategoryActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontSelectSearchFilterCategoryActionGroup.xml new file mode 100644 index 0000000000000..3048217f5dfda --- /dev/null +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontSelectSearchFilterCategoryActionGroup.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="StorefrontSelectSearchFilterCategoryActionGroup"> + <annotations> + <description>Clicks on Category Filter. Clicks on the provided Category.</description> + </annotations> + <arguments> + <argument name="category"/> + </arguments> + + <click selector="{{StorefrontCategoryFilterSection.CategoryFilter}}" stepKey="clickCategoryFilterTitle"/> + <scrollTo selector="{{StorefrontCategoryFilterSection.CategoryByName(category.name)}}" stepKey="scrollToClickCategoryFilter"/> + <click selector="{{StorefrontCategoryFilterSection.CategoryByName(category.name)}}" stepKey="clickCategoryFilter"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminCreateSearchTermEntityTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminCreateSearchTermEntityTest.xml index 2b425f34f8a5b..86a1d4321cba0 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminCreateSearchTermEntityTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminCreateSearchTermEntityTest.xml @@ -27,7 +27,7 @@ </before> <after> <!-- Delete created search term --> - <actionGroup ref="AssertSearchTermSuccessDeleteMessage" stepKey="deleteSearchTerm"> + <actionGroup ref="AssertSearchTermSuccessDeleteMessageActionGroup" stepKey="deleteSearchTerm"> <argument name="searchQuery" value="$$createSimpleProduct.sku$$"/> </actionGroup> @@ -39,7 +39,7 @@ </after> <!-- Go to the search terms page and create new search term --> - <actionGroup ref="AssertSearchTermSaveSuccessMessage" stepKey="createNewSearchTerm"> + <actionGroup ref="AssertSearchTermSaveSuccessMessageActionGroup" stepKey="createNewSearchTerm"> <argument name="searchQuery" value="$$createSimpleProduct.sku$$"/> <argument name="storeValue" value="{{SimpleTerm.store_id}}"/> <argument name="redirectUrl" value="{{SimpleTerm.redirect}}"/> @@ -51,7 +51,7 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <!-- Assert created search term on storefront --> - <actionGroup ref="AssertSearchTermOnFrontend" stepKey="assertCreatedSearchTermOnFrontend"> + <actionGroup ref="AssertSearchTermOnFrontendActionGroup" stepKey="assertCreatedSearchTermOnFrontend"> <argument name="searchQuery" value="$$createSimpleProduct.sku$$"/> <argument name="redirectUrl" value="{{SimpleTerm.redirect}}"/> </actionGroup> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminDeleteSearchTermTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminDeleteSearchTermTest.xml index c72ed424ef307..b449d92d8e003 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminDeleteSearchTermTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminDeleteSearchTermTest.xml @@ -33,7 +33,7 @@ </after> <!--Add new search term--> - <actionGroup ref="AssertSearchTermSaveSuccessMessage" stepKey="addNewSearchTerm"> + <actionGroup ref="AssertSearchTermSaveSuccessMessageActionGroup" stepKey="addNewSearchTerm"> <argument name="searchQuery" value="{{SimpleTerm.search_query}}"/> <argument name="storeValue" value="{{SimpleTerm.store_id}}"/> <argument name="redirectUrl" value="{{SimpleTerm.redirect}}"/> @@ -41,19 +41,19 @@ </actionGroup> <!--Search and delete search term and AssertSearchTermSuccessDeleteMessage--> - <actionGroup ref="AssertSearchTermSuccessDeleteMessage" stepKey="deleteSearchTerm"> + <actionGroup ref="AssertSearchTermSuccessDeleteMessageActionGroup" stepKey="deleteSearchTerm"> <argument name="searchQuery" value="{{SimpleTerm.search_query}}"/> </actionGroup> <!--Verify deleted search term in grid and AssertSearchTermNotInGrid--> - <actionGroup ref="AssertSearchTermNotInGrid" stepKey="verifyDeletedSearchTermNotInGrid"> + <actionGroup ref="AssertSearchTermNotInGridActionGroup" stepKey="verifyDeletedSearchTermNotInGrid"> <argument name="searchQuery" value="{{SimpleTerm.search_query}}"/> </actionGroup> <!--Go to storefront and Verify AssertSearchTermNotOnFrontend--> - <actionGroup ref="AssertSearchTermNotOnFrontend" stepKey="verifySearchTermNotOnFrontend"> + <actionGroup ref="AssertSearchTermNotOnFrontendActionGroup" stepKey="verifySearchTermNotOnFrontend"> <argument name="searchQuery" value="{{SimpleTerm.search_query}}"/> <argument name="url_key" value="$$simpleProduct.custom_attributes[url_key]$$"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml index 3b60e4b09de28..02738c118dcc9 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml @@ -36,7 +36,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> <argument name="phrase" value="$createSimpleProduct.sku$"/> </actionGroup> - <actionGroup ref="StorefrontOpenProductFromQuickSearch" stepKey="openAndCheckProduct"> + <actionGroup ref="StorefrontOpenProductFromQuickSearchActionGroup" stepKey="openAndCheckProduct"> <argument name="productName" value="$createSimpleProduct.name$"/> <argument name="productUrlKey" value="$createSimpleProduct.custom_attributes[url_key]$"/> </actionGroup> @@ -106,7 +106,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> <argument name="phrase" value="ThisShouldn'tReturnAnything"/> </actionGroup> - <actionGroup ref="StorefrontCheckSearchIsEmpty" stepKey="checkEmpty"/> + <actionGroup ref="StorefrontCheckSearchIsEmptyActionGroup" stepKey="checkEmpty"/> </test> <test name="QuickSearchWithTwoCharsEmptyResults" extends="QuickSearchEmptyResults"> @@ -254,11 +254,11 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> <argument name="phrase" value="{{_defaultProduct.name}}"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchCheckProductNameInGrid" stepKey="assertProduct1Position"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameInGridActionGroup" stepKey="assertProduct1Position"> <argument name="productName" value="$product1.name$"/> <argument name="index" value="2"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchCheckProductNameInGrid" stepKey="assertProduct2Position"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameInGridActionGroup" stepKey="assertProduct2Position"> <argument name="productName" value="$product2.name$"/> <argument name="index" value="1"/> </actionGroup> @@ -283,11 +283,11 @@ <argument name="defaultValue" value="{{_defaultProduct.name}}"/> </actionGroup> </before> - <actionGroup ref="StorefrontQuickSearchCheckProductNameInGrid" stepKey="assertProduct1Position"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameInGridActionGroup" stepKey="assertProduct1Position"> <argument name="productName" value="$product1.name$"/> <argument name="index" value="1"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchCheckProductNameInGrid" stepKey="assertProduct2Position"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameInGridActionGroup" stepKey="assertProduct2Position"> <argument name="productName" value="$product2.name$"/> <argument name="index" value="2"/> </actionGroup> @@ -317,7 +317,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> <argument name="phrase" value="$createSimpleProduct.name$"/> </actionGroup> - <actionGroup ref="StorefrontAddToCartFromQuickSearch" stepKey="addProductToCart"> + <actionGroup ref="StorefrontAddToCartFromQuickSearchActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$createSimpleProduct.name$"/> </actionGroup> </test> @@ -349,7 +349,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> <argument name="phrase" value="$createVirtualProduct.name$"/> </actionGroup> - <actionGroup ref="StorefrontAddToCartFromQuickSearch" stepKey="addProductToCart"> + <actionGroup ref="StorefrontAddToCartFromQuickSearchActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$createVirtualProduct.name$"/> </actionGroup> </test> @@ -387,7 +387,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> <argument name="phrase" value="{{_defaultProduct.name}}"/> </actionGroup> - <actionGroup ref="StorefrontOpenProductFromQuickSearch" stepKey="openAndCheckProduct"> + <actionGroup ref="StorefrontOpenProductFromQuickSearchActionGroup" stepKey="openAndCheckProduct"> <argument name="productName" value="{{_defaultProduct.name}}"/> <argument name="productUrlKey" value="{{_defaultProduct.urlKey}}"/> </actionGroup> @@ -430,7 +430,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> <argument name="phrase" value="$createProduct.name$"/> </actionGroup> - <actionGroup ref="StorefrontAddToCartFromQuickSearch" stepKey="addProductToCart"> + <actionGroup ref="StorefrontAddToCartFromQuickSearchActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$createProduct.name$"/> </actionGroup> </test> @@ -467,7 +467,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> <argument name="phrase" value=""$createProduct.name$""/> </actionGroup> - <actionGroup ref="StorefrontAddToCartFromQuickSearch" stepKey="addProductToCart"> + <actionGroup ref="StorefrontAddToCartFromQuickSearchActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$createProduct.name$"/> </actionGroup> </test> @@ -519,7 +519,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> <argument name="phrase" value="$createBundleProduct.name$"/> </actionGroup> - <actionGroup ref="StorefrontOpenProductFromQuickSearch" stepKey="openAndCheckProduct"> + <actionGroup ref="StorefrontOpenProductFromQuickSearchActionGroup" stepKey="openAndCheckProduct"> <argument name="productName" value="$createBundleProduct.name$"/> <argument name="productUrlKey" value="$createBundleProduct.custom_attributes[url_key]$"/> </actionGroup> @@ -589,7 +589,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> <argument name="phrase" value="$createBundleProduct.name$"/> </actionGroup> - <actionGroup ref="StorefrontOpenProductFromQuickSearch" stepKey="openAndCheckProduct"> + <actionGroup ref="StorefrontOpenProductFromQuickSearchActionGroup" stepKey="openAndCheckProduct"> <argument name="productName" value="$createBundleProduct.name$"/> <argument name="productUrlKey" value="$createBundleProduct.custom_attributes[url_key]$"/> </actionGroup> @@ -676,7 +676,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefront"> <argument name="phrase" value="$createConfigProduct.name$"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchCheckProductNameInGrid" stepKey="seeProductInGrid"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameInGridActionGroup" stepKey="seeProductInGrid"> <argument name="productName" value="$createConfigProduct.name$"/> <argument name="index" value="1"/> </actionGroup> @@ -692,7 +692,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefrontAgain"> <argument name="phrase" value="$createConfigProduct.name$"/> </actionGroup> - <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeProductAnymore"> + <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGridActionGroup" stepKey="dontSeeProductAnymore"> <argument name="productName" value="$createConfigProduct.name$"/> </actionGroup> </test> diff --git a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml index a144a4849db60..0417d1eee1ae2 100644 --- a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml +++ b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml @@ -92,7 +92,7 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchForSecondSearchTerm"> <argument name="phrase" value="?;"/> </actionGroup> - <actionGroup ref="StorefrontCheckSearchIsEmpty" stepKey="checkEmptyForSecondSearchTerm"/> + <actionGroup ref="StorefrontCheckSearchIsEmptyActionGroup" stepKey="checkEmptyForSecondSearchTerm"/> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchProductForWithSpecialSymbols"> <argument name="phrase" value="?{{ProductWithSpecialSymbols.name}};"/> </actionGroup> @@ -104,10 +104,10 @@ <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchForThirdSearchTerm"> <argument name="phrase" value="?anythingcangobetween;"/> </actionGroup> - <actionGroup ref="StorefrontCheckSearchIsEmpty" stepKey="checkEmptyForThirdSearchTerm"/> + <actionGroup ref="StorefrontCheckSearchIsEmptyActionGroup" stepKey="checkEmptyForThirdSearchTerm"/> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchForForthSearchTerm"> <argument name="phrase" value="? anything at all ;"/> </actionGroup> - <actionGroup ref="StorefrontCheckSearchIsEmpty" stepKey="checkEmptyForForthSearchTerm"/> + <actionGroup ref="StorefrontCheckSearchIsEmptyActionGroup" stepKey="checkEmptyForForthSearchTerm"/> </test> </tests> diff --git a/app/code/Magento/Search/Test/Mftf/Test/AdminMassDeleteSearchTermEntityTest.xml b/app/code/Magento/Search/Test/Mftf/Test/AdminMassDeleteSearchTermEntityTest.xml index 67ccb51bf401e..57f34b41a967f 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/AdminMassDeleteSearchTermEntityTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/AdminMassDeleteSearchTermEntityTest.xml @@ -52,13 +52,13 @@ <actionGroup ref="deleteSearchTerm" stepKey="deleteSearchTerms"/> <!-- Assert search terms are absent on the search term page --> - <actionGroup ref="AssertSearchTermNotInGrid" stepKey="assertFirstSearchTermNotInGrid"> + <actionGroup ref="AssertSearchTermNotInGridActionGroup" stepKey="assertFirstSearchTermNotInGrid"> <argument name="searchQuery" value="$$createFirstSearchTerm.query_text$$"/> </actionGroup> - <actionGroup ref="AssertSearchTermNotInGrid" stepKey="assertSecondSearchTermNotInGrid"> + <actionGroup ref="AssertSearchTermNotInGridActionGroup" stepKey="assertSecondSearchTermNotInGrid"> <argument name="searchQuery" value="$$createSecondSearchTerm.query_text$$"/> </actionGroup> - <actionGroup ref="AssertSearchTermNotInGrid" stepKey="assertThirdSearchTermNotInGrid"> + <actionGroup ref="AssertSearchTermNotInGridActionGroup" stepKey="assertThirdSearchTermNotInGrid"> <argument name="searchQuery" value="$$createThirdSearchTerm.query_text$$"/> </actionGroup> @@ -70,14 +70,14 @@ <actionGroup ref="StorefrontCheckQuickSearchActionGroup" stepKey="quickSearchForFirstSearchTerm"> <argument name="phrase" value="$$createFirstSearchTerm.query_text$$"/> </actionGroup> - <actionGroup ref="StorefrontCheckSearchIsEmpty" stepKey="checkEmptyForFirstSearchTerm"/> + <actionGroup ref="StorefrontCheckSearchIsEmptyActionGroup" stepKey="checkEmptyForFirstSearchTerm"/> <actionGroup ref="StorefrontCheckQuickSearchActionGroup" stepKey="quickSearchForSecondSearchTerm"> <argument name="phrase" value="$$createSecondSearchTerm.query_text$$"/> </actionGroup> - <actionGroup ref="StorefrontCheckSearchIsEmpty" stepKey="checkEmptyForSecondSearchTerm"/> + <actionGroup ref="StorefrontCheckSearchIsEmptyActionGroup" stepKey="checkEmptyForSecondSearchTerm"/> <actionGroup ref="StorefrontCheckQuickSearchActionGroup" stepKey="quickSearchForThirdSearchTerm"> <argument name="phrase" value="$$createThirdSearchTerm.query_text$$"/> </actionGroup> - <actionGroup ref="StorefrontCheckSearchIsEmpty" stepKey="checkEmptyForThirdSearchTerm"/> + <actionGroup ref="StorefrontCheckSearchIsEmptyActionGroup" stepKey="checkEmptyForThirdSearchTerm"/> </test> </tests> From 136cb0400b7e8beb50be8a4bef75c62ff08b0937 Mon Sep 17 00:00:00 2001 From: Maximilian Fickers <m.fickers@basecom.de> Date: Fri, 29 Nov 2019 12:45:37 +0100 Subject: [PATCH 348/595] 25042 Add unit tests for header Logo block image dimension getters --- .../Test/Unit/Block/Html/Header/LogoTest.php | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/app/code/Magento/Theme/Test/Unit/Block/Html/Header/LogoTest.php b/app/code/Magento/Theme/Test/Unit/Block/Html/Header/LogoTest.php index 91af1a9bf6078..077f12e578dca 100644 --- a/app/code/Magento/Theme/Test/Unit/Block/Html/Header/LogoTest.php +++ b/app/code/Magento/Theme/Test/Unit/Block/Html/Header/LogoTest.php @@ -44,4 +44,38 @@ public function testGetLogoSrc() $this->assertEquals('http://localhost/pub/media/logo/default/image.gif', $block->getLogoSrc()); } + + /** + * cover \Magento\Theme\Block\Html\Header\Logo::getLogoHeight + */ + public function testGetLogoHeight() + { + $scopeConfig = $this->createMock(\Magento\Framework\App\Config\ScopeConfigInterface::class); + $scopeConfig->expects($this->once())->method('getValue')->willReturn(null); + + $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $arguments = [ + 'scopeConfig' => $scopeConfig, + ]; + $block = $objectManager->getObject(\Magento\Theme\Block\Html\Header\Logo::class, $arguments); + + $this->assertEquals(null, $block->getLogoHeight()); + } + + /** + * @covers \Magento\Theme\Block\Html\Header\Logo::getLogoWidth + */ + public function testGetLogoWidth() + { + $scopeConfig = $this->createMock(\Magento\Framework\App\Config\ScopeConfigInterface::class); + $scopeConfig->expects($this->once())->method('getValue')->willReturn('170'); + + $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $arguments = [ + 'scopeConfig' => $scopeConfig, + ]; + $block = $objectManager->getObject(\Magento\Theme\Block\Html\Header\Logo::class, $arguments); + + $this->assertEquals('170', $block->getLogoHeight()); + } } From 26fc7c187010101ba1367f640c929ac7a1ee3550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Fri, 29 Nov 2019 13:06:37 +0100 Subject: [PATCH 349/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...talogPriceRuleWithConditionActionGroup.xml | 28 +++ ...ipleWebsiteCatalogPriceRuleActionGroup.xml | 15 ++ ...minFillCatalogRuleConditionActionGroup.xml | 35 +++ .../ApplyCatalogPriceRulesActionGroup.xml | 21 ++ .../CatalogPriceRuleActionGroup.xml | 214 +----------------- .../CreateCatalogPriceRuleActionGroup.xml | 29 +++ ...eRuleConditionWithAttributeActionGroup.xml | 31 +++ ...ateCatalogPriceRuleViaTheUiActionGroup.xml | 30 +++ ...ByUIWithConditionIsCategoryActionGroup.xml | 28 +++ ...eRuleByUIWithConditionIsSKUActionGroup.xml | 28 +++ ...logPriceRuleWithInvalidDataActionGroup.xml | 29 +++ .../OpenCatalogPriceRuleActionGroup.xml | 22 ++ .../RemoveCatalogPriceRuleActionGroup.xml | 18 ++ .../SelectGeneralCustomerGroupActionGroup.xml | 18 ++ ...ectNotLoggedInCustomerGroupActionGroup.xml | 18 ++ ...nfigurableProductWithSpecialPricesTest.xml | 4 +- .../Test/AdminCreateCatalogPriceRuleTest.xml | 12 +- .../AdminDeleteCatalogPriceRuleEntityTest.xml | 4 +- .../Test/AdminDeleteCatalogPriceRuleTest.xml | 2 +- ...tributeIsUndefinedCatalogPriceRuleTest.xml | 12 +- ...uleForSimpleAndConfigurableProductTest.xml | 4 +- ...RuleForSimpleProductAndFixedMethodTest.xml | 8 +- ...orSimpleProductForNewCustomerGroupTest.xml | 2 +- ...eForSimpleProductWithCustomOptionsTest.xml | 4 +- ...hipArePersistedUnderLongTermCookieTest.xml | 4 +- .../StorefrontInactiveCatalogRuleTest.xml | 2 +- ...eProductWithAssignedSimpleProductsTest.xml | 2 +- ...eForConfigurableProductWithOptionsTest.xml | 6 +- ...ConfigurableWithCatalogRuleAppliedTest.xml | 2 +- 29 files changed, 385 insertions(+), 247 deletions(-) create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCreateCatalogPriceRuleWithConditionActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCreateMultipleWebsiteCatalogPriceRuleActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminFillCatalogRuleConditionActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/ApplyCatalogPriceRulesActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleConditionWithAttributeActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleViaTheUiActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleByUIWithConditionIsSKUActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleWithInvalidDataActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/OpenCatalogPriceRuleActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/RemoveCatalogPriceRuleActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectGeneralCustomerGroupActionGroup.xml create mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.xml diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCreateCatalogPriceRuleWithConditionActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCreateCatalogPriceRuleWithConditionActionGroup.xml new file mode 100644 index 0000000000000..eebc1175f1894 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCreateCatalogPriceRuleWithConditionActionGroup.xml @@ -0,0 +1,28 @@ +<?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="AdminCreateCatalogPriceRuleWithConditionActionGroup" extends="CreateCatalogPriceRuleActionGroup"> + <arguments> + <argument name="catalogRuleType" type="entity" defaultValue="PriceRuleWithCondition"/> + </arguments> + <waitForPageLoad stepKey="waitForPageLoad" after="addNewRule"/> + <click selector="{{AdminNewCatalogPriceRule.conditionsTab}}" stepKey="expandConditions" before="openActionDropdown"/> + <scrollTo selector="{{AdminNewCatalogPriceRule.conditionsTab}}" stepKey="scrollToConditionsTab" after="expandConditions"/> + <waitForElementVisible selector="{{PriceRuleConditionsSection.createNewRule}}" stepKey="waitForNewRule" after="scrollToConditionsTab"/> + <click selector="{{PriceRuleConditionsSection.createNewRule}}" stepKey="clickNewRule" after="waitForNewRule"/> + <selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionsDropdown}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="selectProductAttribute" after="clickNewRule"/> + <waitForPageLoad stepKey="waitForAttributeLoad" after="selectProductAttribute"/> + <!--Assert that attribute contains today date without time--> + <comment userInput="Assert that attribute contains today date without time" stepKey="assertDate" after="waitForAttributeLoad"/> + <generateDate date="now" format="Y-m-d" stepKey="today" after="assertDate"/> + <grabTextFrom selector="{{PriceRuleConditionsSection.firstProductAttributeSelected}}" stepKey="grabTextFromSelectedAttribute" after="today"/> + <assertEquals expected="$today" actual="$grabTextFromSelectedAttribute" stepKey="assertTodayDate" after="grabTextFromSelectedAttribute"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCreateMultipleWebsiteCatalogPriceRuleActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCreateMultipleWebsiteCatalogPriceRuleActionGroup.xml new file mode 100644 index 0000000000000..06887a6aaba96 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminCreateMultipleWebsiteCatalogPriceRuleActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AdminCreateMultipleWebsiteCatalogPriceRuleActionGroup" extends="CreateCatalogPriceRuleActionGroup"> + <remove keyForRemoval="selectSite"/> + <selectOption selector="{{AdminNewCatalogPriceRule.websites}}" parameterArray="['FirstWebsite', 'SecondWebsite']" stepKey="selectWebsite"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminFillCatalogRuleConditionActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminFillCatalogRuleConditionActionGroup.xml new file mode 100644 index 0000000000000..fd173acfa434c --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/AdminFillCatalogRuleConditionActionGroup.xml @@ -0,0 +1,35 @@ +<?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="AdminFillCatalogRuleConditionActionGroup"> + <annotations> + <description>Clicks on the Conditions tab. Fills in the provided condition for Catalog Price Rule.</description> + </annotations> + <arguments> + <argument name="condition" type="string" defaultValue="{{CatalogRuleProductConditions.categoryIds}}"/> + <argument name="conditionOperator" type="string" defaultValue="is"/> + <argument name="conditionValue" type="string" defaultValue="2"/> + </arguments> + + <conditionalClick selector="{{AdminNewCatalogPriceRule.conditionsTab}}" dependentSelector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" visible="false" stepKey="openConditionsTab"/> + <waitForElementVisible selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" stepKey="waitForAddConditionButton"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" stepKey="addNewCondition"/> + <selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="{{condition}}" stepKey="selectTypeCondition"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.condition('is')}}" stepKey="clickOnOperator"/> + <selectOption selector="{{AdminNewCatalogPriceRuleConditions.activeOperatorSelect}}" userInput="{{conditionOperator}}" stepKey="selectCondition"/> + <!-- In case we are choosing already selected value - select is not closed automatically --> + <conditionalClick selector="{{AdminNewCatalogPriceRuleConditions.condition('...')}}" dependentSelector="{{AdminNewCatalogPriceRuleConditions.activeOperatorSelect}}" visible="true" stepKey="closeSelect"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.condition('...')}}" stepKey="clickToChooseOption3"/> + <waitForElementVisible selector="{{AdminNewCatalogPriceRuleConditions.activeValueInput}}" stepKey="waitForValueInput"/> + <fillField selector="{{AdminNewCatalogPriceRuleConditions.activeValueInput}}" userInput="{{conditionValue}}" stepKey="fillConditionValue"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.activeConditionApplyButton}}" stepKey="clickApply"/> + <waitForElementNotVisible selector="{{AdminNewCatalogPriceRuleConditions.activeConditionApplyButton}}" stepKey="waitForApplyButtonInvisibility"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/ApplyCatalogPriceRulesActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/ApplyCatalogPriceRulesActionGroup.xml new file mode 100644 index 0000000000000..0b74558599fbd --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/ApplyCatalogPriceRulesActionGroup.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="ApplyCatalogPriceRulesActionGroup"> + <annotations> + <description>Goes to the Catalog Price Rule grid page. Clicks on Apply Rules. Validates that the Success Message is present and correct.</description> + </annotations> + + <amOnPage stepKey="goToPriceRulePage" url="{{CatalogRulePage.url}}"/> + <waitForPageLoad stepKey="waitForPriceRulePage"/> + <click stepKey="applyRules" selector="{{AdminCatalogPriceRuleGrid.applyRules}}"/> + <see stepKey="assertSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="Updated rules applied."/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CatalogPriceRuleActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CatalogPriceRuleActionGroup.xml index 50b4165a3f34b..e0d02a280bf6c 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CatalogPriceRuleActionGroup.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CatalogPriceRuleActionGroup.xml @@ -9,7 +9,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <!-- action group to create a new catalog price rule giving a catalogRule entity --> - <actionGroup name="newCatalogPriceRuleByUI"> + <actionGroup name="NewCatalogPriceRuleByUIActionGroup"> <annotations> <description>Goes to the Catalog Price Rule grid. Clicks on Add. Fills in the provided Catalog Rule details.</description> </annotations> @@ -40,216 +40,4 @@ <scrollToTopOfPage stepKey="scrollToTop"/> <waitForPageLoad stepKey="waitForApplied"/> </actionGroup> - - <actionGroup name="createCatalogPriceRule"> - <annotations> - <description>Clicks on the Add button. Fills Rule Name, Description, Website and Discount Value.</description> - </annotations> - <arguments> - <argument name="catalogRule" defaultValue="_defaultCatalogRule"/> - </arguments> - <click stepKey="addNewRule" selector="{{AdminGridMainControls.add}}"/> - <fillField selector="{{AdminNewCatalogPriceRule.ruleName}}" userInput="{{catalogRule.name}}" stepKey="fillName" /> - <click stepKey="selectActive" selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}"/> - <fillField selector="{{AdminNewCatalogPriceRule.description}}" userInput="{{catalogRule.description}}" stepKey="fillDescription" /> - <selectOption selector="{{AdminNewCatalogPriceRule.websites}}" parameterArray="{{catalogRule.website_ids}}" stepKey="selectSite" /> - <click stepKey="openActionDropdown" selector="{{AdminNewCatalogPriceRule.actionsTab}}"/> - <fillField stepKey="fillDiscountValue" selector="{{AdminNewCatalogPriceRuleActions.discountAmount}}" userInput="{{catalogRule.discount_amount}}"/> - <scrollToTopOfPage stepKey="scrollToTop"/> - <click selector="{{AdminNewCatalogPriceRule.save}}" stepKey="clickSave"/> - <waitForPageLoad stepKey="waitForApplied"/> - </actionGroup> - - <actionGroup name="AdminCreateCatalogPriceRuleWithConditionActionGroup" extends="createCatalogPriceRule"> - <arguments> - <argument name="catalogRuleType" type="entity" defaultValue="PriceRuleWithCondition"/> - </arguments> - <waitForPageLoad stepKey="waitForPageLoad" after="addNewRule"/> - <click selector="{{AdminNewCatalogPriceRule.conditionsTab}}" stepKey="expandConditions" before="openActionDropdown"/> - <scrollTo selector="{{AdminNewCatalogPriceRule.conditionsTab}}" stepKey="scrollToConditionsTab" after="expandConditions"/> - <waitForElementVisible selector="{{PriceRuleConditionsSection.createNewRule}}" stepKey="waitForNewRule" after="scrollToConditionsTab"/> - <click selector="{{PriceRuleConditionsSection.createNewRule}}" stepKey="clickNewRule" after="waitForNewRule"/> - <selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionsDropdown}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="selectProductAttribute" after="clickNewRule"/> - <waitForPageLoad stepKey="waitForAttributeLoad" after="selectProductAttribute"/> - <!--Assert that attribute contains today date without time--> - <comment userInput="Assert that attribute contains today date without time" stepKey="assertDate" after="waitForAttributeLoad"/> - <generateDate date="now" format="Y-m-d" stepKey="today" after="assertDate"/> - <grabTextFrom selector="{{PriceRuleConditionsSection.firstProductAttributeSelected}}" stepKey="grabTextFromSelectedAttribute" after="today"/> - <assertEquals expected="$today" actual="$grabTextFromSelectedAttribute" stepKey="assertTodayDate" after="grabTextFromSelectedAttribute"/> - </actionGroup> - <actionGroup name="AdminCreateMultipleWebsiteCatalogPriceRule" extends="createCatalogPriceRule"> - <remove keyForRemoval="selectSite"/> - <selectOption selector="{{AdminNewCatalogPriceRule.websites}}" parameterArray="['FirstWebsite', 'SecondWebsite']" stepKey="selectWebsite"/> - </actionGroup> - <actionGroup name="CreateCatalogPriceRuleViaTheUi"> - <arguments> - <argument name="catalogRule" defaultValue="_defaultCatalogRule"/> - <argument name="customerGroup" defaultValue="General" type="string"/> - <argument name="disregardRules" defaultValue="Yes" type="string"/> - </arguments> - - <fillField selector="{{AdminNewCatalogPriceRule.ruleName}}" userInput="{{catalogRule.name}}" stepKey="fillName1"/> - <fillField selector="{{AdminNewCatalogPriceRule.description}}" userInput="{{catalogRule.description}}" stepKey="fillDescription1"/> - <selectOption selector="{{AdminNewCatalogPriceRule.websites}}" userInput="{{catalogRule.website_ids[0]}}" stepKey="selectWebSite1"/> - <selectOption selector="{{AdminNewCatalogPriceRule.customerGroups}}" userInput="{{customerGroup}}" stepKey="selectCustomerGroup1"/> - <scrollTo selector="{{AdminNewCatalogPriceRule.actionsTab}}" stepKey="scrollToActionTab1"/> - <click selector="{{AdminNewCatalogPriceRule.actionsTab}}" stepKey="openActionDropdown1"/> - <selectOption selector="{{AdminNewCatalogPriceRuleActions.apply}}" userInput="{{catalogRule.simple_action}}" stepKey="discountType1"/> - <fillField selector="{{AdminNewCatalogPriceRuleActions.discountAmount}}" userInput="{{catalogRule.discount_amount}}" stepKey="fillDiscountValue1"/> - <selectOption selector="{{AdminNewCatalogPriceRuleActions.disregardRules}}" userInput="{{disregardRules}}" stepKey="discardSubsequentRules1"/> - <waitForPageLoad stepKey="waitForPageToLoad1"/> - <scrollToTopOfPage stepKey="scrollToTop1"/> - </actionGroup> - - <actionGroup name="CreateCatalogPriceRuleConditionWithAttribute"> - <annotations> - <description>Add Conditional Requirements to a Catalog Price Rule from the creation/edit page.</description> - </annotations> - <arguments> - <argument name="attributeName" type="string"/> - <argument name="targetValue" type="string"/> - <argument name="targetSelectValue" type="string"/> - </arguments> - - <click selector="{{AdminNewCatalogPriceRule.conditionsTab}}" stepKey="openConditionsTab"/> - <waitForPageLoad stepKey="waitForConditionTabOpened"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" stepKey="addNewCondition"/> - <selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="{{attributeName}}" stepKey="selectTypeCondition"/> - <waitForElement selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsisValue('1', targetValue)}}" stepKey="waitForIsTarget"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsisValue('1', 'is')}}" stepKey="clickOnIs"/> - <selectOption selector="{{AdminNewCatalogPriceRuleConditions.targetSelect('1')}}" userInput="{{targetSelectValue}}" stepKey="selectTargetCondition"/> - <click selector="{{AdminNewCatalogPriceRule.fromDateButton}}" stepKey="clickFromCalender"/> - <click selector="{{AdminNewCatalogPriceRule.todayDate}}" stepKey="clickFromToday"/> - </actionGroup> - - <!-- Apply all of the saved catalog price rules --> - <actionGroup name="applyCatalogPriceRules"> - <annotations> - <description>Goes to the Catalog Price Rule grid page. Clicks on Apply Rules. Validates that the Success Message is present and correct.</description> - </annotations> - - <amOnPage stepKey="goToPriceRulePage" url="{{CatalogRulePage.url}}"/> - <waitForPageLoad stepKey="waitForPriceRulePage"/> - <click stepKey="applyRules" selector="{{AdminCatalogPriceRuleGrid.applyRules}}"/> - <see stepKey="assertSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="Updated rules applied."/> - </actionGroup> - - <!--Add Catalog Rule Condition With product SKU--> - <actionGroup name="newCatalogPriceRuleByUIWithConditionIsSKU" extends="newCatalogPriceRuleByUI"> - <annotations> - <description>EXTENDS: newCatalogPriceRuleByUI. Add a Catalog Price Rule Condition based on the provided SKU.</description> - </annotations> - <arguments> - <argument name="productSku"/> - </arguments> - - <click selector="{{AdminNewCatalogPriceRule.conditionsTab}}" after="discardSubsequentRules" stepKey="openConditionsTab"/> - <waitForPageLoad after="openConditionsTab" stepKey="waitForConditionTabOpened"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" after="waitForConditionTabOpened" stepKey="addNewCondition"/> - <selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="Magento\CatalogRule\Model\Rule\Condition\Product|sku" after="addNewCondition" stepKey="selectTypeCondition"/> - <waitForPageLoad after="selectTypeCondition" stepKey="waitForConditionChosed"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsis('1')}}" after="waitForConditionChosed" stepKey="clickEllipsis"/> - <fillField selector="{{AdminNewCatalogPriceRuleConditions.targetInput('1', '1')}}" userInput="{{productSku}}" after="clickEllipsis" stepKey="fillProductSku"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.applyButton('1', '1')}}" after="fillProductSku" stepKey="clickApply"/> - </actionGroup> - - <!--Add Catalog Rule Condition With Category--> - <actionGroup name="newCatalogPriceRuleByUIWithConditionIsCategory" extends="newCatalogPriceRuleByUI"> - <annotations> - <description>EXTENDS: newCatalogPriceRuleByUI. Add a Catalog Price Rule Condition based on the provided Category ID.</description> - </annotations> - <arguments> - <argument name="categoryId"/> - </arguments> - - <click selector="{{AdminNewCatalogPriceRule.conditionsTab}}" after="discardSubsequentRules" stepKey="openConditionsTab"/> - <waitForPageLoad after="openConditionsTab" stepKey="waitForConditionTabOpened"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" after="waitForConditionTabOpened" stepKey="addNewCondition"/> - <selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="Magento\CatalogRule\Model\Rule\Condition\Product|category_ids" after="addNewCondition" stepKey="selectTypeCondition"/> - <waitForPageLoad after="selectTypeCondition" stepKey="waitForConditionChosed"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsis('1')}}" after="waitForConditionChosed" stepKey="clickEllipsis"/> - <fillField selector="{{AdminNewCatalogPriceRuleConditions.targetInput('1', '1')}}" userInput="{{categoryId}}" after="clickEllipsis" stepKey="fillCategoryId"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.applyButton('1', '1')}}" after="fillCategoryId" stepKey="clickApply"/> - </actionGroup> - - <actionGroup name="selectGeneralCustomerGroupActionGroup"> - <annotations> - <description>Selects the 'General' Customer Group for a Catalog Price Rule on the creation/edit page.</description> - </annotations> - - <selectOption selector="{{AdminNewCatalogPriceRule.customerGroups}}" userInput="General" stepKey="selectCustomerGroup"/> - </actionGroup> - - <actionGroup name="selectNotLoggedInCustomerGroupActionGroup"> - <annotations> - <description>Selects the 'NOT LOGGED IN' Customer Group for a Catalog Price Rule on the creation/edit page.</description> - </annotations> - - <selectOption selector="{{AdminNewCatalogPriceRule.customerGroups}}" userInput="NOT LOGGED IN" stepKey="selectCustomerGroup"/> - </actionGroup> - - <!-- Open rule for Edit --> - <actionGroup name="OpenCatalogPriceRule"> - <arguments> - <argument name="ruleName" type="string" defaultValue="CustomCatalogRule.name"/> - </arguments> - <amOnPage url="{{AdminCatalogPriceRuleGridPage.url}}" stepKey="goToAdminCatalogPriceRuleGridPage"/> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> - <fillField selector="{{AdminCatalogPriceRuleGridSection.filterByRuleName}}" userInput="{{ruleName}}" stepKey="filterByRuleName"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearch"/> - <click selector="{{AdminGridTableSection.row('1')}}" stepKey="clickEdit"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <actionGroup name="RemoveCatalogPriceRule" extends="OpenCatalogPriceRule"> - <click selector="{{AdminMainActionsSection.delete}}" after="waitForPageLoad" stepKey="clickToDelete"/> - <waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" after="clickToDelete" stepKey="waitForElementVisible"/> - <click selector="{{AdminConfirmationModalSection.ok}}" after="waitForElementVisible" stepKey="clickToConfirm"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" after="clickToConfirm" stepKey="waitForSuccessMessage"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the rule." after="waitForSuccessMessage" stepKey="verifyRuleIsDeleted"/> - </actionGroup> - - <actionGroup name="AdminFillCatalogRuleConditionActionGroup"> - <annotations> - <description>Clicks on the Conditions tab. Fills in the provided condition for Catalog Price Rule.</description> - </annotations> - <arguments> - <argument name="condition" type="string" defaultValue="{{CatalogRuleProductConditions.categoryIds}}"/> - <argument name="conditionOperator" type="string" defaultValue="is"/> - <argument name="conditionValue" type="string" defaultValue="2"/> - </arguments> - - <conditionalClick selector="{{AdminNewCatalogPriceRule.conditionsTab}}" dependentSelector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" visible="false" stepKey="openConditionsTab"/> - <waitForElementVisible selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" stepKey="waitForAddConditionButton"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" stepKey="addNewCondition"/> - <selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="{{condition}}" stepKey="selectTypeCondition"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.condition('is')}}" stepKey="clickOnOperator"/> - <selectOption selector="{{AdminNewCatalogPriceRuleConditions.activeOperatorSelect}}" userInput="{{conditionOperator}}" stepKey="selectCondition"/> - <!-- In case we are choosing already selected value - select is not closed automatically --> - <conditionalClick selector="{{AdminNewCatalogPriceRuleConditions.condition('...')}}" dependentSelector="{{AdminNewCatalogPriceRuleConditions.activeOperatorSelect}}" visible="true" stepKey="closeSelect"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.condition('...')}}" stepKey="clickToChooseOption3"/> - <waitForElementVisible selector="{{AdminNewCatalogPriceRuleConditions.activeValueInput}}" stepKey="waitForValueInput"/> - <fillField selector="{{AdminNewCatalogPriceRuleConditions.activeValueInput}}" userInput="{{conditionValue}}" stepKey="fillConditionValue"/> - <click selector="{{AdminNewCatalogPriceRuleConditions.activeConditionApplyButton}}" stepKey="clickApply"/> - <waitForElementNotVisible selector="{{AdminNewCatalogPriceRuleConditions.activeConditionApplyButton}}" stepKey="waitForApplyButtonInvisibility"/> - </actionGroup> - - <actionGroup name="newCatalogPriceRuleWithInvalidData"> - <annotations> - <description>Goes to the Catalog Price Rule grid. Clicks on Add. Fills in the provided Catalog Rule details with invalid data.</description> - </annotations> - <arguments> - <argument name="catalogRule" defaultValue="catalogRuleWithInvalid"/> - </arguments> - - <!-- Go to the admin Catalog rule grid and add a new one --> - <amOnPage stepKey="goToPriceRulePage" url="{{CatalogRulePage.url}}"/> - <waitForPageLoad stepKey="waitForPriceRulePage"/> - - <click stepKey="addNewRule" selector="{{AdminGridMainControls.add}}"/> - <fillField stepKey="fillPriority" selector="{{AdminNewCatalogPriceRule.priority}}" userInput="{{catalogRule.priority}}"/> - <scrollToTopOfPage stepKey="scrollToTop"/> - <click selector="{{AdminNewCatalogPriceRule.save}}" stepKey="clickSave"/> - <waitForPageLoad stepKey="waitForApplied"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleActionGroup.xml new file mode 100644 index 0000000000000..f43cd44c50de2 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleActionGroup.xml @@ -0,0 +1,29 @@ +<?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="CreateCatalogPriceRuleActionGroup"> + <annotations> + <description>Clicks on the Add button. Fills Rule Name, Description, Website and Discount Value.</description> + </annotations> + <arguments> + <argument name="catalogRule" defaultValue="_defaultCatalogRule"/> + </arguments> + <click stepKey="addNewRule" selector="{{AdminGridMainControls.add}}"/> + <fillField selector="{{AdminNewCatalogPriceRule.ruleName}}" userInput="{{catalogRule.name}}" stepKey="fillName" /> + <click stepKey="selectActive" selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}"/> + <fillField selector="{{AdminNewCatalogPriceRule.description}}" userInput="{{catalogRule.description}}" stepKey="fillDescription" /> + <selectOption selector="{{AdminNewCatalogPriceRule.websites}}" parameterArray="{{catalogRule.website_ids}}" stepKey="selectSite" /> + <click stepKey="openActionDropdown" selector="{{AdminNewCatalogPriceRule.actionsTab}}"/> + <fillField stepKey="fillDiscountValue" selector="{{AdminNewCatalogPriceRuleActions.discountAmount}}" userInput="{{catalogRule.discount_amount}}"/> + <scrollToTopOfPage stepKey="scrollToTop"/> + <click selector="{{AdminNewCatalogPriceRule.save}}" stepKey="clickSave"/> + <waitForPageLoad stepKey="waitForApplied"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleConditionWithAttributeActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleConditionWithAttributeActionGroup.xml new file mode 100644 index 0000000000000..97d1324f7c4fa --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleConditionWithAttributeActionGroup.xml @@ -0,0 +1,31 @@ +<?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="CreateCatalogPriceRuleConditionWithAttributeActionGroup"> + <annotations> + <description>Add Conditional Requirements to a Catalog Price Rule from the creation/edit page.</description> + </annotations> + <arguments> + <argument name="attributeName" type="string"/> + <argument name="targetValue" type="string"/> + <argument name="targetSelectValue" type="string"/> + </arguments> + + <click selector="{{AdminNewCatalogPriceRule.conditionsTab}}" stepKey="openConditionsTab"/> + <waitForPageLoad stepKey="waitForConditionTabOpened"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" stepKey="addNewCondition"/> + <selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="{{attributeName}}" stepKey="selectTypeCondition"/> + <waitForElement selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsisValue('1', targetValue)}}" stepKey="waitForIsTarget"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsisValue('1', 'is')}}" stepKey="clickOnIs"/> + <selectOption selector="{{AdminNewCatalogPriceRuleConditions.targetSelect('1')}}" userInput="{{targetSelectValue}}" stepKey="selectTargetCondition"/> + <click selector="{{AdminNewCatalogPriceRule.fromDateButton}}" stepKey="clickFromCalender"/> + <click selector="{{AdminNewCatalogPriceRule.todayDate}}" stepKey="clickFromToday"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleViaTheUiActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleViaTheUiActionGroup.xml new file mode 100644 index 0000000000000..f549102ecd140 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/CreateCatalogPriceRuleViaTheUiActionGroup.xml @@ -0,0 +1,30 @@ +<?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="CreateCatalogPriceRuleViaTheUiActionGroup"> + <arguments> + <argument name="catalogRule" defaultValue="_defaultCatalogRule"/> + <argument name="customerGroup" defaultValue="General" type="string"/> + <argument name="disregardRules" defaultValue="Yes" type="string"/> + </arguments> + + <fillField selector="{{AdminNewCatalogPriceRule.ruleName}}" userInput="{{catalogRule.name}}" stepKey="fillName1"/> + <fillField selector="{{AdminNewCatalogPriceRule.description}}" userInput="{{catalogRule.description}}" stepKey="fillDescription1"/> + <selectOption selector="{{AdminNewCatalogPriceRule.websites}}" userInput="{{catalogRule.website_ids[0]}}" stepKey="selectWebSite1"/> + <selectOption selector="{{AdminNewCatalogPriceRule.customerGroups}}" userInput="{{customerGroup}}" stepKey="selectCustomerGroup1"/> + <scrollTo selector="{{AdminNewCatalogPriceRule.actionsTab}}" stepKey="scrollToActionTab1"/> + <click selector="{{AdminNewCatalogPriceRule.actionsTab}}" stepKey="openActionDropdown1"/> + <selectOption selector="{{AdminNewCatalogPriceRuleActions.apply}}" userInput="{{catalogRule.simple_action}}" stepKey="discountType1"/> + <fillField selector="{{AdminNewCatalogPriceRuleActions.discountAmount}}" userInput="{{catalogRule.discount_amount}}" stepKey="fillDiscountValue1"/> + <selectOption selector="{{AdminNewCatalogPriceRuleActions.disregardRules}}" userInput="{{disregardRules}}" stepKey="discardSubsequentRules1"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + <scrollToTopOfPage stepKey="scrollToTop1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup.xml new file mode 100644 index 0000000000000..9b5a482c214d4 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup.xml @@ -0,0 +1,28 @@ +<?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="NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup" extends="NewCatalogPriceRuleByUIActionGroup"> + <annotations> + <description>EXTENDS: newCatalogPriceRuleByUI. Add a Catalog Price Rule Condition based on the provided Category ID.</description> + </annotations> + <arguments> + <argument name="categoryId"/> + </arguments> + + <click selector="{{AdminNewCatalogPriceRule.conditionsTab}}" after="discardSubsequentRules" stepKey="openConditionsTab"/> + <waitForPageLoad after="openConditionsTab" stepKey="waitForConditionTabOpened"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" after="waitForConditionTabOpened" stepKey="addNewCondition"/> + <selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="Magento\CatalogRule\Model\Rule\Condition\Product|category_ids" after="addNewCondition" stepKey="selectTypeCondition"/> + <waitForPageLoad after="selectTypeCondition" stepKey="waitForConditionChosed"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsis('1')}}" after="waitForConditionChosed" stepKey="clickEllipsis"/> + <fillField selector="{{AdminNewCatalogPriceRuleConditions.targetInput('1', '1')}}" userInput="{{categoryId}}" after="clickEllipsis" stepKey="fillCategoryId"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.applyButton('1', '1')}}" after="fillCategoryId" stepKey="clickApply"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleByUIWithConditionIsSKUActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleByUIWithConditionIsSKUActionGroup.xml new file mode 100644 index 0000000000000..9d25ffa948ad1 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleByUIWithConditionIsSKUActionGroup.xml @@ -0,0 +1,28 @@ +<?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="NewCatalogPriceRuleByUIWithConditionIsSKUActionGroup" extends="NewCatalogPriceRuleByUIActionGroup"> + <annotations> + <description>EXTENDS: newCatalogPriceRuleByUI. Add a Catalog Price Rule Condition based on the provided SKU.</description> + </annotations> + <arguments> + <argument name="productSku"/> + </arguments> + + <click selector="{{AdminNewCatalogPriceRule.conditionsTab}}" after="discardSubsequentRules" stepKey="openConditionsTab"/> + <waitForPageLoad after="openConditionsTab" stepKey="waitForConditionTabOpened"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.newCondition}}" after="waitForConditionTabOpened" stepKey="addNewCondition"/> + <selectOption selector="{{AdminNewCatalogPriceRuleConditions.conditionSelect('1')}}" userInput="Magento\CatalogRule\Model\Rule\Condition\Product|sku" after="addNewCondition" stepKey="selectTypeCondition"/> + <waitForPageLoad after="selectTypeCondition" stepKey="waitForConditionChosed"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.targetEllipsis('1')}}" after="waitForConditionChosed" stepKey="clickEllipsis"/> + <fillField selector="{{AdminNewCatalogPriceRuleConditions.targetInput('1', '1')}}" userInput="{{productSku}}" after="clickEllipsis" stepKey="fillProductSku"/> + <click selector="{{AdminNewCatalogPriceRuleConditions.applyButton('1', '1')}}" after="fillProductSku" stepKey="clickApply"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleWithInvalidDataActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleWithInvalidDataActionGroup.xml new file mode 100644 index 0000000000000..5fd56c81734b6 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/NewCatalogPriceRuleWithInvalidDataActionGroup.xml @@ -0,0 +1,29 @@ +<?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="NewCatalogPriceRuleWithInvalidDataActionGroup"> + <annotations> + <description>Goes to the Catalog Price Rule grid. Clicks on Add. Fills in the provided Catalog Rule details with invalid data.</description> + </annotations> + <arguments> + <argument name="catalogRule" defaultValue="catalogRuleWithInvalid"/> + </arguments> + + <!-- Go to the admin Catalog rule grid and add a new one --> + <amOnPage stepKey="goToPriceRulePage" url="{{CatalogRulePage.url}}"/> + <waitForPageLoad stepKey="waitForPriceRulePage"/> + + <click stepKey="addNewRule" selector="{{AdminGridMainControls.add}}"/> + <fillField stepKey="fillPriority" selector="{{AdminNewCatalogPriceRule.priority}}" userInput="{{catalogRule.priority}}"/> + <scrollToTopOfPage stepKey="scrollToTop"/> + <click selector="{{AdminNewCatalogPriceRule.save}}" stepKey="clickSave"/> + <waitForPageLoad stepKey="waitForApplied"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/OpenCatalogPriceRuleActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/OpenCatalogPriceRuleActionGroup.xml new file mode 100644 index 0000000000000..c810d9579df92 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/OpenCatalogPriceRuleActionGroup.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="OpenCatalogPriceRuleActionGroup"> + <arguments> + <argument name="ruleName" type="string" defaultValue="CustomCatalogRule.name"/> + </arguments> + <amOnPage url="{{AdminCatalogPriceRuleGridPage.url}}" stepKey="goToAdminCatalogPriceRuleGridPage"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> + <fillField selector="{{AdminCatalogPriceRuleGridSection.filterByRuleName}}" userInput="{{ruleName}}" stepKey="filterByRuleName"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearch"/> + <click selector="{{AdminGridTableSection.row('1')}}" stepKey="clickEdit"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/RemoveCatalogPriceRuleActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/RemoveCatalogPriceRuleActionGroup.xml new file mode 100644 index 0000000000000..7c7ecba3ff74f --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/RemoveCatalogPriceRuleActionGroup.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="RemoveCatalogPriceRuleActionGroup" extends="OpenCatalogPriceRuleActionGroup"> + <click selector="{{AdminMainActionsSection.delete}}" after="waitForPageLoad" stepKey="clickToDelete"/> + <waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" after="clickToDelete" stepKey="waitForElementVisible"/> + <click selector="{{AdminConfirmationModalSection.ok}}" after="waitForElementVisible" stepKey="clickToConfirm"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" after="clickToConfirm" stepKey="waitForSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the rule." after="waitForSuccessMessage" stepKey="verifyRuleIsDeleted"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectGeneralCustomerGroupActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectGeneralCustomerGroupActionGroup.xml new file mode 100644 index 0000000000000..cc4981f73f3f8 --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectGeneralCustomerGroupActionGroup.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="SelectGeneralCustomerGroupActionGroup"> + <annotations> + <description>Selects the 'General' Customer Group for a Catalog Price Rule on the creation/edit page.</description> + </annotations> + + <selectOption selector="{{AdminNewCatalogPriceRule.customerGroups}}" userInput="General" stepKey="selectCustomerGroup"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.xml new file mode 100644 index 0000000000000..38b64803acadd --- /dev/null +++ b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.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="SelectNotLoggedInCustomerGroupActionGroup"> + <annotations> + <description>Selects the 'NOT LOGGED IN' Customer Group for a Catalog Price Rule on the creation/edit page.</description> + </annotations> + + <selectOption selector="{{AdminNewCatalogPriceRule.customerGroups}}" userInput="NOT LOGGED IN" stepKey="selectCustomerGroup"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml index 4df08fcca696b..41fbc33bbbec0 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml @@ -112,12 +112,12 @@ <actionGroup ref="saveProductForm" stepKey="saveSecondProduct"/> <!-- Create a new catalog price rule --> - <actionGroup ref="newCatalogPriceRuleByUIWithConditionIsCategory" stepKey="newCatalogPriceRuleByUIWithConditionIsCategory"> + <actionGroup ref="NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup" stepKey="newCatalogPriceRuleByUIWithConditionIsCategory"> <argument name="categoryId" value="$createCategory.id$"/> </actionGroup> <!-- Select not logged in customer group --> - <actionGroup ref="selectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <!-- Save and apply the new catalog price rule --> <actionGroup ref="SaveAndApplyCatalogPriceRuleActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest.xml index ee61af180d350..4cd7df106a131 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest.xml @@ -31,7 +31,7 @@ <!-- log in and create the price rule --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup stepKey="createNewPriceRule" ref="newCatalogPriceRuleByUI"/> + <actionGroup stepKey="createNewPriceRule" ref="NewCatalogPriceRuleByUIActionGroup"/> <actionGroup stepKey="selectNotLoggedInCustomerGroup" ref="selectNotLoggedInCustomerGroup"/> <click stepKey="saveAndApply" selector="{{AdminNewCatalogPriceRule.saveAndApply}}"/> <see stepKey="assertSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule."/> @@ -80,7 +80,7 @@ <group value="CatalogRule"/> </annotations> <before> - <actionGroup stepKey="createNewPriceRule" ref="newCatalogPriceRuleByUI"> + <actionGroup stepKey="createNewPriceRule" ref="NewCatalogPriceRuleByUIActionGroup"> <argument name="catalogRule" value="CatalogRuleByFixed"/> </actionGroup> </before> @@ -103,7 +103,7 @@ <group value="CatalogRule"/> </annotations> <before> - <actionGroup stepKey="createNewPriceRule" ref="newCatalogPriceRuleByUI"> + <actionGroup stepKey="createNewPriceRule" ref="NewCatalogPriceRuleByUIActionGroup"> <argument name="catalogRule" value="CatalogRuleToPercent"/> </actionGroup> </before> @@ -126,7 +126,7 @@ <group value="CatalogRule"/> </annotations> <before> - <actionGroup stepKey="createNewPriceRule" ref="newCatalogPriceRuleByUI"> + <actionGroup stepKey="createNewPriceRule" ref="NewCatalogPriceRuleByUIActionGroup"> <argument name="catalogRule" value="CatalogRuleToFixed"/> </actionGroup> </before> @@ -172,7 +172,7 @@ </after> <!-- Create a catalog rule for the NOT LOGGED IN customer group --> - <actionGroup ref="newCatalogPriceRuleByUI" stepKey="createNewPriceRule"/> + <actionGroup ref="NewCatalogPriceRuleByUIActionGroup" stepKey="createNewPriceRule"/> <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="saveAndApply"/> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccess"/> @@ -213,7 +213,7 @@ <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> </after> - <actionGroup ref="newCatalogPriceRuleWithInvalidData" stepKey="createNewPriceRule"> + <actionGroup ref="NewCatalogPriceRuleWithInvalidDataActionGroup" stepKey="createNewPriceRule"> <argument name="catalogRule" value="catalogRuleWithInvalid"/> </actionGroup> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest.xml index d80759531ecae..e3c5862d4f0e9 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest.xml @@ -31,7 +31,7 @@ <amOnPage url="{{AdminNewCatalogPriceRulePage.url}}" stepKey="openNewCatalogPriceRulePage"/> <waitForPageLoad stepKey="waitForPageToLoad1"/> - <actionGroup ref="CreateCatalogPriceRuleViaTheUi" stepKey="createCatalogPriceRuleViaTheUi1"> + <actionGroup ref="CreateCatalogPriceRuleViaTheUiActionGroup" stepKey="createCatalogPriceRuleViaTheUi1"> <argument name="catalogRule" value="DeleteActiveCatalogPriceRuleWithConditions"/> <argument name="customerGroup" value="General"/> <argument name="disregardRules" value="Yes"/> @@ -163,7 +163,7 @@ <amOnPage url="{{AdminNewCatalogPriceRulePage.url}}" stepKey="openNewCatalogPriceRulePage"/> <waitForPageLoad stepKey="waitForPageToLoad1"/> - <actionGroup ref="CreateCatalogPriceRuleViaTheUi" stepKey="createCatalogPriceRuleViaTheUi1"> + <actionGroup ref="CreateCatalogPriceRuleViaTheUiActionGroup" stepKey="createCatalogPriceRuleViaTheUi1"> <argument name="catalogRule" value="DeleteActiveCatalogPriceRuleWithConditions"/> <argument name="customerGroup" value="General"/> <argument name="disregardRules" value="Yes"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml index 16fbca2697702..71bbeccaaf541 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml @@ -47,7 +47,7 @@ </after> <!-- Create a catalog price rule --> - <actionGroup ref="newCatalogPriceRuleByUI" stepKey="createNewPriceRule"/> + <actionGroup ref="NewCatalogPriceRuleByUIActionGroup" stepKey="createNewPriceRule"/> <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="saveAndApply"/> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccess"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminEnableAttributeIsUndefinedCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminEnableAttributeIsUndefinedCatalogPriceRuleTest.xml index 54bf243c4cde6..da855b08cf390 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminEnableAttributeIsUndefinedCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminEnableAttributeIsUndefinedCatalogPriceRuleTest.xml @@ -70,11 +70,11 @@ <!--Create catalog price rule--> <amOnPage url="{{CatalogRulePage.url}}" stepKey="goToPriceRulePage"/> <waitForPageLoad stepKey="waitForPriceRulePage"/> - <actionGroup ref="createCatalogPriceRule" stepKey="createCatalogPriceRule"> + <actionGroup ref="CreateCatalogPriceRuleActionGroup" stepKey="createCatalogPriceRule"> <argument name="catalogRule" value="CatalogRuleWithAllCustomerGroups"/> </actionGroup> - <actionGroup ref="selectNotLoggedInCustomerGroupActionGroup" stepKey="selectCustomerGroup"/> - <actionGroup ref="CreateCatalogPriceRuleConditionWithAttribute" stepKey="createCatalogPriceRuleCondition"> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectCustomerGroup"/> + <actionGroup ref="CreateCatalogPriceRuleConditionWithAttributeActionGroup" stepKey="createCatalogPriceRuleCondition"> <argument name="attributeName" value="$$createProductAttribute.attribute[frontend_labels][0][label]$$"/> <argument name="targetValue" value="is"/> <argument name="targetSelectValue" value="is undefined"/> @@ -113,11 +113,11 @@ <!--Create new Catalog Price Rule--> <amOnPage url="{{CatalogRulePage.url}}" stepKey="goToPriceRulePage1"/> <waitForPageLoad stepKey="waitForPriceRulePage1"/> - <actionGroup ref="createCatalogPriceRule" stepKey="createCatalogPriceRule1"> + <actionGroup ref="CreateCatalogPriceRuleActionGroup" stepKey="createCatalogPriceRule1"> <argument name="catalogRule" value="CatalogRuleWithAllCustomerGroups"/> </actionGroup> - <actionGroup ref="selectNotLoggedInCustomerGroupActionGroup" stepKey="selectCustomerGroup1"/> - <actionGroup ref="CreateCatalogPriceRuleConditionWithAttribute" stepKey="createCatalogPriceRuleCondition1"> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectCustomerGroup1"/> + <actionGroup ref="CreateCatalogPriceRuleConditionWithAttributeActionGroup" stepKey="createCatalogPriceRuleCondition1"> <argument name="attributeName" value="$$createSecondProductAttribute.attribute[frontend_labels][0][label]$$"/> <argument name="targetValue" value="is"/> <argument name="targetSelectValue" value="is undefined"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleAndConfigurableProductTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleAndConfigurableProductTest.xml index b9e7bfb4d41e4..2f12df8b75fc6 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleAndConfigurableProductTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleAndConfigurableProductTest.xml @@ -101,12 +101,12 @@ <deleteData createDataKey="createCategory" stepKey="deleteApiCategory"/> </after> <!-- Begin creating a new catalog price rule --> - <actionGroup ref="newCatalogPriceRuleByUIWithConditionIsCategory" stepKey="newCatalogPriceRuleByUIWithConditionIsCategory"> + <actionGroup ref="NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup" stepKey="newCatalogPriceRuleByUIWithConditionIsCategory"> <argument name ="categoryId" value="$createCategory.id$"/> </actionGroup> <!-- Select not logged in customer group --> - <actionGroup ref="selectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <!-- Save and apply the new catalog price rule --> <actionGroup ref="SaveAndApplyCatalogPriceRuleActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductAndFixedMethodTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductAndFixedMethodTest.xml index 3405d0c4e776d..956a2e07fc6b4 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductAndFixedMethodTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductAndFixedMethodTest.xml @@ -53,22 +53,22 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!-- 1. Begin creating a new catalog price rule --> - <actionGroup ref="newCatalogPriceRuleByUIWithConditionIsCategory" stepKey="newCatalogPriceRuleByUIWithConditionIsCategory"> + <actionGroup ref="NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup" stepKey="newCatalogPriceRuleByUIWithConditionIsCategory"> <argument name ="categoryId" value="$createCategory.id$"/> <argument name ="catalogRule" value="CatalogRuleByFixed"/> </actionGroup> <!-- Select not logged in customer group --> - <actionGroup ref="selectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <!-- Save and apply the new catalog price rule --> <actionGroup ref="SaveAndApplyCatalogPriceRuleActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> <magentoCLI command="indexer:reindex" stepKey="reindex"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> - + <!-- Navigate to category on store front --> <amOnPage url="{{StorefrontProductPage.url($createCategory.name$)}}" stepKey="goToCategoryPage"/> - + <!-- Check product 1 name on store front category page --> <actionGroup ref="AssertProductDetailsOnStorefrontActionGroup" stepKey="storefrontProduct1Name"> <argument name="productInfo" value="$createProduct1.name$"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml index c3bcde92bd1f2..e5e3cf9ead5e5 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductForNewCustomerGroupTest.xml @@ -64,7 +64,7 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!-- 1. Begin creating a new catalog price rule --> - <actionGroup ref="newCatalogPriceRuleByUIWithConditionIsCategory" stepKey="newCatalogPriceRuleByUIWithConditionIsCategory"> + <actionGroup ref="NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup" stepKey="newCatalogPriceRuleByUIWithConditionIsCategory"> <argument name ="categoryId" value="$createCategory.id$"/> <argument name="catalogRule" value="CatalogRuleByFixed"/> </actionGroup> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductWithCustomOptionsTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductWithCustomOptionsTest.xml index a251ee1e235d0..166d202ec2410 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductWithCustomOptionsTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogRuleForSimpleProductWithCustomOptionsTest.xml @@ -66,12 +66,12 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!-- 1. Begin creating a new catalog price rule --> - <actionGroup ref="newCatalogPriceRuleByUIWithConditionIsCategory" stepKey="newCatalogPriceRuleByUIWithConditionIsCategory"> + <actionGroup ref="NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup" stepKey="newCatalogPriceRuleByUIWithConditionIsCategory"> <argument name ="categoryId" value="$createCategory.id$"/> </actionGroup> <!-- Select not logged in customer group --> - <actionGroup ref="selectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> + <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> <!-- Save and apply the new catalog price rule --> <actionGroup ref="SaveAndApplyCatalogPriceRuleActionGroup" stepKey="saveAndApplyCatalogPriceRule"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/CatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/CatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest.xml index 738f193fcc511..86d3dccba7595 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/CatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/CatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest.xml @@ -32,11 +32,11 @@ <actionGroup ref="LoginAsAdmin" stepKey="login"/> <!--Create Catalog Rule--> - <actionGroup ref="newCatalogPriceRuleByUIWithConditionIsCategory" stepKey="createCatalogPriceRule"> + <actionGroup ref="NewCatalogPriceRuleByUIWithConditionIsCategoryActionGroup" stepKey="createCatalogPriceRule"> <argument name="catalogRule" value="_defaultCatalogRule"/> <argument name="categoryId" value="$$createCategory.id$$"/> </actionGroup> - <actionGroup ref="selectGeneralCustomerGroupActionGroup" stepKey="selectCustomerGroup"/> + <actionGroup ref="SelectGeneralCustomerGroupActionGroup" stepKey="selectCustomerGroup"/> <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="clickSaveAndApplyRules"/> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccess"/> <magentoCLI command="indexer:reindex" stepKey="reindex"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml index 08e59c6316411..1f9c8df60492e 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/StorefrontInactiveCatalogRuleTest.xml @@ -24,7 +24,7 @@ <createData entity="ApiSimpleProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup stepKey="createNewPriceRule" ref="newCatalogPriceRuleByUI"/> + <actionGroup stepKey="createNewPriceRule" ref="NewCatalogPriceRuleByUIActionGroup"/> <actionGroup stepKey="selectLoggedInCustomers" ref="selectNotLoggedInCustomerGroup"/> <scrollToTopOfPage stepKey="scrollToTop"/> <click stepKey="setInactive" selector="{{AdminCategoryBasicFieldSection.enableCategoryLabel}}"/> diff --git a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProductsTest.xml b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProductsTest.xml index 3e700b5bcfb1b..71ab764453b20 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProductsTest.xml +++ b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithAssignedSimpleProductsTest.xml @@ -178,7 +178,7 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Create price rule --> - <actionGroup ref="newCatalogPriceRuleByUI" stepKey="createPriceRule"> + <actionGroup ref="NewCatalogPriceRuleByUIActionGroup" stepKey="createPriceRule"> <argument name="catalogRule" value="CatalogRuleToFixed"/> </actionGroup> <actionGroup ref="CatalogSelectCustomerGroupActionGroup" stepKey="addCustomerGroup"> diff --git a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml index e53e51c626aa9..6fda432ce7905 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml +++ b/app/code/Magento/CatalogRuleConfigurable/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithOptionsTest.xml @@ -126,7 +126,7 @@ </after> <!-- Create price rule for first configurable product option --> - <actionGroup ref="newCatalogPriceRuleByUI" stepKey="createFirstPriceRule"> + <actionGroup ref="NewCatalogPriceRuleByUIActionGroup" stepKey="createFirstPriceRule"> <argument name="catalogRule" value="CatalogRuleToFixed"/> </actionGroup> <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroupForFirstPriceRule"/> @@ -140,7 +140,7 @@ <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccessMessageForFirstPriceRule"/> <!-- Create price rule for second configurable product option --> - <actionGroup ref="newCatalogPriceRuleByUI" stepKey="createSecondPriceRule"> + <actionGroup ref="NewCatalogPriceRuleByUIActionGroup" stepKey="createSecondPriceRule"> <argument name="catalogRule" value="_defaultCatalogRule"/> </actionGroup> <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroupForSecondPriceRule"/> @@ -154,7 +154,7 @@ <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccessMessageForSecondPriceRule"/> <!-- Create price rule for third configurable product option --> - <actionGroup ref="newCatalogPriceRuleByUI" stepKey="createThirdPriceRule"> + <actionGroup ref="NewCatalogPriceRuleByUIActionGroup" stepKey="createThirdPriceRule"> <argument name="catalogRule" value="CatalogRuleWithoutDiscount"/> </actionGroup> <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroupForThirdPriceRule"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml index bc8f3e49272b7..275147549c178 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml @@ -132,7 +132,7 @@ <see selector="{{StorefrontCategoryMainSection.lineProductName('3')}}" userInput="$$createSimpleProduct.name$$" stepKey="seeSimpleProduct"/> <!--Create and apply catalog price rule--> - <actionGroup ref="newCatalogPriceRuleByUIWithConditionIsSKU" stepKey="createCatalogPriceRule"> + <actionGroup ref="NewCatalogPriceRuleByUIWithConditionIsSKUActionGroup" stepKey="createCatalogPriceRule"> <argument name="catalogRule" value="CatalogRuleByPercentWith96Amount" /> <argument name="productSku" value="$$createConfigChildProduct3.sku$$" /> </actionGroup> From 3aebff43b3511862dcbeec352d00e4eb407ce61a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Fri, 29 Nov 2019 13:13:55 +0100 Subject: [PATCH 350/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- ...wedInShoppingCartValidationActionGroup.xml | 20 ++++++++++++++++ ...axQtyAllowedInShoppingCartActionGroup.xml} | 10 +------- .../DisplayOutOfStockProductActionGroup.xml | 18 ++------------ .../NoDisplayOutOfStockProductActionGroup.xml | 24 +++++++++++++++++++ ...eroMaximumQtyAllowedInShoppingCartTest.xml | 2 +- ...roductWithDisabledChildrenProductsTest.xml | 4 ++-- ...eeProductDisplayOutOfStockProductsTest.xml | 6 ++--- 7 files changed, 53 insertions(+), 31 deletions(-) create mode 100644 app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductMaxQtyAllowedInShoppingCartValidationActionGroup.xml rename app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/{AdminProductActionGroup.xml => AdminProductSetMaxQtyAllowedInShoppingCartActionGroup.xml} (64%) create mode 100644 app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/NoDisplayOutOfStockProductActionGroup.xml diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductMaxQtyAllowedInShoppingCartValidationActionGroup.xml b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductMaxQtyAllowedInShoppingCartValidationActionGroup.xml new file mode 100644 index 0000000000000..1dbc0256be7d8 --- /dev/null +++ b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductMaxQtyAllowedInShoppingCartValidationActionGroup.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="AdminProductMaxQtyAllowedInShoppingCartValidationActionGroup" extends="AdminProductSetMaxQtyAllowedInShoppingCartActionGroup"> + <arguments> + <argument name="qty" type="string"/> + <argument name="errorMessage" type="string"/> + </arguments> + + <waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" after="clickDone" stepKey="waitProductValidationErrorMessageAppears"/> + <see selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" userInput="{{errorMessage}}" after="waitProductValidationErrorMessageAppears" stepKey="checkProductValidationErrorMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductActionGroup.xml b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductSetMaxQtyAllowedInShoppingCartActionGroup.xml similarity index 64% rename from app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductActionGroup.xml rename to app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductSetMaxQtyAllowedInShoppingCartActionGroup.xml index 84dc6b93c885f..a5e4d3e9c2af7 100644 --- a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductActionGroup.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/AdminProductSetMaxQtyAllowedInShoppingCartActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminProductSetMaxQtyAllowedInShoppingCart"> + <actionGroup name="AdminProductSetMaxQtyAllowedInShoppingCartActionGroup"> <arguments> <argument name="qty" type="string"/> </arguments> @@ -19,13 +19,5 @@ <click selector="{{AdminSlideOutDialogSection.doneButton}}" stepKey="clickDone"/> </actionGroup> - <actionGroup name="AdminProductMaxQtyAllowedInShoppingCartValidationActionGroup" extends="AdminProductSetMaxQtyAllowedInShoppingCart"> - <arguments> - <argument name="qty" type="string"/> - <argument name="errorMessage" type="string"/> - </arguments> - <waitForElementVisible selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" after="clickDone" stepKey="waitProductValidationErrorMessageAppears"/> - <see selector="{{AdminProductFormAdvancedInventorySection.maxiQtyAllowedInCartError}}" userInput="{{errorMessage}}" after="waitProductValidationErrorMessageAppears" stepKey="checkProductValidationErrorMessage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/DisplayOutOfStockProductActionGroup.xml b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/DisplayOutOfStockProductActionGroup.xml index 13cb9089bf920..a6fe2b49508ff 100644 --- a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/DisplayOutOfStockProductActionGroup.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/DisplayOutOfStockProductActionGroup.xml @@ -8,11 +8,11 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="displayOutOfStockProduct"> + <actionGroup name="DisplayOutOfStockProductActionGroup"> <annotations> <description>Goes to the 'Configuration' page for 'Inventory'. Enables 'Display Out of Stock Products'. Clicks on the Save button.</description> </annotations> - + <amOnPage url="{{InventoryConfigurationPage.url}}" stepKey="navigateToInventoryConfigurationPage"/> <waitForPageLoad stepKey="waitForConfigPageToLoad"/> <conditionalClick stepKey="expandProductStockOptions" selector="{{InventoryConfigSection.ProductStockOptionsTab}}" dependentSelector="{{InventoryConfigSection.CheckIfProductStockOptionsTabExpanded}}" visible="true"/> @@ -22,18 +22,4 @@ <selectOption selector="{{InventoryConfigSection.DisplayOutOfStockDropdown}}" userInput="Yes" stepKey="switchToYes"/> <click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/> </actionGroup> - - <actionGroup name="noDisplayOutOfStockProduct"> - <annotations> - <description>Goes to the 'Configuration' page for 'Inventory'. Disables 'Display Out of Stock Products'. Clicks on the Save button.</description> - </annotations> - - <amOnPage url="{{InventoryConfigurationPage.url}}" stepKey="navigateToInventoryConfigurationPage"/> - <waitForPageLoad stepKey="waitForConfigPageToLoad"/> - <conditionalClick stepKey="expandProductStockOptions" selector="{{InventoryConfigSection.ProductStockOptionsTab}}" dependentSelector="{{InventoryConfigSection.CheckIfProductStockOptionsTabExpanded}}" visible="true"/> - <uncheckOption selector="{{InventoryConfigSection.DisplayOutOfStockSystemValue}}" stepKey="uncheckUseSystemValue"/> - <waitForElementVisible selector="{{InventoryConfigSection.DisplayOutOfStockDropdown}}" stepKey="waitForSwitcherDropdown"/> - <selectOption selector="{{InventoryConfigSection.DisplayOutOfStockDropdown}}" userInput="No" stepKey="switchToNo"/> - <click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/NoDisplayOutOfStockProductActionGroup.xml b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/NoDisplayOutOfStockProductActionGroup.xml new file mode 100644 index 0000000000000..6f6b7ae20987f --- /dev/null +++ b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/NoDisplayOutOfStockProductActionGroup.xml @@ -0,0 +1,24 @@ +<?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="NoDisplayOutOfStockProductActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Inventory'. Disables 'Display Out of Stock Products'. Clicks on the Save button.</description> + </annotations> + + <amOnPage url="{{InventoryConfigurationPage.url}}" stepKey="navigateToInventoryConfigurationPage"/> + <waitForPageLoad stepKey="waitForConfigPageToLoad"/> + <conditionalClick stepKey="expandProductStockOptions" selector="{{InventoryConfigSection.ProductStockOptionsTab}}" dependentSelector="{{InventoryConfigSection.CheckIfProductStockOptionsTabExpanded}}" visible="true"/> + <uncheckOption selector="{{InventoryConfigSection.DisplayOutOfStockSystemValue}}" stepKey="uncheckUseSystemValue"/> + <waitForElementVisible selector="{{InventoryConfigSection.DisplayOutOfStockDropdown}}" stepKey="waitForSwitcherDropdown"/> + <selectOption selector="{{InventoryConfigSection.DisplayOutOfStockDropdown}}" userInput="No" stepKey="switchToNo"/> + <click selector="{{ContentManagementSection.Save}}" stepKey="clickSaveConfig"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml b/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml index f7cf0a4deba4b..92265afb03528 100644 --- a/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml @@ -71,7 +71,7 @@ <argument name="errorMessage" value="Please enter a valid number in this field."/> </actionGroup> <!-- Fill correct value --> - <actionGroup ref="AdminProductSetMaxQtyAllowedInShoppingCart" stepKey="setProductMaxQtyAllowedInShoppingCartToCorrectNumber"> + <actionGroup ref="AdminProductSetMaxQtyAllowedInShoppingCartActionGroup" stepKey="setProductMaxQtyAllowedInShoppingCartToCorrectNumber"> <argument name="qty" value="50"/> </actionGroup> <waitForElementNotVisible selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryModal}}" stepKey="waitForModalFormToDisappear"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml index 49f3f8b5ea931..dd1ca79147140 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml @@ -40,7 +40,7 @@ </before> <after> <!-- Don't display out of stock product --> - <actionGroup ref="noDisplayOutOfStockProduct" stepKey="revertDisplayOutOfStockProduct"/> + <actionGroup ref="NoDisplayOutOfStockProductActionGroup" stepKey="revertDisplayOutOfStockProduct"/> <!-- Delete configurable product --> <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> @@ -105,7 +105,7 @@ <see userInput="$$createSimpleProduct.name$$" selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" stepKey="seeProductNameInConfigurations"/> <!-- Display out of stock product --> - <actionGroup ref="displayOutOfStockProduct" stepKey="displayOutOfStockProduct"/> + <actionGroup ref="DisplayOutOfStockProductActionGroup" stepKey="displayOutOfStockProduct"/> <!-- Flash cache --> <magentoCLI command="cache:flush" stepKey="flushCache"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml index 308e256543736..1f0cc7b65aa7b 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml @@ -61,7 +61,7 @@ </before> <after> <!-- Don't display out of stock product --> - <actionGroup ref="noDisplayOutOfStockProduct" stepKey="revertDisplayOutOfStockProduct"/> + <actionGroup ref="NoDisplayOutOfStockProductActionGroup" stepKey="revertDisplayOutOfStockProduct"/> <!-- Delete configurable product --> <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> @@ -119,7 +119,7 @@ <actionGroup ref="saveProductForm" stepKey="saveConfigurableProduct"/> <!-- Display out of stock product --> - <actionGroup ref="displayOutOfStockProduct" stepKey="displayOutOfStockProduct"/> + <actionGroup ref="DisplayOutOfStockProductActionGroup" stepKey="displayOutOfStockProduct"/> <!-- Flash cache --> <magentoCLI command="cache:flush" stepKey="flushCache"/> @@ -137,4 +137,4 @@ <waitForPageLoad stepKey="waitForProductPageLoad"/> <see userInput="$$createConfigProductAttributeOptionThree.option[store_labels][1][label]$$" selector="{{StorefrontProductInfoMainSection.optionByAttributeId($$createConfigProductAttribute.attribute_id$$)}}" stepKey="assertOptionNotAvailable" /> </test> -</tests> \ No newline at end of file +</tests> From ca6a5ab3bf9d25ba6ae69d300eba483954afa1d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Fri, 29 Nov 2019 13:22:52 +0100 Subject: [PATCH 351/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../ActionGroup/AdminExportActionGroup.xml | 102 ------------------ .../DeleteAllExportedFilesActionGroup.xml | 32 ++++++ .../DeleteExportedFileActionGroup.xml | 28 +++++ .../DownloadFileByRowIndexActionGroup.xml | 24 +++++ .../ExportAllProductsActionGroup.xml | 24 +++++ ...rtProductsFilterByAttributeActionGroup.xml | 31 ++++++ .../Test/AdminExportBundleProductTest.xml | 8 +- ...portGroupedProductWithSpecialPriceTest.xml | 8 +- ...mportConfigurableProductWithImagesTest.xml | 6 +- ...figurableProductsWithCustomOptionsTest.xml | 8 +- ...igurableProductsWithAssignedImagesTest.xml | 8 +- ...ableProductAssignedToCustomWebsiteTest.xml | 8 +- ...rtSimpleProductWithCustomAttributeTest.xml | 8 +- 13 files changed, 166 insertions(+), 129 deletions(-) delete mode 100644 app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/AdminExportActionGroup.xml create mode 100644 app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DeleteAllExportedFilesActionGroup.xml create mode 100644 app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DeleteExportedFileActionGroup.xml create mode 100644 app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DownloadFileByRowIndexActionGroup.xml create mode 100644 app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportAllProductsActionGroup.xml create mode 100644 app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportProductsFilterByAttributeActionGroup.xml diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/AdminExportActionGroup.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/AdminExportActionGroup.xml deleted file mode 100644 index c56bc667e2494..0000000000000 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/AdminExportActionGroup.xml +++ /dev/null @@ -1,102 +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"> - <!-- Export products using filtering by attribute --> - <actionGroup name="exportProductsFilterByAttribute"> - <annotations> - <description>Filters Products by the provided Attribute. Exports the filtered Products list. Validates that the Success Message is present.</description> - </annotations> - <arguments> - <argument name="attribute" type="string"/> - <argument name="attributeData" type="string"/> - </arguments> - - <selectOption selector="{{AdminExportMainSection.entityType}}" userInput="Products" stepKey="selectProductsOption"/> - <waitForElementVisible selector="{{AdminExportMainSection.entityAttributes}}" stepKey="waitForElementVisible"/> - <scrollTo selector="{{AdminExportAttributeSection.chooseAttribute('attribute')}}" stepKey="scrollToAttribute"/> - <checkOption selector="{{AdminExportAttributeSection.chooseAttribute('attribute')}}" stepKey="selectAttribute"/> - <fillField selector="{{AdminExportAttributeSection.fillFilter('attribute')}}" userInput="{{attributeData}}" stepKey="setDataInField"/> - <waitForPageLoad stepKey="waitForUserInput"/> - <scrollTo selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="scrollToContinue"/> - <click selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="clickContinueButton"/> - <see selector="{{AdminMessagesSection.success}}" userInput="Message is added to queue, wait to get your file soon" stepKey="seeSuccessMessage"/> - </actionGroup> - - <!-- Export products without filtering --> - <actionGroup name="exportAllProducts"> - <annotations> - <description>Exports the unfiltered Products list. Validates that the Success Message is present.</description> - </annotations> - - <selectOption selector="{{AdminExportMainSection.entityType}}" userInput="Products" stepKey="selectProductsOption"/> - <waitForElementVisible selector="{{AdminExportMainSection.entityAttributes}}" stepKey="waitForElementVisible" time="5"/> - <scrollTo selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="scrollToContinue"/> - <wait stepKey="waitForScroll" time="5"/> - <click selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="clickContinueButton"/> - <wait stepKey="waitForClick" time="5"/> - <see selector="{{AdminMessagesSection.success}}" userInput="Message is added to queue, wait to get your file soon. Make sure your cron job is running to export the file" stepKey="seeSuccessMessage"/> - </actionGroup> - - <!-- Download first file in the grid --> - <actionGroup name="downloadFileByRowIndex"> - <annotations> - <description>Downloads the provided Grid Index on the Exports grid page.</description> - </annotations> - <arguments> - <argument name="rowIndex" type="string"/> - </arguments> - - <reloadPage stepKey="refreshPage"/> - <waitForPageLoad stepKey="waitFormReload"/> - <click stepKey="clickSelectBtn" selector="{{AdminExportAttributeSection.selectByIndex(rowIndex)}}"/> - <click stepKey="clickOnDownload" selector="{{AdminExportAttributeSection.download(rowIndex)}}" after="clickSelectBtn"/> - </actionGroup> - - <!-- Delete exported file --> - <actionGroup name="deleteExportedFile"> - <annotations> - <description>Deletes the provided Grid Index on the Exports grid page.</description> - </annotations> - <arguments> - <argument name="rowIndex" type="string"/> - </arguments> - - <amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/> - <waitForPageLoad time="30" stepKey="waitFormReload"/> - <click stepKey="clickSelectBtn" selector="{{AdminExportAttributeSection.selectByIndex(rowIndex)}}"/> - <click stepKey="clickOnDelete" selector="{{AdminExportAttributeSection.delete(rowIndex)}}" after="clickSelectBtn"/> - <waitForElementVisible selector="{{AdminProductGridConfirmActionSection.title}}" stepKey="waitForConfirmModal"/> - <click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmDelete"/> - <waitForElementVisible selector="{{AdminDataGridTableSection.dataGridEmpty}}" stepKey="waitDataGridEmptyMessageAppears"/> - <see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage"/> - </actionGroup> - - <actionGroup name="deleteAllExportedFiles"> - <amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/> - <executeInSelenium - function=" - function ($webdriver) use ($I) { - $buttons = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::xpath('//tr[@data-repeat-index=\'0\']//button')); - while(!empty($buttons)) { - $buttons[0]->click(); - $I->waitForElementVisible('//tr[@data-repeat-index=\'0\']//a[text()=\'Delete\']', 10); - $deleteButton = $webdriver->findElement(\Facebook\WebDriver\WebDriverBy::xpath('//tr[@data-repeat-index=\'0\']//a[text()=\'Delete\']')); - $deleteButton->click(); - $I->waitForElementVisible('.modal-popup.confirm button.action-accept', 10); - $I->click('.modal-popup.confirm button.action-accept'); - $I->waitForPageLoad(60); - $buttons = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::xpath('//tr[@data-repeat-index=\'0\']//button')); - } - }" - stepKey="deleteAllExportedFilesOneByOne"/> - <waitForElementVisible selector="{{AdminDataGridTableSection.dataGridEmpty}}" stepKey="waitDataGridEmptyMessageAppears"/> - <see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DeleteAllExportedFilesActionGroup.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DeleteAllExportedFilesActionGroup.xml new file mode 100644 index 0000000000000..aa8fad2a1d575 --- /dev/null +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DeleteAllExportedFilesActionGroup.xml @@ -0,0 +1,32 @@ +<?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="DeleteAllExportedFilesActionGroup"> + <amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/> + <executeInSelenium + function=" + function ($webdriver) use ($I) { + $buttons = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::xpath('//tr[@data-repeat-index=\'0\']//button')); + while(!empty($buttons)) { + $buttons[0]->click(); + $I->waitForElementVisible('//tr[@data-repeat-index=\'0\']//a[text()=\'Delete\']', 10); + $deleteButton = $webdriver->findElement(\Facebook\WebDriver\WebDriverBy::xpath('//tr[@data-repeat-index=\'0\']//a[text()=\'Delete\']')); + $deleteButton->click(); + $I->waitForElementVisible('.modal-popup.confirm button.action-accept', 10); + $I->click('.modal-popup.confirm button.action-accept'); + $I->waitForPageLoad(60); + $buttons = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::xpath('//tr[@data-repeat-index=\'0\']//button')); + } + }" + stepKey="deleteAllExportedFilesOneByOne"/> + <waitForElementVisible selector="{{AdminDataGridTableSection.dataGridEmpty}}" stepKey="waitDataGridEmptyMessageAppears"/> + <see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DeleteExportedFileActionGroup.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DeleteExportedFileActionGroup.xml new file mode 100644 index 0000000000000..78d7293b7437b --- /dev/null +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DeleteExportedFileActionGroup.xml @@ -0,0 +1,28 @@ +<?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="DeleteExportedFileActionGroup"> + <annotations> + <description>Deletes the provided Grid Index on the Exports grid page.</description> + </annotations> + <arguments> + <argument name="rowIndex" type="string"/> + </arguments> + + <amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/> + <waitForPageLoad time="30" stepKey="waitFormReload"/> + <click stepKey="clickSelectBtn" selector="{{AdminExportAttributeSection.selectByIndex(rowIndex)}}"/> + <click stepKey="clickOnDelete" selector="{{AdminExportAttributeSection.delete(rowIndex)}}" after="clickSelectBtn"/> + <waitForElementVisible selector="{{AdminProductGridConfirmActionSection.title}}" stepKey="waitForConfirmModal"/> + <click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmDelete"/> + <waitForElementVisible selector="{{AdminDataGridTableSection.dataGridEmpty}}" stepKey="waitDataGridEmptyMessageAppears"/> + <see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DownloadFileByRowIndexActionGroup.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DownloadFileByRowIndexActionGroup.xml new file mode 100644 index 0000000000000..ec164ff172625 --- /dev/null +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/DownloadFileByRowIndexActionGroup.xml @@ -0,0 +1,24 @@ +<?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="DownloadFileByRowIndexActionGroup"> + <annotations> + <description>Downloads the provided Grid Index on the Exports grid page.</description> + </annotations> + <arguments> + <argument name="rowIndex" type="string"/> + </arguments> + + <reloadPage stepKey="refreshPage"/> + <waitForPageLoad stepKey="waitFormReload"/> + <click stepKey="clickSelectBtn" selector="{{AdminExportAttributeSection.selectByIndex(rowIndex)}}"/> + <click stepKey="clickOnDownload" selector="{{AdminExportAttributeSection.download(rowIndex)}}" after="clickSelectBtn"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportAllProductsActionGroup.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportAllProductsActionGroup.xml new file mode 100644 index 0000000000000..3edbb1b821843 --- /dev/null +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportAllProductsActionGroup.xml @@ -0,0 +1,24 @@ +<?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="ExportAllProductsActionGroup"> + <annotations> + <description>Exports the unfiltered Products list. Validates that the Success Message is present.</description> + </annotations> + + <selectOption selector="{{AdminExportMainSection.entityType}}" userInput="Products" stepKey="selectProductsOption"/> + <waitForElementVisible selector="{{AdminExportMainSection.entityAttributes}}" stepKey="waitForElementVisible" time="5"/> + <scrollTo selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="scrollToContinue"/> + <wait stepKey="waitForScroll" time="5"/> + <click selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="clickContinueButton"/> + <wait stepKey="waitForClick" time="5"/> + <see selector="{{AdminMessagesSection.success}}" userInput="Message is added to queue, wait to get your file soon. Make sure your cron job is running to export the file" stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportProductsFilterByAttributeActionGroup.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportProductsFilterByAttributeActionGroup.xml new file mode 100644 index 0000000000000..f3ca894202893 --- /dev/null +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/ActionGroup/ExportProductsFilterByAttributeActionGroup.xml @@ -0,0 +1,31 @@ +<?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"> + <!-- Export products using filtering by attribute --> + <actionGroup name="ExportProductsFilterByAttributeActionGroup"> + <annotations> + <description>Filters Products by the provided Attribute. Exports the filtered Products list. Validates that the Success Message is present.</description> + </annotations> + <arguments> + <argument name="attribute" type="string"/> + <argument name="attributeData" type="string"/> + </arguments> + + <selectOption selector="{{AdminExportMainSection.entityType}}" userInput="Products" stepKey="selectProductsOption"/> + <waitForElementVisible selector="{{AdminExportMainSection.entityAttributes}}" stepKey="waitForElementVisible"/> + <scrollTo selector="{{AdminExportAttributeSection.chooseAttribute('attribute')}}" stepKey="scrollToAttribute"/> + <checkOption selector="{{AdminExportAttributeSection.chooseAttribute('attribute')}}" stepKey="selectAttribute"/> + <fillField selector="{{AdminExportAttributeSection.fillFilter('attribute')}}" userInput="{{attributeData}}" stepKey="setDataInField"/> + <waitForPageLoad stepKey="waitForUserInput"/> + <scrollTo selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="scrollToContinue"/> + <click selector="{{AdminExportAttributeSection.continueBtn}}" stepKey="clickContinueButton"/> + <see selector="{{AdminMessagesSection.success}}" userInput="Message is added to queue, wait to get your file soon" stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportBundleProductTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportBundleProductTest.xml index 74345e64a7c9a..369805a94dd84 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportBundleProductTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportBundleProductTest.xml @@ -86,7 +86,7 @@ <!-- Login as admin --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="deleteAllExportedFiles" stepKey="clearExportedFilesList"/> + <actionGroup ref="DeleteAllExportedFilesActionGroup" stepKey="clearExportedFilesList"/> </before> <after> <!-- Delete products creations --> @@ -102,7 +102,7 @@ <deleteData createDataKey="createProductAttribute" stepKey="deleteProductAttribute"/> <!-- Delete exported file --> - <actionGroup ref="deleteExportedFile" stepKey="deleteExportedFile"> + <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> <argument name="rowIndex" value="0"/> </actionGroup> <!-- Log out --> @@ -113,14 +113,14 @@ <amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/> <!-- Export created below products --> - <actionGroup ref="exportAllProducts" stepKey="exportCreatedProducts"/> + <actionGroup ref="ExportAllProductsActionGroup" stepKey="exportCreatedProducts"/> <!-- Run cron --> <magentoCLI command="cron:run" stepKey="runCron3"/> <magentoCLI command="cron:run" stepKey="runCron4"/> <!-- Download product --> - <actionGroup ref="downloadFileByRowIndex" stepKey="downloadCreatedProducts"> + <actionGroup ref="DownloadFileByRowIndexActionGroup" stepKey="downloadCreatedProducts"> <argument name="rowIndex" value="0"/> </actionGroup> </test> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportGroupedProductWithSpecialPriceTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportGroupedProductWithSpecialPriceTest.xml index b0ac6a4bc95ac..d9b93196db060 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportGroupedProductWithSpecialPriceTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportGroupedProductWithSpecialPriceTest.xml @@ -54,7 +54,7 @@ <!-- Login as admin --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="deleteAllExportedFiles" stepKey="clearExportedFilesList"/> + <actionGroup ref="DeleteAllExportedFilesActionGroup" stepKey="clearExportedFilesList"/> </before> <after> <!-- Deleted created products --> @@ -66,7 +66,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete exported file --> - <actionGroup ref="deleteExportedFile" stepKey="deleteExportedFile"> + <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> <argument name="rowIndex" value="0"/> </actionGroup> <!-- Log out --> @@ -78,14 +78,14 @@ <waitForPageLoad stepKey="waitForExportIndexPageLoad"/> <!-- Export created below products --> - <actionGroup ref="exportAllProducts" stepKey="exportCreatedProducts"/> + <actionGroup ref="ExportAllProductsActionGroup" stepKey="exportCreatedProducts"/> <!-- Run cron --> <magentoCLI command="cron:run" stepKey="runCron3"/> <magentoCLI command="cron:run" stepKey="runCron4"/> <!-- Download product --> - <actionGroup ref="downloadFileByRowIndex" stepKey="downloadCreatedProducts"> + <actionGroup ref="DownloadFileByRowIndexActionGroup" stepKey="downloadCreatedProducts"> <argument name="rowIndex" value="0"/> </actionGroup> </test> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml index f0ec7dbd0706b..4a22d3d3d43f0 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml @@ -128,7 +128,7 @@ <!-- Login as admin --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="deleteAllExportedFiles" stepKey="clearExportedFilesList"/> + <actionGroup ref="DeleteAllExportedFilesActionGroup" stepKey="clearExportedFilesList"/> </before> <after> <!-- Remove downloadable domains --> @@ -159,7 +159,7 @@ <amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/> <!-- Set Export Settings: Entity Type > Products, SKU > ConfProd's sku and press "Continue" --> - <actionGroup ref="exportProductsFilterByAttribute" stepKey="exportProductBySku"> + <actionGroup ref="ExportProductsFilterByAttributeActionGroup" stepKey="exportProductBySku"> <argument name="attribute" value="sku"/> <argument name="attributeData" value="$$createExportImportConfigurableProduct.sku$$"/> </actionGroup> @@ -169,7 +169,7 @@ <magentoCLI command="cron:run" stepKey="runCronSecondTime"/> <!-- Save exported file: file successfully downloaded --> - <actionGroup ref="downloadFileByRowIndex" stepKey="downloadCreatedProducts"> + <actionGroup ref="DownloadFileByRowIndexActionGroup" stepKey="downloadCreatedProducts"> <argument name="rowIndex" value="0"/> </actionGroup> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml index 1870cb21bd55b..397c1ee57e7f5 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleAndConfigurableProductsWithCustomOptionsTest.xml @@ -79,7 +79,7 @@ <!-- Login as admin --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="deleteAllExportedFiles" stepKey="clearExportedFilesList"/> + <actionGroup ref="DeleteAllExportedFilesActionGroup" stepKey="clearExportedFilesList"/> </before> <after> <!-- Delete configurable product creation --> @@ -90,7 +90,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete exported file --> - <actionGroup ref="deleteExportedFile" stepKey="deleteExportedFile"> + <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> <argument name="rowIndex" value="0"/> </actionGroup> <!-- Log out --> @@ -102,7 +102,7 @@ <waitForPageLoad stepKey="waitForExportIndexPageLoad"/> <!-- Fill entity attributes data --> - <actionGroup ref="exportProductsFilterByAttribute" stepKey="exportProductBySku"> + <actionGroup ref="ExportProductsFilterByAttributeActionGroup" stepKey="exportProductBySku"> <argument name="attribute" value="sku"/> <argument name="attributeData" value="$$createConfigProduct.sku$$"/> </actionGroup> @@ -112,7 +112,7 @@ <magentoCLI command="cron:run" stepKey="runCron4"/> <!-- Download product --> - <actionGroup ref="downloadFileByRowIndex" stepKey="downloadCreatedProducts"> + <actionGroup ref="DownloadFileByRowIndexActionGroup" stepKey="downloadCreatedProducts"> <argument name="rowIndex" value="0"/> </actionGroup> </test> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml index f6690199d63fe..e00346654ecf4 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAndConfigurableProductsWithAssignedImagesTest.xml @@ -95,7 +95,7 @@ <!-- Login as admin --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="deleteAllExportedFiles" stepKey="clearExportedFilesList"/> + <actionGroup ref="DeleteAllExportedFilesActionGroup" stepKey="clearExportedFilesList"/> </before> <after> <!-- Delete configurable product creation --> @@ -106,7 +106,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete exported file --> - <actionGroup ref="deleteExportedFile" stepKey="deleteExportedFile"> + <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> <argument name="rowIndex" value="0"/> </actionGroup> <!-- Log out --> @@ -117,7 +117,7 @@ <amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/> <!-- Fill entity attributes data --> - <actionGroup ref="exportProductsFilterByAttribute" stepKey="exportProductBySku"> + <actionGroup ref="ExportProductsFilterByAttributeActionGroup" stepKey="exportProductBySku"> <argument name="attribute" value="sku"/> <argument name="attributeData" value="$$createConfigProduct.sku$$"/> </actionGroup> @@ -127,7 +127,7 @@ <magentoCLI command="cron:run" stepKey="runCron4"/> <!-- Download product --> - <actionGroup ref="downloadFileByRowIndex" stepKey="downloadCreatedProducts"> + <actionGroup ref="DownloadFileByRowIndexActionGroup" stepKey="downloadCreatedProducts"> <argument name="rowIndex" value="0"/> </actionGroup> </test> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAssignedToMainWebsiteAndConfigurableProductAssignedToCustomWebsiteTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAssignedToMainWebsiteAndConfigurableProductAssignedToCustomWebsiteTest.xml index 271b4621d1a96..04be8f3ae823e 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAssignedToMainWebsiteAndConfigurableProductAssignedToCustomWebsiteTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductAssignedToMainWebsiteAndConfigurableProductAssignedToCustomWebsiteTest.xml @@ -77,7 +77,7 @@ <!-- Login as admin --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="deleteAllExportedFiles" stepKey="clearExportedFilesList"/> + <actionGroup ref="DeleteAllExportedFilesActionGroup" stepKey="clearExportedFilesList"/> </before> <after> <!-- Delete simple product --> @@ -91,7 +91,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete exported file --> - <actionGroup ref="deleteExportedFile" stepKey="deleteExportedFile"> + <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> <argument name="rowIndex" value="0"/> </actionGroup> <!-- Log out --> @@ -103,14 +103,14 @@ <waitForPageLoad stepKey="waitForExportIndexPageLoad"/> <!-- Export created below products --> - <actionGroup ref="exportAllProducts" stepKey="exportCreatedProducts"/> + <actionGroup ref="ExportAllProductsActionGroup" stepKey="exportCreatedProducts"/> <!-- Run cron --> <magentoCLI command="cron:run" stepKey="runCron3"/> <magentoCLI command="cron:run" stepKey="runCron4"/> <!-- Download product --> - <actionGroup ref="downloadFileByRowIndex" stepKey="downloadCreatedProducts"> + <actionGroup ref="DownloadFileByRowIndexActionGroup" stepKey="downloadCreatedProducts"> <argument name="rowIndex" value="0"/> </actionGroup> </test> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductWithCustomAttributeTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductWithCustomAttributeTest.xml index 238a3286dc40d..8553fb8a2cf7e 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductWithCustomAttributeTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportSimpleProductWithCustomAttributeTest.xml @@ -34,7 +34,7 @@ <!-- Login as admin --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="deleteAllExportedFiles" stepKey="clearExportedFilesList"/> + <actionGroup ref="DeleteAllExportedFilesActionGroup" stepKey="clearExportedFilesList"/> </before> <after> <!-- Delete product creations --> @@ -43,7 +43,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete exported file --> - <actionGroup ref="deleteExportedFile" stepKey="deleteExportedFile"> + <actionGroup ref="DeleteExportedFileActionGroup" stepKey="deleteExportedFile"> <argument name="rowIndex" value="0"/> </actionGroup> <!-- Log out --> @@ -55,14 +55,14 @@ <waitForPageLoad stepKey="waitForExportIndexPageLoad"/> <!-- Export created below products --> - <actionGroup ref="exportAllProducts" stepKey="exportCreatedProducts"/> + <actionGroup ref="ExportAllProductsActionGroup" stepKey="exportCreatedProducts"/> <!-- Run cron --> <magentoCLI command="cron:run" stepKey="runCron3"/> <magentoCLI command="cron:run" stepKey="runCron4"/> <!-- Download product --> - <actionGroup ref="downloadFileByRowIndex" stepKey="downloadCreatedProducts"> + <actionGroup ref="DownloadFileByRowIndexActionGroup" stepKey="downloadCreatedProducts"> <argument name="rowIndex" value="0"/> </actionGroup> </test> From 0262f1428561f5c329a50bfbd62714fa58e175be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Fri, 29 Nov 2019 17:26:23 +0100 Subject: [PATCH 352/595] REFACTOR: Extract Action Groups to separate files (according to MFTF best practices) --- .../Test/AdminDashboardWithChartsChart.xml | 2 +- ...thOnlinePaymentIncludingTaxAndDiscount.xml | 2 +- .../Mftf/Test/AdminAddBundleItemsTest.xml | 10 +- ...undleProductToCartFromWishListPageTest.xml | 2 +- .../AdminAddDefaultImageBundleProductTest.xml | 18 +- .../AdminAddDefaultVideoBundleProductTest.xml | 10 +- ...inAssociateBundleProductToWebsitesTest.xml | 10 +- .../Test/AdminAttributeSetSelectionTest.xml | 4 +- .../AdminBasicBundleProductAttributesTest.xml | 6 +- .../AdminBundleProductSetEditContentTest.xml | 6 +- ...CreateAndEditBundleProductSettingsTest.xml | 18 +- .../Mftf/Test/AdminDeleteABundleProduct.xml | 6 +- .../AdminDeleteBundleDynamicProductTest.xml | 2 +- .../AdminDeleteBundleFixedProductTest.xml | 2 +- .../AdminEditRelatedBundleProductTest.xml | 10 +- .../AdminFilterProductListByBundleProduct.xml | 4 +- .../Test/AdminMassDeleteBundleProducts.xml | 8 +- .../Test/AdminProductBundleCreationTest.xml | 6 +- ...minRemoveDefaultImageBundleProductTest.xml | 24 +- ...minRemoveDefaultVideoBundleProductTest.xml | 10 +- ...sUpdateAttributesForBundleProductsTest.xml | 6 +- .../Test/BundleProductFixedPricingTest.xml | 8 +- .../BundleProductWithTierPriceInCartTest.xml | 4 +- ...urrencyChangingBundleProductInCartTest.xml | 4 +- .../EnableDisableBundleProductStatusTest.xml | 6 +- .../Test/Mftf/Test/EndToEndB2CAdminTest.xml | 8 +- .../MassEnableDisableBundleProductsTest.xml | 8 +- .../Test/NewBundleProductSelectionTest.xml | 2 +- ...NewProductsListWidgetBundleProductTest.xml | 4 +- .../StorefrontAddBundleOptionsToCartTest.xml | 8 +- .../Mftf/Test/StorefrontAdminEditDataTest.xml | 12 +- .../Mftf/Test/StorefrontBundleCartTest.xml | 12 +- .../StorefrontBundleProductDetailsTest.xml | 6 +- ...undleProductShownInCategoryListAndGrid.xml | 6 +- ...rontCheckBundleProductOptionTierPrices.xml | 4 +- ...tCustomerSelectAndSetBundleOptionsTest.xml | 8 +- .../Test/StorefrontEditBundleProductTest.xml | 10 +- ...ontGoToDetailsPageWhenAddingToCartTest.xml | 4 +- ...torefrontSortBundleProductsByPriceTest.xml | 2 +- ...oductPricesForCombinationOfOptionsTest.xml | 2 +- .../AddCategoryImageActionGroup.xml | 31 + .../AddCrossSellProductBySkuActionGroup.xml | 32 + ...ductAttributeInProductModalActionGroup.xml | 28 + ...AddProductCustomOptionFieldActionGroup.xml | 31 + .../AddProductCustomOptionFileActionGroup.xml | 30 + .../AddProductImageActionGroup.xml | 26 + ...rtFromStorefrontProductPageActionGroup.xml | 22 + .../AddRelatedProductBySkuActionGroup.xml | 32 + ... => AddSimpleProductToCartActionGroup.xml} | 8 +- .../AddSpecialPriceToProductActionGroup.xml | 28 + ...rtFromStorefrontProductPageActionGroup.xml | 28 + .../AddUpSellProductBySkuActionGroup.xml | 26 + ...AdvancedPricingToTheProductActionGroup.xml | 12 - ...PricingToTheProductExtendedActionGroup.xml | 21 + ...dUnassignedAttributeToGroupActionGroup.xml | 21 + ...tProductCustomOptionVisibleActionGroup.xml | 19 + ...ertProductHasNoCustomOptionActionGroup.xml | 15 + ...rtProductHasNoCustomOptionsActionGroup.xml | 16 + ...dminAssignProductToCategoryActionGroup.xml | 25 + .../ActionGroup/AdminCategoryActionGroup.xml | 459 ----------- .../AdminCategoryAssignProductActionGroup.xml | 25 + ...singInCategoryProductsGridActionGroup.xml} | 9 +- ...itionInCategoryProductsGridActionGroup.xml | 18 + ...ckOnAdvancedInventoryButtonActionGroup.xml | 19 + ...lickOnAdvancedInventoryLinkActionGroup.xml | 11 - ...ateAttributeFromProductPageActionGroup.xml | 27 + ...uteFromProductPageWithScopeActionGroup.xml | 18 + ...teAttributeWithSearchWeightActionGroup.xml | 27 + ...TwoStoreViesFromProductPageActionGroup.xml | 35 + ...CreateCatalogProductWidgetActionGroup.xml} | 12 - ...reateRecentlyProductsWidgetActionGroup.xml | 22 + ...eSearchableProductAttributeActionGroup.xml | 16 + ...ductWithTextOptionCharLimitActionGroup.xml | 47 ++ ...leteAllProductCustomOptionsActionGroup.xml | 26 + .../AdminDeleteCategoryByNameActionGroup.xml | 23 + ...inDeleteProductCustomOptionActionGroup.xml | 15 + ...lProductAttributePropertiesActionGroup.xml | 12 - ...ProductCountryOfManufactureActionGroup.xml | 17 + ...AdminProcessProductWebsitesActionGroup.xml | 17 + .../ActionGroup/AdminProductActionGroup.xml | 759 ------------------ ...AdminProductAddSpecialPriceActionGroup.xml | 28 + ...ricingNewCustomerGroupPriceActionGroup.xml | 24 + .../AdminProductAttributeActionGroup.xml | 379 --------- .../AdminProductAttributeSetActionGroup.xml | 126 +-- .../AdminProductGridActionGroup.xml | 445 ---------- ...teAttributeSetWithAttributeActionGroup.xml | 35 + ...illTextAttributeValueByNameActionGroup.xml | 23 + ...oductPageSelectAttributeSetActionGroup.xml | 23 + .../AdminSetProductDisabledActionGroup.xml | 15 + ...tchScopeForProductAttributeActionGroup.xml | 19 + ...scountsPercentageOfProductsActionGroup.xml | 27 + ...escriptionInProductEditFormActionGroup.xml | 18 + ...roductImageAdminProductPageActionGroup.xml | 23 + ...tImageNotInAdminProductPageActionGroup.xml | 23 + ...NotInStorefrontProductPage2ActionGroup.xml | 24 + ...eNotInStorefrontProductPageActionGroup.xml | 24 + ...ImageStorefrontProductPage2ActionGroup.xml | 24 + ...tImageStorefrontProductPageActionGroup.xml | 24 + ...ductInStorefrontProductPageActionGroup.xml | 34 +- ...tProductIsAssignedToWebsiteActionGroup.xml | 15 + ...oductIsNotAssignedToWebsiteActionGroup.xml | 15 + ...dSkuInStorefrontProductPageActionGroup.xml | 26 + ...PageByCustomAttributeUrlKeyActionGroup.xml | 26 + ...roductNameInProductEditFormActionGroup.xml | 17 + .../AssertProductOnAdminGridActionGroup.xml | 2 +- ...AssertProductOnCategoryPageActionGroup.xml | 19 + ...latedUpSellCrossSellSectionActionGroup.xml | 24 + ...sAvailableInProductWebsitesActionGroup.xml | 19 + ...tAvailableInProductWebsitesActionGroup.xml | 15 + .../CategoryPresentActionGroup.xml | 26 + .../ChangeSeoUrlKeyActionGroup.xml | 24 + ...angeSeoUrlKeyForSubCategoryActionGroup.xml | 25 + ...atusProductUsingProductGridActionGroup.xml | 38 + ...eConditionsProductAttributeActionGroup.xml | 25 + ...tributeInMoreInformationTabActionGroup.xml | 24 + ...buteNotInMoreInformationTabActionGroup.xml | 22 + .../CheckCategoryImageInAdminActionGroup.xml | 28 + ...CategoryNameIsRequiredFieldActionGroup.xml | 23 + .../CheckCategoryOnStorefrontActionGroup.xml | 24 + ...eckCustomizableOptionImportActionGroup.xml | 27 + ...RequiredFieldsInProductFormActionGroup.xml | 25 + .../ClearProductsFilterActionGroup.xml | 20 + ...ConfirmChangeInputTypeModalActionGroup.xml | 20 + ...eAttributeDropdownNthOptionActionGroup.xml | 26 + ...eDropdownNthOptionAsDefaultActionGroup.xml | 18 + .../ActionGroup/CreateCategoryActionGroup.xml | 30 + .../CreateCustomRadioOptionsActionGroup.xml | 43 + .../CreateDefaultAttributeSetActionGroup.xml | 25 + .../CreateProductAttributeActionGroup.xml | 25 + ...oductAttributeWithDateFieldActionGroup.xml | 23 + ...oductAttributeWithTextFieldActionGroup.xml | 20 + ...impleProductAndAddToWebsiteActionGroup.xml | 34 + ...atedProductConnectToWebsiteActionGroup.xml | 29 + .../ActionGroup/CustomOptionsActionGroup.xml | 172 ---- ...cateProductUsingProductGridActionGroup.xml | 21 + ...AllProductsUsingProductGridActionGroup.xml | 29 + .../DeleteAttributeSetByLabelActionGroup.xml | 30 + .../ActionGroup/DeleteCategoryActionGroup.xml | 31 + ...leteDefaultCategoryChildrenActionGroup.xml | 35 + .../DeleteMostRecentCategoryActionGroup.xml | 25 + .../DeleteProductAttributeActionGroup.xml | 21 + ...uctAttributeByAttributeCodeActionGroup.xml | 18 +- ...leteProductAttributeByLabelActionGroup.xml | 29 + .../DeleteProductByNameActionGroup.xml | 25 + .../DeleteProductBySkuActionGroup.xml | 34 + ...leteProductUsingProductGridActionGroup.xml | 35 + .../DeleteProductsByKeywordActionGroup.xml | 31 + .../DeleteProductsIfTheyExistActionGroup.xml | 24 + .../ExpandAdminProductSectionActionGroup.xml | 25 + .../FillAdminSimpleProductFormActionGroup.xml | 38 + .../FillCategoryFormActionGroup.xml | 23 + ...ategoryNameAndUrlKeyAndSaveActionGroup.xml | 29 + .../FillMainProductFormActionGroup.xml | 28 + ...FillMainProductFormByStringActionGroup.xml | 32 + ...FillMainProductFormNoWeightActionGroup.xml | 26 + .../FillNewProductCategoryActionGroup.xml | 34 + ...ductNameAndSkuInProductFormActionGroup.xml | 22 + .../FilterAndSelectProductActionGroup.xml | 30 + ...uctAttributeByAttributeCodeActionGroup.xml | 24 + ...ctAttributeByAttributeLabelActionGroup.xml | 23 + ...ductAttributeByDefaultLabelActionGroup.xml | 24 + ...teSetGridByAttributeSetNameActionGroup.xml | 25 + ...ProductGridByDisabledStatusActionGroup.xml | 22 + ...rProductGridByEnabledStatusActionGroup.xml | 22 + .../FilterProductGridByName2ActionGroup.xml | 25 + .../FilterProductGridByNameActionGroup.xml | 25 + ...lterProductGridByPriceRangeActionGroup.xml | 26 + ...ProductGridBySetNewFromDateActionGroup.xml | 22 + .../FilterProductGridBySku2ActionGroup.xml | 25 + .../FilterProductGridBySkuActionGroup.xml | 25 + ...lterProductGridBySkuAndNameActionGroup.xml | 25 + .../GoToAdminCategoryPageByIdActionGroup.xml | 23 + .../GoToAttributeGridPageActionGroup.xml | 18 + .../GoToAttributeSetByNameActionGroup.xml | 25 + .../GoToCreateCategoryPageActionGroup.xml | 25 + .../GoToCreateProductPageActionGroup.xml | 27 + .../GoToProductCatalogPageActionGroup.xml | 20 + .../GoToProductPageViaIDActionGroup.xml | 21 + ...oSpecifiedCreateProductPageActionGroup.xml | 25 + ...ontCategoryPageByParametersActionGroup.xml | 28 + .../GoToSubCategoryPageActionGroup.xml | 29 + ...tProductCustomizableOptionsActionGroup.xml | 29 + ...tAttributeGridToDefaultViewActionGroup.xml | 21 + ...setProductGridToDefaultViewActionGroup.xml | 19 + .../NavigateToCreatedCategoryActionGroup.xml | 26 + ...teToCreatedProductAttributeActionGroup.xml | 25 + ...ateToCreatedProductEditPageActionGroup.xml | 37 + ...igateToEditProductAttributeActionGroup.xml | 26 + .../NavigateToMediaGalleryActionGroup.xml | 25 + ...penCategoryFromCategoryTreeActionGroup.xml | 27 + ...ingRowXColumnYInProductGridActionGroup.xml | 22 + .../ProductSetAdvancedPricingActionGroup.xml | 38 + ...SetAdvancedTierFixedPricingActionGroup.xml | 15 + .../ProductSetWebsiteActionGroup.xml | 28 + .../RemoveCategoryFromProductActionGroup.xml | 19 + .../RemoveCategoryImageActionGroup.xml | 24 + .../RemoveProductImageActionGroup.xml | 20 + .../RemoveProductImageByNameActionGroup.xml | 21 + .../ResetImportOptionFilterActionGroup.xml | 20 + ...setProductGridToDefaultViewActionGroup.xml | 23 + .../SaveAttributeSetActionGroup.xml | 19 + .../SaveCategoryFormActionGroup.xml | 20 + .../SaveProductAttributeActionGroup.xml | 21 + .../SaveProductAttributeInUseActionGroup.xml | 21 + .../SaveProductFormActionGroup.xml | 22 + ...veProductFormNoSuccessCheckActionGroup.xml | 19 + .../SearchForProductOnBackendActionGroup.xml | 22 - ...chForProductOnBackendByNameActionGroup.xml | 22 + ...SearchProductGridByKeyword2ActionGroup.xml | 23 + .../SearchProductGridByKeywordActionGroup.xml | 23 + .../SelectProductInWebsitesActionGroup.xml | 24 + .../SetCategoryByNameActionGroup.xml | 21 + .../SetProductUrlKeyActionGroup.xml | 22 + .../SetProductUrlKeyByStringActionGroup.xml | 22 + .../SortProductsByIdAscendingActionGroup.xml | 19 + .../SortProductsByIdDescendingActionGroup.xml | 19 + ...AddCategoryProductToCompareActionGroup.xml | 25 + ...orefrontAddProductToCompareActionGroup.xml | 23 + ...rontAddSimpleProductWithQtyActionGroup.xml | 17 + ...ontAssertActiveProductImageActionGroup.xml | 17 + ...rtFotoramaImageAvailabilityActionGroup.xml | 17 + ...tProductImagesOnProductPageActionGroup.xml | 8 - ...uctInRecentlyComparedWidgetActionGroup.xml | 22 + ...ductInRecentlyOrderedWidgetActionGroup.xml | 22 + ...efrontAssertProductInWidgetActionGroup.xml | 26 - ...tProductPriceOnCategoryPageActionGroup.xml | 21 + .../StorefrontCategoryActionGroup.xml | 124 --- ...ntCategoryPageSortAscendingActionGroup.xml | 17 + ...tCategoryPageSortDescendingActionGroup.xml | 17 + ...rontCategoryPageSortProductActionGroup.xml | 12 - ...CheckAddToCartButtonAbsenceActionGroup.xml | 18 + .../StorefrontCheckCategoryActionGroup.xml | 25 + ...tCheckCategorySimpleProductActionGroup.xml | 26 + ...tCheckCompareSidebarProductActionGroup.xml | 21 + ...ntCheckCompareSimpleProductActionGroup.xml | 25 + ...ssingInCategoryProductsPageActionGroup.xml | 7 - ...refrontCheckProductPositionActionGroup.xml | 18 + ...CheckProductPriceInCategoryActionGroup.xml | 12 +- ...torefrontCheckSimpleProductActionGroup.xml | 30 + .../StorefrontClearCompareActionGroup.xml | 24 + .../StorefrontCompareActionGroup.xml | 95 --- .../StorefrontGoToCategoryPageActionGroup.xml | 9 +- ...orefrontGoToSubCategoryPageActionGroup.xml | 18 + ...rontOpenAndCheckComparisionActionGroup.xml | 22 + .../StorefrontOpenProductPageActionGroup.xml | 11 - ...penProductPageOnSecondStoreActionGroup.xml | 22 + .../StorefrontProductActionGroup.xml | 90 --- .../StorefrontProductPageActionGroup.xml | 87 -- ...witchCategoryViewToListModeActionGroup.xml | 19 + .../SwitchCategoryStoreViewActionGroup.xml | 33 + ...witchCategoryToAllStoreViewActionGroup.xml | 31 + .../SwitchToTheNewStoreViewActionGroup.xml | 26 + .../TestDynamicValidationHintActionGroup.xml | 30 + .../ToggleProductEnabledActionGroup.xml | 18 + .../UnassignAttributeFromGroupActionGroup.xml | 26 + .../UnassignWebsiteFromProductActionGroup.xml | 15 + ...erifyCategoryPageParametersActionGroup.xml | 29 + .../ViewProductInAdminGridActionGroup.xml | 31 + .../Test/Mftf/Test/AddToCartCrossSellTest.xml | 10 +- .../AdminAddDefaultImageSimpleProductTest.xml | 16 +- ...AdminAddDefaultImageVirtualProductTest.xml | 16 +- .../AdminAddDefaultVideoSimpleProductTest.xml | 10 +- ...AdminAddDefaultVideoVirtualProductTest.xml | 6 +- .../Test/AdminAddImageForCategoryTest.xml | 16 +- .../AdminAddImageToWYSIWYGCatalogTest.xml | 2 +- .../AdminAddImageToWYSIWYGProductTest.xml | 2 +- .../AdminAddInStockProductToTheCartTest.xml | 2 +- .../Test/AdminApplyTierPriceToProductTest.xml | 18 +- ...signProductAttributeToAttributeSetTest.xml | 4 +- ...inBackorderAllowedAddProductToCartTest.xml | 2 +- .../Test/AdminChangeProductAttributeSet.xml | 4 +- ...oductPriceWithDisabledChildProductTest.xml | 2 +- ...StockProductIsNotVisibleInCategoryTest.xml | 2 +- ...tOfStockProductIsVisibleInCategoryTest.xml | 2 +- .../AdminCloneProductWithDuplicateUrlTest.xml | 12 +- ...CreateAndEditSimpleProductSettingsTest.xml | 16 +- ...reateAndEditVirtualProductSettingsTest.xml | 18 +- .../Test/AdminCreateAndSwitchProductType.xml | 26 +- .../AdminCreateAttributeSetEntityTest.xml | 8 +- ...AdminCreateCategoryFromProductPageTest.xml | 8 +- ...AdminCreateCategoryWithAnchorFieldTest.xml | 2 +- ...eateCategoryWithCustomRootCategoryTest.xml | 4 +- ...CreateCategoryWithInactiveCategoryTest.xml | 2 +- ...eCategoryWithInactiveIncludeInMenuTest.xml | 2 +- ...inCreateCategoryWithProductsGridFilter.xml | 8 +- ...inCreateCategoryWithRequiredFieldsTest.xml | 2 +- ...mProductAttributeWithDropdownFieldTest.xml | 4 +- ...dminCreateDropdownProductAttributeTest.xml | 6 +- ...ibleInStorefrontAdvancedSearchFormTest.xml | 6 +- .../Test/AdminCreateDuplicateCategoryTest.xml | 4 +- .../Test/AdminCreateDuplicateProductTest.xml | 10 +- ...ibleInStorefrontAdvancedSearchFormTest.xml | 6 +- ...nCreateNewAttributeFromProductPageTest.xml | 4 +- ...AdminCreateNewAttributeFromProductTest.xml | 4 +- ...AdminCreateNewGroupForAttributeSetTest.xml | 14 +- ...ateProductAttributeFromProductPageTest.xml | 4 +- ...eProductAttributeRequiredTextFieldTest.xml | 4 +- .../AdminCreateProductCustomAttributeSet.xml | 4 +- .../AdminCreateProductDuplicateUrlkeyTest.xml | 2 +- ...CreateRootCategoryAndSubcategoriesTest.xml | 12 +- ...inCreateRootCategoryRequiredFieldsTest.xml | 2 +- .../Test/AdminCreateSimpleProductTest.xml | 4 +- ...untryOfManufactureAttributeSKUMaskTest.xml | 2 +- ...dminCreateSimpleProductWithUnicodeTest.xml | 4 +- ...inCreateTextEditorProductAttributeTest.xml | 18 +- ...tualProductOutOfStockWithTierPriceTest.xml | 2 +- ...CustomOptionsSuiteAndImportOptionsTest.xml | 2 +- ...roductWithTierPriceForGeneralGroupTest.xml | 2 +- .../Mftf/Test/AdminDeleteAttributeSetTest.xml | 2 +- ...minDeleteConfigurableChildProductsTest.xml | 4 +- ...wnProductAttributeFromAttributeSetTest.xml | 6 +- .../Test/AdminDeleteProductAttributeTest.xml | 8 +- ...AdminDeleteProductWithCustomOptionTest.xml | 2 +- ...roductsImageInCaseOfMultipleStoresTest.xml | 40 +- .../Test/AdminDeleteSimpleProductTest.xml | 2 +- ...ldProductAttributeFromAttributeSetTest.xml | 8 +- .../Test/AdminDeleteVirtualProductTest.xml | 2 +- ...sableProductOnChangingAttributeSetTest.xml | 2 +- ...dminEditTextEditorProductAttributeTest.xml | 2 +- ...lterByNameByStoreViewOnProductGridTest.xml | 6 +- ...CategoryProductsUsingScopeSelectorTest.xml | 6 +- ...dPageNumberAfterSaveAndCloseActionTest.xml | 4 +- ...CustomizableOptionToProductWithSKUTest.xml | 10 +- .../AdminMassChangeProductsStatusTest.xml | 4 +- .../Test/AdminMassProductPriceUpdateTest.xml | 4 +- ...UpdateProductAttributesGlobalScopeTest.xml | 6 +- ...ductAttributesMissingRequiredFieldTest.xml | 2 +- ...ateProductAttributesStoreViewScopeTest.xml | 8 +- ...sUpdateProductStatusStoreViewScopeTest.xml | 18 +- ...CategoryFromParentAnchoredCategoryTest.xml | 2 +- ...oryToAnotherPositionInCategoryTreeTest.xml | 2 +- .../AdminMoveProductBetweenCategoriesTest.xml | 8 +- ...dminNavigateMultipleUpSellProductsTest.xml | 10 +- ...egoryIndexerInUpdateOnScheduleModeTest.xml | 6 +- ...nAssignedToCategoryWithoutCustomURLKey.xml | 10 +- ...ductGridFilteringByCustomAttributeTest.xml | 10 +- ...roductGridFilteringByDateAttributeTest.xml | 4 +- ...ctImageAssignmentForMultipleStoresTest.xml | 12 +- ...AdminProductTypeSwitchingOnEditingTest.xml | 8 +- ...dminRemoveCustomOptionsFromProductTest.xml | 38 +- ...minRemoveDefaultImageSimpleProductTest.xml | 20 +- ...inRemoveDefaultImageVirtualProductTest.xml | 20 +- ...minRemoveDefaultVideoSimpleProductTest.xml | 10 +- ...inRemoveDefaultVideoVirtualProductTest.xml | 6 +- .../AdminRemoveImageAffectsAllScopesTest.xml | 22 +- .../Test/AdminRemoveImageFromCategoryTest.xml | 20 +- ...ctedUserAddCategoryFromProductPageTest.xml | 16 +- ...ToAssociateSimpleProductToWebsitesTest.xml | 6 +- .../Test/AdminSimpleProductImagesTest.xml | 36 +- .../AdminSimpleProductSetEditContentTest.xml | 6 +- .../AdminSimpleSetEditRelatedProductsTest.xml | 20 +- .../Mftf/Test/AdminSortingByWebsitesTest.xml | 4 +- ...gnProductAttributeFromAttributeSetTest.xml | 6 +- .../AdminUpdateCategoryStoreUrlKeyTest.xml | 10 +- ...rifyDataOverridingOnStoreViewLevelTest.xml | 4 +- ...rifyDataOverridingOnStoreViewLevelTest.xml | 4 +- ...dminUpdateSimpleProductTieredPriceTest.xml | 4 +- ...RegularPriceInStockDisabledProductTest.xml | 4 +- ...WithRegularPriceInStockEnabledFlatTest.xml | 4 +- ...PriceInStockNotVisibleIndividuallyTest.xml | 4 +- ...arPriceInStockUnassignFromCategoryTest.xml | 4 +- ...ceInStockVisibleInCatalogAndSearchTest.xml | 4 +- ...arPriceInStockVisibleInCatalogOnlyTest.xml | 4 +- ...larPriceInStockVisibleInSearchOnlyTest.xml | 4 +- ...gularPriceInStockWithCustomOptionsTest.xml | 4 +- ...eProductWithRegularPriceOutOfStockTest.xml | 4 +- ...rPriceInStockVisibleInCategoryOnlyTest.xml | 2 +- ...eInStockVisibleInCategoryAndSearchTest.xml | 2 +- ...rPriceInStockVisibleInCategoryOnlyTest.xml | 2 +- ...tOfStockVisibleInCategoryAndSearchTest.xml | 2 +- .../Mftf/Test/AdminVerifyProductOrderTest.xml | 2 +- .../AdminVirtualProductSetEditContentTest.xml | 6 +- ...AdminVirtualSetEditRelatedProductsTest.xml | 6 +- .../AdvanceCatalogSearchSimpleProductTest.xml | 4 +- .../Test/CheckTierPricingOfProductsTest.xml | 16 +- ...bleOptionTextInputLengthValidationHint.xml | 6 +- .../Test/CreateProductAttributeEntityTest.xml | 68 +- .../Test/Mftf/Test/DeleteCategoriesTest.xml | 18 +- ...UsedInConfigurableProductAttributeTest.xml | 4 +- ...cheAfterChangingCategoryPageLayoutTest.xml | 2 +- .../Test/Mftf/Test/EndToEndB2CAdminTest.xml | 64 +- .../Mftf/Test/EndToEndB2CGuestUserTest.xml | 28 +- .../Mftf/Test/EndToEndB2CLoggedInUserTest.xml | 14 +- .../SimpleProductTwoCustomOptionsTest.xml | 10 +- ...rontCatalogNavigationMenuUIDesktopTest.xml | 4 +- ...chorIsVisibleOnViewportOnceClickedTest.xml | 10 +- .../StorefrontProductNameWithDoubleQuote.xml | 10 +- ...torefrontProductWithEmptyAttributeTest.xml | 4 +- ...orefrontRememberCategoryPaginationTest.xml | 136 ++-- ...ceForDifferentTimezonesForWebsitesTest.xml | 2 +- ...ctAndProductCategoryPartialReindexTest.xml | 8 +- ...ldCategoriesShouldNotIncludeInMenuTest.xml | 8 +- ...mportConfigurableProductWithImagesTest.xml | 10 +- ...eroMaximumQtyAllowedInShoppingCartTest.xml | 2 +- ...nfigurableProductWithSpecialPricesTest.xml | 8 +- .../AdminDeleteCatalogPriceRuleEntityTest.xml | 2 +- .../Test/AdminDeleteCatalogPriceRuleTest.xml | 2 +- ...CatalogPriceRuleByProductAttributeTest.xml | 22 +- .../Mftf/Test/EndToEndB2CGuestUserTest.xml | 16 +- .../Mftf/Test/EndToEndB2CLoggedInUserTest.xml | 8 +- .../LayerNavigationOfCatalogSearchTest.xml | 4 +- .../Mftf/Test/SearchEntityResultsTest.xml | 46 +- ...tAdvancedSearchEntitySimpleProductTest.xml | 2 +- ...goryWithRestrictedUrlKeyNotCreatedTest.xml | 40 +- ...minUrlForProductRewrittenCorrectlyTest.xml | 6 +- ...iteStoreLevelUrlKeyOfChildCategoryTest.xml | 134 ++-- .../Test/CheckCheckoutSuccessPageTest.xml | 10 +- .../CheckNotVisibleProductInMinicartTest.xml | 4 +- ...guringInstantPurchaseFunctionalityTest.xml | 2 +- ...ddressShouldBeCheckedOnPaymentPageTest.xml | 2 +- ...ndleDynamicProductFromShoppingCartTest.xml | 2 +- ...BundleFixedProductFromShoppingCartTest.xml | 2 +- ...ownloadableProductFromShoppingCartTest.xml | 2 +- ...leteVirtualProductFromShoppingCartTest.xml | 2 +- .../Mftf/Test/EndToEndB2CGuestUserTest.xml | 28 +- .../Mftf/Test/EndToEndB2CLoggedInUserTest.xml | 14 +- ...OfDefaultBillingAndShippingAddressTest.xml | 2 +- ...ckoutAsCustomerUsingDefaultAddressTest.xml | 2 +- ...eCheckoutAsCustomerUsingNewAddressTest.xml | 2 +- ...utAsCustomerUsingNonDefaultAddressTest.xml | 2 +- .../OnePageCheckoutUsingSignInLinkTest.xml | 2 +- ...OnePageCheckoutWithAllProductTypesTest.xml | 10 +- ...CartAndMiniShoppingCartPerCustomerTest.xml | 4 +- ...oppingCartWithoutAnySelectedOptionTest.xml | 2 +- ...ontCheckCustomerInfoCreatedByGuestTest.xml | 2 +- ...ateShoppingCartWhileUpdateMinicartTest.xml | 2 +- ...BundleDynamicProductToShoppingCartTest.xml | 2 +- ...pingCartWithDisableMiniCartSidebarTest.xml | 2 +- ...MultiSelectOptionToTheShoppingCartTest.xml | 2 +- ...pesOfCustomOptionToTheShoppingCartTest.xml | 4 +- ...ultiSelectOptionsToTheShoppingCartTest.xml | 2 +- ...efrontApplyPromoCodeDuringCheckoutTest.xml | 2 +- ...rontCheckCartAndCheckoutItemsCountTest.xml | 4 +- ...isplayWithDefaultDisplayLimitationTest.xml | 40 +- ...edToTheCartThanDefaultDisplayLimitTest.xml | 44 +- ...isplayLimitAndDefaultTotalQuantityTest.xml | 40 +- ...ShoppingCartWithMoreThan20ProductsTest.xml | 42 +- ...rtItemDisplayWithDefaultLimitationTest.xml | 44 +- ...playWithCustomDisplayConfigurationTest.xml | 16 +- ...ingAddressAndProductWithTierPricesTest.xml | 8 +- ...ssAndRegisterCustomerAfterCheckoutTest.xml | 4 +- ...ntCheckoutWithSpecialPriceProductsTest.xml | 8 +- ...erCheckoutDisabledProductAndCouponTest.xml | 4 +- ...OnLoginWhenGuestCheckoutIsDisabledTest.xml | 4 +- ...egistrationAndDisableGuestCheckoutTest.xml | 4 +- ...frontCustomerCheckoutWithoutRegionTest.xml | 2 +- ...OrderWithNewAddressesThatWasEditedTest.xml | 2 +- ...eBundleProductFromMiniShoppingCartTest.xml | 2 +- ...aultLimitationFromMiniShoppingCartTest.xml | 42 +- ...VirtualProductFromMiniShoppingCartTest.xml | 6 +- ...eSimpleProductFromMiniShoppingCartTest.xml | 4 +- ...StorefrontGuestCheckoutDataPersistTest.xml | 4 +- ...tCheckoutUsingFreeShippingAndTaxesTest.xml | 6 +- ...tCheckoutWithCouponAndZeroSubtotalTest.xml | 6 +- ...ingPagerShoppingCartWith20ProductsTest.xml | 40 +- ...ntOnePageCheckoutDataWhenChangeQtyTest.xml | 2 +- ...refrontOnePageCheckoutJsValidationTest.xml | 2 +- ...aForGuestCustomerWithPhysicalQuoteTest.xml | 2 +- ...tOnCheckoutPageDifferentStoreViewsTest.xml | 4 +- ...ngesInBackendAfterCustomerCheckoutTest.xml | 8 +- ...PagerForOneItemPerPageAnd2ProductsTest.xml | 4 +- ...efrontUKCustomerCheckoutWithCouponTest.xml | 4 +- ...uctQuantityEqualsToOrderedQuantityTest.xml | 8 +- ...CouponAndBankTransferPaymentMethodTest.xml | 4 +- ...riceInShoppingCartAfterProductSaveTest.xml | 4 +- ...UpdateShoppingCartSimpleProductQtyTest.xml | 2 +- ...eProductFromMiniShoppingCartEntityTest.xml | 2 +- ...SubtotalOrdersWithProcessingStatusTest.xml | 2 +- .../AdminAddDefaultImageConfigurableTest.xml | 16 +- ...agesAndPricesToConfigurableProductTest.xml | 2 +- ...hangedWhenSavingProductWithSameSkuTest.xml | 8 +- ...bleProductAttributeValueUniquenessTest.xml | 6 +- ...CheckResultsOfColorAndOtherFiltersTest.xml | 16 +- ...nCheckValidatorConfigurableProductTest.xml | 6 +- .../AdminConfigurableProductCreateTest.xml | 2 +- .../AdminConfigurableProductDeleteTest.xml | 4 +- .../AdminConfigurableProductLongSkuTest.xml | 2 +- ...AdminConfigurableProductOutOfStockTest.xml | 12 +- .../AdminConfigurableProductSearchTest.xml | 2 +- ...nConfigurableProductSetEditContentTest.xml | 6 +- ...ConfigurableProductUpdateAttributeTest.xml | 6 +- .../AdminConfigurableProductUpdateTest.xml | 2 +- ...ConfigurableSetEditRelatedProductsTest.xml | 2 +- ...AndEditConfigurableProductSettingsTest.xml | 10 +- .../Test/AdminCreateAndSwitchProductType.xml | 34 +- ...onfigurableProductBasedOnParentSkuTest.xml | 14 +- ...ctWithCreatingCategoryAndAttributeTest.xml | 14 +- ...roductWithDisabledChildrenProductsTest.xml | 10 +- ...reateConfigurableProductWithImagesTest.xml | 10 +- ...eeProductDisplayOutOfStockProductsTest.xml | 10 +- ...oductDontDisplayOutOfStockProductsTest.xml | 10 +- ...ableProductWithTierPriceForOneItemTest.xml | 8 +- ...ctWithTwoOptionsAssignedToCategoryTest.xml | 20 +- ...woOptionsWithoutAssignedToCategoryTest.xml | 20 +- .../AdminDeleteConfigurableProductTest.xml | 2 +- ...AdminProductTypeSwitchingOnEditingTest.xml | 12 +- .../Mftf/Test/AdminRelatedProductsTest.xml | 30 +- ...dminRemoveDefaultImageConfigurableTest.xml | 20 +- .../Test/Mftf/Test/EndToEndB2CAdminTest.xml | 10 +- ...vailableToConfigureDisabledProductTest.xml | 4 +- .../ProductsQtyReturnAfterOrderCancelTest.xml | 4 +- ...urableProductCategoryViewChildOnlyTest.xml | 4 +- ...rontConfigurableProductChildSearchTest.xml | 6 +- ...orefrontConfigurableProductDetailsTest.xml | 18 +- .../StorefrontConfigurableProductViewTest.xml | 2 +- ...gurableProductWithFileCustomOptionTest.xml | 4 +- ...ConfigurableWithCatalogRuleAppliedTest.xml | 12 +- ...nfigurableProductLayeredNavigationTest.xml | 2 +- ...efrontVisibilityOfDuplicateProductTest.xml | 26 +- ...ayWhenChooseThreeAllowedCurrenciesTest.xml | 2 +- .../AdminOrderRateDisplayedInOneLineTest.xml | 2 +- ...ectNavigateFromCustomerViewCartProduct.xml | 2 +- .../Mftf/Test/PasswordAutocompleteOffTest.xml | 2 +- ...AddDefaultImageDownloadableProductTest.xml | 16 +- ...AddDefaultVideoDownloadableProductTest.xml | 6 +- ...AndEditDownloadableProductSettingsTest.xml | 10 +- .../Test/AdminCreateAndSwitchProductType.xml | 4 +- ...bleProductAndAssignItToCustomStoreTest.xml | 10 +- ...wnloadableProductWithCustomOptionsTest.xml | 10 +- ...loadableProductWithDefaultSetLinksTest.xml | 12 +- ...eDownloadableProductWithGroupPriceTest.xml | 12 +- ...bleProductWithInvalidDomainLinkUrlTest.xml | 6 +- ...nCreateDownloadableProductWithLinkTest.xml | 10 +- ...DownloadableProductWithManageStockTest.xml | 10 +- ...oadableProductWithOutOfStockStatusTest.xml | 10 +- ...ownloadableProductWithSpecialPriceTest.xml | 12 +- ...ductWithoutFillingQuantityAndStockTest.xml | 10 +- ...wnloadableProductWithoutTaxClassIdTest.xml | 12 +- .../AdminDeleteDownloadableProductTest.xml | 2 +- ...nDownloadableProductSetEditContentTest.xml | 6 +- ...DownloadableSetEditRelatedProductsTest.xml | 6 +- ...AdminProductTypeSwitchingOnEditingTest.xml | 6 +- ...oveDefaultImageDownloadableProductTest.xml | 18 +- ...oveDefaultVideoDownloadableProductTest.xml | 6 +- ...leProductWithSeparateLinksFromCartTest.xml | 8 +- .../Test/Mftf/Test/EndToEndB2CAdminTest.xml | 8 +- ...wnloadableLinksDownloadableProductTest.xml | 8 +- ...wnloadableLinksDownloadableProductTest.xml | 8 +- ...ableProductSamplesAreNotAccessibleTest.xml | 6 +- ...ntElasticsearch6SearchInvalidValueTest.xml | 18 +- .../Test/AdminCreatingShippingLabelTest.xml | 2 +- ...edProductWithTwoLinksToCartActionGroup.xml | 2 +- ...AdminAddDefaultImageGroupedProductTest.xml | 18 +- ...AdminAddDefaultVideoGroupedProductTest.xml | 8 +- ...nAssociateGroupedProductToWebsitesTest.xml | 10 +- ...reateAndEditGroupedProductSettingsTest.xml | 16 +- .../Test/AdminDeleteGroupedProductTest.xml | 2 +- .../AdminGroupedProductSetEditContentTest.xml | 6 +- .../Test/AdminGroupedProductsListTest.xml | 8 +- ...AdminGroupedSetEditRelatedProductsTest.xml | 4 +- ...inRemoveDefaultImageGroupedProductTest.xml | 20 +- ...inRemoveDefaultVideoGroupedProductTest.xml | 8 +- .../AdminSortingAssociatedProductsTest.xml | 14 +- .../Test/Mftf/Test/EndToEndB2CAdminTest.xml | 10 +- ...ewProductsListWidgetGroupedProductTest.xml | 2 +- .../AdminCheckDoubleImportOfProductsTest.xml | 4 +- ...utesChangedValueToEmptyAfterImportTest.xml | 16 +- ...dminImportProductsWithErrorEntriesTest.xml | 2 +- ...lityDifferentStoreViewsAfterImportTest.xml | 8 +- .../Test/Mftf/Test/ShopByButtonInMobile.xml | 2 +- ...hMapAssignedConfigProductIsCorrectTest.xml | 4 +- ...toreFrontCheckingWithMultishipmentTest.xml | 4 +- ...oreFrontCheckingWithSingleShipmentTest.xml | 4 +- ...toreFrontMinicartWithMultishipmentTest.xml | 4 +- ...oreFrontMyAccountWithMultishipmentTest.xml | 4 +- ...frontCheckoutWithMultipleAddressesTest.xml | 6 +- ...ingCartBehaviorAfterSessionExpiredTest.xml | 2 +- ...GuestCheckoutWithEnabledPersistentTest.xml | 2 +- .../ShippingQuotePersistedForGuestTest.xml | 4 +- ...CartPersistenceUnderLongTermCookieTest.xml | 6 +- ...listIsPersistedUnderLongTermCookieTest.xml | 4 +- ...inValidateUrlOnGetVideoInformationTest.xml | 2 +- .../YoutubeVideoWindowOnProductPageTest.xml | 6 +- ...efrontGuestCheckoutDisabledProductTest.xml | 12 +- ...erWithCheckMoneyOrderPaymentMethodTest.xml | 8 +- ...WithProductQtyWithoutStockDecreaseTest.xml | 8 +- ...ectnessInvoicedItemInBundleProductTest.xml | 2 +- .../Test/Mftf/Test/AdminCreateInvoiceTest.xml | 2 +- ...rderCreationWithMultiWebsiteConfigTest.xml | 4 +- .../Test/StorefrontPrintOrderGuestTest.xml | 6 +- ...inCartRulesAppliedForProductInCartTest.xml | 8 +- .../Mftf/Test/AdminCreateBuyXGetYFreeTest.xml | 2 +- ...eConditionAndFreeShippingIsAppliedTest.xml | 2 +- ...AndVerifyRuleConditionIsNotAppliedTest.xml | 2 +- ...inCreateCartPriceRuleForCouponCodeTest.xml | 2 +- ...ateCartPriceRuleForGeneratedCouponTest.xml | 2 +- ...talAndVerifyRuleConditionIsAppliedTest.xml | 2 +- ...oryAndVerifyRuleConditionIsAppliedTest.xml | 6 +- ...ghtAndVerifyRuleConditionIsAppliedTest.xml | 2 +- .../AdminCreateFixedAmountDiscountTest.xml | 2 +- ...CreateFixedAmountWholeCartDiscountTest.xml | 2 +- .../AdminCreatePercentOfProductPriceTest.xml | 2 +- ...iveSalesRuleAndVerifyDeleteMessageTest.xml | 4 +- ...yRulesShouldApplyToComplexProductsTest.xml | 12 +- .../AdminGlobalSearchOnProductPageTest.xml | 12 +- ...archSuggestionByProductDescriptionTest.xml | 2 +- ...ustomStoreShippingMethodTableRatesTest.xml | 4 +- ...splayTableRatesShippingMethodForAETest.xml | 2 +- .../Mftf/Test/AdminCreateImageSwatchTest.xml | 4 +- .../Mftf/Test/AdminCreateTextSwatchTest.xml | 4 +- ...ateVisualSwatchWithNonValidOptionsTest.xml | 6 +- ...uctWithAttributesImagesAndSwatchesTest.xml | 14 +- ...figurableProductSwatchMinimumPriceTest.xml | 6 +- ...ntDisplayAllCharactersOnTextSwatchTest.xml | 2 +- .../StorefrontFilterByImageSwatchTest.xml | 16 +- .../Test/StorefrontFilterByTextSwatchTest.xml | 4 +- .../StorefrontFilterByVisualSwatchTest.xml | 4 +- ...tImageColorWhenFilterByColorFilterTest.xml | 6 +- ...oductImagesMatchingProductSwatchesTest.xml | 20 +- ...SwatchAttributesDisplayInWidgetCMSTest.xml | 8 +- ...tSwatchProductWithFileCustomOptionTest.xml | 10 +- .../Test/Mftf/Test/AdminTaxReportGridTest.xml | 12 +- ...oppingCartForCustomerPhysicalQuoteTest.xml | 4 +- ...nShoppingCartForGuestPhysicalQuoteTest.xml | 4 +- ...esignConfigMediaGalleryImageUploadTest.xml | 2 +- .../AdminInlineTranslationOnCheckoutTest.xml | 6 +- ...StorefrontButtonsInlineTranslationTest.xml | 2 +- ...dFilterDeleteAndVerifyErrorMessageTest.xml | 4 +- ...ateURLRewriteWhenCategoryIsDeletedTest.xml | 4 +- ...tipleStoreviewsDuringProductImportTest.xml | 20 +- ...rlKeyForStoreViewAndMovingCategoryTest.xml | 6 +- ...CategoryUrlRewriteAndAddNoRedirectTest.xml | 2 +- ...yUrlRewriteAndAddPermanentRedirectTest.xml | 2 +- ...tUrlRewriteAndAddTemporaryRedirectTest.xml | 2 +- ...eProductURLRewriteAndAddNoRedirectTest.xml | 4 +- ...ithCategoryAndAddTemporaryRedirectTest.xml | 6 +- ...tUrLRewriteAndAddPermanentRedirectTest.xml | 4 +- ...tUrLRewriteAndAddTemporaryRedirectTest.xml | 4 +- ...SeveralWebsitesAndCheckURLRewritesTest.xml | 8 +- ...CreateUrlRewriteForCustomStoreViewTest.xml | 8 +- ...oryUrlRewriteAndAddAspxRequestPathTest.xml | 2 +- ...CategoryUrlRewriteAndAddNoRedirectTest.xml | 2 +- ...yUrlRewriteAndAddPermanentRedirectTest.xml | 2 +- ...yUrlRewriteAndAddTemporaryRedirectTest.xml | 2 +- ...inUpdateCustomURLRewritesTemporaryTest.xml | 4 +- ...writesForProductInAnchorCategoriesTest.xml | 8 +- ...FixedTaxValSavedForSpecificWebsiteTest.xml | 8 +- ...inRemoveProductWeeeAttributeOptionTest.xml | 6 +- ...ddToCartWishListWithUnselectedAttrTest.xml | 2 +- ...tChildImageShouldBeShownOnWishListTest.xml | 12 +- ...uctsToCartFromWishlistUsingSidebarTest.xml | 4 +- ...teBundleDynamicProductFromWishlistTest.xml | 6 +- ...veProductsFromWishlistUsingSidebarTest.xml | 4 +- .../Test/WishListWithDisabledProductTest.xml | 4 +- 644 files changed, 6491 insertions(+), 4779 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddCategoryImageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddCrossSellProductBySkuActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductAttributeInProductModalActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductCustomOptionFieldActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductCustomOptionFileActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductImageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductWithQtyToCartFromStorefrontProductPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddRelatedProductBySkuActionGroup.xml rename app/code/Magento/Catalog/Test/Mftf/ActionGroup/{AddProductToCartActionGroup.xml => AddSimpleProductToCartActionGroup.xml} (80%) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddSpecialPriceToProductActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddToCartFromStorefrontProductPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddUpSellProductBySkuActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddAdvancedPricingToTheProductExtendedActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddUnassignedAttributeToGroupActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductCustomOptionVisibleActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductHasNoCustomOptionActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductHasNoCustomOptionsActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssignProductToCategoryActionGroup.xml delete mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryAssignProductActionGroup.xml rename app/code/Magento/Catalog/Test/Mftf/ActionGroup/{AdminCheckProductsInGridActionGroup.xml => AdminCheckProductIsMissingInCategoryProductsGridActionGroup.xml} (61%) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductPositionInCategoryProductsGridActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryButtonActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeFromProductPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeFromProductPageWithScopeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeWithSearchWeightActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeWithValueWithTwoStoreViesFromProductPageActionGroup.xml rename app/code/Magento/Catalog/Test/Mftf/ActionGroup/{AdminCreateWidgetActionGroup.xml => AdminCreateCatalogProductWidgetActionGroup.xml} (64%) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateRecentlyProductsWidgetActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateSearchableProductAttributeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateSimpleProductWithTextOptionCharLimitActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductCustomOptionsActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteCategoryByNameActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteProductCustomOptionActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductCountryOfManufactureActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProcessProductWebsitesActionGroup.xml delete mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAddSpecialPriceActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAdvancedPricingNewCustomerGroupPriceActionGroup.xml delete mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml delete mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageCreateAttributeSetWithAttributeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageFillTextAttributeValueByNameActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageSelectAttributeSetActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetProductDisabledActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSwitchScopeForProductAttributeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertDiscountsPercentageOfProductsActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductDescriptionInProductEditFormActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageAdminProductPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInAdminProductPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInStorefrontProductPage2ActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInStorefrontProductPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageStorefrontProductPage2ActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageStorefrontProductPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductIsAssignedToWebsiteActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductIsNotAssignedToWebsiteActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameAndSkuInStorefrontProductPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameInProductEditFormActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductOnCategoryPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertTextInAdminProductRelatedUpSellCrossSellSectionActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertWebsiteIsAvailableInProductWebsitesActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertWebsiteIsNotAvailableInProductWebsitesActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CategoryPresentActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeSeoUrlKeyActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeSeoUrlKeyForSubCategoryActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeStatusProductUsingProductGridActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeUseForPromoRuleConditionsProductAttributeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckAttributeInMoreInformationTabActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckAttributeNotInMoreInformationTabActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryImageInAdminActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryNameIsRequiredFieldActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryOnStorefrontActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCustomizableOptionImportActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckRequiredFieldsInProductFormActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ClearProductsFilterActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ConfirmChangeInputTypeModalActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateAttributeDropdownNthOptionActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateAttributeDropdownNthOptionAsDefaultActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateCategoryActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateCustomRadioOptionsActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateDefaultAttributeSetActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDateFieldActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithTextFieldActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateSimpleProductAndAddToWebsiteActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreatedProductConnectToWebsiteActionGroup.xml delete mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/CustomOptionsActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllDuplicateProductUsingProductGridActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllProductsUsingProductGridActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAttributeSetByLabelActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteCategoryActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteDefaultCategoryChildrenActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteMostRecentCategoryActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByLabelActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductByNameActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductBySkuActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductUsingProductGridActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductsByKeywordActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductsIfTheyExistActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ExpandAdminProductSectionActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillAdminSimpleProductFormActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillCategoryFormActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillCategoryNameAndUrlKeyAndSaveActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormByStringActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormNoWeightActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillNewProductCategoryActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillProductNameAndSkuInProductFormActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterAndSelectProductActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByAttributeCodeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByAttributeLabelActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByDefaultLabelActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeSetGridByAttributeSetNameActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByDisabledStatusActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByEnabledStatusActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByName2ActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByNameActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByPriceRangeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySetNewFromDateActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySku2ActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySkuActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySkuAndNameActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAdminCategoryPageByIdActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAttributeGridPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAttributeSetByNameActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToCreateCategoryPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToCreateProductPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToProductCatalogPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToProductPageViaIDActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSpecifiedCreateProductPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToStorefrontCategoryPageByParametersActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSubCategoryPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ImportProductCustomizableOptionsActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToAndResetProductAttributeGridToDefaultViewActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToAndResetProductGridToDefaultViewActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedCategoryActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductAttributeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductEditPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToEditProductAttributeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToMediaGalleryActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/OpenCategoryFromCategoryTreeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/OpenProductForEditByClickingRowXColumnYInProductGridActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetAdvancedPricingActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetAdvancedTierFixedPricingActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetWebsiteActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveCategoryFromProductActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveCategoryImageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveProductImageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveProductImageByNameActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ResetImportOptionFilterActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ResetProductGridToDefaultViewActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveAttributeSetActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveCategoryFormActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductAttributeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductAttributeInUseActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormNoSuccessCheckActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchForProductOnBackendByNameActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByKeyword2ActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByKeywordActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SelectProductInWebsitesActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetCategoryByNameActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetProductUrlKeyActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetProductUrlKeyByStringActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SortProductsByIdAscendingActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SortProductsByIdDescendingActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCompareActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddProductToCompareActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddSimpleProductWithQtyActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertActiveProductImageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertFotoramaImageAvailabilityActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInRecentlyComparedWidgetActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInRecentlyOrderedWidgetActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductPriceOnCategoryPageActionGroup.xml delete mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortAscendingActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortDescendingActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckAddToCartButtonAbsenceActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCategoryActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCategorySimpleProductActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCompareSidebarProductActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCompareSimpleProductActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductPositionActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckSimpleProductActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontClearCompareActionGroup.xml delete mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCompareActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontGoToSubCategoryPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenAndCheckComparisionActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenProductPageOnSecondStoreActionGroup.xml delete mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml delete mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontSwitchCategoryViewToListModeActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchCategoryStoreViewActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchCategoryToAllStoreViewActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchToTheNewStoreViewActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/TestDynamicValidationHintActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ToggleProductEnabledActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/UnassignAttributeFromGroupActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/UnassignWebsiteFromProductActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/VerifyCategoryPageParametersActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/ViewProductInAdminGridActionGroup.xml diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsChart.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsChart.xml index f48c7752efc7a..dde24d9f1c602 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsChart.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsChart.xml @@ -54,7 +54,7 @@ <comment userInput="Add product to the shopping cart" stepKey="addProductToCart"/> <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createProduct.name$$"/> </actionGroup> <!--Go to Checkout--> diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml index 8f0ce4918b978..5d52fe26d39e0 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml @@ -95,7 +95,7 @@ <!--Adding Special price to product--> <amOnPage url="{{AdminProductEditPage.url($$simpleProduct.id$$)}}" stepKey="openAdminProductEditPage"/> <actionGroup ref="AddSpecialPriceToProductActionGroup" stepKey="addSpecialPrice"/> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <!--Create New Order--> <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml index 401d360a34c64..c494f29f1a604 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml @@ -51,11 +51,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct0$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> @@ -91,7 +91,7 @@ <waitForPageLoad stepKey="WaitForPageToLoad"/> <conditionalClick selector="{{AdminProductFiltersSection.filtersClear}}" dependentSelector="{{AdminProductFiltersSection.filtersClear}}" visible="true" stepKey="ClickOnButtonToRemoveFiltersIfPresent"/> <waitForPageLoad stepKey="WaitForClear"/> - <actionGroup ref="filterProductGridByName" stepKey="filterBundleProductOptionsDownToName"> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName"> <argument name="product" value="BundleProduct"/> </actionGroup> <click selector="{{AdminProductFormBundleSection.addOptions}}" stepKey="clickOnBundleProductToEdit"/> @@ -103,11 +103,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToNewBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToNewOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterNewBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterNewBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterNewBundleProductOptions"> <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="filterProductGridBySku" stepKey="filterNewBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterNewBundleProductOptions2"> <argument name="product" value="$$simpleProduct3$$"/> </actionGroup> <checkOption selector="{{AdminProductFormBundleSection.firstProductOption}}" stepKey="selectNewFirstGridRow2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleProductToCartFromWishListPageTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleProductToCartFromWishListPageTest.xml index 2a4b119a5cabc..b2d3c376d9b5a 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleProductToCartFromWishListPageTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleProductToCartFromWishListPageTest.xml @@ -51,7 +51,7 @@ <requiredEntity createDataKey="createSimpleProduct2"/> </createData> <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="goToProductEditPage"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> </before> <after> <!-- Delete created data --> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml index 21e6be98b3169..3770e47079c98 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml @@ -32,11 +32,11 @@ <!-- Create a bundle product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/> <waitForPageLoad stepKey="waitForProductPageLoadBundle"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateBundleProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillBundleProductNameAndSku"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillBundleProductNameAndSku"> <argument name="product" value="BundleProduct"/> </actionGroup> @@ -51,11 +51,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> @@ -64,23 +64,23 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> <!--Save product--> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="assertProductImageAdminProductPage" stepKey="assertProductImageAdminProductPage"/> + <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="BundleProduct"/> </actionGroup> <!-- Assert product image in storefront product page --> - <actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertProductImageStorefrontProductPage"> + <actionGroup ref="AssertProductImageStorefrontProductPageActionGroup" stepKey="assertProductImageStorefrontProductPage"> <argument name="product" value="BundleProduct"/> <argument name="image" value="MagentoLogo"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultVideoBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultVideoBundleProductTest.xml index c49202f31aefb..66443e130ed08 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultVideoBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultVideoBundleProductTest.xml @@ -29,10 +29,10 @@ <!-- Create a bundle product --> <!-- Replacing steps in base AdminAddDefaultVideoSimpleProductTest --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillMainProductForm"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="BundleProduct"/> </actionGroup> @@ -46,11 +46,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProducts" after="selectOptionBundleTitle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProducts" after="waitForAddProducts"/> <waitForPageLoad stepKey="waitForPageLoad" after="clickAddProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku1" after="waitForPageLoad"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku1" after="waitForPageLoad"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="checkOption1" after="filterProductGridBySku1"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku2" after="checkOption1"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku2" after="checkOption1"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="checkOption2" after="filterProductGridBySku2"/> @@ -59,7 +59,7 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillQty2" before="saveProductForm"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="BundleProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAssociateBundleProductToWebsitesTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAssociateBundleProductToWebsitesTest.xml index 505a319c5c44f..b58637cf2e81d 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAssociateBundleProductToWebsitesTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAssociateBundleProductToWebsitesTest.xml @@ -79,14 +79,14 @@ <argument name="websiteName" value="{{secondCustomWebsite.name}}"/> </actionGroup> - <actionGroup ref="NavigateToAndResetProductGridToDefaultView" stepKey="resetProductGridFilter"/> + <actionGroup ref="NavigateToAndResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridFilter"/> <!-- Admin logout --> <actionGroup ref="logout" stepKey="adminLogout"/> </after> <!-- Open product page and assign grouped project to second website --> - <actionGroup ref="filterAndSelectProduct" stepKey="openAdminProductPage"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openAdminProductPage"> <argument name="productSku" value="$$createBundleProduct.sku$$"/> </actionGroup> <actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="assignProductToSecondWebsite"> @@ -95,15 +95,15 @@ <actionGroup ref="AdminUnassignProductInWebsiteActionGroup" stepKey="unassignProductFromDefaultWebsite"> <argument name="website" value="{{_defaultWebsite.name}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveGroupedProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveGroupedProduct"/> <!-- Assert product is assigned to Second website --> - <actionGroup ref="AssertProductIsAssignedToWebsite" stepKey="seeCustomWebsiteIsChecked"> + <actionGroup ref="AssertProductIsAssignedToWebsiteActionGroup" stepKey="seeCustomWebsiteIsChecked"> <argument name="website" value="{{secondCustomWebsite.name}}"/> </actionGroup> <!-- Assert product is not assigned to Main website --> - <actionGroup ref="AssertProductIsNotAssignedToWebsite" stepKey="seeMainWebsiteIsNotChecked"> + <actionGroup ref="AssertProductIsNotAssignedToWebsiteActionGroup" stepKey="seeMainWebsiteIsNotChecked"> <argument name="website" value="{{_defaultWebsite.name}}"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml index 1d2f21b7d15f9..c8977cbae1957 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAttributeSetSelectionTest.xml @@ -56,7 +56,7 @@ <!--Set filter to product name--> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/> <waitForPageLoad stepKey="WaitForPageToLoad"/> - <actionGroup ref="filterProductGridByName" stepKey="filterBundleProductOptionsDownToName"> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName"> <argument name="product" value="BundleProduct"/> </actionGroup> <seeElement selector="{{AdminProductFiltersSection.attributeSetOfFirstRow(ProductAttributeFrontendLabel.label)}}" stepKey="seeAttributeSet"/> @@ -77,7 +77,7 @@ <!--Set filter to product name--> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage2"/> <waitForPageLoad stepKey="WaitForPageToLoad2"/> - <actionGroup ref="filterProductGridByName" stepKey="filterBundleProductOptionsDownToName2"> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName2"> <argument name="product" value="BundleProduct"/> </actionGroup> <seeElement selector="{{AdminProductFiltersSection.attributeSetOfFirstRow(BundleProduct.defaultAttribute)}}" stepKey="seeAttributeSet2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml index c6a07f7ed95c3..fcfd80ac8533c 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml @@ -24,7 +24,7 @@ <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> </after> <!--Create attribute set--> - <actionGroup ref="CreateDefaultAttributeSet" stepKey="createDefaultAttributeSet"> + <actionGroup ref="CreateDefaultAttributeSetActionGroup" stepKey="createDefaultAttributeSet"> <argument name="label" value="{{ProductAttributeFrontendLabel.label}}"/> </actionGroup> @@ -91,14 +91,14 @@ <seeOptionIsSelected selector="{{AdminProductFormBundleSection.countryOfManufactureDropDown}}" userInput="Italy" stepKey="seeCountryOfManufacture"/> <!--Create second attribute set for edit--> - <actionGroup ref="CreateDefaultAttributeSet" stepKey="createSecondAttributeSet"> + <actionGroup ref="CreateDefaultAttributeSetActionGroup" stepKey="createSecondAttributeSet"> <argument name="label" value="{{ProductAttributeFrontendLabelTwo.label}}"/> </actionGroup> <!--Filter catalog--> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPage"/> <waitForPageLoad stepKey="WaitForPageToLoad"/> - <actionGroup ref="filterProductGridByName" stepKey="filterBundleProductOptionsDownToName"> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName"> <argument name="product" value="BundleProduct"/> </actionGroup> <click selector="{{AdminProductFiltersSection.attributeSetOfFirstRow(ProductAttributeFrontendLabel.label)}}" stepKey="clickAttributeSet2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminBundleProductSetEditContentTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBundleProductSetEditContentTest.xml index 65733a5bcc037..788dc4a848fd3 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminBundleProductSetEditContentTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBundleProductSetEditContentTest.xml @@ -21,16 +21,16 @@ </annotations> <after> <!-- Delete bundle product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> </after> <!-- Create product --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="BundleProduct"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml index 42584a31651d7..9d5b1be6fae04 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminCreateAndEditBundleProductSettingsTest.xml @@ -42,7 +42,7 @@ </after> <!-- Create new bundle product --> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createBundleProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createBundleProduct"> <argument name="productType" value="bundle"/> </actionGroup> @@ -75,7 +75,7 @@ </actionGroup> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveButton"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveButton"/> <!-- Open product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> @@ -101,7 +101,7 @@ </actionGroup> <!-- Assert product in assigned to Website --> - <actionGroup ref="AssertProductIsAssignedToWebsite" stepKey="seeCustomWebsiteIsChecked"> + <actionGroup ref="AssertProductIsAssignedToWebsiteActionGroup" stepKey="seeCustomWebsiteIsChecked"> <argument name="website" value="$createWebsite.website[name]$"/> </actionGroup> @@ -122,7 +122,7 @@ <actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="disableGiftMessageSettings"/> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveProduct"/> <!-- Verify Url Key after changing --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> @@ -137,7 +137,7 @@ <dontSeeElement selector="{{StorefrontProductCartGiftOptionSection.giftOptions}}" stepKey="dontSeeGiftOptionBtn"/> <!-- Delete created bundle product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> </test> @@ -184,7 +184,7 @@ </after> <!-- Create new bundle product --> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createBundleProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createBundleProduct"> <argument name="productType" value="bundle"/> </actionGroup> @@ -227,7 +227,7 @@ </actionGroup> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="saveWithThreeOptions"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveWithThreeOptions"/> <!-- Open created product --> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct"> @@ -243,12 +243,12 @@ </actionGroup> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveProduct"/> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveWithTwoOptions"/> <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="messageYouSavedTheProductIsShown"/> <!-- Delete created bundle product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProduct.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProduct.xml index 86db6f372b5f8..e0558177e4c3e 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProduct.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProduct.xml @@ -40,11 +40,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> @@ -64,7 +64,7 @@ <waitForPageLoad stepKey="Loading"/> <!--Apply Name Filter--> - <actionGroup ref="filterProductGridByName" stepKey="filterBundleProductOptionsDownToName"> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName"> <argument name="product" value="BundleProduct"/> </actionGroup> <click selector="{{AdminProductFiltersSection.allCheckbox}}" stepKey="SelectAllOnly1"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml index a4e26256e9773..51821b136ba26 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml @@ -31,7 +31,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteBundleProductFilteredBySkuAndName"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteBundleProductFilteredBySkuAndName"> <argument name="product" value="$$createDynamicBundleProduct$$"/> </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml index 2527dae7eadf8..dcd53fff6f6dd 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml @@ -28,7 +28,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteBundleProductFilteredBySkuAndName"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteBundleProductFilteredBySkuAndName"> <argument name="product" value="$$createFixedBundleProduct$$"/> </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminEditRelatedBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminEditRelatedBundleProductTest.xml index 08faa9d2444df..632ba194cf8de 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminEditRelatedBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminEditRelatedBundleProductTest.xml @@ -26,7 +26,7 @@ </before> <after> <!-- Delete the bundled product --> - <actionGroup stepKey="deleteBundle" ref="deleteProductUsingProductGrid"> + <actionGroup stepKey="deleteBundle" ref="DeleteProductUsingProductGridActionGroup"> <argument name="product" value="BundleProduct"/> </actionGroup> <!--Logging out--> @@ -38,15 +38,15 @@ <!-- Create a bundle product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/> <waitForPageLoad stepKey="waitForProductPageLoadBundle"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateBundleProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillBundleProductNameAndSku"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillBundleProductNameAndSku"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct0"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct0"> <argument name="sku" value="$$simpleProduct0.sku$$"/> </actionGroup> @@ -54,7 +54,7 @@ <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown"/> - <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct1"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct1"> <argument name="sku" value="$$simpleProduct1.sku$$"/> </actionGroup> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProduct.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProduct.xml index 40a6e1b75c60a..ff5c909077e47 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProduct.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProduct.xml @@ -40,11 +40,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProducts.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProducts.xml index 2f891fcc8f169..1cad591d257d3 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProducts.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProducts.xml @@ -48,11 +48,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> @@ -83,11 +83,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle2"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption2"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts2"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptionsx2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptionsx2"> <argument name="product" value="$$simpleProduct3$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRowx2"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions22"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions22"> <argument name="product" value="$$simpleProduct4$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow22"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml index 1f46e1fc9f0b1..ea3b671417fb6 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml @@ -32,7 +32,7 @@ <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> <deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndexPage"/> - <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteAllProducts"/> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- go to bundle product creation page--> @@ -48,11 +48,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultImageBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultImageBundleProductTest.xml index 730df90b31be6..77be5b879b1c6 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultImageBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultImageBundleProductTest.xml @@ -25,7 +25,7 @@ </before> <after> <!-- Delete the bundled product we created in the test body --> - <actionGroup ref="deleteProductBySku" stepKey="deleteBundleProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteBundleProduct"> <argument name="sku" value="{{BundleProduct.sku}}"/> </actionGroup> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> @@ -36,11 +36,11 @@ <!-- Create a bundle product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/> <waitForPageLoad stepKey="waitForProductPageLoadBundle"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateBundleProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillBundleProductNameAndSku"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillBundleProductNameAndSku"> <argument name="product" value="BundleProduct"/> </actionGroup> @@ -55,11 +55,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> @@ -68,27 +68,27 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> <!--Save product--> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Remove image from product --> - <actionGroup ref="removeProductImage" stepKey="removeProductImage"/> + <actionGroup ref="RemoveProductImageActionGroup" stepKey="removeProductImage"/> - <actionGroup ref="saveProductForm" stepKey="saveProductFormAfterRemove"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductFormAfterRemove"/> <!-- Assert product image not in admin product form --> - <actionGroup ref="assertProductImageNotInAdminProductPage" stepKey="assertProductImageNotInAdminProductPage"/> + <actionGroup ref="AssertProductImageNotInAdminProductPageActionGroup" stepKey="assertProductImageNotInAdminProductPage"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPageAfterRemove"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPageAfterRemove"> <argument name="product" value="BundleProduct"/> </actionGroup> <!-- Assert product image not in storefront product page --> - <actionGroup ref="assertProductImageNotInStorefrontProductPage" stepKey="assertProductImageNotInStorefrontProductPage"> + <actionGroup ref="AssertProductImageNotInStorefrontProductPageActionGroup" stepKey="assertProductImageNotInStorefrontProductPage"> <argument name="product" value="BundleProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultVideoBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultVideoBundleProductTest.xml index d050c5443d1fe..0de9f4ee75a4d 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultVideoBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultVideoBundleProductTest.xml @@ -29,10 +29,10 @@ <!-- Create a bundle product --> <!-- Replacing steps in base AdminRemoveDefaultVideoSimpleProductTest --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillMainProductForm"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="BundleProduct"/> </actionGroup> @@ -46,11 +46,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProducts" after="selectOptionBundleTitle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProducts" after="waitForAddProducts"/> <waitForPageLoad stepKey="waitForPageLoad" after="clickAddProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku1" after="waitForPageLoad"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku1" after="waitForPageLoad"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="checkOption1" after="filterProductGridBySku1"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku2" after="checkOption1"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku2" after="checkOption1"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="checkOption2" after="filterProductGridBySku2"/> @@ -59,7 +59,7 @@ <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillQty2" before="saveProductForm"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="BundleProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminShouldBeAbleToMassUpdateAttributesForBundleProductsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminShouldBeAbleToMassUpdateAttributesForBundleProductsTest.xml index fe55fda4d0e05..994a10ae02692 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminShouldBeAbleToMassUpdateAttributesForBundleProductsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminShouldBeAbleToMassUpdateAttributesForBundleProductsTest.xml @@ -59,17 +59,17 @@ <magentoCLI command="cron:run" stepKey="cronRun"/> <magentoCLI command="cron:run" stepKey="cronRunTwice"/> <!-- Search for a product with a new name and Open Product --> - <actionGroup ref="filterProductGridByName" stepKey="searchWithNewProductName"> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="searchWithNewProductName"> <argument name="product" value="UpdateAttributeNameAndDescription"/> </actionGroup> <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openProductPage"> <argument name="product" value="$$createFixedBundleProduct$$"/> </actionGroup> <!-- Assert product name and description --> - <actionGroup ref="AssertProductNameInProductEditForm" stepKey="assertProductName"> + <actionGroup ref="AssertProductNameInProductEditFormActionGroup" stepKey="assertProductName"> <argument name="productName" value="{{UpdateAttributeNameAndDescription.name}}"/> </actionGroup> - <actionGroup ref="AssertProductDescriptionInProductEditForm" stepKey="assertProductDescription"> + <actionGroup ref="AssertProductDescriptionInProductEditFormActionGroup" stepKey="assertProductDescription"> <argument name="productDescription" value="{{UpdateAttributeNameAndDescription.description}}"/> </actionGroup> </test> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml index c922b981aecd9..2259e91deb2b4 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml @@ -32,7 +32,7 @@ <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> <deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/> <!-- Delete the bundled product we created in the test body --> - <actionGroup ref="deleteProductBySku" stepKey="deleteBundleProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteBundleProduct"> <argument name="sku" value="{{BundleProduct.sku}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -50,11 +50,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> @@ -82,7 +82,7 @@ <waitForPageLoad stepKey="WaitForPageToLoad"/> <conditionalClick selector="{{AdminProductFiltersSection.filtersClear}}" dependentSelector="{{AdminProductFiltersSection.filtersClear}}" visible="true" stepKey="ClickOnButtonToRemoveFiltersIfPresent"/> <waitForPageLoad stepKey="WaitForClear"/> - <actionGroup ref="filterProductGridByName" stepKey="filterBundleProductOptionsDownToName"> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName"> <argument name="product" value="BundleProduct"/> </actionGroup> <seeElement selector="{{AdminProductFiltersSection.priceOfFirstRow(BundleProduct.fixedPrice)}}" stepKey="seePrice"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml index 46c6114637af6..a27d5a832ed21 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml @@ -26,7 +26,7 @@ <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> <deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/> <actionGroup ref="StorefrontSignOutActionGroup" stepKey="StorefrontSignOutActionGroup"/> - <actionGroup stepKey="deleteBundle" ref="deleteProductUsingProductGrid"> + <actionGroup stepKey="deleteBundle" ref="DeleteProductUsingProductGridActionGroup"> <argument name="product" value="BundleProduct"/> </actionGroup> <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearFiltersAfter"/> @@ -55,7 +55,7 @@ <argument name="inputType" value="checkbox"/> </actionGroup> <scrollToTopOfPage stepKey="scrollTopPageProduct"/> - <actionGroup ref="ProductSetAdvancedPricing" stepKey="addTierPriceProduct"> + <actionGroup ref="ProductSetAdvancedPricingActionGroup" stepKey="addTierPriceProduct"> <argument name="group" value="ALL GROUPS"/> <argument name="quantity" value="1"/> <argument name="price" value="Discount"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml index ded8bb3c83337..915ccbf2cac09 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml @@ -24,7 +24,7 @@ </before> <after> <!-- Delete the bundled product --> - <actionGroup stepKey="deleteBundle" ref="deleteProductUsingProductGrid"> + <actionGroup stepKey="deleteBundle" ref="DeleteProductUsingProductGridActionGroup"> <argument name="product" value="BundleProduct"/> </actionGroup> <actionGroup ref="AdminClearFiltersActionGroup" stepKey="ClearFiltersAfter"/> @@ -58,7 +58,7 @@ </actionGroup> <checkOption selector="{{AdminProductFormBundleSection.userDefinedQuantity('0', '0')}}" stepKey="userDefinedQuantitiyOptionProduct0"/> <checkOption selector="{{AdminProductFormBundleSection.userDefinedQuantity('0', '1')}}" stepKey="userDefinedQuantitiyOptionProduct1"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <amOnPage url="{{ConfigCurrencySetupPage.url}}" stepKey="navigateToConfigCurrencySetupPage"/> <waitForPageLoad stepKey="waitForConfigCurrencySetupPage"/> <conditionalClick selector="{{CurrencySetupSection.currencyOptions}}" dependentSelector="{{CurrencySetupSection.allowCurrencies}}" visible="false" stepKey="openOptions"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml index 0cfd1f99a8ce0..1e16a82ed8714 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml @@ -46,11 +46,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> @@ -77,7 +77,7 @@ <!--Testing disabled view--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="GoToProductCatalog"/> <waitForPageLoad stepKey="WaitForCatalogProductPageToLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="FindProductEditPage"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="FindProductEditPage"> <argument name="product" value="BundleProduct"/> </actionGroup> <click selector="{{AdminDataGridTableSection.rowViewAction('1')}}" stepKey="ClickProductInGrid"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/EndToEndB2CAdminTest.xml index 9040d675be34f..5f7a1827a6156 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -11,7 +11,7 @@ <!--Create Bundle Product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle" after="seeSimpleProductInGrid"/> <waitForPageLoad stepKey="waitForProductPageLoadBundle" after="visitAdminProductPageBundle"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateBundleProduct" after="waitForProductPageLoadBundle"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct" after="waitForProductPageLoadBundle"> <argument name="product" value="BundleProduct"/> </actionGroup> @@ -24,20 +24,20 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle" after="selectInputType"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption" after="waitForAddProductsToBundle"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts" after="clickAddProductsToOption"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions" after="waitForPageLoadAfterBundleProducts"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions" after="waitForPageLoadAfterBundleProducts"> <argument name="product" value="SimpleProduct"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" 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="saveProductForm" stepKey="saveBundleProduct" after="fillProductDefaultQty"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveBundleProduct" after="fillProductDefaultQty"/> <actionGroup ref="viewBundleProductInAdminGrid" stepKey="viewBundleProductInGrid" after="saveBundleProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> <!--@TODO Move cleanup to "after" when MQE-830 is resolved--> <comment userInput="Clean up bundle product" stepKey="cleanUpBundleProduct" after="deleteSimpleProduct"/> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteBundleProduct" after="cleanUpBundleProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteBundleProduct" after="cleanUpBundleProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml index ff192538637ef..b689587bcd8eb 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml @@ -48,11 +48,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> @@ -80,11 +80,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle2"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption2"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts2"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptionsx2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptionsx2"> <argument name="product" value="$$simpleProduct3$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRowx2"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions22"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions22"> <argument name="product" value="$$simpleProduct4$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow22"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/NewBundleProductSelectionTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/NewBundleProductSelectionTest.xml index e0a6a9afd648e..2b948ff02d38c 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/NewBundleProductSelectionTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/NewBundleProductSelectionTest.xml @@ -27,7 +27,7 @@ <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/> <waitForPageLoad stepKey="WaitForPageToLoad"/> <!--Selecting new bundle product--> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateBundleProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> <!--Testing if on the bundle product creation page--> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/NewProductsListWidgetBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/NewProductsListWidgetBundleProductTest.xml index 8efe32a7d84c0..27369d38f0c35 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/NewProductsListWidgetBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/NewProductsListWidgetBundleProductTest.xml @@ -52,11 +52,11 @@ <selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="checkbox" stepKey="selectInputType"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleOptionsToCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleOptionsToCartTest.xml index a1630128638d9..810f84baed906 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleOptionsToCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAddBundleOptionsToCartTest.xml @@ -43,7 +43,7 @@ <deleteData createDataKey="simpleProduct9" stepKey="deleteSimpleProduct9"/> <deleteData createDataKey="simpleProduct10" stepKey="deleteSimpleProduct10"/> <!--delete created bundle product--> - <actionGroup stepKey="deleteProduct1" ref="deleteProductBySku"> + <actionGroup stepKey="deleteProduct1" ref="DeleteProductBySkuActionGroup"> <argument name="sku" value="{{BundleProduct.sku}}"/> </actionGroup> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" @@ -54,10 +54,10 @@ <!-- Start creating a bundle product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> <waitForPageLoad stepKey="waitForProductList"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillNameAndSku"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillNameAndSku"> <argument name="product" value="BundleProduct"/> </actionGroup> @@ -97,7 +97,7 @@ </actionGroup> <!-- Save product--> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Go to Storefront and open Bundle Product page--> <amOnPage url="{{BundleProduct.sku}}.html" stepKey="goToStorefront"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml index 40132ea956584..75e1fa5d7cd4d 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml @@ -32,11 +32,11 @@ <!-- Create a bundle product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/> <waitForPageLoad stepKey="waitForProductPageLoadBundle"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateBundleProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillBundleProductNameAndSku"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillBundleProductNameAndSku"> <argument name="product" value="BundleProduct"/> </actionGroup> @@ -50,11 +50,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> @@ -87,7 +87,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> <waitForPageLoad stepKey="waitForProductFilterLoad"/> @@ -106,7 +106,7 @@ <assertNotEquals expected="{$grabTotalBefore}" expectedType="string" actual="{$grabTotalAfter}" actualType="string" stepKey="assertNotEquals"/> <!-- Delete the bundled product --> - <actionGroup stepKey="deleteBundle" ref="deleteProductUsingProductGrid"> + <actionGroup stepKey="deleteBundle" ref="DeleteProductUsingProductGridActionGroup"> <argument name="product" value="BundleProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleCartTest.xml index 695c3a8bf7dbb..9d1008875e57f 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleCartTest.xml @@ -32,10 +32,10 @@ <!-- Start creating a bundle product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> <waitForPageLoad stepKey="waitForProductList"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillNameAndSku"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillNameAndSku"> <argument name="product" value="BundleProduct"/> </actionGroup> @@ -80,7 +80,7 @@ </actionGroup> <!-- Save product and go to storefront --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <amOnPage url="{{BundleProduct.sku}}.html" stepKey="goToStorefront"/> <waitForPageLoad stepKey="waitForStorefront"/> <click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomize"/> @@ -149,10 +149,10 @@ <!-- Start creating a bundle product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> <waitForPageLoad stepKey="waitForProductList"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillNameAndSku"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillNameAndSku"> <argument name="product" value="BundleProduct"/> </actionGroup> @@ -197,7 +197,7 @@ </actionGroup> <!-- Save product and go to storefront --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <amOnPage url="{{BundleProduct.sku}}.html" stepKey="goToStorefront"/> <waitForPageLoad stepKey="waitForStorefront"/> <click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomize"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml index d7394b2dbf32e..35f3cb527628b 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> <deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndexPage"/> - <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteAllProducts"/> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- go to bundle product creation page--> @@ -55,11 +55,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGrid.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGrid.xml index 88db5b64fa42d..ff25b3f1407c4 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGrid.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGrid.xml @@ -37,7 +37,7 @@ <!--Make category--> <amOnPage url="{{AdminCategoryPage.url}}" stepKey="goToCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> - <actionGroup ref="CreateCategory" stepKey="createASubcategory"> + <actionGroup ref="CreateCategoryActionGroup" stepKey="createASubcategory"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> @@ -59,11 +59,11 @@ <selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/> <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductOptionTierPrices.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductOptionTierPrices.xml index 532af1ea76dca..0487668c10094 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductOptionTierPrices.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCheckBundleProductOptionTierPrices.xml @@ -28,7 +28,7 @@ <!-- Simple product 1 --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <amOnPage url="{{AdminProductEditPage.url($$simpleProduct1CreateBundleProduct.id$$)}}" stepKey="openAdminEditPageProduct1"/> - <actionGroup ref="ProductSetAdvancedPricing" stepKey="addTierPriceProduct1"> + <actionGroup ref="ProductSetAdvancedPricingActionGroup" stepKey="addTierPriceProduct1"> <argument name="group" value="ALL GROUPS"/> <argument name="quantity" value="5"/> <argument name="price" value="Discount"/> @@ -36,7 +36,7 @@ </actionGroup> <!-- Simple product 2 --> <amOnPage url="{{AdminProductEditPage.url($$simpleProduct2CreateBundleProduct.id$$)}}" stepKey="openAdminEditPageProduct2"/> - <actionGroup ref="ProductSetAdvancedPricing" stepKey="addTierPriceProduct2"> + <actionGroup ref="ProductSetAdvancedPricingActionGroup" stepKey="addTierPriceProduct2"> <argument name="group" value="ALL GROUPS"/> <argument name="quantity" value="7"/> <argument name="price" value="Discount"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml index 5e6e891541420..9998e202fce24 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSelectAndSetBundleOptionsTest.xml @@ -25,7 +25,7 @@ </before> <after> <!-- Delete the bundled product --> - <actionGroup stepKey="deleteBundle" ref="deleteProductUsingProductGrid"> + <actionGroup stepKey="deleteBundle" ref="DeleteProductUsingProductGridActionGroup"> <argument name="product" value="BundleProduct"/> </actionGroup> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="logout"/> @@ -36,10 +36,10 @@ <!-- Start creating a bundle product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> <waitForPageLoad stepKey="waitForProductList"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillNameAndSku"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillNameAndSku"> <argument name="product" value="BundleProduct"/> </actionGroup> @@ -88,7 +88,7 @@ </actionGroup> <!-- Save product and go to storefront --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <amOnPage url="{{BundleProduct.sku}}.html" stepKey="goToStorefront"/> <waitForPageLoad stepKey="waitForStorefront"/> <click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomize"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml index 58806126aee30..0ac47a27f1f95 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml @@ -32,11 +32,11 @@ <!-- Create a bundle product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/> <waitForPageLoad stepKey="waitForProductPageLoadBundle"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateBundleProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateBundleProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillBundleProductNameAndSku"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillBundleProductNameAndSku"> <argument name="product" value="BundleProduct"/> </actionGroup> @@ -50,11 +50,11 @@ <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> @@ -116,7 +116,7 @@ <assertNotEquals expected="{$grabTotalBefore}" expectedType="string" actual="{$grabTotalAfter}" actualType="string" stepKey="assertNotEquals"/> <!-- Delete the bundled product --> - <actionGroup stepKey="deleteBundle" ref="deleteProductUsingProductGrid"> + <actionGroup stepKey="deleteBundle" ref="DeleteProductUsingProductGridActionGroup"> <argument name="product" value="BundleProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml index ccd6a58223b3c..8f47bd7962bea 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml @@ -48,11 +48,11 @@ <selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/> <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontSortBundleProductsByPriceTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontSortBundleProductsByPriceTest.xml index 18316e41241e4..8bf0de7530e64 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontSortBundleProductsByPriceTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontSortBundleProductsByPriceTest.xml @@ -156,7 +156,7 @@ </actionGroup> <!-- Switch category view to List mode --> - <actionGroup ref="StorefrontSwitchCategoryViewToListMode" stepKey="switchCategoryViewToListMode"/> + <actionGroup ref="StorefrontSwitchCategoryViewToListModeActionGroup" stepKey="switchCategoryViewToListMode"/> <!-- Sort products By Price --> <actionGroup ref="StorefrontCategoryPageSortProductActionGroup" stepKey="sortProductByPrice"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml index 31a5f9bab7758..c78796d2fd8b4 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontVerifyDynamicBundleProductPricesForCombinationOfOptionsTest.xml @@ -42,7 +42,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <amOnPage url="{{AdminProductEditPage.url($$simpleProduct5.id$$)}}" stepKey="openAdminEditPage"/> <actionGroup ref="AddSpecialPriceToProductActionGroup" stepKey="addSpecialPrice"/> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <!--Create Bundle product--> <createData entity="ApiBundleProductPriceViewRange" stepKey="createBundleProduct"> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddCategoryImageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddCategoryImageActionGroup.xml new file mode 100644 index 0000000000000..5837891667cc9 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddCategoryImageActionGroup.xml @@ -0,0 +1,31 @@ +<?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="AddCategoryImageActionGroup"> + <annotations> + <description>Requires navigation to the Category creation/edit page. Adds the provided image to a Category. Validates that the Image exists.</description> + </annotations> + <arguments> + <argument name="image" defaultValue="ProductImage"/> + </arguments> + + <conditionalClick selector="{{AdminCategoryContentSection.sectionHeader}}" dependentSelector="{{AdminCategoryContentSection.uploadButton}}" visible="false" stepKey="openContentSection"/> + <waitForPageLoad time="30" stepKey="waitForPageLoad"/> + <waitForElementVisible selector="{{AdminCategoryContentSection.uploadButton}}" stepKey="seeImageSectionIsReady"/> + <attachFile selector="{{AdminCategoryContentSection.uploadImageFile}}" userInput="{{image.file}}" stepKey="uploadFile"/> + <waitForAjaxLoad time="30" stepKey="waitForAjaxUpload"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoading"/> + <grabTextFrom selector="{{AdminCategoryContentSection.imageFileName}}" stepKey="grabCategoryFileName"/> + <assertRegExp stepKey="assertEquals" message="pass"> + <expectedResult type="string">/magento-logo(_[0-9]+)*?\.png$/</expectedResult> + <actualResult type="variable">grabCategoryFileName</actualResult> + </assertRegExp> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddCrossSellProductBySkuActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddCrossSellProductBySkuActionGroup.xml new file mode 100644 index 0000000000000..bf238a0b88417 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddCrossSellProductBySkuActionGroup.xml @@ -0,0 +1,32 @@ +<?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="AddCrossSellProductBySkuActionGroup"> + <annotations> + <description>Adds the provided Product SKU as a Cross Sell Product on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="sku"/> + </arguments> + + <!--Scroll up to avoid error--> + <scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" x="0" y="-100" stepKey="scrollTo"/> + <conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedUpSellCrossSell"/> + <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddCrossSellProductsButton}}" stepKey="clickAddCrossSellButton"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <click selector="{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectProduct"/> + <click selector="{{AdminProductCrossSellModalSection.addSelectedProducts}}" stepKey="addRelatedProductSelected"/> + <waitForPageLoad stepKey="waitForModalDisappear"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductAttributeInProductModalActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductAttributeInProductModalActionGroup.xml new file mode 100644 index 0000000000000..0b8721c589706 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductAttributeInProductModalActionGroup.xml @@ -0,0 +1,28 @@ +<?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="AddProductAttributeInProductModalActionGroup"> + <annotations> + <description>Adds the provided Attribute Code to the Product on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="attributeCode" type="string"/> + </arguments> + + <click stepKey="addAttribute" selector="{{AdminProductFormActionSection.addAttributeButton}}"/> + <conditionalClick selector="{{AdminProductAddAttributeModalSection.clearFilters}}" dependentSelector="{{AdminProductAddAttributeModalSection.clearFilters}}" visible="true" stepKey="clearFilters"/> + <click stepKey="clickFilters" selector="{{AdminProductAddAttributeModalSection.filters}}"/> + <fillField stepKey="fillCode" selector="{{AdminProductAddAttributeModalSection.attributeCodeFilter}}" userInput="{{attributeCode}}"/> + <click stepKey="clickApply" selector="{{AdminProductAddAttributeModalSection.applyFilters}}"/> + <waitForPageLoad stepKey="waitForFilters"/> + <checkOption selector="{{AdminProductAddAttributeModalSection.firstRowCheckBox}}" stepKey="checkAttribute"/> + <click stepKey="addSelected" selector="{{AdminProductAddAttributeModalSection.addSelected}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductCustomOptionFieldActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductCustomOptionFieldActionGroup.xml new file mode 100644 index 0000000000000..784a30de3d3c0 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductCustomOptionFieldActionGroup.xml @@ -0,0 +1,31 @@ +<?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="AddProductCustomOptionFieldActionGroup"> + <annotations> + <description>Add a custom Field Product Option to a Product based on the provided Option.</description> + </annotations> + <arguments> + <argument name="option" defaultValue="ProductOptionField"/> + </arguments> + + <scrollTo selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="scrollToAddButtonOption"/> + <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/> + <click selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" stepKey="clickAddOption"/> + <waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" stepKey="waitForOption"/> + <fillField selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" userInput="{{option.title}}" stepKey="fillTitle"/> + <click selector="{{AdminProductCustomizableOptionsSection.lastOptionTypeParent}}" stepKey="openTypeSelect"/> + <click selector="{{AdminProductCustomizableOptionsSection.optionType('Field')}}" stepKey="selectTypeFile"/> + <waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.optionPriceByTitle(option.title)}}" stepKey="waitForElements"/> + <fillField selector="{{AdminProductCustomizableOptionsSection.optionPriceByTitle(option.title)}}" userInput="{{option.price}}" stepKey="fillPrice"/> + <selectOption selector="{{AdminProductCustomizableOptionsSection.optionPriceTypeByTitle(option.title)}}" userInput="{{option.price_type}}" stepKey="selectPriceType"/> + <fillField selector="{{AdminProductCustomizableOptionsSection.optionSkuByTitle(option.title)}}" userInput="{{option.title}}" stepKey="fillSku"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductCustomOptionFileActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductCustomOptionFileActionGroup.xml new file mode 100644 index 0000000000000..961493d06f494 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductCustomOptionFileActionGroup.xml @@ -0,0 +1,30 @@ +<?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="AddProductCustomOptionFileActionGroup"> + <annotations> + <description>Add a custom File Product Option to a Product based on the provided File.</description> + </annotations> + <arguments> + <argument name="option" defaultValue="ProductOptionFile"/> + </arguments> + + <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/> + <click selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" stepKey="clickAddOption"/> + <waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" stepKey="waitForOption"/> + <fillField selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" userInput="{{option.title}}" stepKey="fillTitle"/> + <click selector="{{AdminProductCustomizableOptionsSection.lastOptionTypeParent}}" stepKey="openTypeSelect"/> + <click selector="{{AdminProductCustomizableOptionsSection.optionType('File')}}" stepKey="selectTypeFile"/> + <waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.optionPriceByTitle(option.title)}}" stepKey="waitForElements"/> + <fillField selector="{{AdminProductCustomizableOptionsSection.optionPriceByTitle(option.title)}}" userInput="{{option.price}}" stepKey="fillPrice"/> + <selectOption selector="{{AdminProductCustomizableOptionsSection.optionPriceTypeByTitle(option.title)}}" userInput="{{option.price_type}}" stepKey="selectPriceType"/> + <fillField selector="{{AdminProductCustomizableOptionsSection.optionFileExtensionByTitle(option.title)}}" userInput="{{option.file_extension}}" stepKey="fillCompatibleExtensions"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductImageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductImageActionGroup.xml new file mode 100644 index 0000000000000..2efeca44003b3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductImageActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AddProductImageActionGroup"> + <annotations> + <description>Adds the provided Product Image on the Admin Products creation/edit page.</description> + </annotations> + <arguments> + <argument name="image" defaultValue="ProductImage"/> + </arguments> + + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/> + <waitForPageLoad time="30" stepKey="waitForPageRefresh"/> + <waitForElementVisible selector="{{AdminProductImagesSection.imageUploadButton}}" stepKey="seeImageSectionIsReady"/> + <attachFile selector="{{AdminProductImagesSection.imageFileUpload}}" userInput="{{image.file}}" stepKey="uploadFile"/> + <waitForElementNotVisible selector="{{AdminProductImagesSection.uploadProgressBar}}" stepKey="waitForUpload"/> + <waitForElementVisible selector="{{AdminProductImagesSection.imageFile(image.fileName)}}" stepKey="waitForThumbnail"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductWithQtyToCartFromStorefrontProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductWithQtyToCartFromStorefrontProductPageActionGroup.xml new file mode 100644 index 0000000000000..237db68dcf953 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductWithQtyToCartFromStorefrontProductPageActionGroup.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="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" extends="AddToCartFromStorefrontProductPageActionGroup"> + <annotations> + <description>EXTENDS: addToCartFromStorefrontProductPage. Fills in the provided Product Quantity for the provided Product Name.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="productQty" type="string"/> + </arguments> + + <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="{{productQty}}" stepKey="fillProductQuantity" before="addToCart"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddRelatedProductBySkuActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddRelatedProductBySkuActionGroup.xml new file mode 100644 index 0000000000000..ce62acf6dd32a --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddRelatedProductBySkuActionGroup.xml @@ -0,0 +1,32 @@ +<?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="AddRelatedProductBySkuActionGroup"> + <annotations> + <description>Adds the provided Product SKU as a Related Product on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="sku"/> + </arguments> + + <!--Scroll up to avoid error--> + <scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" x="0" y="-100" stepKey="scrollTo"/> + <conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedUpSellCrossSell"/> + <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddRelatedProductsButton}}" stepKey="clickAddRelatedProductButton"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <click selector="{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectProduct"/> + <click selector="{{AdminAddRelatedProductsModalSection.AddSelectedProductsButton}}" stepKey="addRelatedProductSelected"/> + <waitForElementNotVisible selector="{{AdminAddRelatedProductsModalSection.AddSelectedProductsButton}}" stepKey="waitForElementNotVisible"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductToCartActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddSimpleProductToCartActionGroup.xml similarity index 80% rename from app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductToCartActionGroup.xml rename to app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddSimpleProductToCartActionGroup.xml index bc7288d33bcb3..81e3b8c99d9d2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductToCartActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddSimpleProductToCartActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AddSimpleProductToCart"> + <actionGroup name="AddSimpleProductToCartActionGroup"> <annotations> <description>Navigates to the Storefront Product page. Then adds the Product to the Cart. Validates that the Success Message is present and correct.</description> </annotations> @@ -26,10 +26,4 @@ <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForProductAddedMessage"/> <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{product.name}} to your shopping cart." stepKey="seeAddToCartSuccessMessage"/> </actionGroup> - <actionGroup name="StorefrontAddSimpleProductWithQtyActionGroup" extends="AddSimpleProductToCart"> - <arguments> - <argument name="quantity" type="string" defaultValue="1"/> - </arguments> - <fillField userInput="{{quantity}}" selector="{{StorefrontProductPageSection.qtyInput}}" stepKey="fillProductQty" after="goToProductPage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddSpecialPriceToProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddSpecialPriceToProductActionGroup.xml new file mode 100644 index 0000000000000..dde25104b64dd --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddSpecialPriceToProductActionGroup.xml @@ -0,0 +1,28 @@ +<?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="AddSpecialPriceToProductActionGroup"> + <annotations> + <description>Sets the provided Special Price on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="price" type="string" defaultValue="8"/> + </arguments> + + <waitForPageLoad stepKey="waitForPageLoad"/> + <click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickAdvancedPricingLink"/> + <waitForPageLoad stepKey="waitForAdvancedPricingModal"/> + <waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="waitSpecialPrice"/> + <fillField userInput="{{price}}" selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="fillSpecialPrice"/> + <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDone"/> + <waitForPageLoad stepKey="waitForAdvancedPricingModalGone"/> + <waitForElementNotVisible selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="waitForCloseModalWindow"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddToCartFromStorefrontProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddToCartFromStorefrontProductPageActionGroup.xml new file mode 100644 index 0000000000000..b27bda2b7c8f1 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddToCartFromStorefrontProductPageActionGroup.xml @@ -0,0 +1,28 @@ +<?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"> + <!--Click Add to Cart button in storefront product page--> + <actionGroup name="AddToCartFromStorefrontProductPageActionGroup"> + <annotations> + <description>Click on the Add to Cart button. Validates that the Success Message is present.</description> + </annotations> + <arguments> + <argument name="productName"/> + </arguments> + + <click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addToCart"/> + <waitForPageLoad stepKey="waitForAddToCart"/> + <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdding}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdding"/> + <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdded}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdded"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{productName}} to your shopping cart." stepKey="seeAddToCartSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddUpSellProductBySkuActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddUpSellProductBySkuActionGroup.xml new file mode 100644 index 0000000000000..b107aab956beb --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddUpSellProductBySkuActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AddUpSellProductBySkuActionGroup" extends="AddRelatedProductBySkuActionGroup"> + <annotations> + <description>EXTENDS: addRelatedProductBySku. Add the provided Product as an Up Sell Product.</description> + </annotations> + + <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddUpSellProductsButton}}" stepKey="clickAddRelatedProductButton"/> + <conditionalClick selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <click selector="{{AdminAddUpSellProductsModalSection.Modal}}{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectProduct"/> + <click selector="{{AdminAddUpSellProductsModalSection.AddSelectedProductsButton}}" stepKey="addRelatedProductSelected"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddAdvancedPricingToTheProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddAdvancedPricingToTheProductActionGroup.xml index f5e5957507eeb..958549d5768a8 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddAdvancedPricingToTheProductActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddAdvancedPricingToTheProductActionGroup.xml @@ -28,16 +28,4 @@ <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceFixedPriceInput(index)}}" userInput="{{groupPrice.price}}" stepKey="selectProductTierPriceFixedPrice"/> <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton"/> </actionGroup> - - <!-- Customer group is selected in different way for B2B --> - <actionGroup name="AdminAddAdvancedPricingToTheProductExtendedActionGroup" extends="AdminAddAdvancedPricingToTheProductActionGroup"> - <annotations> - <description>EXTENDS: AdminAddAdvancedPricingToTheProductActionGroup. Removes 'selectProductTierPriceCustomerGroupInput'. Selects the provided Group Price at the provided Index for B2B.</description> - </annotations> - - <remove keyForRemoval="selectProductTierPriceCustomerGroupInput"/> - <click selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect(index)}}" stepKey="clickProductTierPriceCustGroupSelect" after="selectProductTierPriceWebsiteInput"/> - <waitForElement selector="{{AdminProductFormAdvancedPricingSection.productTierPriceGroupOrCatalogOption(groupPrice.customer_group)}}" time="30" stepKey="waitProductTierPriceGroupOrCatalogOption" after="clickProductTierPriceCustGroupSelect"/> - <click selector="{{AdminProductFormAdvancedPricingSection.productTierPriceGroupOrCatalogOption(groupPrice.customer_group)}}" stepKey="clickAllGroupsOption" after="waitProductTierPriceGroupOrCatalogOption"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddAdvancedPricingToTheProductExtendedActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddAdvancedPricingToTheProductExtendedActionGroup.xml new file mode 100644 index 0000000000000..cf8a3879886f1 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddAdvancedPricingToTheProductExtendedActionGroup.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="AdminAddAdvancedPricingToTheProductExtendedActionGroup" extends="AdminAddAdvancedPricingToTheProductActionGroup"> + <annotations> + <description>EXTENDS: AdminAddAdvancedPricingToTheProductActionGroup. Removes 'selectProductTierPriceCustomerGroupInput'. Selects the provided Group Price at the provided Index for B2B.</description> + </annotations> + + <remove keyForRemoval="selectProductTierPriceCustomerGroupInput"/> + <click selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect(index)}}" stepKey="clickProductTierPriceCustGroupSelect" after="selectProductTierPriceWebsiteInput"/> + <waitForElement selector="{{AdminProductFormAdvancedPricingSection.productTierPriceGroupOrCatalogOption(groupPrice.customer_group)}}" time="30" stepKey="waitProductTierPriceGroupOrCatalogOption" after="clickProductTierPriceCustGroupSelect"/> + <click selector="{{AdminProductFormAdvancedPricingSection.productTierPriceGroupOrCatalogOption(groupPrice.customer_group)}}" stepKey="clickAllGroupsOption" after="waitProductTierPriceGroupOrCatalogOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddUnassignedAttributeToGroupActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddUnassignedAttributeToGroupActionGroup.xml new file mode 100644 index 0000000000000..2815bb7a00abf --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddUnassignedAttributeToGroupActionGroup.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="AdminAddUnassignedAttributeToGroupActionGroup" extends="CreateDefaultAttributeSetActionGroup"> + <arguments> + <argument name="firstOption" type="string" defaultValue="color"/> + <argument name="secondOption" type="string" defaultValue="material"/> + <argument name="group" type="string" defaultValue="Product Details"/> + </arguments> + <dragAndDrop selector1="{{AdminProductAttributeSetSection.attribute(firstOption)}}" selector2="{{AdminProductAttributeSetSection.attribute(group)}}" stepKey="unassign1"/> + <dragAndDrop selector1="{{AdminProductAttributeSetSection.attribute(secondOption)}}" selector2="{{AdminProductAttributeSetSection.attribute(group)}}" stepKey="unassign2"/> + <click selector="{{AdminProductAttributeSetSection.saveBtn}}" stepKey="clickSaveButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductCustomOptionVisibleActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductCustomOptionVisibleActionGroup.xml new file mode 100644 index 0000000000000..c00d214d53984 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductCustomOptionVisibleActionGroup.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="AdminAssertProductCustomOptionVisibleActionGroup"> + <arguments> + <argument name="option" defaultValue="ProductOptionField"/> + </arguments> + <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.checkIfCustomizableOptionsTabOpen}}" visible="true" stepKey="expandContentTab"/> + <waitForPageLoad time="10" stepKey="waitCustomizableOptionsTabOpened"/> + <seeElement selector="{{AdminProductCustomizableOptionsSection.fillOptionTitle(option.title)}}" stepKey="assertCustomOptionVisible"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductHasNoCustomOptionActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductHasNoCustomOptionActionGroup.xml new file mode 100644 index 0000000000000..d4d10efb697a1 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductHasNoCustomOptionActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AdminAssertProductHasNoCustomOptionActionGroup" extends="AdminAssertProductCustomOptionVisibleActionGroup"> + <remove keyForRemoval="assertCustomOptionVisible"/> + <dontSeeElement selector="{{AdminProductCustomizableOptionsSection.fillOptionTitle(option.title)}}" after="waitCustomizableOptionsTabOpened" stepKey="assertNoCustomOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductHasNoCustomOptionsActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductHasNoCustomOptionsActionGroup.xml new file mode 100644 index 0000000000000..f1a41b4922c5a --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertProductHasNoCustomOptionsActionGroup.xml @@ -0,0 +1,16 @@ +<?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="AdminAssertProductHasNoCustomOptionsActionGroup"> + <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.checkIfCustomizableOptionsTabOpen}}" visible="true" stepKey="expandContentTab"/> + <waitForPageLoad time="10" stepKey="waitCustomizableOptionsTabOpened"/> + <dontSeeElement selector="{{AdminProductCustomizableOptionsSection.customOption}}" stepKey="assertNoCustomOptions"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssignProductToCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssignProductToCategoryActionGroup.xml new file mode 100644 index 0000000000000..b88129f382263 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssignProductToCategoryActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AdminAssignProductToCategoryActionGroup"> + <annotations> + <description>Navigates to existing product page. Changes the category and saves the product.</description> + </annotations> + <arguments> + <argument name="productId" type="string"/> + <argument name="categoryName" type="string"/> + </arguments> + + <amOnPage url="{{AdminProductEditPage.url(productId)}}" stepKey="amOnPage"/> + <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{categoryName}}]" stepKey="selectCategory"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveProductMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml deleted file mode 100644 index afc332cc28378..0000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml +++ /dev/null @@ -1,459 +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"> - <!--Create a new category--> - <actionGroup name="CreateCategory"> - <annotations> - <description>Requires navigation to the Category creation page. Adds a new Subcategory. Validates that the Category was created.</description> - </annotations> - <arguments> - <argument name="categoryEntity" defaultValue="_defaultCategory"/> - </arguments> - - <seeInCurrentUrl url="{{AdminCategoryPage.url}}" stepKey="seeOnCategoryPage"/> - <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategory"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Category" stepKey="seeCategoryPageTitle"/> - <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{categoryEntity.name}}" stepKey="enterCategoryName"/> - <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSEO"/> - <fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{categoryEntity.name_lwr}}" stepKey="enterURLKey"/> - <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> - <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccess"/> - <seeInTitle userInput="{{categoryEntity.name}}" stepKey="seeNewCategoryPageTitle"/> - <seeElement selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryEntity.name)}}" stepKey="seeCategoryInTree"/> - </actionGroup> - - <!-- Go to create new root or sub category page --> - <actionGroup name="goToCreateCategoryPage"> - <annotations> - <description>Goes to the Category grid page. Clicks the Add Subcategory button.</description> - </annotations> - <arguments> - <argument name="selector" defaultValue="AdminCategorySidebarActionSection.AddSubcategoryButton"/> - </arguments> - - <amOnPage url="{{AdminCategoryPage.url}}" stepKey="amOnAdminCategoryPage"/> - <scrollToTopOfPage stepKey="scrollToTopOfPage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <click selector="{{selector}}" stepKey="clickOnAddCategory"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Category" stepKey="seeCategoryPageTitle"/> - </actionGroup> - - <!-- Go to admin category page by id --> - <actionGroup name="goToAdminCategoryPageById"> - <annotations> - <description>Goes to the Category edit page for a specified Category ID.</description> - </annotations> - <arguments> - <argument name="id" type="string"/> - </arguments> - - <amOnPage url="{{AdminCategoryEditPage.url(id)}}" stepKey="amOnAdminCategoryPage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="{{id}}" stepKey="seeCategoryPageTitle"/> - </actionGroup> - - <!-- Fill category fields --> - <actionGroup name="fillCategoryForm"> - <annotations> - <description>Requires navigation to the Subcategory creation/edit page. Fills the Subcategory Name. Fills the Search Engine Optimization.</description> - </annotations> - <arguments> - <argument name="categoryEntity" defaultValue="_defaultCategory"/> - </arguments> - - <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{categoryEntity.name}}" stepKey="enterCategoryName"/> - <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSEO"/> - <fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{categoryEntity.name_lwr}}" stepKey="enterURLKey"/> - </actionGroup> - - <!-- Save category form --> - <actionGroup name="saveCategoryForm"> - <annotations> - <description>Requires navigation to the Category creation/edit page. Checks that the url contains the AdminCategoryPage url. Saves the Category.</description> - </annotations> - - <seeInCurrentUrl url="{{AdminCategoryPage.url}}" stepKey="seeOnCategoryPage"/> - <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> - <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccess"/> - </actionGroup> - - <!--Upload image for category --> - <actionGroup name="addCategoryImage"> - <annotations> - <description>Requires navigation to the Category creation/edit page. Adds the provided image to a Category. Validates that the Image exists.</description> - </annotations> - <arguments> - <argument name="image" defaultValue="ProductImage"/> - </arguments> - - <conditionalClick selector="{{AdminCategoryContentSection.sectionHeader}}" dependentSelector="{{AdminCategoryContentSection.uploadButton}}" visible="false" stepKey="openContentSection"/> - <waitForPageLoad time="30" stepKey="waitForPageLoad"/> - <waitForElementVisible selector="{{AdminCategoryContentSection.uploadButton}}" stepKey="seeImageSectionIsReady"/> - <attachFile selector="{{AdminCategoryContentSection.uploadImageFile}}" userInput="{{image.file}}" stepKey="uploadFile"/> - <waitForAjaxLoad time="30" stepKey="waitForAjaxUpload"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoading"/> - <grabTextFrom selector="{{AdminCategoryContentSection.imageFileName}}" stepKey="grabCategoryFileName"/> - <assertRegExp stepKey="assertEquals" message="pass"> - <expectedResult type="string">/magento-logo(_[0-9]+)*?\.png$/</expectedResult> - <actualResult type="variable">grabCategoryFileName</actualResult> - </assertRegExp> - </actionGroup> - - <!-- Remove image from category --> - <actionGroup name="removeCategoryImage"> - <annotations> - <description>Requires navigation to the Category creation/edit page. Removes the current Category image. Validates that the Image does not exist.</description> - </annotations> - - <conditionalClick selector="{{AdminCategoryContentSection.sectionHeader}}" dependentSelector="{{AdminCategoryContentSection.uploadButton}}" visible="false" stepKey="openContentSection"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <waitForElementVisible selector="{{AdminCategoryContentSection.uploadButton}}" stepKey="seeImageSectionIsReady"/> - <click selector="{{AdminCategoryContentSection.removeImageButton}}" stepKey="clickRemoveImage"/> - <waitForAjaxLoad time="30" stepKey="waitForAjaxUpload"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoading"/> - <dontSee selector="{{AdminCategoryContentSection.imageFileName}}" stepKey="dontSeeImage"/> - </actionGroup> - - <actionGroup name="checkCategoryImageInAdmin"> - <annotations> - <description>Requires navigation to the Category creation/edit page. Click on the Upload button. Validates that the Image exists.</description> - </annotations> - <arguments> - <argument name="image" defaultValue="ProductImage"/> - </arguments> - - <conditionalClick selector="{{AdminCategoryContentSection.sectionHeader}}" dependentSelector="{{AdminCategoryContentSection.uploadButton}}" visible="false" stepKey="openContentSection"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <waitForElementVisible selector="{{AdminCategoryContentSection.uploadButton}}" stepKey="seeImageSectionIsReady"/> - <grabTextFrom selector="{{AdminCategoryContentSection.imageFileName}}" stepKey="grabCategoryFileName"/> - <assertRegExp stepKey="assertEquals" message="pass"> - <expectedResult type="string">/magento-logo(_[0-9]+)*?\.png$/</expectedResult> - <actualResult type="variable">grabCategoryFileName</actualResult> - </assertRegExp> - </actionGroup> - - <!-- Action to navigate to Media Gallery. Used in tests to cleanup uploaded images --> - <actionGroup name="navigateToMediaGallery"> - <annotations> - <description>Navigates to the category page and Opens the Media Gallery.</description> - </annotations> - - <amOnPage url="{{AdminCategoryPage.url}}" stepKey="amOnAdminCategoryPage"/> - <waitForElementVisible selector="{{AdminCategoryContentSection.sectionHeader}}" stepKey="waitForContentSection"/> - <conditionalClick selector="{{AdminCategoryContentSection.sectionHeader}}" dependentSelector="{{AdminCategoryContentSection.uploadButton}}" visible="false" stepKey="openContentSection"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <waitForElementVisible selector="{{AdminCategoryContentSection.selectFromGalleryButton}}" stepKey="waitForSelectFromGalleryButton"/> - <click selector="{{AdminCategoryContentSection.selectFromGalleryButton}}" stepKey="clickSelectFromGalleryButton"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/> - </actionGroup> - - <!--Actions to check if a category exists on StoreFront--> - <actionGroup name="CheckCategoryOnStorefront"> - <annotations> - <description>Navigates to the category page on the storefront and asserts that the title is correct for page and browser.</description> - </annotations> - <arguments> - <argument name="categoryEntity" defaultValue="_defaultCategory"/> - </arguments> - - <amOnPage url="/{{categoryEntity.name_lwr}}.html" stepKey="goToCategoryFrontPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <see selector="{{StorefrontCategoryMainSection.CategoryTitle}}" userInput="{{categoryEntity.name_lwr}}" stepKey="assertCategoryOnStorefront"/> - <seeInTitle userInput="{{categoryEntity.name}}" stepKey="seeCategoryNameInTitle"/> - </actionGroup> - - <!--Actions to delete category--> - <actionGroup name="DeleteCategory"> - <annotations> - <description>Navigates to the category page and deletes the specified category.</description> - </annotations> - <arguments> - <argument name="categoryEntity" defaultValue="_defaultCategory"/> - </arguments> - - <amOnPage url="{{AdminCategoryPage.url}}" stepKey="goToCategoryPage"/> - <waitForPageLoad time="60" stepKey="waitForCategoryPageLoad"/> - <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryEntity.name)}}" stepKey="clickCategoryLink"/> - <click selector="{{AdminCategoryMainActionsSection.DeleteButton}}" stepKey="clickDelete"/> - <waitForElementVisible selector="{{AdminCategoryModalSection.message}}" stepKey="waitForConfirmationModal"/> - <see selector="{{AdminCategoryModalSection.message}}" userInput="Are you sure you want to delete this category?" stepKey="seeDeleteConfirmationMessage"/> - <click selector="{{AdminCategoryModalSection.ok}}" stepKey="confirmDelete"/> - <waitForPageLoad time="60" stepKey="waitForDeleteToFinish"/> - <see selector="You deleted the category." stepKey="seeDeleteSuccess"/> - <click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="expandToSeeAllCategories"/> - <dontSee selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryEntity.name)}}" stepKey="dontSeeCategoryInTree"/> - </actionGroup> - <actionGroup name="AdminDeleteCategoryByName" extends="DeleteCategory"> - <arguments> - <argument name="categoryName" type="string" defaultValue="category1"/> - </arguments> - <remove keyForRemoval="clickCategoryLink"/> - <remove keyForRemoval="dontSeeCategoryInTree"/> - <remove keyForRemoval="expandToSeeAllCategories"/> - <conditionalClick selector="{{AdminCategorySidebarTreeSection.expandAll}}" dependentSelector="{{AdminCategorySidebarTreeSection.categoryByName(categoryName)}}" visible="false" stepKey="expandCategories" after="waitForCategoryPageLoad"/> - <click selector="{{AdminCategorySidebarTreeSection.categoryByName(categoryName)}}" stepKey="clickCategory" after="expandCategories"/> - <conditionalClick selector="{{AdminCategorySidebarTreeSection.expandAll}}" dependentSelector="{{AdminCategorySidebarTreeSection.categoryByName(categoryName)}}" visible="false" stepKey="expandCategoriesToSeeAll" after="seeDeleteSuccess"/> - <dontSee selector="{{AdminCategorySidebarTreeSection.categoryByName(categoryName)}}" stepKey="dontSeeCategory" after="expandCategoriesToSeeAll"/> - </actionGroup> - - <!-- Actions to fill out a new category from the product page--> - <!-- The action assumes that you are already on an admin product configuration page --> - <actionGroup name="FillNewProductCategory" > - <annotations> - <description>Actions to fill out a new category from the product page with specified category and parent category names.</description> - </annotations> - <arguments> - <argument name="categoryName" defaultValue="Test Category" type="string"/> - <argument name="parentCategoryName" defaultValue="default" type="string"/> - </arguments> - - <!-- Click on new Category --> - <click stepKey="clickNewCategory" selector="{{AdminProductCategoryCreationSection.newCategory}}"/> - <waitForPageLoad stepKey="waitForFieldSet"/> - <fillField stepKey="fillCategoryName" selector="{{AdminProductCategoryCreationSection.nameInput}}" userInput="{{categoryName}}"/> - - <!-- Search and select a parent category for the product --> - <click stepKey="clickParentCategory" selector="{{AdminProductCategoryCreationSection.parentCategory}}"/> - <waitForPageLoad stepKey="waitForDropDownVisible"/> - <fillField stepKey="searchForParent" userInput="{{parentCategoryName}}" selector="{{AdminProductCategoryCreationSection.parentSearch}}"/> - <waitForPageLoad stepKey="waitForFieldResults"/> - <click stepKey="clickParent" selector="{{AdminProductCategoryCreationSection.parentSearchResult}}"/> - <click stepKey="createCategory" selector="{{AdminProductCategoryCreationSection.createCategory}}"/> - <waitForPageLoad stepKey="waitForCategoryCreated"/> - </actionGroup> - - <!-- Actions to delete the category last made --> - <actionGroup name="DeleteMostRecentCategory"> - <annotations> - <description>Actions to delete the category last made (the last category on the list).</description> - </annotations> - - <amOnPage url="/{{AdminCategoryPage.url}}" stepKey="goToCategoryFrontPage"/> - <waitForPageLoad stepKey="waitForCategoryPageLoad"/> - <click stepKey="goToCreateCategory" selector="{{AdminCategorySidebarTreeSection.lastCreatedCategory}}"/> - <waitForPageLoad stepKey="waitForCreatedCategoryPageLoad"/> - <click stepKey="clickDeleteCategory" selector="{{AdminCategoryMainActionsSection.DeleteButton}}"/> - <waitForPageLoad stepKey="waitForModalVisible"/> - <click stepKey="clickOkToDelete" selector="{{AdminCategoryModalSection.ok}}"/> - <waitForPageLoad stepKey="waitForModalNotVisible"/> - </actionGroup> - - <!-- Actions to check if a certain category is present on the page --> - <actionGroup name="CategoryPresent" > - <annotations> - <description>Navigates to category page, asserts category is there. Navigates to storefront category page and asserts category is there. This action group will not work categories where name does NOT equal SEO.</description> - </annotations> - <arguments> - <argument name="categoryName" defaultValue="Test Category" type="string"/> - </arguments> - - <amOnPage url="{{AdminCategoryPage.url}}" stepKey="goToCategoryAdminPage"/> - <waitForPageLoad stepKey="waitForCategoryAdminPageLoad"/> - <see userInput="{{categoryName}}" stepKey="assertCategoryOnAdminPage" selector="{{AdminCategorySidebarTreeSection.treeContainer}}"/> - <amOnPage url="/{{categoryName}}.html" stepKey="goToCustomerFrontPage"/> - <see userInput="{{categoryName}}" stepKey="assertCategoryNameOnStorefront" selector="{{StorefrontCategoryMainSection.CategoryTitle}}"/> - <waitForPageLoad stepKey="waitForCustomerCategoryPageLoad"/> - </actionGroup> - - <!--Check that name field is required--> - <actionGroup name="CheckCategoryNameIsRequiredField"> - <annotations> - <description>Navigates to category page, attempts to add subcategory without name. Expects required field prompt.</description> - </annotations> - - <seeInCurrentUrl url="{{AdminCategoryPage.url}}" stepKey="seeOnCategoryPage"/> - <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategory"/> - <clearField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" stepKey="makeNameFieldEmpty"/> - <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> - <seeInCurrentUrl url="{{AdminCategoryPage.url}}add" stepKey="seeBackOnCreateCategoryPage"/> - <see selector="{{AdminCategoryBasicFieldSection.FieldError('uid')}}" userInput="This is a required field." stepKey="seeErrorMessage"/> - </actionGroup> - - <actionGroup name="switchCategoryStoreView"> - <annotations> - <description>Navigates to category page, selects a category and changes store view to specified store.</description> - </annotations> - <arguments> - <argument name="Store"/> - <argument name="CatName"/> - </arguments> - - <amOnPage url="{{AdminCategoryPage.page}}" stepKey="amOnCategoryPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(CatName)}}" stepKey="navigateToCreatedCategory"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <waitForLoadingMaskToDisappear stepKey="waitForSpinner"/> - <scrollToTopOfPage stepKey="scrollToToggle"/> - <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}" stepKey="openStoreViewDropDown"/> - <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewOption(Store)}}" stepKey="selectStoreView"/> - <waitForPageLoad stepKey="waitForPageLoad3"/> - <waitForLoadingMaskToDisappear stepKey="waitForSpinner2"/> - <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}" stepKey="selectStoreViewAccept"/> - <waitForPageLoad stepKey="waitForStoreViewChangeLoad"/> - </actionGroup> - - <actionGroup name="switchCategoryToAllStoreView"> - <annotations> - <description>Navigates to category page, selects a category and changes store view to all stores.</description> - </annotations> - <arguments> - <argument name="CatName"/> - </arguments> - - <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(CatName)}}" stepKey="navigateToCreatedCategory"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <waitForLoadingMaskToDisappear stepKey="waitForSpinner1"/> - <scrollToTopOfPage stepKey="scrollToToggle"/> - <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}" stepKey="openStoreViewDropDown"/> - <click selector="{{AdminCategoryMainActionsSection.allStoreViews}}" stepKey="clickStoreViewByName"/> - <see selector="{{AdminCategoryMainActionsSection.storeSwitcher}}" userInput="All Store Views" stepKey="seeAllStoreView"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <waitForLoadingMaskToDisappear stepKey="waitForSpinner2"/> - <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}" stepKey="selectStoreViewAccept"/> - <waitForPageLoad stepKey="waitForStoreViewChangeLoad"/> - </actionGroup> - - <actionGroup name="navigateToCreatedCategory"> - <annotations> - <description>Navigates to category page, selects a category by specified category.</description> - </annotations> - <arguments> - <argument name="Category"/> - </arguments> - - <amOnPage url="{{AdminCategoryPage.page}}" stepKey="amOnCategoryPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="expandAll"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(Category.Name)}}" stepKey="navigateToCreatedCategory"/> - <waitForLoadingMaskToDisappear stepKey="waitForSpinner"/> - </actionGroup> - - <actionGroup name="ChangeSeoUrlKey"> - <annotations> - <description>Requires navigation to category creation/edit. Updates the Search Engine Optimization.</description> - </annotations> - <arguments> - <argument name="value" type="string"/> - </arguments> - - <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSeoSection"/> - <fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{value}}" stepKey="enterURLKey"/> - <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> - <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccessMessage"/> - </actionGroup> - - <actionGroup name="ChangeSeoUrlKeyForSubCategory"> - <annotations> - <description>Requires navigation to subcategory creation/edit. Updates the Search Engine Optimization.</description> - </annotations> - <arguments> - <argument name="value" type="string"/> - </arguments> - - <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSeoSection"/> - <uncheckOption selector="{{AdminCategorySEOSection.UrlKeyDefaultValueCheckbox}}" stepKey="uncheckDefaultValue"/> - <fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{value}}" stepKey="enterURLKey"/> - <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> - <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccessMessage"/> - </actionGroup> - - <actionGroup name="OpenCategoryFromCategoryTree"> - <annotations> - <description>Navigates to category page, selects a category by specified category. Replicates actionGroup:navigateToCreatedCategory.</description> - </annotations> - <arguments> - <argument name="category" type="string"/> - </arguments> - - <amOnPage url="{{AdminCategoryPage.url}}" stepKey="openAdminCategoryIndexPage"/> - <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> - <click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="clickOnExpandTree"/> - <waitForPageLoad stepKey="waitForCategoryToLoad"/> - <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(category)}}" stepKey="selectCategory"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <waitForElementVisible selector="{{AdminCategoryContentSection.categoryPageTitle}}" stepKey="waitForCategoryTitle"/> - </actionGroup> - - <actionGroup name="AdminAssignProductToCategory"> - <annotations> - <description>Navigates to existing product page. Changes the category and saves the product.</description> - </annotations> - <arguments> - <argument name="productId" type="string"/> - <argument name="categoryName" type="string"/> - </arguments> - - <amOnPage url="{{AdminProductEditPage.url(productId)}}" stepKey="amOnPage"/> - <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{categoryName}}]" stepKey="selectCategory"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveProductMessage"/> - </actionGroup> - - <actionGroup name="FillCategoryNameAndUrlKeyAndSave"> - <annotations> - <description>Requires navigation to subcategory creation/edit. Fills the name, and sets the Search Engine Optimization for the category.</description> - </annotations> - <arguments> - <argument name="categoryName" type="string"/> - <argument name="categoryUrlKey" type="string"/> - </arguments> - - <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{categoryName}}" stepKey="enterCategoryName"/> - <scrollTo selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="scrollToSearchEngineOptimization"/> - <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSEO"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{categoryUrlKey}}" stepKey="enterURLKey"/> - <scrollToTopOfPage stepKey="scrollToTheTopOfPage"/> - <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> - <waitForPageLoad stepKey="waitForPageToLoad1"/> - </actionGroup> - - <actionGroup name="AdminCategoryAssignProduct"> - <annotations> - <description>Requires navigation to category creation/edit page. Assign products to category - using "Products in Category" tab.</description> - </annotations> - <arguments> - <argument name="productSku" type="string"/> - </arguments> - - <conditionalClick selector="{{AdminCategoryBasicFieldSection.productsInCategory}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="false" stepKey="clickOnProductInCategory"/> - <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickOnResetFilter"/> - <fillField selector="{{AdminCategoryContentSection.productTableColumnSku}}" userInput="{{productSku}}" stepKey="fillSkuFilter"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearchButton"/> - <click selector="{{AdminCategoryContentSection.productTableRow}}" stepKey="selectProductFromTableRow"/> - </actionGroup> - - <actionGroup name="DeleteDefaultCategoryChildren"> - <annotations> - <description>Deletes all children categories of Default Root Category.</description> - </annotations> - - <amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToAdminCategoryPage"/> - <executeInSelenium function="function ($webdriver) use ($I) { - $children = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::xpath('//ul[contains(@class, \'x-tree-node-ct\')]/li[@class=\'x-tree-node\' and contains(., - \'{{DefaultCategory.name}}\')]/ul[contains(@class, \'x-tree-node-ct\')]/li//a')); - while (!empty($children)) { - $I->click('//ul[contains(@class, \'x-tree-node-ct\')]/li[@class=\'x-tree-node\' and contains(., - \'{{DefaultCategory.name}}\')]/ul[contains(@class, \'x-tree-node-ct\')]/li//a'); - $I->waitForPageLoad(30); - $I->click('#delete'); - $I->waitForElementVisible('aside.confirm .modal-footer button.action-accept'); - $I->click('aside.confirm .modal-footer button.action-accept'); - $I->waitForPageLoad(30); - $I->waitForElementVisible('#messages div.message-success', 30); - $I->see('You deleted the category.', '#messages div.message-success'); - $children = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::xpath('//ul[contains(@class, \'x-tree-node-ct\')]/li[@class=\'x-tree-node\' and contains(., - \'{{DefaultCategory.name}}\')]/ul[contains(@class, \'x-tree-node-ct\')]/li//a')); - } - }" stepKey="deleteAllChildCategories"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryAssignProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryAssignProductActionGroup.xml new file mode 100644 index 0000000000000..9dc661ae5ecad --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryAssignProductActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AdminCategoryAssignProductActionGroup"> + <annotations> + <description>Requires navigation to category creation/edit page. Assign products to category - using "Products in Category" tab.</description> + </annotations> + <arguments> + <argument name="productSku" type="string"/> + </arguments> + + <conditionalClick selector="{{AdminCategoryBasicFieldSection.productsInCategory}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="false" stepKey="clickOnProductInCategory"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickOnResetFilter"/> + <fillField selector="{{AdminCategoryContentSection.productTableColumnSku}}" userInput="{{productSku}}" stepKey="fillSkuFilter"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearchButton"/> + <click selector="{{AdminCategoryContentSection.productTableRow}}" stepKey="selectProductFromTableRow"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductsInGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductIsMissingInCategoryProductsGridActionGroup.xml similarity index 61% rename from app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductsInGridActionGroup.xml rename to app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductIsMissingInCategoryProductsGridActionGroup.xml index 440739875c0c1..4b360cde1485a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductsInGridActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductIsMissingInCategoryProductsGridActionGroup.xml @@ -8,17 +8,10 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminCheckProductIsMissingInCategoryProductsGrid"> + <actionGroup name="AdminCheckProductIsMissingInCategoryProductsGridActionGroup"> <arguments> <argument name="productName" type="string"/> </arguments> <dontSee selector="{{AdminCategoryProductsGridSection.nameColumn}}" userInput="{{productName}}" stepKey="dontSeeProduct"/> </actionGroup> - <actionGroup name="AdminCheckProductPositionInCategoryProductsGrid"> - <arguments> - <argument name="position" type="string"/> - <argument name="productName" type="string"/> - </arguments> - <see selector="{{AdminCategoryProductsGridSection.rowProductName(position)}}" userInput="{{productName}}" stepKey="assertProductPosition"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductPositionInCategoryProductsGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductPositionInCategoryProductsGridActionGroup.xml new file mode 100644 index 0000000000000..2c0832e0ee877 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckProductPositionInCategoryProductsGridActionGroup.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="AdminCheckProductPositionInCategoryProductsGridActionGroup"> + <arguments> + <argument name="position" type="string"/> + <argument name="productName" type="string"/> + </arguments> + <see selector="{{AdminCategoryProductsGridSection.rowProductName(position)}}" userInput="{{productName}}" stepKey="assertProductPosition"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryButtonActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryButtonActionGroup.xml new file mode 100644 index 0000000000000..33b99cef6d650 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryButtonActionGroup.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="AdminClickOnAdvancedInventoryButtonActionGroup"> + <annotations> + <description>Clicks on the 'Advanced Inventory' link on the Admin Product creation/edit page.</description> + </annotations> + + <click selector="{{AdminProductFormSection.advancedInventoryButton}}" stepKey="clickOnAdvancedInventoryLink"/> + <waitForPageLoad stepKey="waitForAdvancedInventoryPageToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryLinkActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryLinkActionGroup.xml index a0cff133cbbed..60438e23e084c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryLinkActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickOnAdvancedInventoryLinkActionGroup.xml @@ -18,15 +18,4 @@ <click selector="{{AdminProductFormSection.advancedInventoryLink}}" stepKey="clickOnAdvancedInventoryLink"/> <waitForPageLoad stepKey="waitForAdvancedInventoryPageToLoad"/> </actionGroup> - - <!-- ActionGroup click on Advanced Inventory Button in product form; - You must already be on the product form page --> - <actionGroup name="AdminClickOnAdvancedInventoryButtonActionGroup"> - <annotations> - <description>Clicks on the 'Advanced Inventory' link on the Admin Product creation/edit page.</description> - </annotations> - - <click selector="{{AdminProductFormSection.advancedInventoryButton}}" stepKey="clickOnAdvancedInventoryLink"/> - <waitForPageLoad stepKey="waitForAdvancedInventoryPageToLoad"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeFromProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeFromProductPageActionGroup.xml new file mode 100644 index 0000000000000..ae8e8a84149e1 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeFromProductPageActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AdminCreateAttributeFromProductPageActionGroup"> + <annotations> + <description>From the Product creation/edit page, under 'Configurations', Clicks on 'Create Configurations'. Clicks on 'Create New Attribute'. Fills Label. Selects Type. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="attributeName" type="string"/> + <argument name="attributeType" type="string" defaultValue="TextField"/> + </arguments> + + <click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickAddAttributeBtn"/> + <see userInput="Select Attribute" stepKey="checkNewAttributePopUpAppeared"/> + <click selector="{{AdminProductFormAttributeSection.createNewAttribute}}" stepKey="clickCreateNewAttribute"/> + <fillField selector="{{AdminProductFormNewAttributeSection.attributeLabel}}" userInput="{{attributeName}}" stepKey="fillAttributeLabel"/> + <selectOption selector="{{AdminProductFormNewAttributeSection.attributeType}}" userInput="{{attributeType}}" stepKey="selectAttributeType"/> + <click selector="{{AdminProductFormNewAttributeSection.saveAttribute}}" stepKey="saveAttribute"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeFromProductPageWithScopeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeFromProductPageWithScopeActionGroup.xml new file mode 100644 index 0000000000000..2ee84fcb24b68 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeFromProductPageWithScopeActionGroup.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="AdminCreateAttributeFromProductPageWithScopeActionGroup" extends="AdminCreateAttributeFromProductPageActionGroup" insertAfter="selectAttributeType"> + <arguments> + <argument name="scope" type="string" defaultValue="Store View"/> + </arguments> + <conditionalClick selector="{{AdminProductFormNewAttributeAdvancedSection.sectionHeader}}" dependentSelector="{{AdminProductFormNewAttributeAdvancedSection.scope}}" visible="false" stepKey="openAttributeAdvancedSection"/> + <selectOption selector="{{AdminProductFormNewAttributeAdvancedSection.scope}}" userInput="{{scope}}" stepKey="selectScope"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeWithSearchWeightActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeWithSearchWeightActionGroup.xml new file mode 100644 index 0000000000000..2ca4c9b616862 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeWithSearchWeightActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AdminCreateAttributeWithSearchWeightActionGroup" extends="AdminProductPageCreateAttributeSetWithAttributeActionGroup" insertAfter="selectAttributeType"> + <annotations> + <description>EXTENDS: AdminProductPageCreateAttributeSetWithAttribute. Sets the provided Search Weight and Default Values.</description> + </annotations> + <arguments> + <argument name="weight" type="string" defaultValue="1"/> + <argument name="defaultValue" type="string" defaultValue="default"/> + </arguments> + + <click selector="{{AdminProductFormNewAttributeAdvancedSection.sectionHeader}}" stepKey="openAdvancedSection"/> + <fillField selector="{{AdminProductFormNewAttributeAdvancedSection.defaultValue}}" userInput="{{defaultValue}}" stepKey="inputDefault"/> + <click selector="{{AdminProductFormNewAttributeStorefrontSection.sectionHeader}}" stepKey="openStorefrontSection"/> + <checkOption selector="{{AdminProductFormNewAttributeStorefrontSection.useInSearch}}" stepKey="checkUseInSearch"/> + <waitForElementVisible selector="{{AdminProductFormNewAttributeStorefrontSection.searchWeight}}" stepKey="waitForSearchWeight"/> + <selectOption selector="{{AdminProductFormNewAttributeStorefrontSection.searchWeight}}" userInput="{{weight}}" stepKey="selectWeight"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeWithValueWithTwoStoreViesFromProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeWithValueWithTwoStoreViesFromProductPageActionGroup.xml new file mode 100644 index 0000000000000..ec02df1fbf327 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateAttributeWithValueWithTwoStoreViesFromProductPageActionGroup.xml @@ -0,0 +1,35 @@ +<?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="AdminCreateAttributeWithValueWithTwoStoreViesFromProductPageActionGroup" extends="AdminCreateAttributeFromProductPageActionGroup"> + <remove keyForRemoval="saveAttribute"/> + <annotations> + <description>EXTENDS: AdminCreateAttributeFromProductPage. Adds the 2 provided Store Views to a Product. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="firstStoreViewName" type="string"/> + <argument name="secondStoreViewName" type="string"/> + </arguments> + + <click selector="{{AdminProductFormNewAttributeSection.addValue}}" stepKey="addValue" after="selectAttributeType"/> + <seeElement selector="{{AdminProductFormNewAttributeSection.optionViewName(firstStoreViewName))}}" stepKey="seeFirstStoreView"/> + <seeElement selector="{{AdminProductFormNewAttributeSection.optionViewName(firstStoreViewName))}}" stepKey="seeSecondStoreView"/> + <fillField selector="{{AdminProductFormNewAttributeSection.optionValue('1'))}}" userInput="default" stepKey="fillDefaultStoreView"/> + <fillField selector="{{AdminProductFormNewAttributeSection.optionValue('2'))}}" userInput="admin" stepKey="fillAdminStoreView"/> + <fillField selector="{{AdminProductFormNewAttributeSection.optionValue('3'))}}" userInput="view1" stepKey="fillFirstStoreView"/> + <fillField selector="{{AdminProductFormNewAttributeSection.optionValue('4'))}}" userInput="view2" stepKey="fillSecondStoreView"/> + + <!--Check store view in Manage Titles section--> + <click selector="{{AdminProductFormNewAttributeSection.manageTitlesHeader}}" stepKey="openManageTitlesSection"/> + <seeElement selector="{{AdminProductFormNewAttributeSection.manageTitlesViewName(customStoreEN.name)}}" stepKey="seeFirstStoreViewName"/> + <seeElement selector="{{AdminProductFormNewAttributeSection.manageTitlesViewName(customStoreFR.name)}}" stepKey="seeSecondStoreViewName"/> + <click selector="{{AdminProductFormNewAttributeSection.saveAttribute}}" stepKey="saveAttribute1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateCatalogProductWidgetActionGroup.xml similarity index 64% rename from app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml rename to app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateCatalogProductWidgetActionGroup.xml index f3ebbc6370f87..1b9b9d60b36e2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateCatalogProductWidgetActionGroup.xml @@ -8,18 +8,6 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminCreateRecentlyProductsWidgetActionGroup" extends="AdminCreateWidgetActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateWidgetActionGroup. Adds Product Attributes/Buttons to a Widget. Clicks on the Save button.</description> - </annotations> - - <selectOption selector="{{AdminCatalogProductWidgetSection.productAttributesToShow}}" parameterArray="['Name', 'Image', 'Price']" stepKey="selectAllProductAttributes"/> - <selectOption selector="{{AdminCatalogProductWidgetSection.productButtonsToShow}}" parameterArray="['Add to Cart', 'Add to Compare', 'Add to Wishlist']" stepKey="selectAllProductButtons"/> - <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveWidget"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessageAppears"/> - <see selector="{{AdminMessagesSection.success}}" userInput="The widget instance has been saved" stepKey="seeSuccess"/> - </actionGroup> - <actionGroup name="AdminCreateCatalogProductWidgetActionGroup" extends="AdminCreateWidgetActionGroup"> <annotations> <description>EXTENDS: AdminCreateWidgetActionGroup. Creates Catalog Category Link Widget.</description> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateRecentlyProductsWidgetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateRecentlyProductsWidgetActionGroup.xml new file mode 100644 index 0000000000000..e22620790ef70 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateRecentlyProductsWidgetActionGroup.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="AdminCreateRecentlyProductsWidgetActionGroup" extends="AdminCreateWidgetActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateWidgetActionGroup. Adds Product Attributes/Buttons to a Widget. Clicks on the Save button.</description> + </annotations> + + <selectOption selector="{{AdminCatalogProductWidgetSection.productAttributesToShow}}" parameterArray="['Name', 'Image', 'Price']" stepKey="selectAllProductAttributes"/> + <selectOption selector="{{AdminCatalogProductWidgetSection.productButtonsToShow}}" parameterArray="['Add to Cart', 'Add to Compare', 'Add to Wishlist']" stepKey="selectAllProductButtons"/> + <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveWidget"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessageAppears"/> + <see selector="{{AdminMessagesSection.success}}" userInput="The widget instance has been saved" stepKey="seeSuccess"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateSearchableProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateSearchableProductAttributeActionGroup.xml new file mode 100644 index 0000000000000..1e1418b3e0e75 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateSearchableProductAttributeActionGroup.xml @@ -0,0 +1,16 @@ +<?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="AdminCreateSearchableProductAttributeActionGroup" extends="CreateProductAttributeActionGroup" insertAfter="checkRequired"> + <click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="goToStorefrontPropertiesTab"/> + <waitForElementVisible selector="{{StorefrontPropertiesSection.PageTitle}}" stepKey="waitTabLoad"/> + <selectOption selector="{{AdvancedAttributePropertiesSection.UseInSearch}}" userInput="Yes" stepKey="setSearchable"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateSimpleProductWithTextOptionCharLimitActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateSimpleProductWithTextOptionCharLimitActionGroup.xml new file mode 100644 index 0000000000000..66620e3d9dd07 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCreateSimpleProductWithTextOptionCharLimitActionGroup.xml @@ -0,0 +1,47 @@ +<?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="AdminCreateSimpleProductWithTextOptionCharLimitActionGroup"> + <annotations> + <description>Goes to the Admin Product grid page. Clicks on Add. Fills the provided Product details (Name, SKU, Price, Quantity, Category and URL). Adds a Text Product Option with the provided Char Limits. Clicks on Save. Validates that the Product details are present and correct.</description> + </annotations> + <arguments> + <argument name="category"/> + <argument name="simpleProduct"/> + <argument name="charLimit"/> + </arguments> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> + <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/> + <click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/> + <fillField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> + <fillField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/> + <fillField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/> + <fillField userInput="{{simpleProduct.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/> + <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="searchAndSelectCategory"/> + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> + <fillField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> + + <click selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="openCustomOptionsSection"/> + <click selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" stepKey="clickAddOption"/> + <fillField selector="{{AdminProductCustomizableOptionsSection.optionTitleInput('0')}}" userInput="option1" stepKey="fillOptionTitle"/> + <click selector="{{AdminProductCustomizableOptionsSection.optionTypeOpenDropDown}}" stepKey="openTypeDropDown"/> + <click selector="{{AdminProductCustomizableOptionsSection.optionTypeTextField}}" stepKey="selectTypeTextField"/> + <fillField userInput="20" selector="{{AdminProductCustomizableOptionsSection.maxCharactersInput}}" stepKey="fillMaxChars"/> + + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveMessageSuccess"/> + <seeInField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="assertFieldName"/> + <seeInField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="assertFieldSku"/> + <seeInField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="assertFieldPrice"/> + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSectionAssert"/> + <seeInField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="assertFieldUrlKey"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductCustomOptionsActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductCustomOptionsActionGroup.xml new file mode 100644 index 0000000000000..103c25b2c6f50 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteAllProductCustomOptionsActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AdminDeleteAllProductCustomOptionsActionGroup"> + <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.checkIfCustomizableOptionsTabOpen}}" visible="true" stepKey="expandContentTab"/> + <waitForPageLoad time="10" stepKey="waitCustomizableOptionsTabOpened"/> + <executeInSelenium function="function($webdriver) use ($I) { + $buttons = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::cssSelector('[data-index=\'options\'] [data-index=\'delete_button\']')); + while(!empty($buttons)) { + $button = reset($buttons); + $I->executeJS('arguments[0].scrollIntoView(false)', [$button]); + $button->click(); + $webdriver->wait()->until(\Facebook\WebDriver\WebDriverExpectedCondition::stalenessOf($button)); + $buttons = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::cssSelector('[data-index=\'options\'] [data-index=\'delete_button\']')); + } + }" stepKey="deleteCustomOptions"/> + <dontSeeElement selector="{{AdminProductCustomizableOptionsSection.customOptionButtonDelete}}" stepKey="assertNoCustomOptions"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteCategoryByNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteCategoryByNameActionGroup.xml new file mode 100644 index 0000000000000..de7f569074ac3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteCategoryByNameActionGroup.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="AdminDeleteCategoryByNameActionGroup" extends="DeleteCategoryActionGroup"> + <arguments> + <argument name="categoryName" type="string" defaultValue="category1"/> + </arguments> + <remove keyForRemoval="clickCategoryLink"/> + <remove keyForRemoval="dontSeeCategoryInTree"/> + <remove keyForRemoval="expandToSeeAllCategories"/> + <conditionalClick selector="{{AdminCategorySidebarTreeSection.expandAll}}" dependentSelector="{{AdminCategorySidebarTreeSection.categoryByName(categoryName)}}" visible="false" stepKey="expandCategories" after="waitForCategoryPageLoad"/> + <click selector="{{AdminCategorySidebarTreeSection.categoryByName(categoryName)}}" stepKey="clickCategory" after="expandCategories"/> + <conditionalClick selector="{{AdminCategorySidebarTreeSection.expandAll}}" dependentSelector="{{AdminCategorySidebarTreeSection.categoryByName(categoryName)}}" visible="false" stepKey="expandCategoriesToSeeAll" after="seeDeleteSuccess"/> + <dontSee selector="{{AdminCategorySidebarTreeSection.categoryByName(categoryName)}}" stepKey="dontSeeCategory" after="expandCategoriesToSeeAll"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteProductCustomOptionActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteProductCustomOptionActionGroup.xml new file mode 100644 index 0000000000000..22c4ef6a7d568 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteProductCustomOptionActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AdminDeleteProductCustomOptionActionGroup" extends="AdminAssertProductCustomOptionVisibleActionGroup"> + <remove keyForRemoval="assertCustomOptionVisible"/> + <click selector="{{AdminProductCustomizableOptionsSection.deleteCustomOptions(option.title)}}" after="waitCustomizableOptionsTabOpened" stepKey="clickDeleteCustomOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductAttributePropertiesActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductAttributePropertiesActionGroup.xml index ec73001976dc6..cd850f8a7004d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductAttributePropertiesActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductAttributePropertiesActionGroup.xml @@ -15,16 +15,4 @@ <fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{attributeName}}" stepKey="fillDefaultLabel"/> <selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="{{attributeType}}" stepKey="selectInputType"/> </actionGroup> - - <!--You are on AdminProductEditPage--> - <!-- Switch scope for product attribute--> - <!-- !Note! Scope : 0 - Store View; 1 - Global; 2 - Website; --> - <actionGroup name="AdminSwitchScopeForProductAttributeActionGroup"> - <arguments> - <argument name="scope" type="string" defaultValue="1"/> - </arguments> - <click selector="{{AttributePropertiesSection.AdvancedProperties}}" stepKey="expandAdvancedProperties"/> - <waitForElementVisible selector="{{AttributePropertiesSection.Scope}}" stepKey="waitOpenAdvancedProperties"/> - <selectOption selector="{{AttributePropertiesSection.Scope}}" userInput="1" stepKey="selectNecessaryScope"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductCountryOfManufactureActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductCountryOfManufactureActionGroup.xml new file mode 100644 index 0000000000000..7642bb5f6635d --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminFillProductCountryOfManufactureActionGroup.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="AdminFillProductCountryOfManufactureActionGroup"> + <arguments> + <argument name="countryId" type="string" defaultValue="US"/> + </arguments> + <selectOption selector="{{AdminProductFormBundleSection.countryOfManufactureDropDown}}" userInput="{{countryId}}" stepKey="countryOfManufactureDropDown"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProcessProductWebsitesActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProcessProductWebsitesActionGroup.xml new file mode 100644 index 0000000000000..fbd49224231f3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProcessProductWebsitesActionGroup.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="AdminProcessProductWebsitesActionGroup" extends="CreatedProductConnectToWebsiteActionGroup"> + <arguments> + <argument name="websiteToUnassign"/> + </arguments> + <uncheckOption selector="{{ProductInWebsitesSection.website(websiteToUnassign.name)}}" after="SelectWebsite" stepKey="uncheckWebsite"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml deleted file mode 100644 index 428b3828901cd..0000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml +++ /dev/null @@ -1,759 +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"> - <!--Navigate to create product page from product grid page--> - <actionGroup name="goToCreateProductPage"> - <annotations> - <description>Clicks on the 'Add Product' toggle on the Admin Products grid page. Clicks on the provided Product (Type).</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - - <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductToggle"/> - <waitForElementVisible selector="{{AdminProductGridActionSection.addTypeProduct(product.type_id)}}" stepKey="waitForAddProductDropdown" time="30"/> - <click selector="{{AdminProductGridActionSection.addTypeProduct(product.type_id)}}" stepKey="clickAddProductType"/> - <waitForPageLoad time="30" stepKey="waitForCreateProductPageLoad"/> - <seeInCurrentUrl url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, product.type_id)}}" stepKey="seeNewProductUrl"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeNewProductTitle"/> - </actionGroup> - - <!--Navigate to create product page directly via ID--> - <actionGroup name="goToProductPageViaID"> - <annotations> - <description>Goes to the Product edit page for the provided Product ID.</description> - </annotations> - <arguments> - <argument name="productId" type="string"/> - </arguments> - - <amOnPage url="{{AdminProductEditPage.url(productId)}}" stepKey="goToProduct"/> - </actionGroup> - - <!-- Fill main fields in create product form using a product entity --> - <actionGroup name="fillMainProductForm"> - <annotations> - <description>Fills in the provided Product details (Name, SKU, Price, Quantity, Stock Status, Weight Type and Weight) on the Admin Products creation/edit page.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - - <scrollToTopOfPage stepKey="scrollToTopOfPage"/> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/> - <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="fillProductQty"/> - <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="selectStockStatus"/> - <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has weight" stepKey="selectWeight"/> - <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{product.weight}}" stepKey="fillProductWeight"/> - </actionGroup> - - <!-- Fill main fields in create product form using strings for flexibility --> - <actionGroup name="FillMainProductFormByString"> - <annotations> - <description>Fills in the provided Product Name, SKU, Price, Quantity, Stock Status and Weight on the Admin Products creation/edit page.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - <argument name="productSku" type="string"/> - <argument name="productPrice" type="string"/> - <argument name="productQuantity" type="string"/> - <argument name="productStatus" type="string"/> - <argument name="productWeight" type="string"/> - </arguments> - - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{productName}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{productSku}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{productPrice}}" stepKey="fillProductPrice"/> - <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{productQuantity}}" stepKey="fillProductQty"/> - <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{productStatus}}" stepKey="selectStockStatus"/> - <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has weight" stepKey="selectWeight"/> - <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{productWeight}}" stepKey="fillProductWeight"/> - </actionGroup> - - <!--Fill main fields in create product form with no weight, useful for virtual and downloadable products --> - <actionGroup name="fillMainProductFormNoWeight"> - <annotations> - <description>Fills in the provided Product details (Name, SKU, Price, Quantity, Stock Status and Weight Type) on the Admin Products creation/edit page.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="DownloadableProduct"/> - </arguments> - - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/> - <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="fillProductQty"/> - <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="selectStockStatus"/> - <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has no weight" stepKey="selectWeight"/> - </actionGroup> - - <!--Fill main fields in create product form with name and sku --> - <actionGroup name="fillProductNameAndSkuInProductForm"> - <annotations> - <description>Fills in the provided Product details (Name and SKU) on the Admin Products creation and edit page.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/> - </actionGroup> - <actionGroup name="AdminFillProductCountryOfManufactureActionGroup"> - <arguments> - <argument name="countryId" type="string" defaultValue="US"/> - </arguments> - <selectOption selector="{{AdminProductFormBundleSection.countryOfManufactureDropDown}}" userInput="{{countryId}}" stepKey="countryOfManufactureDropDown"/> - </actionGroup> - - <!--Check that required fields are actually required--> - <actionGroup name="checkRequiredFieldsInProductForm"> - <annotations> - <description>Validates that the 'Required Field' error message is present and correct for the Product Name, SKU and Price fields.</description> - </annotations> - - <clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductName"/> - <clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductSku"/> - <clearField selector="{{AdminProductFormSection.productPrice}}" stepKey="clearProductPrice"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/> - <see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/> - <see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/> - <see selector="{{AdminProductFormSection.priceFieldError}}" userInput="This is a required field." stepKey="seePriceRequired"/> - </actionGroup> - - <!--Save product and see success message--> - <actionGroup name="saveProductForm"> - <annotations> - <description>Clicks on the Save button. Validates that the Success Message is present and correct.</description> - </annotations> - - <scrollToTopOfPage stepKey="scrollTopPageProduct"/> - <waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveProductButton"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitProductSaveSuccessMessage"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/> - </actionGroup> - - <actionGroup name="toggleProductEnabled"> - <annotations> - <description>Clicks on the Enable Product toggle.</description> - </annotations> - - <click selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="toggleEnabled"/> - </actionGroup> - - <!-- Save product but do not expect a success message --> - <actionGroup name="SaveProductFormNoSuccessCheck" extends="saveProductForm"> - <annotations> - <description>EXTENDS: saveProductForm. Removes 'waitProductSaveSuccessMessage' and 'seeSaveConfirmation'.</description> - </annotations> - - <remove keyForRemoval="waitProductSaveSuccessMessage"/> - <remove keyForRemoval="seeSaveConfirmation"/> - </actionGroup> - - <!--Upload image for product--> - <actionGroup name="addProductImage"> - <annotations> - <description>Adds the provided Product Image on the Admin Products creation/edit page.</description> - </annotations> - <arguments> - <argument name="image" defaultValue="ProductImage"/> - </arguments> - - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/> - <waitForPageLoad time="30" stepKey="waitForPageRefresh"/> - <waitForElementVisible selector="{{AdminProductImagesSection.imageUploadButton}}" stepKey="seeImageSectionIsReady"/> - <attachFile selector="{{AdminProductImagesSection.imageFileUpload}}" userInput="{{image.file}}" stepKey="uploadFile"/> - <waitForElementNotVisible selector="{{AdminProductImagesSection.uploadProgressBar}}" stepKey="waitForUpload"/> - <waitForElementVisible selector="{{AdminProductImagesSection.imageFile(image.fileName)}}" stepKey="waitForThumbnail"/> - </actionGroup> - - <!--Remove image for product--> - <actionGroup name="removeProductImage"> - <annotations> - <description>Removes a Product Image on the Admin Products creation/edit page.</description> - </annotations> - - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/> - <waitForPageLoad time="30" stepKey="waitForPageRefresh"/> - <click selector="{{AdminProductImagesSection.removeImageButton}}" stepKey="clickRemoveImage"/> - </actionGroup> - - <!--Remove Product image by name--> - <actionGroup name="RemoveProductImageByName" extends="removeProductImage"> - <annotations> - <description>Removes a Product Image on the Admin Products creation/edit page by name.</description> - </annotations> - - <arguments> - <argument name="image" defaultValue="ProductImage"/> - </arguments> - <click selector="{{AdminProductImagesSection.removeImageButtonForExactImage(image.fileName)}}" stepKey="clickRemoveImage"/> - </actionGroup> - - <!-- Assert product image in Admin Product page --> - <actionGroup name="assertProductImageAdminProductPage"> - <annotations> - <description>Validates that the provided Product Image is present and correct.</description> - </annotations> - <arguments> - <argument name="image" defaultValue="MagentoLogo"/> - </arguments> - - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <seeElement selector="{{AdminProductImagesSection.imageFile(image.filename)}}" stepKey="seeImage"/> - </actionGroup> - - <!-- Assert no product image in Admin Product page --> - <actionGroup name="assertProductImageNotInAdminProductPage"> - <annotations> - <description>Validates that the provided Product Image is NOT present.</description> - </annotations> - <arguments> - <argument name="image" defaultValue="MagentoLogo"/> - </arguments> - - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <dontSeeElement selector="{{AdminProductImagesSection.imageFile(image.filename)}}" stepKey="seeImage"/> - </actionGroup> - - <!--Fill fields for simple product in a category in Admin--> - <actionGroup name="FillAdminSimpleProductForm"> - <annotations> - <description>Goes to the Admin Product grid page. Clicks on Add. Fills the provided Product details (Name, SKU, Price, Quantity, Category and URL). Clicks on Save. Validates that the Product details are present and correct.</description> - </annotations> - <arguments> - <argument name="category"/> - <argument name="simpleProduct"/> - </arguments> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> - <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/> - <click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/> - <fillField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> - <fillField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/> - <fillField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/> - <fillField userInput="{{simpleProduct.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/> - <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="searchAndSelectCategory"/> - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> - <fillField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveMessageSuccess"/> - <seeInField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="assertFieldName"/> - <seeInField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="assertFieldSku"/> - <seeInField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="assertFieldPrice"/> - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSectionAssert"/> - <seeInField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="assertFieldUrlKey"/> - </actionGroup> - - <!--Fill fields for simple product in a category in Admin, including text option with char limit--> - <actionGroup name="AdminCreateSimpleProductWithTextOptionCharLimit"> - <annotations> - <description>Goes to the Admin Product grid page. Clicks on Add. Fills the provided Product details (Name, SKU, Price, Quantity, Category and URL). Adds a Text Product Option with the provided Char Limits. Clicks on Save. Validates that the Product details are present and correct.</description> - </annotations> - <arguments> - <argument name="category"/> - <argument name="simpleProduct"/> - <argument name="charLimit"/> - </arguments> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> - <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/> - <click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/> - <fillField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> - <fillField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/> - <fillField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/> - <fillField userInput="{{simpleProduct.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/> - <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="searchAndSelectCategory"/> - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> - <fillField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> - - <click selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="openCustomOptionsSection"/> - <click selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" stepKey="clickAddOption"/> - <fillField selector="{{AdminProductCustomizableOptionsSection.optionTitleInput('0')}}" userInput="option1" stepKey="fillOptionTitle"/> - <click selector="{{AdminProductCustomizableOptionsSection.optionTypeOpenDropDown}}" stepKey="openTypeDropDown"/> - <click selector="{{AdminProductCustomizableOptionsSection.optionTypeTextField}}" stepKey="selectTypeTextField"/> - <fillField userInput="20" selector="{{AdminProductCustomizableOptionsSection.maxCharactersInput}}" stepKey="fillMaxChars"/> - - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveMessageSuccess"/> - <seeInField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="assertFieldName"/> - <seeInField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="assertFieldSku"/> - <seeInField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="assertFieldPrice"/> - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSectionAssert"/> - <seeInField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="assertFieldUrlKey"/> - </actionGroup> - - <actionGroup name="ProductSetWebsite"> - <annotations> - <description>Sets the provided Website on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="website" type="string"/> - </arguments> - - <scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToWebsites"/> - <conditionalClick selector="{{ProductInWebsitesSection.sectionHeader}}" dependentSelector="{{ProductInWebsitesSection.website(website)}}" visible="false" stepKey="clickToOpenProductInWebsite"/> - <waitForPageLoad stepKey="waitForPageOpened"/> - <click selector="{{ProductInWebsitesSection.website(website)}}" stepKey="selectWebsite"/> - <click selector="{{AdminProductFormAdvancedPricingSection.save}}" stepKey="clickSaveProduct"/> - <waitForPageLoad time='60' stepKey="waitForProducrSaved"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSaveSuccessMessage"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveSuccessMessage"/> - </actionGroup> - - <actionGroup name="ProductSetAdvancedPricing"> - <annotations> - <description>Sets the provided Advanced Pricing on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="website" type="string" defaultValue=""/> - <argument name="group" type="string" defaultValue="Retailer"/> - <argument name="quantity" type="string" defaultValue="1"/> - <argument name="price" type="string" defaultValue="Discount"/> - <argument name="amount" type="string" defaultValue="45"/> - </arguments> - - <click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton"/> - <waitForElement selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForCustomerGroupPriceAddButton"/> - <click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAnd10percent"/> - <waitForElement selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect('0')}}" stepKey="waitForSelectCustomerGroupNameAttribute2"/> - <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceWebsiteSelect('0')}}" userInput="{{website}}" stepKey="selectProductWebsiteValue"/> - <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect('0')}}" userInput="{{group}}" stepKey="selectProductCustomGroupValue"/> - <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceQtyInput('0')}}" userInput="{{quantity}}" stepKey="fillProductTierPriceQtyInput"/> - <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceValueTypeSelect('0')}}" userInput="{{price}}" stepKey="selectProductTierPriceValueType"/> - <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('0')}}" userInput="{{amount}}" stepKey="selectProductTierPricePriceInput"/> - <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton"/> - <waitForPageLoad stepKey="WaitForProductSave"/> - <click selector="{{AdminProductFormAdvancedPricingSection.save}}" stepKey="clickSaveProduct1"/> - <waitForPageLoad time="60" stepKey="WaitForProductSave1"/> - <see userInput="You saved the product." stepKey="seeSaveConfirmation"/> - </actionGroup> - <actionGroup name="ProductSetAdvancedTierFixedPricing" extends="ProductSetAdvancedPricing"> - <remove keyForRemoval="selectProductTierPricePriceInput"/> - <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceFixedPriceInput('0')}}" userInput="{{amount}}" stepKey="selectProductTierPricePriceInput" after="selectProductTierPriceValueType"/> - </actionGroup> - - <!--Assert text in Related, Up-Sell or Cross-Sell section in Admin Product page--> - <actionGroup name="AssertTextInAdminProductRelatedUpSellCrossSellSection"> - <annotations> - <description>Validates that provided Text appears in the provided Element on the Admin Product creation/edit page under 'Related Products, Up-Sells, and Cross-Sells' section.</description> - </annotations> - <arguments> - <argument name="element" defaultValue="AdminProductFormRelatedUpSellCrossSellSection.relatedProductSectionText"/> - <argument name="expectedText"/> - </arguments> - - <conditionalClick selector="{{AdminProductFormSection.productFormTab('Related Products')}}" dependentSelector="{{AdminProductFormSection.productFormTabState('Related Products', 'closed')}}" visible="true" stepKey="openTab"/> - <waitForPageLoad time="30" stepKey="waitForPageLoad"/> - <see selector="{{element}}" userInput="{{expectedText}}" stepKey="assertText"/> - </actionGroup> - - <!--Related products--> - <actionGroup name="addRelatedProductBySku"> - <annotations> - <description>Adds the provided Product SKU as a Related Product on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="sku"/> - </arguments> - - <!--Scroll up to avoid error--> - <scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" x="0" y="-100" stepKey="scrollTo"/> - <conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedUpSellCrossSell"/> - <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddRelatedProductsButton}}" stepKey="clickAddRelatedProductButton"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <click selector="{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectProduct"/> - <click selector="{{AdminAddRelatedProductsModalSection.AddSelectedProductsButton}}" stepKey="addRelatedProductSelected"/> - <waitForElementNotVisible selector="{{AdminAddRelatedProductsModalSection.AddSelectedProductsButton}}" stepKey="waitForElementNotVisible"/> - </actionGroup> - - <!--Click AddCrossSellProducts and adds product by SKU--> - <actionGroup name="addCrossSellProductBySku"> - <annotations> - <description>Adds the provided Product SKU as a Cross Sell Product on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="sku"/> - </arguments> - - <!--Scroll up to avoid error--> - <scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" x="0" y="-100" stepKey="scrollTo"/> - <conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedUpSellCrossSell"/> - <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddCrossSellProductsButton}}" stepKey="clickAddCrossSellButton"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <click selector="{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectProduct"/> - <click selector="{{AdminProductCrossSellModalSection.addSelectedProducts}}" stepKey="addRelatedProductSelected"/> - <waitForPageLoad stepKey="waitForModalDisappear"/> - </actionGroup> - - <!--Add special price to product in Admin product page--> - <actionGroup name="AddSpecialPriceToProductActionGroup"> - <annotations> - <description>Sets the provided Special Price on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="price" type="string" defaultValue="8"/> - </arguments> - - <waitForPageLoad stepKey="waitForPageLoad"/> - <click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickAdvancedPricingLink"/> - <waitForPageLoad stepKey="waitForAdvancedPricingModal"/> - <waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="waitSpecialPrice"/> - <fillField userInput="{{price}}" selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="fillSpecialPrice"/> - <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDone"/> - <waitForPageLoad stepKey="waitForAdvancedPricingModalGone"/> - <waitForElementNotVisible selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="waitForCloseModalWindow"/> - </actionGroup> - - <!--Select Product In Websites--> - <actionGroup name="SelectProductInWebsitesActionGroup"> - <annotations> - <description>Sets the provided Website on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="website" type="string"/> - </arguments> - - <scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToWebsites"/> - <conditionalClick selector="{{ProductInWebsitesSection.sectionHeader}}" dependentSelector="{{AdminProductContentSection.sectionHeaderShow}}" visible="false" stepKey="expandSection"/> - <waitForPageLoad stepKey="waitForPageOpened"/> - <checkOption selector="{{ProductInWebsitesSection.website(website)}}" stepKey="selectWebsite"/> - </actionGroup> - <actionGroup name="unassignWebsiteFromProductActionGroup" extends="SelectProductInWebsitesActionGroup"> - <remove keyForRemoval="selectWebsite"/> - <uncheckOption selector="{{ProductInWebsitesSection.website(website)}}" stepKey="unSelectWebsite" after="waitForPageOpened"/> - </actionGroup> - - <actionGroup name="AdminProductAddSpecialPrice"> - <annotations> - <description>Sets the provided Special Price on the Admin Product creation/edit page. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="specialPrice" type="string"/> - </arguments> - - <click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickAdvancedPricingLink1"/> - <waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="waitSpecialPrice1"/> - <click selector="{{AdminProductFormAdvancedPricingSection.useDefaultPrice}}" stepKey="checkUseDefault"/> - <fillField userInput="{{specialPrice}}" selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="fillSpecialPrice"/> - <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDone"/> - <waitForElementNotVisible selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="waitForCloseModalWindow"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> - </actionGroup> - - <!--Switch to New Store view--> - <actionGroup name="SwitchToTheNewStoreView"> - <annotations> - <description>Switches the New Store View.</description> - </annotations> - <arguments> - <argument name="storeViewName" type="string"/> - </arguments> - - <scrollTo selector="{{AdminProductContentSection.pageHeader}}" stepKey="scrollToUp"/> - <waitForElementVisible selector="{{AdminProductFormActionSection.changeStoreButton}}" stepKey="waitForElementBecomeVisible"/> - <click selector="{{AdminProductFormActionSection.changeStoreButton}}" stepKey="clickStoreviewSwitcher"/> - <click selector="{{AdminProductFormActionSection.selectStoreView(storeViewName)}}" stepKey="chooseStoreView"/> - <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="acceptStoreSwitchingMessage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <!--Create a Simple Product--> - <actionGroup name="createSimpleProductAndAddToWebsite"> - <annotations> - <description>Goes to the Admin Product grid page. Clicks on Add Product. Fills the provided Product Details (Name, SKU, Price, Quantity and Website). Clicks on Save.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="website" type="string"/> - </arguments> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToCatalogProductGrid"/> - <waitForPageLoad stepKey="waitForProductGrid"/> - <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/> - <click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/> - <fillField userInput="{{product.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillProductName"/> - <fillField userInput="{{product.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillProductSKU"/> - <fillField userInput="{{product.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillProductPrice"/> - <fillField userInput="{{product.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillProductQuantity"/> - <click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="openProductInWebsites"/> - <click selector="{{ProductInWebsitesSection.website(website)}}" stepKey="selectWebsite"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSave"/> - <waitForLoadingMaskToDisappear stepKey="waitForProductPageSave"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> - </actionGroup> - - <actionGroup name="CreatedProductConnectToWebsite"> - <annotations> - <description>Clicks on 'Edit' for the provided Product. Clicks on the provided Website. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="website"/> - <argument name="product"/> - </arguments> - - <click stepKey="openProduct" selector="{{AdminProductGridActionSection.productName(product.sku)}}"/> - <waitForPageLoad stepKey="waitForProductPage"/> - <scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="ScrollToWebsites"/> - <click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="openWebsitesList"/> - <waitForPageLoad stepKey="waitForWebsitesList"/> - <click selector="{{ProductInWebsitesSection.website(website.name)}}" stepKey="SelectWebsite"/> - <click selector="{{AdminProductFormAdvancedPricingSection.save}}" stepKey="clickSaveProduct"/> - <waitForPageLoad stepKey="waitForSave"/> - </actionGroup> - - <!-- Action group assign to one website and unassign from another --> - <actionGroup name="AdminProcessProductWebsitesActionGroup" extends="CreatedProductConnectToWebsite"> - <arguments> - <argument name="websiteToUnassign"/> - </arguments> - <uncheckOption selector="{{ProductInWebsitesSection.website(websiteToUnassign.name)}}" after="SelectWebsite" stepKey="uncheckWebsite"/> - </actionGroup> - - <!--Check tier price with a discount percentage on product--> - <actionGroup name="AssertDiscountsPercentageOfProducts"> - <annotations> - <description>Validates that the provided Product Tier Price is present and correct.</description> - </annotations> - <arguments> - <argument name="amount" type="string" defaultValue="45"/> - </arguments> - - <click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton"/> - <waitForElement selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForCustomerGroupPriceAddButton"/> - <grabValueFrom selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('0')}}" stepKey="grabProductTierPriceInput"/> - <assertEquals stepKey="assertProductTierPriceInput"> - <expectedResult type="string">{{amount}}</expectedResult> - <actualResult type="string">$grabProductTierPriceInput</actualResult> - </assertEquals> - </actionGroup> - - <!-- This action group goes to the product index page, opens the drop down and clicks the specified product type for adding a product --> - <actionGroup name="GoToSpecifiedCreateProductPage"> - <annotations> - <description>Goes to the Admin Product grid page. Clicks on the Add Product toggle. Clicks on the provided Product Type.</description> - </annotations> - <arguments> - <argument type="string" name="productType" defaultValue="simple"/> - </arguments> - - <comment userInput="actionGroup:GoToSpecifiedCreateProductPage" stepKey="actionGroupComment"/> - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> - <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/> - <click selector="{{AdminProductGridActionSection.addTypeProduct(productType)}}" stepKey="clickAddProduct"/> - <waitForPageLoad stepKey="waitForFormToLoad"/> - </actionGroup> - - <!-- This action group simply navigates to the product catalog page --> - <actionGroup name="GoToProductCatalogPage"> - <annotations> - <description>Goes to the Admin Products grid page.</description> - </annotations> - - <comment userInput="actionGroup:GoToProductCatalogPage" stepKey="actionGroupComment"/> - <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/> - <waitForPageLoad stepKey="WaitForPageToLoad"/> - </actionGroup> - - <actionGroup name="SetProductUrlKey"> - <annotations> - <description>Fills the Product details (URL) for the SEO section.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> - <fillField userInput="{{product.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> - </actionGroup> - - <actionGroup name="SetProductUrlKeyByString"> - <annotations> - <description>Fills the Product SEO URL Key.</description> - </annotations> - <arguments> - <argument name="urlKey" type="string"/> - </arguments> - - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> - <fillField userInput="{{urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> - </actionGroup> - - <actionGroup name="SetCategoryByName"> - <annotations> - <description>Sets the provided Category Name for a Product on the Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="categoryName" type="string"/> - </arguments> - - <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{categoryName}}]" stepKey="searchAndSelectCategory"/> - </actionGroup> - <!--Remove category from product in ProductFrom Page--> - <actionGroup name="removeCategoryFromProduct"> - <arguments> - <argument name="categoryName" type="string" defaultValue="{{_defaultCategory.name}}"/> - </arguments> - <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> - <click selector="{{AdminProductFormSection.unselectCategories(categoryName)}}" stepKey="unselectCategories"/> - <click selector="{{AdminProductFormSection.done}}" stepKey="clickOnDoneAdvancedCategory"/> - </actionGroup> - - <actionGroup name="expandAdminProductSection"> - <annotations> - <description>Expand the provided Section Selector based on the provided dependant Section Selector.</description> - </annotations> - <arguments> - <argument name="sectionSelector" defaultValue="{{AdminProductContentSection.sectionHeader}}" type="string"/> - <argument name="sectionDependentSelector" defaultValue="{{AdminProductContentSection.sectionHeaderShow}}" type="string"/> - </arguments> - - <scrollToTopOfPage stepKey="scrollToTopOfPage"/> - <waitForElementVisible time="30" selector="{{sectionSelector}}" stepKey="waitForSection"/> - <conditionalClick selector="{{sectionSelector}}" dependentSelector="{{sectionDependentSelector}}" visible="false" stepKey="expandSection"/> - <waitForPageLoad time="30" stepKey="waitForSectionToExpand"/> - </actionGroup> - - <actionGroup name="navigateToCreatedProductEditPage"> - <annotations> - <description>Goes to the Admin Product grid page. Filters the Product grid based on the provided Product details (SKU). Edits the provided Product. Validates that the Product SKU is present and correct.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToAdminProductIndexPage"/> - <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <waitForPageLoad stepKey="waitForClearFilters"/> - <dontSeeElement selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="dontSeeClearFilters"/> - <click selector="{{AdminProductGridFilterSection.viewDropdown}}" stepKey="openViewBookmarksTab"/> - <click selector="{{AdminProductGridFilterSection.viewBookmark('Default View')}}" stepKey="resetToDefaultGridView"/> - <waitForPageLoad stepKey="waitForResetToDefaultView"/> - <see selector="{{AdminProductGridFilterSection.viewDropdown}}" userInput="Default View" stepKey="seeDefaultViewSelected"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForPageLoad stepKey="waitForFilterOnGrid"/> - <click selector="{{AdminProductGridSection.selectRowBasedOnName(product.name)}}" stepKey="clickProduct"/> - <waitForPageLoad stepKey="waitForProductEditPageLoad"/> - <waitForElementVisible selector="{{AdminProductFormBundleSection.productSku}}" stepKey="waitForProductSKUField"/> - <seeInField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{product.sku}}" stepKey="seeProductSKU"/> - </actionGroup> - - <actionGroup name="addUpSellProductBySku" extends="addRelatedProductBySku"> - <annotations> - <description>EXTENDS: addRelatedProductBySku. Add the provided Product as an Up Sell Product.</description> - </annotations> - - <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddUpSellProductsButton}}" stepKey="clickAddRelatedProductButton"/> - <conditionalClick selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminAddUpSellProductsModalSection.Modal}} {{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <click selector="{{AdminAddUpSellProductsModalSection.Modal}}{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectProduct"/> - <click selector="{{AdminAddUpSellProductsModalSection.AddSelectedProductsButton}}" stepKey="addRelatedProductSelected"/> - <waitForPageLoad stepKey="waitForPageToLoad1"/> - </actionGroup> - <actionGroup name="adminProductAdvancedPricingNewCustomerGroupPrice"> - <arguments> - <argument name="qty" type="string" defaultValue="2"/> - <argument name="priceType" type="string" defaultValue="Discount"/> - <argument name="discount" type="string" defaultValue="75"/> - <argument name="customerGroup" type="string" defaultValue="0"/> - </arguments> - <click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="addCustomerGroup"/> - <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceQtyInput(customerGroup)}}" userInput="{{qty}}" stepKey="fillProductTierPriceQtyInput1"/> - <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceValueTypeSelect(customerGroup)}}" userInput="{{priceType}}" stepKey="selectProductTierPriceValueType1"/> - <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput(customerGroup)}}" userInput="{{discount}}" stepKey="selectProductTierPricePriceInput"/> - <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton1"/> - </actionGroup> - <actionGroup name="AdminSetProductDisabled"> - <conditionalClick selector="{{AdminProductFormSection.enableProductLabel}}" dependentSelector="{{AdminProductFormSection.productStatusValue('1')}}" visible="true" stepKey="disableProduct"/> - <seeElement selector="{{AdminProductFormSection.productStatusValue('2')}}" stepKey="assertThatProductSetToDisabled"/> - </actionGroup> - - <!-- You are on product Edit Page --> - <!-- Assert checkbox available for website in Product In Websites --> - <actionGroup name="AssertWebsiteIsAvailableInProductWebsites"> - <arguments> - <argument name="website" type="string"/> - </arguments> - <scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToProductInWebsitesSection"/> - <conditionalClick selector="{{ProductInWebsitesSection.sectionHeader}}" dependentSelector="{{ProductInWebsitesSection.sectionHeaderOpened}}" visible="false" stepKey="expandProductWebsitesSection"/> - <seeElement selector="{{ProductInWebsitesSection.website(website)}}" stepKey="seeCheckboxForWebsite"/> - </actionGroup> - - <!-- You are on product Edit Page --> - <!-- Assert checkbox not available for website in Product In Websites --> - <actionGroup name="AssertWebsiteIsNotAvailableInProductWebsites" extends="AssertWebsiteIsAvailableInProductWebsites"> - <remove keyForRemoval="seeCheckboxForWebsite"/> - <dontSeeElement selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="dontSeeCheckboxForWebsite"/> - </actionGroup> - - <!-- You are on product Edit Page --> - <!-- Assert checkbox Is checked for website in Product In Websites --> - <actionGroup name="AssertProductIsAssignedToWebsite" extends="AssertWebsiteIsAvailableInProductWebsites"> - <remove keyForRemoval="seeCheckboxForWebsite"/> - <seeCheckboxIsChecked selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="seeCustomWebsiteIsChecked"/> - </actionGroup> - - <!-- You are on product Edit Page --> - <!-- Assert checkbox is not checked for website in Product In Websites --> - <actionGroup name="AssertProductIsNotAssignedToWebsite" extends="AssertWebsiteIsAvailableInProductWebsites"> - <remove keyForRemoval="seeCheckboxForWebsite"/> - <dontSeeCheckboxIsChecked selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="seeCustomWebsiteIsNotChecked"/> - </actionGroup> - - <!-- You are on product Edit Page --> - <!-- Assert Product Name in admin Product page --> - <actionGroup name="AssertProductNameInProductEditForm"> - <arguments> - <argument name="productName" type="string"/> - </arguments> - <seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{productName}}" stepKey="seeProductNameOnEditProductPage"/> - </actionGroup> - - <!-- You are on product Edit Page --> - <!-- Assert Product Description in admin Product page --> - <actionGroup name="AssertProductDescriptionInProductEditForm"> - <arguments> - <argument name="productDescription" type="string"/> - </arguments> - <conditionalClick selector="{{AdminProductContentSection.sectionHeader}}" dependentSelector="{{AdminProductContentSection.sectionHeaderShow}}" visible="false" stepKey="expandContentSection"/> - <seeInField selector="{{AdminProductContentSection.descriptionTextArea}}" userInput="{{productDescription}}" stepKey="seeProductDescription"/> - </actionGroup> - - <!-- You are on StorefrontProductPage --> - <!-- Check active product image --> - <actionGroup name="StorefrontAssertActiveProductImage"> - <arguments> - <argument name="fileName" defaultValue="magento-logo" type="string"/> - </arguments> - <seeElement selector="{{StorefrontProductMediaSection.productImageActive(fileName)}}" stepKey="seeActiveImageDefault"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAddSpecialPriceActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAddSpecialPriceActionGroup.xml new file mode 100644 index 0000000000000..fc0f908ff5fbe --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAddSpecialPriceActionGroup.xml @@ -0,0 +1,28 @@ +<?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="AdminProductAddSpecialPriceActionGroup"> + <annotations> + <description>Sets the provided Special Price on the Admin Product creation/edit page. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="specialPrice" type="string"/> + </arguments> + + <click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickAdvancedPricingLink1"/> + <waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="waitSpecialPrice1"/> + <click selector="{{AdminProductFormAdvancedPricingSection.useDefaultPrice}}" stepKey="checkUseDefault"/> + <fillField userInput="{{specialPrice}}" selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="fillSpecialPrice"/> + <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDone"/> + <waitForElementNotVisible selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="waitForCloseModalWindow"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAdvancedPricingNewCustomerGroupPriceActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAdvancedPricingNewCustomerGroupPriceActionGroup.xml new file mode 100644 index 0000000000000..f465eceb8f008 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAdvancedPricingNewCustomerGroupPriceActionGroup.xml @@ -0,0 +1,24 @@ +<?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="AdminProductAdvancedPricingNewCustomerGroupPriceActionGroup"> + <arguments> + <argument name="qty" type="string" defaultValue="2"/> + <argument name="priceType" type="string" defaultValue="Discount"/> + <argument name="discount" type="string" defaultValue="75"/> + <argument name="customerGroup" type="string" defaultValue="0"/> + </arguments> + <click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="addCustomerGroup"/> + <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceQtyInput(customerGroup)}}" userInput="{{qty}}" stepKey="fillProductTierPriceQtyInput1"/> + <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceValueTypeSelect(customerGroup)}}" userInput="{{priceType}}" stepKey="selectProductTierPriceValueType1"/> + <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput(customerGroup)}}" userInput="{{discount}}" stepKey="selectProductTierPricePriceInput"/> + <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml deleted file mode 100644 index 42e0bb24c744f..0000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml +++ /dev/null @@ -1,379 +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="navigateToCreatedProductAttribute"> - <annotations> - <description>Goes to the Product Attributes grid page. Filters the grid based on the provided Product Attribute. Clicks on the 1st row.</description> - </annotations> - <arguments> - <argument name="ProductAttribute"/> - </arguments> - - <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> - <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttribute.attribute_code}}" stepKey="setAttributeCode"/> - <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> - <click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - </actionGroup> - - <actionGroup name="navigateToEditProductAttribute"> - <annotations> - <description>Goes to the Product Attributes grid page. Filters the grid based on the provided Product Attribute. Clicks on the 1st row.</description> - </annotations> - <arguments> - <argument name="ProductAttribute" type="string"/> - </arguments> - - <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> - <fillField selector="{{AdminProductAttributeGridSection.GridFilterFrontEndLabel}}" userInput="{{ProductAttribute}}" stepKey="navigateToAttributeEditPage1"/> - <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="navigateToAttributeEditPage2"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="navigateToAttributeEditPage3"/> - <waitForPageLoad stepKey="waitForPageLoad3"/> - </actionGroup> - - <actionGroup name="AdminCreateAttributeFromProductPage"> - <annotations> - <description>From the Product creation/edit page, under 'Configurations', Clicks on 'Create Configurations'. Clicks on 'Create New Attribute'. Fills Label. Selects Type. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="attributeName" type="string"/> - <argument name="attributeType" type="string" defaultValue="TextField"/> - </arguments> - - <click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickAddAttributeBtn"/> - <see userInput="Select Attribute" stepKey="checkNewAttributePopUpAppeared"/> - <click selector="{{AdminProductFormAttributeSection.createNewAttribute}}" stepKey="clickCreateNewAttribute"/> - <fillField selector="{{AdminProductFormNewAttributeSection.attributeLabel}}" userInput="{{attributeName}}" stepKey="fillAttributeLabel"/> - <selectOption selector="{{AdminProductFormNewAttributeSection.attributeType}}" userInput="{{attributeType}}" stepKey="selectAttributeType"/> - <click selector="{{AdminProductFormNewAttributeSection.saveAttribute}}" stepKey="saveAttribute"/> - </actionGroup> - <actionGroup name="AdminCreateAttributeFromProductPageWithScope" extends="AdminCreateAttributeFromProductPage" insertAfter="selectAttributeType"> - <arguments> - <argument name="scope" type="string" defaultValue="Store View"/> - </arguments> - <conditionalClick selector="{{AdminProductFormNewAttributeAdvancedSection.sectionHeader}}" dependentSelector="{{AdminProductFormNewAttributeAdvancedSection.scope}}" visible="false" stepKey="openAttributeAdvancedSection"/> - <selectOption selector="{{AdminProductFormNewAttributeAdvancedSection.scope}}" userInput="{{scope}}" stepKey="selectScope"/> - </actionGroup> - - <actionGroup name="AdminCreateAttributeWithValueWithTwoStoreViesFromProductPage" extends="AdminCreateAttributeFromProductPage"> - <remove keyForRemoval="saveAttribute"/> - <annotations> - <description>EXTENDS: AdminCreateAttributeFromProductPage. Adds the 2 provided Store Views to a Product. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="firstStoreViewName" type="string"/> - <argument name="secondStoreViewName" type="string"/> - </arguments> - - <click selector="{{AdminProductFormNewAttributeSection.addValue}}" stepKey="addValue" after="selectAttributeType"/> - <seeElement selector="{{AdminProductFormNewAttributeSection.optionViewName(firstStoreViewName))}}" stepKey="seeFirstStoreView"/> - <seeElement selector="{{AdminProductFormNewAttributeSection.optionViewName(firstStoreViewName))}}" stepKey="seeSecondStoreView"/> - <fillField selector="{{AdminProductFormNewAttributeSection.optionValue('1'))}}" userInput="default" stepKey="fillDefaultStoreView"/> - <fillField selector="{{AdminProductFormNewAttributeSection.optionValue('2'))}}" userInput="admin" stepKey="fillAdminStoreView"/> - <fillField selector="{{AdminProductFormNewAttributeSection.optionValue('3'))}}" userInput="view1" stepKey="fillFirstStoreView"/> - <fillField selector="{{AdminProductFormNewAttributeSection.optionValue('4'))}}" userInput="view2" stepKey="fillSecondStoreView"/> - - <!--Check store view in Manage Titles section--> - <click selector="{{AdminProductFormNewAttributeSection.manageTitlesHeader}}" stepKey="openManageTitlesSection"/> - <seeElement selector="{{AdminProductFormNewAttributeSection.manageTitlesViewName(customStoreEN.name)}}" stepKey="seeFirstStoreViewName"/> - <seeElement selector="{{AdminProductFormNewAttributeSection.manageTitlesViewName(customStoreFR.name)}}" stepKey="seeSecondStoreViewName"/> - <click selector="{{AdminProductFormNewAttributeSection.saveAttribute}}" stepKey="saveAttribute1"/> - </actionGroup> - - <!-- Creates attribute and attribute set from the product page--> - <actionGroup name="AdminProductPageCreateAttributeSetWithAttribute"> - <annotations> - <description>Adds the provided Product Attribute Set to a Product on the Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="attributeName" type="string"/> - <argument name="attributeSetName" type="string"/> - <argument name="attributeType" type="string" defaultValue="TextField"/> - </arguments> - - <click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickAddAttributeBtn"/> - <waitForPageLoad stepKey="waitForSidePanel"/> - <see userInput="Select Attribute" stepKey="checkNewAttributePopUpAppeared"/> - <click selector="{{AdminProductFormAttributeSection.createNewAttribute}}" stepKey="clickCreateNewAttribute"/> - <fillField selector="{{AdminProductFormNewAttributeSection.attributeLabel}}" userInput="{{attributeName}}" stepKey="fillAttributeLabel"/> - <selectOption selector="{{AdminProductFormNewAttributeSection.attributeType}}" userInput="{{attributeType}}" stepKey="selectAttributeType"/> - <click selector="{{AdminProductFormNewAttributeSection.saveInNewSet}}" stepKey="saveAttribute"/> - <fillField selector="{{AdminProductFormNewAttributeNewSetSection.setName}}" userInput="{{attributeSetName}}" stepKey="fillSetName"/> - <click selector="{{AdminProductFormNewAttributeNewSetSection.accept}}" stepKey="acceptPopup"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingToFinish"/> - <!-- Product page will hang if there is no reload--> - <reloadPage stepKey="reloadPage"/> - <waitForPageLoad stepKey="waitForReload"/> - </actionGroup> - - <!-- Create attribute and set with given search weight and defaultValue from the Edit Product Page --> - <actionGroup name="AdminCreateAttributeWithSearchWeight" extends="AdminProductPageCreateAttributeSetWithAttribute" insertAfter="selectAttributeType"> - <annotations> - <description>EXTENDS: AdminProductPageCreateAttributeSetWithAttribute. Sets the provided Search Weight and Default Values.</description> - </annotations> - <arguments> - <argument name="weight" type="string" defaultValue="1"/> - <argument name="defaultValue" type="string" defaultValue="default"/> - </arguments> - - <click selector="{{AdminProductFormNewAttributeAdvancedSection.sectionHeader}}" stepKey="openAdvancedSection"/> - <fillField selector="{{AdminProductFormNewAttributeAdvancedSection.defaultValue}}" userInput="{{defaultValue}}" stepKey="inputDefault"/> - <click selector="{{AdminProductFormNewAttributeStorefrontSection.sectionHeader}}" stepKey="openStorefrontSection"/> - <checkOption selector="{{AdminProductFormNewAttributeStorefrontSection.useInSearch}}" stepKey="checkUseInSearch"/> - <waitForElementVisible selector="{{AdminProductFormNewAttributeStorefrontSection.searchWeight}}" stepKey="waitForSearchWeight"/> - <selectOption selector="{{AdminProductFormNewAttributeStorefrontSection.searchWeight}}" userInput="{{weight}}" stepKey="selectWeight"/> - </actionGroup> - - <actionGroup name="AdminProductPageSelectAttributeSet"> - <annotations> - <description>Selects the provided Attribute Set from the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="attributeSetName" type="string"/> - </arguments> - - <click stepKey="openDropdown" selector="{{AdminProductFormSection.attributeSet}}"/> - <fillField stepKey="filter" selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{attributeSetName}}"/> - <click stepKey="clickResult" selector="{{AdminProductFormSection.attributeSetFilterResult}}"/> - </actionGroup> - - <actionGroup name="AdminProductPageFillTextAttributeValueByName"> - <annotations> - <description>Fills in the Attribute Name field with the provided value.</description> - </annotations> - <arguments> - <argument name="attributeName" type="string"/> - <argument name="value" type="string"/> - </arguments> - - <click stepKey="openSection" selector="{{AdminProductAttributeSection.attributeSectionHeader}}"/> - <fillField stepKey="fillValue" selector="{{AdminProductAttributeSection.textAttributeByName(attributeName)}}" userInput="{{value}}"/> - </actionGroup> - - <actionGroup name="changeUseForPromoRuleConditionsProductAttribute"> - <annotations> - <description>Select the provided value for the 'Use for Promo Rule Conditions' dropdown menu. Clicks on Save. Validates that the Save message is present.</description> - </annotations> - <arguments> - <argument name="option" type="string"/> - </arguments> - - <click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStoreFrontPropertiesTab"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <selectOption selector="{{StorefrontPropertiesSection.useForPromoRuleConditions}}" userInput="{{option}}" stepKey="changeOption"/> - <click selector="{{AttributePropertiesSection.Save}}" stepKey="saveAttribute"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You saved the product attribute." stepKey="successMessage"/> - </actionGroup> - - <actionGroup name="deleteProductAttribute" extends="navigateToCreatedProductAttribute"> - <annotations> - <description>EXTENDS: navigateToCreatedProductAttribute. Deletes the Product Attribute. Validates that the success message is present.</description> - </annotations> - - <click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="deleteAttribute"/> - <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOnDeleteButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> - </actionGroup> - - <actionGroup name="deleteProductAttributeByLabel"> - <annotations> - <description>Goes to the Admin Product Attributes grid page. Filters the grid for the provided Product Attribute (Label). Deletes the Product Attribute from the grid. Validates that the Success Message is present.</description> - </annotations> - <arguments> - <argument name="ProductAttribute"/> - </arguments> - - <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> - <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttribute.default_label}}" stepKey="setAttributeCode"/> - <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> - <click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="deleteAttribute"/> - <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOnDeleteButton"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> - </actionGroup> - - <!-- Delete product attribute by Attribute Code --> - <actionGroup name="deleteProductAttributeByAttributeCode"> - <annotations> - <description>Goes to the Admin Product Attributes grid page. Filters the grid for the provided Product Attribute Code. Deletes the Product Attribute from the grid. Validates that the Success Message is present.</description> - </annotations> - <arguments> - <argument name="ProductAttributeCode" type="string"/> - </arguments> - - <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> - <waitForPageLoad stepKey="waitForAttributeGridPageLoad"/> - <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttributeCode}}" stepKey="setAttributeCode"/> - <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> - <click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="deleteAttribute"/> - <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOnDeleteButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> - </actionGroup> - - <!--Filter product attribute by Attribute Code --> - <actionGroup name="filterProductAttributeByAttributeCode"> - <annotations> - <description>Filters the Product Attributes grid by the provided Product Attribute Code.</description> - </annotations> - <arguments> - <argument name="ProductAttributeCode" type="string"/> - </arguments> - - <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid"/> - <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttributeCode}}" stepKey="setAttributeCode"/> - <waitForPageLoad stepKey="waitForUserInput"/> - <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> - </actionGroup> - - <!--Filter product attribute by Default Label --> - <actionGroup name="filterProductAttributeByDefaultLabel"> - <annotations> - <description>Filters the Product Attributes grid by the provided Product Attribute Label.</description> - </annotations> - <arguments> - <argument name="productAttributeLabel" type="string"/> - </arguments> - - <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid"/> - <fillField selector="{{AdminProductAttributeGridSection.GridFilterFrontEndLabel}}" userInput="{{productAttributeLabel}}" stepKey="setDefaultLabel"/> - <waitForPageLoad stepKey="waitForUserInput"/> - <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> - </actionGroup> - - <actionGroup name="saveProductAttribute"> - <annotations> - <description>Clicks on Save. Validates that the Success Message is present.</description> - </annotations> - - <waitForElementVisible selector="{{AttributePropertiesSection.Save}}" stepKey="waitForSaveButton"/> - <click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSaveButton"/> - <waitForPageLoad stepKey="waitForAttributeToSave"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="confirmChangeInputTypeModal"> - <annotations> - <description>Clicks on the Confirm button for the 'Product Data My Be Lost' modal.</description> - </annotations> - - <waitForElementVisible selector="{{AdminEditProductAttributesSection.ProductDataMayBeLostConfirmButton}}" stepKey="waitForChangeInputTypeButton"/> - <click selector="{{AdminEditProductAttributesSection.ProductDataMayBeLostConfirmButton}}" stepKey="clickChangeInputTypeButton"/> - <waitForElementNotVisible selector="{{AdminEditProductAttributesSection.ProductDataMayBeLostModal}}" stepKey="waitForChangeInputTypeModalGone"/> - </actionGroup> - - <actionGroup name="saveProductAttributeInUse"> - <annotations> - <description>Clicks on Save. Validates that the Success Message is present.</description> - </annotations> - - <waitForElementVisible selector="{{AttributePropertiesSection.Save}}" stepKey="waitForSaveButton"/> - <click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSaveButton"/> - <waitForPageLoad stepKey="waitForAttributeToSave"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/> - </actionGroup> - - <!--Clicks Add Attribute and adds the given attribute--> - <actionGroup name="addProductAttributeInProductModal"> - <annotations> - <description>Adds the provided Attribute Code to the Product on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="attributeCode" type="string"/> - </arguments> - - <click stepKey="addAttribute" selector="{{AdminProductFormActionSection.addAttributeButton}}"/> - <conditionalClick selector="{{AdminProductAddAttributeModalSection.clearFilters}}" dependentSelector="{{AdminProductAddAttributeModalSection.clearFilters}}" visible="true" stepKey="clearFilters"/> - <click stepKey="clickFilters" selector="{{AdminProductAddAttributeModalSection.filters}}"/> - <fillField stepKey="fillCode" selector="{{AdminProductAddAttributeModalSection.attributeCodeFilter}}" userInput="{{attributeCode}}"/> - <click stepKey="clickApply" selector="{{AdminProductAddAttributeModalSection.applyFilters}}"/> - <waitForPageLoad stepKey="waitForFilters"/> - <checkOption selector="{{AdminProductAddAttributeModalSection.firstRowCheckBox}}" stepKey="checkAttribute"/> - <click stepKey="addSelected" selector="{{AdminProductAddAttributeModalSection.addSelected}}"/> - </actionGroup> - - <!--Clicks createNewAttribute and fills out form--> - <actionGroup name="createProductAttribute"> - <annotations> - <description>Clicks on 'Add New Attribute'. Fills in the Attribute Details (Label, Input Type and Value Required). Clicks on Save.</description> - </annotations> - <arguments> - <argument name="attribute" type="entity" defaultValue="productAttributeWysiwyg"/> - </arguments> - - <click stepKey="createNewAttribute" selector="{{AdminProductAttributeGridSection.createNewAttributeBtn}}"/> - <fillField stepKey="fillDefaultLabel" selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{attribute.attribute_code}}"/> - <selectOption selector="{{AttributePropertiesSection.InputType}}" stepKey="checkInputType" userInput="{{attribute.frontend_input}}"/> - <selectOption selector="{{AttributePropertiesSection.ValueRequired}}" stepKey="checkRequired" userInput="{{attribute.is_required_admin}}"/> - <click stepKey="saveAttribute" selector="{{AttributePropertiesSection.Save}}"/> - </actionGroup> - <actionGroup name="AdminCreateSearchableProductAttribute" extends="createProductAttribute" insertAfter="checkRequired"> - <click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="goToStorefrontPropertiesTab"/> - <waitForElementVisible selector="{{StorefrontPropertiesSection.PageTitle}}" stepKey="waitTabLoad"/> - <selectOption selector="{{AdvancedAttributePropertiesSection.UseInSearch}}" userInput="Yes" stepKey="setSearchable"/> - </actionGroup> - - <!-- Inputs text default value and attribute code--> - <actionGroup name="createProductAttributeWithTextField" extends="createProductAttribute" insertAfter="checkRequired"> - <annotations> - <description>EXTENDS: createProductAttribute. Fills in the Attribute Code and Default Value (Attribute Type: Text Field).</description> - </annotations> - - <click stepKey="openAdvancedProperties" selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}"/> - <fillField stepKey="fillCode" selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attribute.attribute_code}}"/> - <fillField stepKey="fillDefaultValue" selector="{{AdvancedAttributePropertiesSection.DefaultValueText}}" userInput="{{attribute.default_value}}"/> - </actionGroup> - - <!-- Inputs date default value and attribute code--> - <actionGroup name="createProductAttributeWithDateField" extends="createProductAttribute" insertAfter="checkRequired"> - <annotations> - <description>EXTENDS: createProductAttribute. Fills in the Attribute Code and Default Value (Attribute Type: Date Field).</description> - </annotations> - <arguments> - <argument name="date" type="string"/> - </arguments> - - <click stepKey="openAdvancedProperties" selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}"/> - <fillField stepKey="fillCode" selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attribute.attribute_code}}"/> - <fillField stepKey="fillDefaultValue" selector="{{AdvancedAttributePropertiesSection.DefaultValueDate}}" userInput="{{date}}"/> - </actionGroup> - - <!-- Creates dropdown option at row without saving--> - <actionGroup name="createAttributeDropdownNthOption"> - <annotations> - <description>Creates an Option for a Product Attribute (Attribute Type: Dropdown).</description> - </annotations> - <arguments> - <argument name="row" type="string"/> - <argument name="adminName" type="string"/> - <argument name="frontName" type="string"/> - </arguments> - - <click stepKey="clickAddOptions" selector="{{AttributePropertiesSection.dropdownAddOptions}}"/> - <waitForPageLoad stepKey="waitForNewOption"/> - <fillField stepKey="fillAdmin" selector="{{AttributePropertiesSection.dropdownNthOptionAdmin(row)}}" userInput="{{adminName}}"/> - <fillField stepKey="fillStoreView" selector="{{AttributePropertiesSection.dropdownNthOptionDefaultStoreView(row)}}" userInput="{{frontName}}"/> - </actionGroup> - - <!-- Creates dropdown option at row as default--> - <actionGroup name="createAttributeDropdownNthOptionAsDefault" extends="createAttributeDropdownNthOption"> - <annotations> - <description>EXTENDS: createAttributeDropdownNthOption. Checks the 'Is Default' option.</description> - </annotations> - - <checkOption selector="{{AttributePropertiesSection.dropdownNthOptionIsDefault(row)}}" stepKey="setAsDefault" after="fillStoreView"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml index a7d5a3864c052..6e05fa614dfb9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AssignAttributeToGroup"> + <actionGroup name="AssignAttributeToGroupActionGroup"> <annotations> <description>Assign the provided Attribute to an Attribute Set from the Attribute Sets creation/edit page.</description> </annotations> @@ -23,128 +23,4 @@ <waitForPageLoad stepKey="waitForPageLoad2"/> <see userInput="{{attribute}}" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/> </actionGroup> - - <actionGroup name="UnassignAttributeFromGroup"> - <annotations> - <description>Unassign the provided Attribute from an Attribute Set from the Attribute Sets creation/edit page.</description> - </annotations> - <arguments> - <argument name="group" type="string"/> - <argument name="attribute" type="string"/> - </arguments> - - <conditionalClick selector="{{AdminProductAttributeSetEditSection.attributeGroupExtender(group)}}" dependentSelector="{{AdminProductAttributeSetEditSection.attributeGroupCollapsed(group)}}" visible="true" stepKey="extendGroup"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <dragAndDrop selector1="{{AdminProductAttributeSetEditSection.assignedAttribute(attribute)}}" selector2="{{AdminProductAttributeSetEditSection.xThLineItemUnassignedAttribute('1')}}" stepKey="dragAndDropToUnassigned"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <see userInput="{{attribute}}" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassigned"/> - </actionGroup> - - <actionGroup name="SaveAttributeSet"> - <annotations> - <description>Save an Attribute Set on the Attribute Set creation/edit page.</description> - </annotations> - - <click selector="{{AdminProductAttributeSetActionSection.save}}" stepKey="clickSave"/> - <see userInput="You saved the attribute set" selector="{{AdminMessagesSection.success}}" stepKey="successMessage"/> - </actionGroup> - - <!--Generic attribute set creation--> - <actionGroup name="CreateDefaultAttributeSet"> - <annotations> - <description>Goes to the Attribute Sets grid page. Clicks on Add. Fill Name. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="label" type="string"/> - </arguments> - - <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/> - <waitForPageLoad stepKey="wait1"/> - <click selector="{{AdminProductAttributeSetGridSection.addAttributeSetBtn}}" stepKey="clickAddAttributeSet"/> - <fillField selector="{{AdminProductAttributeSetSection.name}}" userInput="{{label}}" stepKey="fillName"/> - <click selector="{{AdminProductAttributeSetSection.saveBtn}}" stepKey="clickSave1"/> - </actionGroup> - <actionGroup name="AdminAddUnassignedAttributeToGroup" extends="CreateDefaultAttributeSet"> - <arguments> - <argument name="firstOption" type="string" defaultValue="color"/> - <argument name="secondOption" type="string" defaultValue="material"/> - <argument name="group" type="string" defaultValue="Product Details"/> - </arguments> - <dragAndDrop selector1="{{AdminProductAttributeSetSection.attribute(firstOption)}}" selector2="{{AdminProductAttributeSetSection.attribute(group)}}" stepKey="unassign1"/> - <dragAndDrop selector1="{{AdminProductAttributeSetSection.attribute(secondOption)}}" selector2="{{AdminProductAttributeSetSection.attribute(group)}}" stepKey="unassign2"/> - <click selector="{{AdminProductAttributeSetSection.saveBtn}}" stepKey="clickSaveButton"/> - </actionGroup> - - <actionGroup name="goToAttributeGridPage"> - <annotations> - <description>Goes to the Attribute Sets grid page.</description> - </annotations> - - <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/> - </actionGroup> - - <actionGroup name="goToAttributeSetByName"> - <annotations> - <description>Searches for the provided Attribute Sets Name. Clicks on the 1st row.</description> - </annotations> - <arguments> - <argument name="name" type="string"/> - </arguments> - - <click selector="{{AdminProductAttributeSetGridSection.resetFilter}}" stepKey="clickResetButton"/> - <fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{name}}" stepKey="filterByName"/> - <click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/> - <click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <!-- Filter By Attribute Label --> - <actionGroup name="filterProductAttributeByAttributeLabel"> - <annotations> - <description>Searches the Attribute Sets grid page for the provided Attribute Set Name.</description> - </annotations> - <arguments> - <argument name="productAttributeLabel" type="string"/> - </arguments> - - <fillField selector="{{AdminProductAttributeGridSection.attributeLabelFilter}}" userInput="{{productAttributeLabel}}" stepKey="setAttributeLabel"/> - <waitForPageLoad stepKey="waitForUserInput"/> - <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> - </actionGroup> - - <actionGroup name="FilterProductAttributeSetGridByAttributeSetName"> - <annotations> - <description>Filters the Attribute Sets grid page for the provided Attribute Set Name.</description> - </annotations> - <arguments> - <argument name="name" type="string"/> - </arguments> - - <click selector="{{AdminProductAttributeSetGridSection.resetFilter}}" stepKey="clickResetButton"/> - <fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{name}}" stepKey="filterByName"/> - <click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/> - <click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/> - <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> - </actionGroup> - - <!-- Delete attribute set --> - <actionGroup name="deleteAttributeSetByLabel"> - <annotations> - <description>Deletes the provided Attribute Set Name from the Attribute Sets grid page.</description> - </annotations> - <arguments> - <argument name="label" type="string"/> - </arguments> - - <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/> - <waitForPageLoad stepKey="waitForAttributeSetPageLoad"/> - <fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{label}}" stepKey="filterByName"/> - <click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/> - <click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/> - <waitForPageLoad stepKey="waitForClick"/> - <click selector="{{AdminProductAttributeSetSection.deleteBtn}}" stepKey="clickDelete"/> - <click selector="{{AdminProductAttributeSetSection.modalOk}}" stepKey="confirmDelete"/> - <waitForPageLoad stepKey="waitForDeleteToFinish"/> - <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="The attribute set has been removed." stepKey="seeDeleteMessage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml deleted file mode 100644 index 320a322fc5f8e..0000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml +++ /dev/null @@ -1,445 +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"> - <!--Reset the product grid to the default view--> - <actionGroup name="resetProductGridToDefaultView"> - <annotations> - <description>Sets the Admin Products grid view to the 'Default View'.</description> - </annotations> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminProductGridFilterSection.viewDropdown}}" stepKey="openViewBookmarksTab"/> - <click selector="{{AdminProductGridFilterSection.viewBookmark('Default View')}}" stepKey="resetToDefaultGridView"/> - <waitForPageLoad stepKey="waitForProductGridLoad"/> - <see selector="{{AdminProductGridFilterSection.viewDropdown}}" userInput="Default View" stepKey="seeDefaultViewSelected"/> - </actionGroup> - - <!--Filter the product grid by the SKU field--> - <actionGroup name="filterProductGridBySku"> - <annotations> - <description>Filters the Admin Products grid by the provided Product (SKU).</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> - </actionGroup> - - <!--Filter the product grid by the SKU string --> - <actionGroup name="filterProductGridBySku2"> - <annotations> - <description>Filters the Admin Products grid by the provided Product SKU.</description> - </annotations> - <arguments> - <argument name="sku" type="string"/> - </arguments> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> - </actionGroup> - - <!--Filter the product grid by the Name field--> - <actionGroup name="filterProductGridByName"> - <annotations> - <description>Filters the Admin Products grid by the provided Product (Name).</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> - </actionGroup> - - <!--Filter the product grid by the Name field--> - <actionGroup name="filterProductGridByName2"> - <annotations> - <description>Filters the Admin Products grid by the provided Product Name.</description> - </annotations> - <arguments> - <argument name="name" type="string"/> - </arguments> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{name}}" stepKey="fillProductNameFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> - </actionGroup> - - <!--Filter the product grid by new from date filter--> - <actionGroup name="filterProductGridBySetNewFromDate"> - <annotations> - <description>Filters the Admin Products grid by the New From Data field. PLEASE NOTE: The Start Date is Hardcoded.</description> - </annotations> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.newFromDateFilter}}" userInput="05/16/2018" stepKey="fillSetAsNewProductFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> - </actionGroup> - - <!--Filter the product grid by a price range--> - <actionGroup name="filterProductGridByPriceRange"> - <annotations> - <description>Filters the Admin Products grid by the provided Price Filter.</description> - </annotations> - <arguments> - <argument name="filter"/> - </arguments> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.priceFilterFrom}}" userInput="{{filter.from}}" stepKey="fillProductPriceFromFilter"/> - <fillField selector="{{AdminProductGridFilterSection.priceFilterTo}}" userInput="{{filter.to}}" stepKey="fillProductPriceToFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> - </actionGroup> - - <!--Filter the product grid to Enabled products--> - <actionGroup name="filterProductGridByEnabledStatus"> - <annotations> - <description>Filters the Admin Products grid by the 'Enabled' Status. PLEASE NOTE: The Filter is Hardcoded.</description> - </annotations> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <selectOption selector="{{AdminProductGridFilterSection.statusFilter}}" userInput="Enabled" stepKey="selectEnabledStatusFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> - </actionGroup> - - <!--Filter the product grid to Disabled products--> - <actionGroup name="filterProductGridByDisabledStatus"> - <annotations> - <description>Filters the Admin Products grid by the 'Disabled' Status. PLEASE NOTE: The Filter is Hardcoded.</description> - </annotations> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <selectOption selector="{{AdminProductGridFilterSection.statusFilter}}" userInput="Disabled" stepKey="selectDisabledStatusFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> - </actionGroup> - - <!--Search product grid with keyword search--> - <actionGroup name="searchProductGridByKeyword"> - <annotations> - <description>Searches the Admin Products grid for the provided Keyword.</description> - </annotations> - <arguments> - <argument name="keyword"/> - </arguments> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <fillField selector="{{AdminProductGridFilterSection.keywordSearch}}" userInput="{{keyword}}" stepKey="fillKeywordSearchField"/> - <click selector="{{AdminProductGridFilterSection.keywordSearchButton}}" stepKey="clickKeywordSearch"/> - </actionGroup> - - <!--Search product grid with keyword search--> - <!-- Argument type: string (see more in MQE-965) --> - <actionGroup name="searchProductGridByKeyword2"> - <annotations> - <description>Searches the Admin Products grid for the provided Keyword.</description> - </annotations> - <arguments> - <argument name="keyword" type="string"/> - </arguments> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <fillField selector="{{AdminProductGridFilterSection.keywordSearch}}" userInput="{{keyword}}" stepKey="fillKeywordSearchField"/> - <click selector="{{AdminProductGridFilterSection.keywordSearchButton}}" stepKey="clickKeywordSearch"/> - </actionGroup> - - <!--Filter product grid by name, sku, and type; and see expected product--> - <actionGroup name="viewProductInAdminGrid"> - <annotations> - <description>Filters the Admin Products grid by the provided Product (Name, SKU and Type).</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <waitForPageLoad stepKey="waitForPageLoadInitial"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> - <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionProductType"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="{{product.name}}" stepKey="seeProductNameInGrid"/> - <see selector="{{AdminProductGridSection.productGridCell('1', 'Price')}}" userInput="{{product.price}}" stepKey="seeProductPriceInGrid"/> - <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> - </actionGroup> - - <!-- Filter product grid by sku, name --> - <actionGroup name="filterProductGridBySkuAndName"> - <annotations> - <description>Filters the Admin Products grid by the provided Product (Name and SKU).</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - </actionGroup> - - <!--Delete a product by filtering grid and using delete action--> - <actionGroup name="deleteProductUsingProductGrid"> - <annotations> - <description>Deletes the provided Product from the Admin Products grid page.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <!--TODO use other action group for filtering grid when MQE-539 is implemented --> - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <waitForPageLoad time="60" stepKey="waitForPageLoadInitial"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <see selector="{{AdminProductGridSection.productGridCell('1', 'SKU')}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> - <click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="openMulticheckDropdown"/> - <click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllProductInFilteredGrid"/> - <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> - <click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/> - <waitForElementVisible selector="{{AdminProductGridConfirmActionSection.title}}" stepKey="waitForConfirmModal"/> - <click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmProductDelete"/> - </actionGroup> - - <!--Delete all products by filtering grid and using mass delete action--> - <actionGroup name="deleteAllDuplicateProductUsingProductGrid" extends="deleteProductUsingProductGrid"> - <annotations> - <description>EXTENDS: deleteProductUsingProductGrid. Removes 'seeProductSkuInGrid'.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <remove keyForRemoval="seeProductSkuInGrid"/> - </actionGroup> - - <!--Delete a product by filtering grid and using delete action--> - <actionGroup name="deleteProductBySku"> - <annotations> - <description>Goes to the Admin Products grid page. Deletes the provided Product SKU.</description> - </annotations> - <arguments> - <argument name="sku" type="string"/> - </arguments> - - <!--TODO use other action group for filtering grid when MQE-539 is implemented --> - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <see selector="{{AdminProductGridSection.productGridCell('1', 'SKU')}}" userInput="{{sku}}" stepKey="seeProductSkuInGrid"/> - <click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="openMulticheckDropdown"/> - <click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllProductInFilteredGrid"/> - <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> - <click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/> - <waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForConfirmModal"/> - <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmProductDelete"/> - <see selector="{{AdminMessagesSection.success}}" userInput="record(s) have been deleted." stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="deleteProductByName" extends="deleteProductBySku"> - <annotations> - <description>EXTENDS: deleteProductBySku. Deletes the provided Product Name.</description> - </annotations> - <arguments> - <argument name="sku" type="string" defaultValue=""/> - <argument name="name" type="string"/> - </arguments> - - <remove keyForRemoval="fillProductSkuFilter"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{name}}" stepKey="fillProductSkuFilter" after="openProductFilters"/> - <remove keyForRemoval="seeProductSkuInGrid"/> - <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="{{name}}" stepKey="seeProductNameInGrid" after="clickApplyFilters"/> - </actionGroup> - - <actionGroup name="deleteProductsByKeyword"> - <annotations> - <description>Delete products by keyword</description> - </annotations> - <arguments> - <argument name="keyword" type="string"/> - </arguments> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <fillField selector="{{AdminProductGridFilterSection.keywordSearch}}" userInput="{{keyword}}" stepKey="fillKeywordField"/> - <click selector="{{AdminProductGridFilterSection.keywordSearchButton}}" stepKey="keywordSearchButton"/> - <click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="openMulticheckDropdown"/> - <click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllProductInFilteredGrid"/> - <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> - <click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/> - <waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForConfirmModal"/> - <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmProductDelete"/> - <see selector="{{AdminMessagesSection.success}}" userInput="record(s) have been deleted." stepKey="seeSuccessMessage"/> - </actionGroup> - - <!--Open product for edit by clicking row X and column Y in product grid--> - <actionGroup name="openProducForEditByClickingRowXColumnYInProductGrid"> - <annotations> - <description>Clicks on the 'Edit' button in the Admin Products grid by the provided Grid coordinates (X, Y).</description> - </annotations> - <arguments> - <argument name="X" type="string" defaultValue="1"/> - <argument name="Y" type="string" defaultValue="2"/> - </arguments> - - <click selector="{{AdminProductGridSection.productGridXRowYColumnButton(X, Y)}}" stepKey="openProductForEdit"/> - </actionGroup> - - <!-- Sort products by ID descending --> - <actionGroup name="sortProductsByIdDescending"> - <annotations> - <description>Filters the ID column in Descending Order.</description> - </annotations> - - <conditionalClick selector="{{AdminProductGridTableHeaderSection.id('ascend')}}" dependentSelector="{{AdminProductGridTableHeaderSection.id('descend')}}" visible="false" stepKey="sortById"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <!-- Sort products by ID ascending --> - <actionGroup name="sortProductsByIdAscending"> - <annotations> - <description>Filters the ID column in Ascending Order.</description> - </annotations> - - <conditionalClick selector="{{AdminProductGridTableHeaderSection.id('descend')}}" dependentSelector="{{AdminProductGridTableHeaderSection.id('ascend')}}" visible="false" stepKey="sortById"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <!--Disabled a product by filtering grid and using change status action--> - <actionGroup name="ChangeStatusProductUsingProductGridActionGroup"> - <annotations> - <description>Goes to the Admin Products grid page. Changes the Product Status to the provided Status. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="status" defaultValue="Enable" type="string"/> - </arguments> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <waitForPageLoad time="60" stepKey="waitForPageLoadInitial"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <see selector="{{AdminProductGridSection.productGridCell('1', 'SKU')}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> - <click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="openMulticheckDropdown"/> - <click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllProductInFilteredGrid"/> - - <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> - <click selector="{{AdminProductGridSection.bulkActionOption('Change status')}}" stepKey="clickChangeStatusAction"/> - <click selector="{{AdminProductGridSection.changeStatus('status')}}" stepKey="clickChangeStatusDisabled"/> - <waitForPageLoad stepKey="waitForStatusToBeChanged"/> - <see selector="{{AdminMessagesSection.success}}" userInput="A total of 1 record(s) have been updated." stepKey="seeSuccessMessage"/> - <waitForLoadingMaskToDisappear stepKey="waitForMaskToDisappear"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial2"/> - </actionGroup> - - <actionGroup name="NavigateToAndResetProductGridToDefaultView" extends="resetProductGridToDefaultView"> - <annotations> - <description>EXTENDS: resetProductGridToDefaultView. Adds an action to go to the Admin Products grid page.</description> - </annotations> - - <amOnPage url="{{AdminProductIndexPage.url}}" before="clickClearFilters" stepKey="goToAdminProductIndexPage"/> - <waitForPageLoad after="goToAdminProductIndexPage" stepKey="waitForProductIndexPageToLoad"/> - </actionGroup> - - <actionGroup name="NavigateToAndResetProductAttributeGridToDefaultView"> - <annotations> - <description>Goes to the Product Attributes grid. Clicks on 'Clear Filters'.</description> - </annotations> - - <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <waitForPageLoad stepKey="waitForGridLoad"/> - </actionGroup> - - <!--Filter and select the product --> - <actionGroup name="filterAndSelectProduct"> - <annotations> - <description>Goes to the Admin Products grid. Filters the Product grid by the provided Product SKU.</description> - </annotations> - <arguments> - <argument name="productSku" type="string"/> - </arguments> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{productSku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> - <click stepKey="openSelectedProduct" selector="{{AdminProductGridSection.productRowBySku(productSku)}}"/> - <waitForPageLoad stepKey="waitForProductToLoad"/> - <waitForElementVisible selector="{{AdminHeaderSection.pageTitle}}" stepKey="waitForProductTitle"/> - </actionGroup> - - <actionGroup name="deleteProductsIfTheyExist"> - <annotations> - <description>Deletes all Products in the Admin Products grid.</description> - </annotations> - - <conditionalClick selector="{{AdminProductGridSection.multicheckDropdown}}" dependentSelector="{{AdminProductGridSection.firstProductRow}}" visible="true" stepKey="openMulticheckDropdown"/> - <conditionalClick selector="{{AdminProductGridSection.multicheckOption('Select All')}}" dependentSelector="{{AdminProductGridSection.firstProductRow}}" visible="true" stepKey="selectAllProductInFilteredGrid"/> - <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> - <click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/> - <waitForElementVisible selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="waitForModalPopUp"/> - <click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmProductDelete"/> - <waitForPageLoad stepKey="waitForGridLoad"/> - </actionGroup> - - <actionGroup name="deleteAllProductsUsingProductGrid"> - <annotations> - <description>Deletes all products in Admin Products grid page.</description> - </annotations> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="openAdminGridProductsPage"/> - <waitForPageLoad time="60" stepKey="waitForPageFullyLoad"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clearGridFilters"/> - - <conditionalClick selector="{{AdminProductGridSection.multicheckDropdown}}" dependentSelector="{{AdminDataGridTableSection.dataGridEmpty}}" visible="false" stepKey="openMulticheckDropdown"/> - <conditionalClick selector="{{AdminProductGridSection.multicheckOption('Select All')}}" dependentSelector="{{AdminDataGridTableSection.dataGridEmpty}}" visible="false" stepKey="selectAllProductsInGrid"/> - <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> - <click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/> - - <waitForElementVisible selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForConfirmModal"/> - <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDelete"/> - <waitForElementVisible selector="{{AdminDataGridTableSection.dataGridEmpty}}" stepKey="waitGridIsEmpty"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageCreateAttributeSetWithAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageCreateAttributeSetWithAttributeActionGroup.xml new file mode 100644 index 0000000000000..bdf59b20f8e38 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageCreateAttributeSetWithAttributeActionGroup.xml @@ -0,0 +1,35 @@ +<?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="AdminProductPageCreateAttributeSetWithAttributeActionGroup"> + <annotations> + <description>Adds the provided Product Attribute Set to a Product on the Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="attributeName" type="string"/> + <argument name="attributeSetName" type="string"/> + <argument name="attributeType" type="string" defaultValue="TextField"/> + </arguments> + + <click selector="{{AdminProductFormSection.addAttributeBtn}}" stepKey="clickAddAttributeBtn"/> + <waitForPageLoad stepKey="waitForSidePanel"/> + <see userInput="Select Attribute" stepKey="checkNewAttributePopUpAppeared"/> + <click selector="{{AdminProductFormAttributeSection.createNewAttribute}}" stepKey="clickCreateNewAttribute"/> + <fillField selector="{{AdminProductFormNewAttributeSection.attributeLabel}}" userInput="{{attributeName}}" stepKey="fillAttributeLabel"/> + <selectOption selector="{{AdminProductFormNewAttributeSection.attributeType}}" userInput="{{attributeType}}" stepKey="selectAttributeType"/> + <click selector="{{AdminProductFormNewAttributeSection.saveInNewSet}}" stepKey="saveAttribute"/> + <fillField selector="{{AdminProductFormNewAttributeNewSetSection.setName}}" userInput="{{attributeSetName}}" stepKey="fillSetName"/> + <click selector="{{AdminProductFormNewAttributeNewSetSection.accept}}" stepKey="acceptPopup"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingToFinish"/> + <!-- Product page will hang if there is no reload--> + <reloadPage stepKey="reloadPage"/> + <waitForPageLoad stepKey="waitForReload"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageFillTextAttributeValueByNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageFillTextAttributeValueByNameActionGroup.xml new file mode 100644 index 0000000000000..336ab90ccec73 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageFillTextAttributeValueByNameActionGroup.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="AdminProductPageFillTextAttributeValueByNameActionGroup"> + <annotations> + <description>Fills in the Attribute Name field with the provided value.</description> + </annotations> + <arguments> + <argument name="attributeName" type="string"/> + <argument name="value" type="string"/> + </arguments> + + <click stepKey="openSection" selector="{{AdminProductAttributeSection.attributeSectionHeader}}"/> + <fillField stepKey="fillValue" selector="{{AdminProductAttributeSection.textAttributeByName(attributeName)}}" userInput="{{value}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageSelectAttributeSetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageSelectAttributeSetActionGroup.xml new file mode 100644 index 0000000000000..0b58c65386951 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductPageSelectAttributeSetActionGroup.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="AdminProductPageSelectAttributeSetActionGroup"> + <annotations> + <description>Selects the provided Attribute Set from the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="attributeSetName" type="string"/> + </arguments> + + <click stepKey="openDropdown" selector="{{AdminProductFormSection.attributeSet}}"/> + <fillField stepKey="filter" selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{attributeSetName}}"/> + <click stepKey="clickResult" selector="{{AdminProductFormSection.attributeSetFilterResult}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetProductDisabledActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetProductDisabledActionGroup.xml new file mode 100644 index 0000000000000..a8b413d523ff0 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetProductDisabledActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AdminSetProductDisabledActionGroup"> + <conditionalClick selector="{{AdminProductFormSection.enableProductLabel}}" dependentSelector="{{AdminProductFormSection.productStatusValue('1')}}" visible="true" stepKey="disableProduct"/> + <seeElement selector="{{AdminProductFormSection.productStatusValue('2')}}" stepKey="assertThatProductSetToDisabled"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSwitchScopeForProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSwitchScopeForProductAttributeActionGroup.xml new file mode 100644 index 0000000000000..bd2414ae6e6c5 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSwitchScopeForProductAttributeActionGroup.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="AdminSwitchScopeForProductAttributeActionGroup"> + <arguments> + <argument name="scope" type="string" defaultValue="1"/> + </arguments> + <click selector="{{AttributePropertiesSection.AdvancedProperties}}" stepKey="expandAdvancedProperties"/> + <waitForElementVisible selector="{{AttributePropertiesSection.Scope}}" stepKey="waitOpenAdvancedProperties"/> + <selectOption selector="{{AttributePropertiesSection.Scope}}" userInput="1" stepKey="selectNecessaryScope"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertDiscountsPercentageOfProductsActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertDiscountsPercentageOfProductsActionGroup.xml new file mode 100644 index 0000000000000..e32c423fb09a3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertDiscountsPercentageOfProductsActionGroup.xml @@ -0,0 +1,27 @@ +<?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="AssertDiscountsPercentageOfProductsActionGroup"> + <annotations> + <description>Validates that the provided Product Tier Price is present and correct.</description> + </annotations> + <arguments> + <argument name="amount" type="string" defaultValue="45"/> + </arguments> + + <click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton"/> + <waitForElement selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForCustomerGroupPriceAddButton"/> + <grabValueFrom selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('0')}}" stepKey="grabProductTierPriceInput"/> + <assertEquals stepKey="assertProductTierPriceInput"> + <expectedResult type="string">{{amount}}</expectedResult> + <actualResult type="string">$grabProductTierPriceInput</actualResult> + </assertEquals> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductDescriptionInProductEditFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductDescriptionInProductEditFormActionGroup.xml new file mode 100644 index 0000000000000..f1bca0c36a57e --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductDescriptionInProductEditFormActionGroup.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="AssertProductDescriptionInProductEditFormActionGroup"> + <arguments> + <argument name="productDescription" type="string"/> + </arguments> + <conditionalClick selector="{{AdminProductContentSection.sectionHeader}}" dependentSelector="{{AdminProductContentSection.sectionHeaderShow}}" visible="false" stepKey="expandContentSection"/> + <seeInField selector="{{AdminProductContentSection.descriptionTextArea}}" userInput="{{productDescription}}" stepKey="seeProductDescription"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageAdminProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageAdminProductPageActionGroup.xml new file mode 100644 index 0000000000000..6ea154d2b01d3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageAdminProductPageActionGroup.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="AssertProductImageAdminProductPageActionGroup"> + <annotations> + <description>Validates that the provided Product Image is present and correct.</description> + </annotations> + <arguments> + <argument name="image" defaultValue="MagentoLogo"/> + </arguments> + + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <seeElement selector="{{AdminProductImagesSection.imageFile(image.filename)}}" stepKey="seeImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInAdminProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInAdminProductPageActionGroup.xml new file mode 100644 index 0000000000000..a761f20b4cc5f --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInAdminProductPageActionGroup.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="AssertProductImageNotInAdminProductPageActionGroup"> + <annotations> + <description>Validates that the provided Product Image is NOT present.</description> + </annotations> + <arguments> + <argument name="image" defaultValue="MagentoLogo"/> + </arguments> + + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <dontSeeElement selector="{{AdminProductImagesSection.imageFile(image.filename)}}" stepKey="seeImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInStorefrontProductPage2ActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInStorefrontProductPage2ActionGroup.xml new file mode 100644 index 0000000000000..4c7fca97a078a --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInStorefrontProductPage2ActionGroup.xml @@ -0,0 +1,24 @@ +<?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="AssertProductImageNotInStorefrontProductPage2ActionGroup"> + <annotations> + <description>Validates that the provided Product Image is not present.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="image" defaultValue="MagentoLogo"/> + </arguments> + + <seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <dontSeeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInStorefrontProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInStorefrontProductPageActionGroup.xml new file mode 100644 index 0000000000000..72febb053046e --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageNotInStorefrontProductPageActionGroup.xml @@ -0,0 +1,24 @@ +<?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="AssertProductImageNotInStorefrontProductPageActionGroup"> + <annotations> + <description>Validates that the provided Product Image is not present.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="image" defaultValue="MagentoLogo"/> + </arguments> + + <seeInCurrentUrl url="/{{product.urlKey}}.html" stepKey="checkUrl"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <dontSeeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageStorefrontProductPage2ActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageStorefrontProductPage2ActionGroup.xml new file mode 100644 index 0000000000000..a4769e675e607 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageStorefrontProductPage2ActionGroup.xml @@ -0,0 +1,24 @@ +<?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="AssertProductImageStorefrontProductPage2ActionGroup"> + <annotations> + <description>Validates that the provided Product Image is present.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="image" defaultValue="MagentoLogo"/> + </arguments> + + <seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <seeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageStorefrontProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageStorefrontProductPageActionGroup.xml new file mode 100644 index 0000000000000..12be0a3d199dc --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductImageStorefrontProductPageActionGroup.xml @@ -0,0 +1,24 @@ +<?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="AssertProductImageStorefrontProductPageActionGroup"> + <annotations> + <description>Validates that the provided Product Image is present.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="image" defaultValue="MagentoLogo"/> + </arguments> + + <seeInCurrentUrl url="/{{product.urlKey}}.html" stepKey="checkUrl"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <seeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductInStorefrontProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductInStorefrontProductPageActionGroup.xml index 8db64ce7c49ac..28ceb82ec6d2e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductInStorefrontProductPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductInStorefrontProductPageActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AssertProductInStorefrontProductPage"> + <actionGroup name="AssertProductInStorefrontProductPageActionGroup"> <annotations> <description>Goes to the Storefront page. Validates that the provided Product details are present.</description> </annotations> @@ -24,36 +24,4 @@ <see userInput="{{product.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/> <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> </actionGroup> - - <actionGroup name="AssertProductNameAndSkuInStorefrontProductPage"> - <annotations> - <description>Goes to the Storefront Product page for the provided Product. Validates that the Product details are present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <!-- Go to storefront product page, assert product name and sku --> - <amOnPage url="{{product.urlKey}}.html" stepKey="navigateToProductPage"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <seeInTitle userInput="{{product.name}}" stepKey="assertProductNameTitle"/> - <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> - <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> - </actionGroup> - - <actionGroup name="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey"> - <annotations> - <description>Goes to the Storefront Product page for the provided Product. Validates that the Product details are present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <!-- Go to storefront product page, assert product name and sku --> - <amOnPage url="{{product.custom_attributes[url_key]}}.html" stepKey="navigateToProductPage"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <seeInTitle userInput="{{product.name}}" stepKey="assertProductNameTitle"/> - <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> - <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductIsAssignedToWebsiteActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductIsAssignedToWebsiteActionGroup.xml new file mode 100644 index 0000000000000..23937af41ae51 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductIsAssignedToWebsiteActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AssertProductIsAssignedToWebsiteActionGroup" extends="AssertWebsiteIsAvailableInProductWebsitesActionGroup"> + <remove keyForRemoval="seeCheckboxForWebsite"/> + <seeCheckboxIsChecked selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="seeCustomWebsiteIsChecked"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductIsNotAssignedToWebsiteActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductIsNotAssignedToWebsiteActionGroup.xml new file mode 100644 index 0000000000000..8963d06e9248f --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductIsNotAssignedToWebsiteActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AssertProductIsNotAssignedToWebsiteActionGroup" extends="AssertWebsiteIsAvailableInProductWebsitesActionGroup"> + <remove keyForRemoval="seeCheckboxForWebsite"/> + <dontSeeCheckboxIsChecked selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="seeCustomWebsiteIsNotChecked"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameAndSkuInStorefrontProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameAndSkuInStorefrontProductPageActionGroup.xml new file mode 100644 index 0000000000000..23b7701010f35 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameAndSkuInStorefrontProductPageActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AssertProductNameAndSkuInStorefrontProductPageActionGroup"> + <annotations> + <description>Goes to the Storefront Product page for the provided Product. Validates that the Product details are present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <!-- Go to storefront product page, assert product name and sku --> + <amOnPage url="{{product.urlKey}}.html" stepKey="navigateToProductPage"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <seeInTitle userInput="{{product.name}}" stepKey="assertProductNameTitle"/> + <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> + <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup.xml new file mode 100644 index 0000000000000..e50e5974023f8 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup"> + <annotations> + <description>Goes to the Storefront Product page for the provided Product. Validates that the Product details are present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <!-- Go to storefront product page, assert product name and sku --> + <amOnPage url="{{product.custom_attributes[url_key]}}.html" stepKey="navigateToProductPage"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <seeInTitle userInput="{{product.name}}" stepKey="assertProductNameTitle"/> + <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> + <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameInProductEditFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameInProductEditFormActionGroup.xml new file mode 100644 index 0000000000000..00f940cd4c3c8 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductNameInProductEditFormActionGroup.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="AssertProductNameInProductEditFormActionGroup"> + <arguments> + <argument name="productName" type="string"/> + </arguments> + <seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{productName}}" stepKey="seeProductNameOnEditProductPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductOnAdminGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductOnAdminGridActionGroup.xml index 95f1cc2c23a37..a384e993405b9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductOnAdminGridActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductOnAdminGridActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AssertProductOnAdminGridActionGroup" extends="viewProductInAdminGrid"> + <actionGroup name="AssertProductOnAdminGridActionGroup" extends="ViewProductInAdminGridActionGroup"> <annotations> <description>EXTENDS: viewProductInAdminGrid. Removes the 'clickClearFiltersAfter' step from the Action Group.</description> </annotations> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductOnCategoryPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductOnCategoryPageActionGroup.xml new file mode 100644 index 0000000000000..d35d6a4778dd6 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductOnCategoryPageActionGroup.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="AssertProductOnCategoryPageActionGroup" extends="StorefrontCheckCategorySimpleProductActionGroup"> + <annotations> + <description>EXTENDS:StorefrontCheckCategorySimpleProduct. Removes 'AssertProductPrice', 'moveMouseOverProduct', 'AssertAddToCart'</description> + </annotations> + <remove keyForRemoval="AssertProductPrice"/> + <remove keyForRemoval="moveMouseOverProduct"/> + <remove keyForRemoval="AssertAddToCart"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertTextInAdminProductRelatedUpSellCrossSellSectionActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertTextInAdminProductRelatedUpSellCrossSellSectionActionGroup.xml new file mode 100644 index 0000000000000..e59f923464250 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertTextInAdminProductRelatedUpSellCrossSellSectionActionGroup.xml @@ -0,0 +1,24 @@ +<?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="AssertTextInAdminProductRelatedUpSellCrossSellSectionActionGroup"> + <annotations> + <description>Validates that provided Text appears in the provided Element on the Admin Product creation/edit page under 'Related Products, Up-Sells, and Cross-Sells' section.</description> + </annotations> + <arguments> + <argument name="element" defaultValue="AdminProductFormRelatedUpSellCrossSellSection.relatedProductSectionText"/> + <argument name="expectedText"/> + </arguments> + + <conditionalClick selector="{{AdminProductFormSection.productFormTab('Related Products')}}" dependentSelector="{{AdminProductFormSection.productFormTabState('Related Products', 'closed')}}" visible="true" stepKey="openTab"/> + <waitForPageLoad time="30" stepKey="waitForPageLoad"/> + <see selector="{{element}}" userInput="{{expectedText}}" stepKey="assertText"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertWebsiteIsAvailableInProductWebsitesActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertWebsiteIsAvailableInProductWebsitesActionGroup.xml new file mode 100644 index 0000000000000..4bd9ce0e09581 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertWebsiteIsAvailableInProductWebsitesActionGroup.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="AssertWebsiteIsAvailableInProductWebsitesActionGroup"> + <arguments> + <argument name="website" type="string"/> + </arguments> + <scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToProductInWebsitesSection"/> + <conditionalClick selector="{{ProductInWebsitesSection.sectionHeader}}" dependentSelector="{{ProductInWebsitesSection.sectionHeaderOpened}}" visible="false" stepKey="expandProductWebsitesSection"/> + <seeElement selector="{{ProductInWebsitesSection.website(website)}}" stepKey="seeCheckboxForWebsite"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertWebsiteIsNotAvailableInProductWebsitesActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertWebsiteIsNotAvailableInProductWebsitesActionGroup.xml new file mode 100644 index 0000000000000..14eb5a40b184e --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertWebsiteIsNotAvailableInProductWebsitesActionGroup.xml @@ -0,0 +1,15 @@ +<?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="AssertWebsiteIsNotAvailableInProductWebsitesActionGroup" extends="AssertWebsiteIsAvailableInProductWebsitesActionGroup"> + <remove keyForRemoval="seeCheckboxForWebsite"/> + <dontSeeElement selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="dontSeeCheckboxForWebsite"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CategoryPresentActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CategoryPresentActionGroup.xml new file mode 100644 index 0000000000000..76aec793c4eca --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CategoryPresentActionGroup.xml @@ -0,0 +1,26 @@ +<?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="CategoryPresentActionGroup" > + <annotations> + <description>Navigates to category page, asserts category is there. Navigates to storefront category page and asserts category is there. This action group will not work categories where name does NOT equal SEO.</description> + </annotations> + <arguments> + <argument name="categoryName" defaultValue="Test Category" type="string"/> + </arguments> + + <amOnPage url="{{AdminCategoryPage.url}}" stepKey="goToCategoryAdminPage"/> + <waitForPageLoad stepKey="waitForCategoryAdminPageLoad"/> + <see userInput="{{categoryName}}" stepKey="assertCategoryOnAdminPage" selector="{{AdminCategorySidebarTreeSection.treeContainer}}"/> + <amOnPage url="/{{categoryName}}.html" stepKey="goToCustomerFrontPage"/> + <see userInput="{{categoryName}}" stepKey="assertCategoryNameOnStorefront" selector="{{StorefrontCategoryMainSection.CategoryTitle}}"/> + <waitForPageLoad stepKey="waitForCustomerCategoryPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeSeoUrlKeyActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeSeoUrlKeyActionGroup.xml new file mode 100644 index 0000000000000..7107cc2a560d1 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeSeoUrlKeyActionGroup.xml @@ -0,0 +1,24 @@ +<?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="ChangeSeoUrlKeyActionGroup"> + <annotations> + <description>Requires navigation to category creation/edit. Updates the Search Engine Optimization.</description> + </annotations> + <arguments> + <argument name="value" type="string"/> + </arguments> + + <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSeoSection"/> + <fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{value}}" stepKey="enterURLKey"/> + <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> + <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeSeoUrlKeyForSubCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeSeoUrlKeyForSubCategoryActionGroup.xml new file mode 100644 index 0000000000000..42813aef05be5 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeSeoUrlKeyForSubCategoryActionGroup.xml @@ -0,0 +1,25 @@ +<?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="ChangeSeoUrlKeyForSubCategoryActionGroup"> + <annotations> + <description>Requires navigation to subcategory creation/edit. Updates the Search Engine Optimization.</description> + </annotations> + <arguments> + <argument name="value" type="string"/> + </arguments> + + <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSeoSection"/> + <uncheckOption selector="{{AdminCategorySEOSection.UrlKeyDefaultValueCheckbox}}" stepKey="uncheckDefaultValue"/> + <fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{value}}" stepKey="enterURLKey"/> + <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> + <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeStatusProductUsingProductGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeStatusProductUsingProductGridActionGroup.xml new file mode 100644 index 0000000000000..b8e8556f53813 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeStatusProductUsingProductGridActionGroup.xml @@ -0,0 +1,38 @@ +<?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="ChangeStatusProductUsingProductGridActionGroup"> + <annotations> + <description>Goes to the Admin Products grid page. Changes the Product Status to the provided Status. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="status" defaultValue="Enable" type="string"/> + </arguments> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <waitForPageLoad time="60" stepKey="waitForPageLoadInitial"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <see selector="{{AdminProductGridSection.productGridCell('1', 'SKU')}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> + <click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="openMulticheckDropdown"/> + <click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllProductInFilteredGrid"/> + + <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> + <click selector="{{AdminProductGridSection.bulkActionOption('Change status')}}" stepKey="clickChangeStatusAction"/> + <click selector="{{AdminProductGridSection.changeStatus('status')}}" stepKey="clickChangeStatusDisabled"/> + <waitForPageLoad stepKey="waitForStatusToBeChanged"/> + <see selector="{{AdminMessagesSection.success}}" userInput="A total of 1 record(s) have been updated." stepKey="seeSuccessMessage"/> + <waitForLoadingMaskToDisappear stepKey="waitForMaskToDisappear"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeUseForPromoRuleConditionsProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeUseForPromoRuleConditionsProductAttributeActionGroup.xml new file mode 100644 index 0000000000000..5282fe2740fc7 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ChangeUseForPromoRuleConditionsProductAttributeActionGroup.xml @@ -0,0 +1,25 @@ +<?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="ChangeUseForPromoRuleConditionsProductAttributeActionGroup"> + <annotations> + <description>Select the provided value for the 'Use for Promo Rule Conditions' dropdown menu. Clicks on Save. Validates that the Save message is present.</description> + </annotations> + <arguments> + <argument name="option" type="string"/> + </arguments> + + <click selector="{{StorefrontPropertiesSection.StoreFrontPropertiesTab}}" stepKey="clickStoreFrontPropertiesTab"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <selectOption selector="{{StorefrontPropertiesSection.useForPromoRuleConditions}}" userInput="{{option}}" stepKey="changeOption"/> + <click selector="{{AttributePropertiesSection.Save}}" stepKey="saveAttribute"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the product attribute." stepKey="successMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckAttributeInMoreInformationTabActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckAttributeInMoreInformationTabActionGroup.xml new file mode 100644 index 0000000000000..548d7de79d599 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckAttributeInMoreInformationTabActionGroup.xml @@ -0,0 +1,24 @@ +<?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="CheckAttributeInMoreInformationTabActionGroup"> + <annotations> + <description>Validates that the Product More Information area contains the provided Text.</description> + </annotations> + <arguments> + <argument name="attributeLabel" type="string"/> + <argument name="attributeValue" type="string"/> + </arguments> + + <click selector="{{StorefrontProductMoreInformationSection.moreInformation}}" stepKey="clickTab"/> + <see userInput="{{attributeLabel}}" selector="{{StorefrontProductMoreInformationSection.moreInformationTextArea}}" stepKey="seeAttributeLabel"/> + <see userInput="{{attributeValue}}" selector="{{StorefrontProductMoreInformationSection.moreInformationTextArea}}" stepKey="seeAttributeValue"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckAttributeNotInMoreInformationTabActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckAttributeNotInMoreInformationTabActionGroup.xml new file mode 100644 index 0000000000000..a6d744ebe92be --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckAttributeNotInMoreInformationTabActionGroup.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="CheckAttributeNotInMoreInformationTabActionGroup"> + <annotations> + <description>Validate that the More Information area does not contain the provided Text.</description> + </annotations> + <arguments> + <argument name="attributeLabel" type="string"/> + </arguments> + + <click selector="{{StorefrontProductMoreInformationSection.moreInformation}}" stepKey="clickTab"/> + <dontSee userInput="{{attributeLabel}}" selector="{{StorefrontProductMoreInformationSection.moreInformationTextArea}}" stepKey="seeAttributeLabel"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryImageInAdminActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryImageInAdminActionGroup.xml new file mode 100644 index 0000000000000..fd01d4db5babb --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryImageInAdminActionGroup.xml @@ -0,0 +1,28 @@ +<?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="CheckCategoryImageInAdminActionGroup"> + <annotations> + <description>Requires navigation to the Category creation/edit page. Click on the Upload button. Validates that the Image exists.</description> + </annotations> + <arguments> + <argument name="image" defaultValue="ProductImage"/> + </arguments> + + <conditionalClick selector="{{AdminCategoryContentSection.sectionHeader}}" dependentSelector="{{AdminCategoryContentSection.uploadButton}}" visible="false" stepKey="openContentSection"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForElementVisible selector="{{AdminCategoryContentSection.uploadButton}}" stepKey="seeImageSectionIsReady"/> + <grabTextFrom selector="{{AdminCategoryContentSection.imageFileName}}" stepKey="grabCategoryFileName"/> + <assertRegExp stepKey="assertEquals" message="pass"> + <expectedResult type="string">/magento-logo(_[0-9]+)*?\.png$/</expectedResult> + <actualResult type="variable">grabCategoryFileName</actualResult> + </assertRegExp> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryNameIsRequiredFieldActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryNameIsRequiredFieldActionGroup.xml new file mode 100644 index 0000000000000..44e1951a0463b --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryNameIsRequiredFieldActionGroup.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="CheckCategoryNameIsRequiredFieldActionGroup"> + <annotations> + <description>Navigates to category page, attempts to add subcategory without name. Expects required field prompt.</description> + </annotations> + + <seeInCurrentUrl url="{{AdminCategoryPage.url}}" stepKey="seeOnCategoryPage"/> + <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategory"/> + <clearField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" stepKey="makeNameFieldEmpty"/> + <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> + <seeInCurrentUrl url="{{AdminCategoryPage.url}}add" stepKey="seeBackOnCreateCategoryPage"/> + <see selector="{{AdminCategoryBasicFieldSection.FieldError('uid')}}" userInput="This is a required field." stepKey="seeErrorMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryOnStorefrontActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryOnStorefrontActionGroup.xml new file mode 100644 index 0000000000000..134b3897b5e02 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCategoryOnStorefrontActionGroup.xml @@ -0,0 +1,24 @@ +<?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="CheckCategoryOnStorefrontActionGroup"> + <annotations> + <description>Navigates to the category page on the storefront and asserts that the title is correct for page and browser.</description> + </annotations> + <arguments> + <argument name="categoryEntity" defaultValue="_defaultCategory"/> + </arguments> + + <amOnPage url="/{{categoryEntity.name_lwr}}.html" stepKey="goToCategoryFrontPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <see selector="{{StorefrontCategoryMainSection.CategoryTitle}}" userInput="{{categoryEntity.name_lwr}}" stepKey="assertCategoryOnStorefront"/> + <seeInTitle userInput="{{categoryEntity.name}}" stepKey="seeCategoryNameInTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCustomizableOptionImportActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCustomizableOptionImportActionGroup.xml new file mode 100644 index 0000000000000..efd0986efca06 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckCustomizableOptionImportActionGroup.xml @@ -0,0 +1,27 @@ +<?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="CheckCustomizableOptionImportActionGroup"> + <annotations> + <description>Validate that the Custom Product Option Import value is present and correct.</description> + </annotations> + <arguments> + <argument name="option" defaultValue="ProductOptionField"/> + <argument name="optionIndex" type="string"/> + </arguments> + + <grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionTitleInput(optionIndex)}}" stepKey="grabOptionTitle"/> + <grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionPrice(optionIndex)}}" stepKey="grabOptionPrice"/> + <grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionSku(optionIndex)}}" stepKey="grabOptionSku"/> + <assertEquals expected="{{option.title}}" expectedType="string" actual="$grabOptionTitle" stepKey="assertOptionTitle"/> + <assertEquals expected="{{option.price}}" expectedType="string" actual="$grabOptionPrice" stepKey="assertOptionPrice"/> + <assertEquals expected="{{option.title}}" expectedType="string" actual="$grabOptionSku" stepKey="assertOptionSku"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckRequiredFieldsInProductFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckRequiredFieldsInProductFormActionGroup.xml new file mode 100644 index 0000000000000..6aaa66dc70803 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CheckRequiredFieldsInProductFormActionGroup.xml @@ -0,0 +1,25 @@ +<?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="CheckRequiredFieldsInProductFormActionGroup"> + <annotations> + <description>Validates that the 'Required Field' error message is present and correct for the Product Name, SKU and Price fields.</description> + </annotations> + + <clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductName"/> + <clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductSku"/> + <clearField selector="{{AdminProductFormSection.productPrice}}" stepKey="clearProductPrice"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/> + <see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/> + <see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/> + <see selector="{{AdminProductFormSection.priceFieldError}}" userInput="This is a required field." stepKey="seePriceRequired"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ClearProductsFilterActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ClearProductsFilterActionGroup.xml new file mode 100644 index 0000000000000..46960b5e25d51 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ClearProductsFilterActionGroup.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="ClearProductsFilterActionGroup"> + <annotations> + <description>Goto the Product grid page. Clear the Search Filters for the grid.</description> + </annotations> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> + <waitForPageLoad time="30" stepKey="waitForProductsPageToLoad"/> + <conditionalClick selector="{{AdminProductFiltersSection.clearFiltersButton}}" dependentSelector="{{AdminProductFiltersSection.clearFiltersButton}}" visible="true" stepKey="cleanFiltersIfTheySet"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ConfirmChangeInputTypeModalActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ConfirmChangeInputTypeModalActionGroup.xml new file mode 100644 index 0000000000000..d207073a01fc0 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ConfirmChangeInputTypeModalActionGroup.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="ConfirmChangeInputTypeModalActionGroup"> + <annotations> + <description>Clicks on the Confirm button for the 'Product Data My Be Lost' modal.</description> + </annotations> + + <waitForElementVisible selector="{{AdminEditProductAttributesSection.ProductDataMayBeLostConfirmButton}}" stepKey="waitForChangeInputTypeButton"/> + <click selector="{{AdminEditProductAttributesSection.ProductDataMayBeLostConfirmButton}}" stepKey="clickChangeInputTypeButton"/> + <waitForElementNotVisible selector="{{AdminEditProductAttributesSection.ProductDataMayBeLostModal}}" stepKey="waitForChangeInputTypeModalGone"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateAttributeDropdownNthOptionActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateAttributeDropdownNthOptionActionGroup.xml new file mode 100644 index 0000000000000..2bf79ca980a44 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateAttributeDropdownNthOptionActionGroup.xml @@ -0,0 +1,26 @@ +<?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="CreateAttributeDropdownNthOptionActionGroup"> + <annotations> + <description>Creates an Option for a Product Attribute (Attribute Type: Dropdown).</description> + </annotations> + <arguments> + <argument name="row" type="string"/> + <argument name="adminName" type="string"/> + <argument name="frontName" type="string"/> + </arguments> + + <click stepKey="clickAddOptions" selector="{{AttributePropertiesSection.dropdownAddOptions}}"/> + <waitForPageLoad stepKey="waitForNewOption"/> + <fillField stepKey="fillAdmin" selector="{{AttributePropertiesSection.dropdownNthOptionAdmin(row)}}" userInput="{{adminName}}"/> + <fillField stepKey="fillStoreView" selector="{{AttributePropertiesSection.dropdownNthOptionDefaultStoreView(row)}}" userInput="{{frontName}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateAttributeDropdownNthOptionAsDefaultActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateAttributeDropdownNthOptionAsDefaultActionGroup.xml new file mode 100644 index 0000000000000..e9e8a98ac86a6 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateAttributeDropdownNthOptionAsDefaultActionGroup.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="CreateAttributeDropdownNthOptionAsDefaultActionGroup" extends="CreateAttributeDropdownNthOptionActionGroup"> + <annotations> + <description>EXTENDS: createAttributeDropdownNthOption. Checks the 'Is Default' option.</description> + </annotations> + + <checkOption selector="{{AttributePropertiesSection.dropdownNthOptionIsDefault(row)}}" stepKey="setAsDefault" after="fillStoreView"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateCategoryActionGroup.xml new file mode 100644 index 0000000000000..660b475c02ab0 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateCategoryActionGroup.xml @@ -0,0 +1,30 @@ +<?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="CreateCategoryActionGroup"> + <annotations> + <description>Requires navigation to the Category creation page. Adds a new Subcategory. Validates that the Category was created.</description> + </annotations> + <arguments> + <argument name="categoryEntity" defaultValue="_defaultCategory"/> + </arguments> + + <seeInCurrentUrl url="{{AdminCategoryPage.url}}" stepKey="seeOnCategoryPage"/> + <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategory"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Category" stepKey="seeCategoryPageTitle"/> + <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{categoryEntity.name}}" stepKey="enterCategoryName"/> + <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSEO"/> + <fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{categoryEntity.name_lwr}}" stepKey="enterURLKey"/> + <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> + <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccess"/> + <seeInTitle userInput="{{categoryEntity.name}}" stepKey="seeNewCategoryPageTitle"/> + <seeElement selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryEntity.name)}}" stepKey="seeCategoryInTree"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateCustomRadioOptionsActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateCustomRadioOptionsActionGroup.xml new file mode 100644 index 0000000000000..8ac87a30afbf6 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateCustomRadioOptionsActionGroup.xml @@ -0,0 +1,43 @@ +<?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="CreateCustomRadioOptionsActionGroup"> + <annotations> + <description>Adds a custom Radio Product Option with 3 Radio Options to a Product based on the provided Options.</description> + </annotations> + <!-- ActionGroup will add a single custom option to a product --> + <!-- You must already be on the product creation page --> + <arguments> + <argument name="customOptionName"/> + <argument name="productOption"/> + <argument name="productOption2"/> + </arguments> + + <click stepKey="clickAddOptions" selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}"/> + <waitForPageLoad stepKey="waitForAddProductPageLoad"/> + + <!-- Fill in the option and select the type of radio (once) --> + <fillField stepKey="fillInOptionTitle" selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" userInput="{{customOptionName}}"/> + <click stepKey="clickOptionTypeParent" selector="{{AdminProductCustomizableOptionsSection.lastOptionTypeParent}}"/> + <waitForPageLoad stepKey="waitForDropdownOpen"/> + <click stepKey="clickOptionType" selector="{{AdminProductCustomizableOptionsSection.optionType('Radio Buttons')}}"/> + + <!-- Add three radio options based on the parameter --> + <click stepKey="clickAddValue" selector="{{AdminProductCustomizableOptionsSection.addValue}}"/> + + <fillField stepKey="fillInValueTitle" selector="{{AdminProductCustomizableOptionsSection.valueTitle}}" userInput="{{productOption.title}}"/> + <fillField stepKey="fillInValuePrice" selector="{{AdminProductCustomizableOptionsSection.valuePrice}}" userInput="{{productOption.price}}"/> + + <click stepKey="clickAddValue2" selector="{{AdminProductCustomizableOptionsSection.addValue}}"/> + + <fillField stepKey="fillInValueTitle2" selector="{{AdminProductCustomizableOptionsSection.valueTitle}}" userInput="{{productOption2.title}}"/> + <fillField stepKey="fillInValuePrice2" selector="{{AdminProductCustomizableOptionsSection.valuePrice}}" userInput="{{productOption2.price}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateDefaultAttributeSetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateDefaultAttributeSetActionGroup.xml new file mode 100644 index 0000000000000..8b95a77465b01 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateDefaultAttributeSetActionGroup.xml @@ -0,0 +1,25 @@ +<?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="CreateDefaultAttributeSetActionGroup"> + <annotations> + <description>Goes to the Attribute Sets grid page. Clicks on Add. Fill Name. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="label" type="string"/> + </arguments> + + <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/> + <waitForPageLoad stepKey="wait1"/> + <click selector="{{AdminProductAttributeSetGridSection.addAttributeSetBtn}}" stepKey="clickAddAttributeSet"/> + <fillField selector="{{AdminProductAttributeSetSection.name}}" userInput="{{label}}" stepKey="fillName"/> + <click selector="{{AdminProductAttributeSetSection.saveBtn}}" stepKey="clickSave1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeActionGroup.xml new file mode 100644 index 0000000000000..0a0c95fdb33cc --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeActionGroup.xml @@ -0,0 +1,25 @@ +<?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="CreateProductAttributeActionGroup"> + <annotations> + <description>Clicks on 'Add New Attribute'. Fills in the Attribute Details (Label, Input Type and Value Required). Clicks on Save.</description> + </annotations> + <arguments> + <argument name="attribute" type="entity" defaultValue="productAttributeWysiwyg"/> + </arguments> + + <click stepKey="createNewAttribute" selector="{{AdminProductAttributeGridSection.createNewAttributeBtn}}"/> + <fillField stepKey="fillDefaultLabel" selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{attribute.attribute_code}}"/> + <selectOption selector="{{AttributePropertiesSection.InputType}}" stepKey="checkInputType" userInput="{{attribute.frontend_input}}"/> + <selectOption selector="{{AttributePropertiesSection.ValueRequired}}" stepKey="checkRequired" userInput="{{attribute.is_required_admin}}"/> + <click stepKey="saveAttribute" selector="{{AttributePropertiesSection.Save}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDateFieldActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDateFieldActionGroup.xml new file mode 100644 index 0000000000000..13b1bca0ad40b --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDateFieldActionGroup.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="CreateProductAttributeWithDateFieldActionGroup" extends="CreateProductAttributeActionGroup" insertAfter="checkRequired"> + <annotations> + <description>EXTENDS: createProductAttribute. Fills in the Attribute Code and Default Value (Attribute Type: Date Field).</description> + </annotations> + <arguments> + <argument name="date" type="string"/> + </arguments> + + <click stepKey="openAdvancedProperties" selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}"/> + <fillField stepKey="fillCode" selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attribute.attribute_code}}"/> + <fillField stepKey="fillDefaultValue" selector="{{AdvancedAttributePropertiesSection.DefaultValueDate}}" userInput="{{date}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithTextFieldActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithTextFieldActionGroup.xml new file mode 100644 index 0000000000000..fccb8ad2413f8 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithTextFieldActionGroup.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="CreateProductAttributeWithTextFieldActionGroup" extends="CreateProductAttributeActionGroup" insertAfter="checkRequired"> + <annotations> + <description>EXTENDS: createProductAttribute. Fills in the Attribute Code and Default Value (Attribute Type: Text Field).</description> + </annotations> + + <click stepKey="openAdvancedProperties" selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}"/> + <fillField stepKey="fillCode" selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attribute.attribute_code}}"/> + <fillField stepKey="fillDefaultValue" selector="{{AdvancedAttributePropertiesSection.DefaultValueText}}" userInput="{{attribute.default_value}}"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateSimpleProductAndAddToWebsiteActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateSimpleProductAndAddToWebsiteActionGroup.xml new file mode 100644 index 0000000000000..97c7072abe42f --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateSimpleProductAndAddToWebsiteActionGroup.xml @@ -0,0 +1,34 @@ +<?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="CreateSimpleProductAndAddToWebsiteActionGroup"> + <annotations> + <description>Goes to the Admin Product grid page. Clicks on Add Product. Fills the provided Product Details (Name, SKU, Price, Quantity and Website). Clicks on Save.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="website" type="string"/> + </arguments> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToCatalogProductGrid"/> + <waitForPageLoad stepKey="waitForProductGrid"/> + <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/> + <click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/> + <fillField userInput="{{product.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillProductName"/> + <fillField userInput="{{product.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillProductSKU"/> + <fillField userInput="{{product.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillProductPrice"/> + <fillField userInput="{{product.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillProductQuantity"/> + <click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="openProductInWebsites"/> + <click selector="{{ProductInWebsitesSection.website(website)}}" stepKey="selectWebsite"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSave"/> + <waitForLoadingMaskToDisappear stepKey="waitForProductPageSave"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreatedProductConnectToWebsiteActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreatedProductConnectToWebsiteActionGroup.xml new file mode 100644 index 0000000000000..d605aa1910134 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreatedProductConnectToWebsiteActionGroup.xml @@ -0,0 +1,29 @@ +<?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="CreatedProductConnectToWebsiteActionGroup"> + <annotations> + <description>Clicks on 'Edit' for the provided Product. Clicks on the provided Website. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="website"/> + <argument name="product"/> + </arguments> + + <click stepKey="openProduct" selector="{{AdminProductGridActionSection.productName(product.sku)}}"/> + <waitForPageLoad stepKey="waitForProductPage"/> + <scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="ScrollToWebsites"/> + <click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="openWebsitesList"/> + <waitForPageLoad stepKey="waitForWebsitesList"/> + <click selector="{{ProductInWebsitesSection.website(website.name)}}" stepKey="SelectWebsite"/> + <click selector="{{AdminProductFormAdvancedPricingSection.save}}" stepKey="clickSaveProduct"/> + <waitForPageLoad stepKey="waitForSave"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CustomOptionsActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CustomOptionsActionGroup.xml deleted file mode 100644 index 753f06cd75e3e..0000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CustomOptionsActionGroup.xml +++ /dev/null @@ -1,172 +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="CreateCustomRadioOptions"> - <annotations> - <description>Adds a custom Radio Product Option with 3 Radio Options to a Product based on the provided Options.</description> - </annotations> - <!-- ActionGroup will add a single custom option to a product --> - <!-- You must already be on the product creation page --> - <arguments> - <argument name="customOptionName"/> - <argument name="productOption"/> - <argument name="productOption2"/> - </arguments> - - <click stepKey="clickAddOptions" selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}"/> - <waitForPageLoad stepKey="waitForAddProductPageLoad"/> - - <!-- Fill in the option and select the type of radio (once) --> - <fillField stepKey="fillInOptionTitle" selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" userInput="{{customOptionName}}"/> - <click stepKey="clickOptionTypeParent" selector="{{AdminProductCustomizableOptionsSection.lastOptionTypeParent}}"/> - <waitForPageLoad stepKey="waitForDropdownOpen"/> - <click stepKey="clickOptionType" selector="{{AdminProductCustomizableOptionsSection.optionType('Radio Buttons')}}"/> - - <!-- Add three radio options based on the parameter --> - <click stepKey="clickAddValue" selector="{{AdminProductCustomizableOptionsSection.addValue}}"/> - - <fillField stepKey="fillInValueTitle" selector="{{AdminProductCustomizableOptionsSection.valueTitle}}" userInput="{{productOption.title}}"/> - <fillField stepKey="fillInValuePrice" selector="{{AdminProductCustomizableOptionsSection.valuePrice}}" userInput="{{productOption.price}}"/> - - <click stepKey="clickAddValue2" selector="{{AdminProductCustomizableOptionsSection.addValue}}"/> - - <fillField stepKey="fillInValueTitle2" selector="{{AdminProductCustomizableOptionsSection.valueTitle}}" userInput="{{productOption2.title}}"/> - <fillField stepKey="fillInValuePrice2" selector="{{AdminProductCustomizableOptionsSection.valuePrice}}" userInput="{{productOption2.price}}"/> - </actionGroup> - - <!--Add a custom option of type "file" to a product--> - <actionGroup name="AddProductCustomOptionFile"> - <annotations> - <description>Add a custom File Product Option to a Product based on the provided File.</description> - </annotations> - <arguments> - <argument name="option" defaultValue="ProductOptionFile"/> - </arguments> - - <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/> - <click selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" stepKey="clickAddOption"/> - <waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" stepKey="waitForOption"/> - <fillField selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" userInput="{{option.title}}" stepKey="fillTitle"/> - <click selector="{{AdminProductCustomizableOptionsSection.lastOptionTypeParent}}" stepKey="openTypeSelect"/> - <click selector="{{AdminProductCustomizableOptionsSection.optionType('File')}}" stepKey="selectTypeFile"/> - <waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.optionPriceByTitle(option.title)}}" stepKey="waitForElements"/> - <fillField selector="{{AdminProductCustomizableOptionsSection.optionPriceByTitle(option.title)}}" userInput="{{option.price}}" stepKey="fillPrice"/> - <selectOption selector="{{AdminProductCustomizableOptionsSection.optionPriceTypeByTitle(option.title)}}" userInput="{{option.price_type}}" stepKey="selectPriceType"/> - <fillField selector="{{AdminProductCustomizableOptionsSection.optionFileExtensionByTitle(option.title)}}" userInput="{{option.file_extension}}" stepKey="fillCompatibleExtensions"/> - </actionGroup> - - <actionGroup name="AddProductCustomOptionField"> - <annotations> - <description>Add a custom Field Product Option to a Product based on the provided Option.</description> - </annotations> - <arguments> - <argument name="option" defaultValue="ProductOptionField"/> - </arguments> - - <scrollTo selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="scrollToAddButtonOption"/> - <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/> - <click selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" stepKey="clickAddOption"/> - <waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" stepKey="waitForOption"/> - <fillField selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" userInput="{{option.title}}" stepKey="fillTitle"/> - <click selector="{{AdminProductCustomizableOptionsSection.lastOptionTypeParent}}" stepKey="openTypeSelect"/> - <click selector="{{AdminProductCustomizableOptionsSection.optionType('Field')}}" stepKey="selectTypeFile"/> - <waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.optionPriceByTitle(option.title)}}" stepKey="waitForElements"/> - <fillField selector="{{AdminProductCustomizableOptionsSection.optionPriceByTitle(option.title)}}" userInput="{{option.price}}" stepKey="fillPrice"/> - <selectOption selector="{{AdminProductCustomizableOptionsSection.optionPriceTypeByTitle(option.title)}}" userInput="{{option.price_type}}" stepKey="selectPriceType"/> - <fillField selector="{{AdminProductCustomizableOptionsSection.optionSkuByTitle(option.title)}}" userInput="{{option.title}}" stepKey="fillSku"/> - </actionGroup> - - <actionGroup name="importProductCustomizableOptions"> - <annotations> - <description>Import custom Product Options for the provided Product Name.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - </arguments> - - <click selector="{{AdminProductCustomizableOptionsSection.importOptions}}" stepKey="clickImportOptions"/> - <waitForElementVisible selector="{{AdminProductImportOptionsSection.selectProductTitle}}" stepKey="waitForTitleVisible"/> - <conditionalClick selector="{{AdminProductImportOptionsSection.resetFiltersButton}}" dependentSelector="{{AdminProductImportOptionsSection.resetFiltersButton}}" visible="true" stepKey="clickResetFilters"/> - <click selector="{{AdminProductImportOptionsSection.filterButton}}" stepKey="clickFilterButton"/> - <waitForElementVisible selector="{{AdminProductImportOptionsSection.nameField}}" stepKey="waitForNameField"/> - <fillField selector="{{AdminProductImportOptionsSection.nameField}}" userInput="{{productName}}" stepKey="fillProductName"/> - <click selector="{{AdminProductImportOptionsSection.applyFiltersButton}}" stepKey="clickApplyFilters"/> - <checkOption selector="{{AdminProductImportOptionsSection.firstRowItemCheckbox}}" stepKey="checkProductCheckbox"/> - <click selector="{{AdminProductImportOptionsSection.importButton}}" stepKey="clickImport"/> - </actionGroup> - - <actionGroup name="resetImportOptionFilter"> - <annotations> - <description>Click on the Reset Filters button for the Import Options filters on the Product grid page.</description> - </annotations> - - <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/> - <click selector="{{AdminProductCustomizableOptionsSection.importOptions}}" stepKey="clickImportOptions"/> - <click selector="{{AdminProductImportOptionsSection.resetFiltersButton}}" stepKey="clickResetFilterButton"/> - </actionGroup> - - <actionGroup name="checkCustomizableOptionImport"> - <annotations> - <description>Validate that the Custom Product Option Import value is present and correct.</description> - </annotations> - <arguments> - <argument name="option" defaultValue="ProductOptionField"/> - <argument name="optionIndex" type="string"/> - </arguments> - - <grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionTitleInput(optionIndex)}}" stepKey="grabOptionTitle"/> - <grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionPrice(optionIndex)}}" stepKey="grabOptionPrice"/> - <grabValueFrom selector="{{AdminProductCustomizableOptionsSection.optionSku(optionIndex)}}" stepKey="grabOptionSku"/> - <assertEquals expected="{{option.title}}" expectedType="string" actual="$grabOptionTitle" stepKey="assertOptionTitle"/> - <assertEquals expected="{{option.price}}" expectedType="string" actual="$grabOptionPrice" stepKey="assertOptionPrice"/> - <assertEquals expected="{{option.title}}" expectedType="string" actual="$grabOptionSku" stepKey="assertOptionSku"/> - </actionGroup> - <!-- Assumes we are on product edit page --> - <actionGroup name="AdminDeleteAllProductCustomOptions"> - <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.checkIfCustomizableOptionsTabOpen}}" visible="true" stepKey="expandContentTab"/> - <waitForPageLoad time="10" stepKey="waitCustomizableOptionsTabOpened"/> - <executeInSelenium function="function($webdriver) use ($I) { - $buttons = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::cssSelector('[data-index=\'options\'] [data-index=\'delete_button\']')); - while(!empty($buttons)) { - $button = reset($buttons); - $I->executeJS('arguments[0].scrollIntoView(false)', [$button]); - $button->click(); - $webdriver->wait()->until(\Facebook\WebDriver\WebDriverExpectedCondition::stalenessOf($button)); - $buttons = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::cssSelector('[data-index=\'options\'] [data-index=\'delete_button\']')); - } - }" stepKey="deleteCustomOptions"/> - <dontSeeElement selector="{{AdminProductCustomizableOptionsSection.customOptionButtonDelete}}" stepKey="assertNoCustomOptions"/> - </actionGroup> - <!-- Assumes we are on product edit page --> - <actionGroup name="AdminAssertProductHasNoCustomOptions"> - <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.checkIfCustomizableOptionsTabOpen}}" visible="true" stepKey="expandContentTab"/> - <waitForPageLoad time="10" stepKey="waitCustomizableOptionsTabOpened"/> - <dontSeeElement selector="{{AdminProductCustomizableOptionsSection.customOption}}" stepKey="assertNoCustomOptions"/> - </actionGroup> - <!-- Assumes we are on product edit page --> - <actionGroup name="AdminAssertProductHasNoCustomOption" extends="AdminAssertProductCustomOptionVisible"> - <remove keyForRemoval="assertCustomOptionVisible"/> - <dontSeeElement selector="{{AdminProductCustomizableOptionsSection.fillOptionTitle(option.title)}}" after="waitCustomizableOptionsTabOpened" stepKey="assertNoCustomOption"/> - </actionGroup> - <!-- Assumes we are on product edit page --> - <actionGroup name="AdminAssertProductCustomOptionVisible"> - <arguments> - <argument name="option" defaultValue="ProductOptionField"/> - </arguments> - <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.checkIfCustomizableOptionsTabOpen}}" visible="true" stepKey="expandContentTab"/> - <waitForPageLoad time="10" stepKey="waitCustomizableOptionsTabOpened"/> - <seeElement selector="{{AdminProductCustomizableOptionsSection.fillOptionTitle(option.title)}}" stepKey="assertCustomOptionVisible"/> - </actionGroup> - <!-- Assumes we are on product edit page --> - <actionGroup name="AdminDeleteProductCustomOption" extends="AdminAssertProductCustomOptionVisible"> - <remove keyForRemoval="assertCustomOptionVisible"/> - <click selector="{{AdminProductCustomizableOptionsSection.deleteCustomOptions(option.title)}}" after="waitCustomizableOptionsTabOpened" stepKey="clickDeleteCustomOption"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllDuplicateProductUsingProductGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllDuplicateProductUsingProductGridActionGroup.xml new file mode 100644 index 0000000000000..8dabf2037bf39 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllDuplicateProductUsingProductGridActionGroup.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="DeleteAllDuplicateProductUsingProductGridActionGroup" extends="DeleteProductUsingProductGridActionGroup"> + <annotations> + <description>EXTENDS: deleteProductUsingProductGrid. Removes 'seeProductSkuInGrid'.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <remove keyForRemoval="seeProductSkuInGrid"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllProductsUsingProductGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllProductsUsingProductGridActionGroup.xml new file mode 100644 index 0000000000000..3609d992a9f0b --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllProductsUsingProductGridActionGroup.xml @@ -0,0 +1,29 @@ +<?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="DeleteAllProductsUsingProductGridActionGroup"> + <annotations> + <description>Deletes all products in Admin Products grid page.</description> + </annotations> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="openAdminGridProductsPage"/> + <waitForPageLoad time="60" stepKey="waitForPageFullyLoad"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clearGridFilters"/> + + <conditionalClick selector="{{AdminProductGridSection.multicheckDropdown}}" dependentSelector="{{AdminDataGridTableSection.dataGridEmpty}}" visible="false" stepKey="openMulticheckDropdown"/> + <conditionalClick selector="{{AdminProductGridSection.multicheckOption('Select All')}}" dependentSelector="{{AdminDataGridTableSection.dataGridEmpty}}" visible="false" stepKey="selectAllProductsInGrid"/> + <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> + <click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/> + + <waitForElementVisible selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForConfirmModal"/> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDelete"/> + <waitForElementVisible selector="{{AdminDataGridTableSection.dataGridEmpty}}" stepKey="waitGridIsEmpty"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAttributeSetByLabelActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAttributeSetByLabelActionGroup.xml new file mode 100644 index 0000000000000..c0586367fcaf6 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAttributeSetByLabelActionGroup.xml @@ -0,0 +1,30 @@ +<?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="DeleteAttributeSetByLabelActionGroup"> + <annotations> + <description>Deletes the provided Attribute Set Name from the Attribute Sets grid page.</description> + </annotations> + <arguments> + <argument name="label" type="string"/> + </arguments> + + <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/> + <waitForPageLoad stepKey="waitForAttributeSetPageLoad"/> + <fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{label}}" stepKey="filterByName"/> + <click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/> + <click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/> + <waitForPageLoad stepKey="waitForClick"/> + <click selector="{{AdminProductAttributeSetSection.deleteBtn}}" stepKey="clickDelete"/> + <click selector="{{AdminProductAttributeSetSection.modalOk}}" stepKey="confirmDelete"/> + <waitForPageLoad stepKey="waitForDeleteToFinish"/> + <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="The attribute set has been removed." stepKey="seeDeleteMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteCategoryActionGroup.xml new file mode 100644 index 0000000000000..a84e92fcbb0f5 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteCategoryActionGroup.xml @@ -0,0 +1,31 @@ +<?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="DeleteCategoryActionGroup"> + <annotations> + <description>Navigates to the category page and deletes the specified category.</description> + </annotations> + <arguments> + <argument name="categoryEntity" defaultValue="_defaultCategory"/> + </arguments> + + <amOnPage url="{{AdminCategoryPage.url}}" stepKey="goToCategoryPage"/> + <waitForPageLoad time="60" stepKey="waitForCategoryPageLoad"/> + <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryEntity.name)}}" stepKey="clickCategoryLink"/> + <click selector="{{AdminCategoryMainActionsSection.DeleteButton}}" stepKey="clickDelete"/> + <waitForElementVisible selector="{{AdminCategoryModalSection.message}}" stepKey="waitForConfirmationModal"/> + <see selector="{{AdminCategoryModalSection.message}}" userInput="Are you sure you want to delete this category?" stepKey="seeDeleteConfirmationMessage"/> + <click selector="{{AdminCategoryModalSection.ok}}" stepKey="confirmDelete"/> + <waitForPageLoad time="60" stepKey="waitForDeleteToFinish"/> + <see selector="You deleted the category." stepKey="seeDeleteSuccess"/> + <click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="expandToSeeAllCategories"/> + <dontSee selector="{{AdminCategorySidebarTreeSection.categoryInTree(categoryEntity.name)}}" stepKey="dontSeeCategoryInTree"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteDefaultCategoryChildrenActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteDefaultCategoryChildrenActionGroup.xml new file mode 100644 index 0000000000000..2fb4e0e05887a --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteDefaultCategoryChildrenActionGroup.xml @@ -0,0 +1,35 @@ +<?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="DeleteDefaultCategoryChildrenActionGroup"> + <annotations> + <description>Deletes all children categories of Default Root Category.</description> + </annotations> + + <amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToAdminCategoryPage"/> + <executeInSelenium function="function ($webdriver) use ($I) { + $children = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::xpath('//ul[contains(@class, \'x-tree-node-ct\')]/li[@class=\'x-tree-node\' and contains(., + \'{{DefaultCategory.name}}\')]/ul[contains(@class, \'x-tree-node-ct\')]/li//a')); + while (!empty($children)) { + $I->click('//ul[contains(@class, \'x-tree-node-ct\')]/li[@class=\'x-tree-node\' and contains(., + \'{{DefaultCategory.name}}\')]/ul[contains(@class, \'x-tree-node-ct\')]/li//a'); + $I->waitForPageLoad(30); + $I->click('#delete'); + $I->waitForElementVisible('aside.confirm .modal-footer button.action-accept'); + $I->click('aside.confirm .modal-footer button.action-accept'); + $I->waitForPageLoad(30); + $I->waitForElementVisible('#messages div.message-success', 30); + $I->see('You deleted the category.', '#messages div.message-success'); + $children = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::xpath('//ul[contains(@class, \'x-tree-node-ct\')]/li[@class=\'x-tree-node\' and contains(., + \'{{DefaultCategory.name}}\')]/ul[contains(@class, \'x-tree-node-ct\')]/li//a')); + } + }" stepKey="deleteAllChildCategories"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteMostRecentCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteMostRecentCategoryActionGroup.xml new file mode 100644 index 0000000000000..8b47b6375c21c --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteMostRecentCategoryActionGroup.xml @@ -0,0 +1,25 @@ +<?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="DeleteMostRecentCategoryActionGroup"> + <annotations> + <description>Actions to delete the category last made (the last category on the list).</description> + </annotations> + + <amOnPage url="/{{AdminCategoryPage.url}}" stepKey="goToCategoryFrontPage"/> + <waitForPageLoad stepKey="waitForCategoryPageLoad"/> + <click stepKey="goToCreateCategory" selector="{{AdminCategorySidebarTreeSection.lastCreatedCategory}}"/> + <waitForPageLoad stepKey="waitForCreatedCategoryPageLoad"/> + <click stepKey="clickDeleteCategory" selector="{{AdminCategoryMainActionsSection.DeleteButton}}"/> + <waitForPageLoad stepKey="waitForModalVisible"/> + <click stepKey="clickOkToDelete" selector="{{AdminCategoryModalSection.ok}}"/> + <waitForPageLoad stepKey="waitForModalNotVisible"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeActionGroup.xml new file mode 100644 index 0000000000000..8ea0e43d0307f --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeActionGroup.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="DeleteProductAttributeActionGroup" extends="NavigateToCreatedProductAttributeActionGroup"> + <annotations> + <description>EXTENDS: navigateToCreatedProductAttribute. Deletes the Product Attribute. Validates that the success message is present.</description> + </annotations> + + <click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="deleteAttribute"/> + <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOnDeleteButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml index 66d4378872605..7fbf6a9b2a178 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml @@ -10,15 +10,21 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="DeleteProductAttributeByAttributeCodeActionGroup"> <annotations> - <description>Delete a Product Attribute from the Product Attribute creation/edit page.</description> + <description>Goes to the Admin Product Attributes grid page. Filters the grid for the provided Product Attribute Code. Deletes the Product Attribute from the grid. Validates that the Success Message is present.</description> </annotations> <arguments> - <argument name="productAttributeCode" type="string"/> + <argument name="ProductAttributeCode" type="string"/> </arguments> - - <waitForPageLoad stepKey="waitForViewAdminProductAttributeLoad" time="30"/> + + <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> + <waitForPageLoad stepKey="waitForAttributeGridPageLoad"/> + <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttributeCode}}" stepKey="setAttributeCode"/> + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> + <click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> <click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="deleteAttribute"/> - <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="clickOnConfirmOk"/> - <waitForPageLoad stepKey="waitForViewProductAttributePageLoad"/> + <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOnDeleteButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByLabelActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByLabelActionGroup.xml new file mode 100644 index 0000000000000..fb78909eab0b6 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByLabelActionGroup.xml @@ -0,0 +1,29 @@ +<?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="DeleteProductAttributeByLabelActionGroup"> + <annotations> + <description>Goes to the Admin Product Attributes grid page. Filters the grid for the provided Product Attribute (Label). Deletes the Product Attribute from the grid. Validates that the Success Message is present.</description> + </annotations> + <arguments> + <argument name="ProductAttribute"/> + </arguments> + + <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> + <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttribute.default_label}}" stepKey="setAttributeCode"/> + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> + <click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="deleteAttribute"/> + <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOnDeleteButton"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductByNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductByNameActionGroup.xml new file mode 100644 index 0000000000000..0541a5ba67d30 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductByNameActionGroup.xml @@ -0,0 +1,25 @@ +<?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="DeleteProductByNameActionGroup" extends="DeleteProductBySkuActionGroup"> + <annotations> + <description>EXTENDS: deleteProductBySku. Deletes the provided Product Name.</description> + </annotations> + <arguments> + <argument name="sku" type="string" defaultValue=""/> + <argument name="name" type="string"/> + </arguments> + + <remove keyForRemoval="fillProductSkuFilter"/> + <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{name}}" stepKey="fillProductSkuFilter" after="openProductFilters"/> + <remove keyForRemoval="seeProductSkuInGrid"/> + <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="{{name}}" stepKey="seeProductNameInGrid" after="clickApplyFilters"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductBySkuActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductBySkuActionGroup.xml new file mode 100644 index 0000000000000..c1f22920ceb99 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductBySkuActionGroup.xml @@ -0,0 +1,34 @@ +<?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="DeleteProductBySkuActionGroup"> + <annotations> + <description>Goes to the Admin Products grid page. Deletes the provided Product SKU.</description> + </annotations> + <arguments> + <argument name="sku" type="string"/> + </arguments> + + <!--TODO use other action group for filtering grid when MQE-539 is implemented --> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <see selector="{{AdminProductGridSection.productGridCell('1', 'SKU')}}" userInput="{{sku}}" stepKey="seeProductSkuInGrid"/> + <click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="openMulticheckDropdown"/> + <click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllProductInFilteredGrid"/> + <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> + <click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/> + <waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForConfirmModal"/> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmProductDelete"/> + <see selector="{{AdminMessagesSection.success}}" userInput="record(s) have been deleted." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductUsingProductGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductUsingProductGridActionGroup.xml new file mode 100644 index 0000000000000..95ad1d743690e --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductUsingProductGridActionGroup.xml @@ -0,0 +1,35 @@ +<?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="DeleteProductUsingProductGridActionGroup"> + <annotations> + <description>Deletes the provided Product from the Admin Products grid page.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <!--TODO use other action group for filtering grid when MQE-539 is implemented --> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <waitForPageLoad time="60" stepKey="waitForPageLoadInitial"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> + <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <see selector="{{AdminProductGridSection.productGridCell('1', 'SKU')}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> + <click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="openMulticheckDropdown"/> + <click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllProductInFilteredGrid"/> + <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> + <click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/> + <waitForElementVisible selector="{{AdminProductGridConfirmActionSection.title}}" stepKey="waitForConfirmModal"/> + <click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmProductDelete"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductsByKeywordActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductsByKeywordActionGroup.xml new file mode 100644 index 0000000000000..6b181d5f93be2 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductsByKeywordActionGroup.xml @@ -0,0 +1,31 @@ +<?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="DeleteProductsByKeywordActionGroup"> + <annotations> + <description>Delete products by keyword</description> + </annotations> + <arguments> + <argument name="keyword" type="string"/> + </arguments> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <fillField selector="{{AdminProductGridFilterSection.keywordSearch}}" userInput="{{keyword}}" stepKey="fillKeywordField"/> + <click selector="{{AdminProductGridFilterSection.keywordSearchButton}}" stepKey="keywordSearchButton"/> + <click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="openMulticheckDropdown"/> + <click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllProductInFilteredGrid"/> + <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> + <click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/> + <waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForConfirmModal"/> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmProductDelete"/> + <see selector="{{AdminMessagesSection.success}}" userInput="record(s) have been deleted." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductsIfTheyExistActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductsIfTheyExistActionGroup.xml new file mode 100644 index 0000000000000..3ef0de8b27a65 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductsIfTheyExistActionGroup.xml @@ -0,0 +1,24 @@ +<?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="DeleteProductsIfTheyExistActionGroup"> + <annotations> + <description>Deletes all Products in the Admin Products grid.</description> + </annotations> + + <conditionalClick selector="{{AdminProductGridSection.multicheckDropdown}}" dependentSelector="{{AdminProductGridSection.firstProductRow}}" visible="true" stepKey="openMulticheckDropdown"/> + <conditionalClick selector="{{AdminProductGridSection.multicheckOption('Select All')}}" dependentSelector="{{AdminProductGridSection.firstProductRow}}" visible="true" stepKey="selectAllProductInFilteredGrid"/> + <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> + <click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/> + <waitForElementVisible selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="waitForModalPopUp"/> + <click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmProductDelete"/> + <waitForPageLoad stepKey="waitForGridLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ExpandAdminProductSectionActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ExpandAdminProductSectionActionGroup.xml new file mode 100644 index 0000000000000..a181cce591e09 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ExpandAdminProductSectionActionGroup.xml @@ -0,0 +1,25 @@ +<?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="ExpandAdminProductSectionActionGroup"> + <annotations> + <description>Expand the provided Section Selector based on the provided dependant Section Selector.</description> + </annotations> + <arguments> + <argument name="sectionSelector" defaultValue="{{AdminProductContentSection.sectionHeader}}" type="string"/> + <argument name="sectionDependentSelector" defaultValue="{{AdminProductContentSection.sectionHeaderShow}}" type="string"/> + </arguments> + + <scrollToTopOfPage stepKey="scrollToTopOfPage"/> + <waitForElementVisible time="30" selector="{{sectionSelector}}" stepKey="waitForSection"/> + <conditionalClick selector="{{sectionSelector}}" dependentSelector="{{sectionDependentSelector}}" visible="false" stepKey="expandSection"/> + <waitForPageLoad time="30" stepKey="waitForSectionToExpand"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillAdminSimpleProductFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillAdminSimpleProductFormActionGroup.xml new file mode 100644 index 0000000000000..2abfc546e6bb3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillAdminSimpleProductFormActionGroup.xml @@ -0,0 +1,38 @@ +<?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="FillAdminSimpleProductFormActionGroup"> + <annotations> + <description>Goes to the Admin Product grid page. Clicks on Add. Fills the provided Product details (Name, SKU, Price, Quantity, Category and URL). Clicks on Save. Validates that the Product details are present and correct.</description> + </annotations> + <arguments> + <argument name="category"/> + <argument name="simpleProduct"/> + </arguments> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> + <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/> + <click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/> + <fillField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> + <fillField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/> + <fillField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/> + <fillField userInput="{{simpleProduct.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/> + <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="searchAndSelectCategory"/> + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> + <fillField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="assertSaveMessageSuccess"/> + <seeInField userInput="{{simpleProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="assertFieldName"/> + <seeInField userInput="{{simpleProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="assertFieldSku"/> + <seeInField userInput="{{simpleProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="assertFieldPrice"/> + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSectionAssert"/> + <seeInField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="assertFieldUrlKey"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillCategoryFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillCategoryFormActionGroup.xml new file mode 100644 index 0000000000000..37989ed9ddc44 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillCategoryFormActionGroup.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="FillCategoryFormActionGroup"> + <annotations> + <description>Requires navigation to the Subcategory creation/edit page. Fills the Subcategory Name. Fills the Search Engine Optimization.</description> + </annotations> + <arguments> + <argument name="categoryEntity" defaultValue="_defaultCategory"/> + </arguments> + + <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{categoryEntity.name}}" stepKey="enterCategoryName"/> + <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSEO"/> + <fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{categoryEntity.name_lwr}}" stepKey="enterURLKey"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillCategoryNameAndUrlKeyAndSaveActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillCategoryNameAndUrlKeyAndSaveActionGroup.xml new file mode 100644 index 0000000000000..bd62dd9e83e55 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillCategoryNameAndUrlKeyAndSaveActionGroup.xml @@ -0,0 +1,29 @@ +<?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="FillCategoryNameAndUrlKeyAndSaveActionGroup"> + <annotations> + <description>Requires navigation to subcategory creation/edit. Fills the name, and sets the Search Engine Optimization for the category.</description> + </annotations> + <arguments> + <argument name="categoryName" type="string"/> + <argument name="categoryUrlKey" type="string"/> + </arguments> + + <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{categoryName}}" stepKey="enterCategoryName"/> + <scrollTo selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="scrollToSearchEngineOptimization"/> + <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSEO"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{categoryUrlKey}}" stepKey="enterURLKey"/> + <scrollToTopOfPage stepKey="scrollToTheTopOfPage"/> + <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormActionGroup.xml new file mode 100644 index 0000000000000..f53059b3de063 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormActionGroup.xml @@ -0,0 +1,28 @@ +<?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="FillMainProductFormActionGroup"> + <annotations> + <description>Fills in the provided Product details (Name, SKU, Price, Quantity, Stock Status, Weight Type and Weight) on the Admin Products creation/edit page.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + + <scrollToTopOfPage stepKey="scrollToTopOfPage"/> + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/> + <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/> + <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="fillProductQty"/> + <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="selectStockStatus"/> + <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has weight" stepKey="selectWeight"/> + <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{product.weight}}" stepKey="fillProductWeight"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormByStringActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormByStringActionGroup.xml new file mode 100644 index 0000000000000..4f3157292d356 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormByStringActionGroup.xml @@ -0,0 +1,32 @@ +<?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="FillMainProductFormByStringActionGroup"> + <annotations> + <description>Fills in the provided Product Name, SKU, Price, Quantity, Stock Status and Weight on the Admin Products creation/edit page.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="productSku" type="string"/> + <argument name="productPrice" type="string"/> + <argument name="productQuantity" type="string"/> + <argument name="productStatus" type="string"/> + <argument name="productWeight" type="string"/> + </arguments> + + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{productName}}" stepKey="fillProductName"/> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{productSku}}" stepKey="fillProductSku"/> + <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{productPrice}}" stepKey="fillProductPrice"/> + <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{productQuantity}}" stepKey="fillProductQty"/> + <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{productStatus}}" stepKey="selectStockStatus"/> + <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has weight" stepKey="selectWeight"/> + <fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{productWeight}}" stepKey="fillProductWeight"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormNoWeightActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormNoWeightActionGroup.xml new file mode 100644 index 0000000000000..b3cc110224b25 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillMainProductFormNoWeightActionGroup.xml @@ -0,0 +1,26 @@ +<?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="FillMainProductFormNoWeightActionGroup"> + <annotations> + <description>Fills in the provided Product details (Name, SKU, Price, Quantity, Stock Status and Weight Type) on the Admin Products creation/edit page.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="DownloadableProduct"/> + </arguments> + + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/> + <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/> + <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="fillProductQty"/> + <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="selectStockStatus"/> + <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has no weight" stepKey="selectWeight"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillNewProductCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillNewProductCategoryActionGroup.xml new file mode 100644 index 0000000000000..9edcfca9416f2 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillNewProductCategoryActionGroup.xml @@ -0,0 +1,34 @@ +<?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="FillNewProductCategoryActionGroup"> + <annotations> + <description>Actions to fill out a new category from the product page with specified category and parent category names.</description> + </annotations> + <arguments> + <argument name="categoryName" defaultValue="Test Category" type="string"/> + <argument name="parentCategoryName" defaultValue="default" type="string"/> + </arguments> + + <!-- Click on new Category --> + <click stepKey="clickNewCategory" selector="{{AdminProductCategoryCreationSection.newCategory}}"/> + <waitForPageLoad stepKey="waitForFieldSet"/> + <fillField stepKey="fillCategoryName" selector="{{AdminProductCategoryCreationSection.nameInput}}" userInput="{{categoryName}}"/> + + <!-- Search and select a parent category for the product --> + <click stepKey="clickParentCategory" selector="{{AdminProductCategoryCreationSection.parentCategory}}"/> + <waitForPageLoad stepKey="waitForDropDownVisible"/> + <fillField stepKey="searchForParent" userInput="{{parentCategoryName}}" selector="{{AdminProductCategoryCreationSection.parentSearch}}"/> + <waitForPageLoad stepKey="waitForFieldResults"/> + <click stepKey="clickParent" selector="{{AdminProductCategoryCreationSection.parentSearchResult}}"/> + <click stepKey="createCategory" selector="{{AdminProductCategoryCreationSection.createCategory}}"/> + <waitForPageLoad stepKey="waitForCategoryCreated"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillProductNameAndSkuInProductFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillProductNameAndSkuInProductFormActionGroup.xml new file mode 100644 index 0000000000000..822b74d9e9e6b --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FillProductNameAndSkuInProductFormActionGroup.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="FillProductNameAndSkuInProductFormActionGroup"> + <annotations> + <description>Fills in the provided Product details (Name and SKU) on the Admin Products creation and edit page.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterAndSelectProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterAndSelectProductActionGroup.xml new file mode 100644 index 0000000000000..2cd64ddc2855f --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterAndSelectProductActionGroup.xml @@ -0,0 +1,30 @@ +<?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="FilterAndSelectProductActionGroup"> + <annotations> + <description>Goes to the Admin Products grid. Filters the Product grid by the provided Product SKU.</description> + </annotations> + <arguments> + <argument name="productSku" type="string"/> + </arguments> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{productSku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> + <click stepKey="openSelectedProduct" selector="{{AdminProductGridSection.productRowBySku(productSku)}}"/> + <waitForPageLoad stepKey="waitForProductToLoad"/> + <waitForElementVisible selector="{{AdminHeaderSection.pageTitle}}" stepKey="waitForProductTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByAttributeCodeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByAttributeCodeActionGroup.xml new file mode 100644 index 0000000000000..efd1d50cb4929 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByAttributeCodeActionGroup.xml @@ -0,0 +1,24 @@ +<?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="FilterProductAttributeByAttributeCodeActionGroup"> + <annotations> + <description>Filters the Product Attributes grid by the provided Product Attribute Code.</description> + </annotations> + <arguments> + <argument name="ProductAttributeCode" type="string"/> + </arguments> + + <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid"/> + <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttributeCode}}" stepKey="setAttributeCode"/> + <waitForPageLoad stepKey="waitForUserInput"/> + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByAttributeLabelActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByAttributeLabelActionGroup.xml new file mode 100644 index 0000000000000..8d2c966de6074 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByAttributeLabelActionGroup.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="FilterProductAttributeByAttributeLabelActionGroup"> + <annotations> + <description>Searches the Attribute Sets grid page for the provided Attribute Set Name.</description> + </annotations> + <arguments> + <argument name="productAttributeLabel" type="string"/> + </arguments> + + <fillField selector="{{AdminProductAttributeGridSection.attributeLabelFilter}}" userInput="{{productAttributeLabel}}" stepKey="setAttributeLabel"/> + <waitForPageLoad stepKey="waitForUserInput"/> + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByDefaultLabelActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByDefaultLabelActionGroup.xml new file mode 100644 index 0000000000000..31702bfdca212 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeByDefaultLabelActionGroup.xml @@ -0,0 +1,24 @@ +<?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="FilterProductAttributeByDefaultLabelActionGroup"> + <annotations> + <description>Filters the Product Attributes grid by the provided Product Attribute Label.</description> + </annotations> + <arguments> + <argument name="productAttributeLabel" type="string"/> + </arguments> + + <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid"/> + <fillField selector="{{AdminProductAttributeGridSection.GridFilterFrontEndLabel}}" userInput="{{productAttributeLabel}}" stepKey="setDefaultLabel"/> + <waitForPageLoad stepKey="waitForUserInput"/> + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeSetGridByAttributeSetNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeSetGridByAttributeSetNameActionGroup.xml new file mode 100644 index 0000000000000..c8aa8eb286fc3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductAttributeSetGridByAttributeSetNameActionGroup.xml @@ -0,0 +1,25 @@ +<?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="FilterProductAttributeSetGridByAttributeSetNameActionGroup"> + <annotations> + <description>Filters the Attribute Sets grid page for the provided Attribute Set Name.</description> + </annotations> + <arguments> + <argument name="name" type="string"/> + </arguments> + + <click selector="{{AdminProductAttributeSetGridSection.resetFilter}}" stepKey="clickResetButton"/> + <fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{name}}" stepKey="filterByName"/> + <click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/> + <click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/> + <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByDisabledStatusActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByDisabledStatusActionGroup.xml new file mode 100644 index 0000000000000..52b6972ec92e6 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByDisabledStatusActionGroup.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="FilterProductGridByDisabledStatusActionGroup"> + <annotations> + <description>Filters the Admin Products grid by the 'Disabled' Status. PLEASE NOTE: The Filter is Hardcoded.</description> + </annotations> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <selectOption selector="{{AdminProductGridFilterSection.statusFilter}}" userInput="Disabled" stepKey="selectDisabledStatusFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByEnabledStatusActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByEnabledStatusActionGroup.xml new file mode 100644 index 0000000000000..1e4d2315bf75e --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByEnabledStatusActionGroup.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="FilterProductGridByEnabledStatusActionGroup"> + <annotations> + <description>Filters the Admin Products grid by the 'Enabled' Status. PLEASE NOTE: The Filter is Hardcoded.</description> + </annotations> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <selectOption selector="{{AdminProductGridFilterSection.statusFilter}}" userInput="Enabled" stepKey="selectEnabledStatusFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByName2ActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByName2ActionGroup.xml new file mode 100644 index 0000000000000..850ea3e167daa --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByName2ActionGroup.xml @@ -0,0 +1,25 @@ +<?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="FilterProductGridByName2ActionGroup"> + <annotations> + <description>Filters the Admin Products grid by the provided Product Name.</description> + </annotations> + <arguments> + <argument name="name" type="string"/> + </arguments> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{name}}" stepKey="fillProductNameFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByNameActionGroup.xml new file mode 100644 index 0000000000000..efd2f1c7be08a --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByNameActionGroup.xml @@ -0,0 +1,25 @@ +<?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="FilterProductGridByNameActionGroup"> + <annotations> + <description>Filters the Admin Products grid by the provided Product (Name).</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByPriceRangeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByPriceRangeActionGroup.xml new file mode 100644 index 0000000000000..d3405f977ccc4 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridByPriceRangeActionGroup.xml @@ -0,0 +1,26 @@ +<?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="FilterProductGridByPriceRangeActionGroup"> + <annotations> + <description>Filters the Admin Products grid by the provided Price Filter.</description> + </annotations> + <arguments> + <argument name="filter"/> + </arguments> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.priceFilterFrom}}" userInput="{{filter.from}}" stepKey="fillProductPriceFromFilter"/> + <fillField selector="{{AdminProductGridFilterSection.priceFilterTo}}" userInput="{{filter.to}}" stepKey="fillProductPriceToFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySetNewFromDateActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySetNewFromDateActionGroup.xml new file mode 100644 index 0000000000000..db12d6f9d8440 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySetNewFromDateActionGroup.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="FilterProductGridBySetNewFromDateActionGroup"> + <annotations> + <description>Filters the Admin Products grid by the New From Data field. PLEASE NOTE: The Start Date is Hardcoded.</description> + </annotations> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.newFromDateFilter}}" userInput="05/16/2018" stepKey="fillSetAsNewProductFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySku2ActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySku2ActionGroup.xml new file mode 100644 index 0000000000000..eb5f20b7c84e3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySku2ActionGroup.xml @@ -0,0 +1,25 @@ +<?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="FilterProductGridBySku2ActionGroup"> + <annotations> + <description>Filters the Admin Products grid by the provided Product SKU.</description> + </annotations> + <arguments> + <argument name="sku" type="string"/> + </arguments> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySkuActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySkuActionGroup.xml new file mode 100644 index 0000000000000..d216b0f976efe --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySkuActionGroup.xml @@ -0,0 +1,25 @@ +<?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="FilterProductGridBySkuActionGroup"> + <annotations> + <description>Filters the Admin Products grid by the provided Product (SKU).</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySkuAndNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySkuAndNameActionGroup.xml new file mode 100644 index 0000000000000..80e8e2c7c3133 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/FilterProductGridBySkuAndNameActionGroup.xml @@ -0,0 +1,25 @@ +<?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="FilterProductGridBySkuAndNameActionGroup"> + <annotations> + <description>Filters the Admin Products grid by the provided Product (Name and SKU).</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> + <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAdminCategoryPageByIdActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAdminCategoryPageByIdActionGroup.xml new file mode 100644 index 0000000000000..b1914118cd034 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAdminCategoryPageByIdActionGroup.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="GoToAdminCategoryPageByIdActionGroup"> + <annotations> + <description>Goes to the Category edit page for a specified Category ID.</description> + </annotations> + <arguments> + <argument name="id" type="string"/> + </arguments> + + <amOnPage url="{{AdminCategoryEditPage.url(id)}}" stepKey="amOnAdminCategoryPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="{{id}}" stepKey="seeCategoryPageTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAttributeGridPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAttributeGridPageActionGroup.xml new file mode 100644 index 0000000000000..2b5fe9d76875c --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAttributeGridPageActionGroup.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="GoToAttributeGridPageActionGroup"> + <annotations> + <description>Goes to the Attribute Sets grid page.</description> + </annotations> + + <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAttributeSetByNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAttributeSetByNameActionGroup.xml new file mode 100644 index 0000000000000..e732f1bd7341e --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToAttributeSetByNameActionGroup.xml @@ -0,0 +1,25 @@ +<?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="GoToAttributeSetByNameActionGroup"> + <annotations> + <description>Searches for the provided Attribute Sets Name. Clicks on the 1st row.</description> + </annotations> + <arguments> + <argument name="name" type="string"/> + </arguments> + + <click selector="{{AdminProductAttributeSetGridSection.resetFilter}}" stepKey="clickResetButton"/> + <fillField selector="{{AdminProductAttributeSetGridSection.filter}}" userInput="{{name}}" stepKey="filterByName"/> + <click selector="{{AdminProductAttributeSetGridSection.searchBtn}}" stepKey="clickSearch"/> + <click selector="{{AdminProductAttributeSetGridSection.nthRow('1')}}" stepKey="clickFirstRow"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToCreateCategoryPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToCreateCategoryPageActionGroup.xml new file mode 100644 index 0000000000000..346f47006cf37 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToCreateCategoryPageActionGroup.xml @@ -0,0 +1,25 @@ +<?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="GoToCreateCategoryPageActionGroup"> + <annotations> + <description>Goes to the Category grid page. Clicks the Add Subcategory button.</description> + </annotations> + <arguments> + <argument name="selector" defaultValue="AdminCategorySidebarActionSection.AddSubcategoryButton"/> + </arguments> + + <amOnPage url="{{AdminCategoryPage.url}}" stepKey="amOnAdminCategoryPage"/> + <scrollToTopOfPage stepKey="scrollToTopOfPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <click selector="{{selector}}" stepKey="clickOnAddCategory"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Category" stepKey="seeCategoryPageTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToCreateProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToCreateProductPageActionGroup.xml new file mode 100644 index 0000000000000..7f95765337189 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToCreateProductPageActionGroup.xml @@ -0,0 +1,27 @@ +<?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"> + <!--Navigate to create product page from product grid page--> + <actionGroup name="GoToCreateProductPageActionGroup"> + <annotations> + <description>Clicks on the 'Add Product' toggle on the Admin Products grid page. Clicks on the provided Product (Type).</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + + <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductToggle"/> + <waitForElementVisible selector="{{AdminProductGridActionSection.addTypeProduct(product.type_id)}}" stepKey="waitForAddProductDropdown" time="30"/> + <click selector="{{AdminProductGridActionSection.addTypeProduct(product.type_id)}}" stepKey="clickAddProductType"/> + <waitForPageLoad time="30" stepKey="waitForCreateProductPageLoad"/> + <seeInCurrentUrl url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, product.type_id)}}" stepKey="seeNewProductUrl"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeNewProductTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToProductCatalogPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToProductCatalogPageActionGroup.xml new file mode 100644 index 0000000000000..08bf948c2223b --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToProductCatalogPageActionGroup.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="GoToProductCatalogPageActionGroup"> + <annotations> + <description>Goes to the Admin Products grid page.</description> + </annotations> + + <comment userInput="actionGroup:GoToProductCatalogPage" stepKey="actionGroupComment"/> + <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/> + <waitForPageLoad stepKey="WaitForPageToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToProductPageViaIDActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToProductPageViaIDActionGroup.xml new file mode 100644 index 0000000000000..104ef83771e9d --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToProductPageViaIDActionGroup.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="GoToProductPageViaIDActionGroup"> + <annotations> + <description>Goes to the Product edit page for the provided Product ID.</description> + </annotations> + <arguments> + <argument name="productId" type="string"/> + </arguments> + + <amOnPage url="{{AdminProductEditPage.url(productId)}}" stepKey="goToProduct"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSpecifiedCreateProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSpecifiedCreateProductPageActionGroup.xml new file mode 100644 index 0000000000000..26041974dbc80 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSpecifiedCreateProductPageActionGroup.xml @@ -0,0 +1,25 @@ +<?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="GoToSpecifiedCreateProductPageActionGroup"> + <annotations> + <description>Goes to the Admin Product grid page. Clicks on the Add Product toggle. Clicks on the provided Product Type.</description> + </annotations> + <arguments> + <argument type="string" name="productType" defaultValue="simple"/> + </arguments> + + <comment userInput="actionGroup:GoToSpecifiedCreateProductPage" stepKey="actionGroupComment"/> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> + <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/> + <click selector="{{AdminProductGridActionSection.addTypeProduct(productType)}}" stepKey="clickAddProduct"/> + <waitForPageLoad stepKey="waitForFormToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToStorefrontCategoryPageByParametersActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToStorefrontCategoryPageByParametersActionGroup.xml new file mode 100644 index 0000000000000..816aeaa09ee9b --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToStorefrontCategoryPageByParametersActionGroup.xml @@ -0,0 +1,28 @@ +<?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"> + <!-- Go to storefront category product page by given parameters --> + <actionGroup name="GoToStorefrontCategoryPageByParametersActionGroup"> + <annotations> + <description>Goes to the Storefront Category page using URI Search Parameters.</description> + </annotations> + <arguments> + <argument name="category" type="string"/> + <argument name="mode" type="string"/> + <argument name="numOfProductsPerPage" type="string"/> + <argument name="sortBy" type="string" defaultValue="position"/> + <argument name="sort" type="string" defaultValue="asc"/> + </arguments> + + <!-- Go to storefront category page --> + <amOnPage url="{{StorefrontCategoryPage.url(category)}}?product_list_limit={{numOfProductsPerPage}}&product_list_mode={{mode}}&product_list_order={{sortBy}}&product_list_dir={{sort}}" stepKey="onCategoryPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSubCategoryPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSubCategoryPageActionGroup.xml new file mode 100644 index 0000000000000..8c35c88f151d5 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSubCategoryPageActionGroup.xml @@ -0,0 +1,29 @@ +<?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="GoToSubCategoryPageActionGroup"> + <annotations> + <description>Goes to the Storefront page. Open the Parent Category menu in the Top Nav Menu. Click on a Subcategory. Validate that the Subcategory is present and correct.</description> + </annotations> + <arguments> + <argument name="parentCategory"/> + <argument name="subCategory"/> + <argument name="urlPath" type="string"/> + </arguments> + + <moveMouseOver selector="{{StorefrontHeaderSection.NavigationCategoryByName(parentCategory.name)}}" stepKey="moveMouseOnMainCategory"/> + <waitForElementVisible selector="{{StorefrontHeaderSection.NavigationCategoryByName(subCategory.name)}}" stepKey="waitForSubCategoryVisible"/> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(subCategory.name)}}" stepKey="goToCategory"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <seeInCurrentUrl url="{{urlPath}}.html" stepKey="checkUrl"/> + <seeInTitle userInput="{{subCategory.name}}" stepKey="assertCategoryNameInTitle"/> + <see userInput="{{subCategory.name}}" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ImportProductCustomizableOptionsActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ImportProductCustomizableOptionsActionGroup.xml new file mode 100644 index 0000000000000..2a847034add1d --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ImportProductCustomizableOptionsActionGroup.xml @@ -0,0 +1,29 @@ +<?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="ImportProductCustomizableOptionsActionGroup"> + <annotations> + <description>Import custom Product Options for the provided Product Name.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + + <click selector="{{AdminProductCustomizableOptionsSection.importOptions}}" stepKey="clickImportOptions"/> + <waitForElementVisible selector="{{AdminProductImportOptionsSection.selectProductTitle}}" stepKey="waitForTitleVisible"/> + <conditionalClick selector="{{AdminProductImportOptionsSection.resetFiltersButton}}" dependentSelector="{{AdminProductImportOptionsSection.resetFiltersButton}}" visible="true" stepKey="clickResetFilters"/> + <click selector="{{AdminProductImportOptionsSection.filterButton}}" stepKey="clickFilterButton"/> + <waitForElementVisible selector="{{AdminProductImportOptionsSection.nameField}}" stepKey="waitForNameField"/> + <fillField selector="{{AdminProductImportOptionsSection.nameField}}" userInput="{{productName}}" stepKey="fillProductName"/> + <click selector="{{AdminProductImportOptionsSection.applyFiltersButton}}" stepKey="clickApplyFilters"/> + <checkOption selector="{{AdminProductImportOptionsSection.firstRowItemCheckbox}}" stepKey="checkProductCheckbox"/> + <click selector="{{AdminProductImportOptionsSection.importButton}}" stepKey="clickImport"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToAndResetProductAttributeGridToDefaultViewActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToAndResetProductAttributeGridToDefaultViewActionGroup.xml new file mode 100644 index 0000000000000..6d0091d90175b --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToAndResetProductAttributeGridToDefaultViewActionGroup.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="NavigateToAndResetProductAttributeGridToDefaultViewActionGroup"> + <annotations> + <description>Goes to the Product Attributes grid. Clicks on 'Clear Filters'.</description> + </annotations> + + <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <waitForPageLoad stepKey="waitForGridLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToAndResetProductGridToDefaultViewActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToAndResetProductGridToDefaultViewActionGroup.xml new file mode 100644 index 0000000000000..c67c0c0e61ab7 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToAndResetProductGridToDefaultViewActionGroup.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="NavigateToAndResetProductGridToDefaultViewActionGroup" extends="ResetProductGridToDefaultViewActionGroup"> + <annotations> + <description>EXTENDS: resetProductGridToDefaultView. Adds an action to go to the Admin Products grid page.</description> + </annotations> + + <amOnPage url="{{AdminProductIndexPage.url}}" before="clickClearFilters" stepKey="goToAdminProductIndexPage"/> + <waitForPageLoad after="goToAdminProductIndexPage" stepKey="waitForProductIndexPageToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedCategoryActionGroup.xml new file mode 100644 index 0000000000000..b1638909652f6 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedCategoryActionGroup.xml @@ -0,0 +1,26 @@ +<?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="NavigateToCreatedCategoryActionGroup"> + <annotations> + <description>Navigates to category page, selects a category by specified category.</description> + </annotations> + <arguments> + <argument name="Category"/> + </arguments> + + <amOnPage url="{{AdminCategoryPage.page}}" stepKey="amOnCategoryPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="expandAll"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(Category.Name)}}" stepKey="navigateToCreatedCategory"/> + <waitForLoadingMaskToDisappear stepKey="waitForSpinner"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductAttributeActionGroup.xml new file mode 100644 index 0000000000000..850939501eb81 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductAttributeActionGroup.xml @@ -0,0 +1,25 @@ +<?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="NavigateToCreatedProductAttributeActionGroup"> + <annotations> + <description>Goes to the Product Attributes grid page. Filters the grid based on the provided Product Attribute. Clicks on the 1st row.</description> + </annotations> + <arguments> + <argument name="ProductAttribute"/> + </arguments> + + <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> + <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttribute.attribute_code}}" stepKey="setAttributeCode"/> + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> + <click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductEditPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductEditPageActionGroup.xml new file mode 100644 index 0000000000000..0c9b5fc1c40e6 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductEditPageActionGroup.xml @@ -0,0 +1,37 @@ +<?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="NavigateToCreatedProductEditPageActionGroup"> + <annotations> + <description>Goes to the Admin Product grid page. Filters the Product grid based on the provided Product details (SKU). Edits the provided Product. Validates that the Product SKU is present and correct.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToAdminProductIndexPage"/> + <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <waitForPageLoad stepKey="waitForClearFilters"/> + <dontSeeElement selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="dontSeeClearFilters"/> + <click selector="{{AdminProductGridFilterSection.viewDropdown}}" stepKey="openViewBookmarksTab"/> + <click selector="{{AdminProductGridFilterSection.viewBookmark('Default View')}}" stepKey="resetToDefaultGridView"/> + <waitForPageLoad stepKey="waitForResetToDefaultView"/> + <see selector="{{AdminProductGridFilterSection.viewDropdown}}" userInput="Default View" stepKey="seeDefaultViewSelected"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForPageLoad stepKey="waitForFilterOnGrid"/> + <click selector="{{AdminProductGridSection.selectRowBasedOnName(product.name)}}" stepKey="clickProduct"/> + <waitForPageLoad stepKey="waitForProductEditPageLoad"/> + <waitForElementVisible selector="{{AdminProductFormBundleSection.productSku}}" stepKey="waitForProductSKUField"/> + <seeInField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{product.sku}}" stepKey="seeProductSKU"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToEditProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToEditProductAttributeActionGroup.xml new file mode 100644 index 0000000000000..9a348d2be8208 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToEditProductAttributeActionGroup.xml @@ -0,0 +1,26 @@ +<?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="NavigateToEditProductAttributeActionGroup"> + <annotations> + <description>Goes to the Product Attributes grid page. Filters the grid based on the provided Product Attribute. Clicks on the 1st row.</description> + </annotations> + <arguments> + <argument name="ProductAttribute" type="string"/> + </arguments> + + <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> + <fillField selector="{{AdminProductAttributeGridSection.GridFilterFrontEndLabel}}" userInput="{{ProductAttribute}}" stepKey="navigateToAttributeEditPage1"/> + <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="navigateToAttributeEditPage2"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="navigateToAttributeEditPage3"/> + <waitForPageLoad stepKey="waitForPageLoad3"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToMediaGalleryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToMediaGalleryActionGroup.xml new file mode 100644 index 0000000000000..fea652311d7c1 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToMediaGalleryActionGroup.xml @@ -0,0 +1,25 @@ +<?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="NavigateToMediaGalleryActionGroup"> + <annotations> + <description>Navigates to the category page and Opens the Media Gallery.</description> + </annotations> + + <amOnPage url="{{AdminCategoryPage.url}}" stepKey="amOnAdminCategoryPage"/> + <waitForElementVisible selector="{{AdminCategoryContentSection.sectionHeader}}" stepKey="waitForContentSection"/> + <conditionalClick selector="{{AdminCategoryContentSection.sectionHeader}}" dependentSelector="{{AdminCategoryContentSection.uploadButton}}" visible="false" stepKey="openContentSection"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <waitForElementVisible selector="{{AdminCategoryContentSection.selectFromGalleryButton}}" stepKey="waitForSelectFromGalleryButton"/> + <click selector="{{AdminCategoryContentSection.selectFromGalleryButton}}" stepKey="clickSelectFromGalleryButton"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/OpenCategoryFromCategoryTreeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/OpenCategoryFromCategoryTreeActionGroup.xml new file mode 100644 index 0000000000000..d172b9b24ab3e --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/OpenCategoryFromCategoryTreeActionGroup.xml @@ -0,0 +1,27 @@ +<?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="OpenCategoryFromCategoryTreeActionGroup"> + <annotations> + <description>Navigates to category page, selects a category by specified category. Replicates actionGroup:navigateToCreatedCategory.</description> + </annotations> + <arguments> + <argument name="category" type="string"/> + </arguments> + + <amOnPage url="{{AdminCategoryPage.url}}" stepKey="openAdminCategoryIndexPage"/> + <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> + <click selector="{{AdminCategorySidebarTreeSection.expandAll}}" stepKey="clickOnExpandTree"/> + <waitForPageLoad stepKey="waitForCategoryToLoad"/> + <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(category)}}" stepKey="selectCategory"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <waitForElementVisible selector="{{AdminCategoryContentSection.categoryPageTitle}}" stepKey="waitForCategoryTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/OpenProductForEditByClickingRowXColumnYInProductGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/OpenProductForEditByClickingRowXColumnYInProductGridActionGroup.xml new file mode 100644 index 0000000000000..d5b6520cb33bb --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/OpenProductForEditByClickingRowXColumnYInProductGridActionGroup.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="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup"> + <annotations> + <description>Clicks on the 'Edit' button in the Admin Products grid by the provided Grid coordinates (X, Y).</description> + </annotations> + <arguments> + <argument name="X" type="string" defaultValue="1"/> + <argument name="Y" type="string" defaultValue="2"/> + </arguments> + + <click selector="{{AdminProductGridSection.productGridXRowYColumnButton(X, Y)}}" stepKey="openProductForEdit"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetAdvancedPricingActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetAdvancedPricingActionGroup.xml new file mode 100644 index 0000000000000..95bda64202159 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetAdvancedPricingActionGroup.xml @@ -0,0 +1,38 @@ +<?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="ProductSetAdvancedPricingActionGroup"> + <annotations> + <description>Sets the provided Advanced Pricing on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="website" type="string" defaultValue=""/> + <argument name="group" type="string" defaultValue="Retailer"/> + <argument name="quantity" type="string" defaultValue="1"/> + <argument name="price" type="string" defaultValue="Discount"/> + <argument name="amount" type="string" defaultValue="45"/> + </arguments> + + <click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton"/> + <waitForElement selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForCustomerGroupPriceAddButton"/> + <click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAnd10percent"/> + <waitForElement selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect('0')}}" stepKey="waitForSelectCustomerGroupNameAttribute2"/> + <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceWebsiteSelect('0')}}" userInput="{{website}}" stepKey="selectProductWebsiteValue"/> + <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect('0')}}" userInput="{{group}}" stepKey="selectProductCustomGroupValue"/> + <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceQtyInput('0')}}" userInput="{{quantity}}" stepKey="fillProductTierPriceQtyInput"/> + <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceValueTypeSelect('0')}}" userInput="{{price}}" stepKey="selectProductTierPriceValueType"/> + <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('0')}}" userInput="{{amount}}" stepKey="selectProductTierPricePriceInput"/> + <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton"/> + <waitForPageLoad stepKey="WaitForProductSave"/> + <click selector="{{AdminProductFormAdvancedPricingSection.save}}" stepKey="clickSaveProduct1"/> + <waitForPageLoad time="60" stepKey="WaitForProductSave1"/> + <see userInput="You saved the product." stepKey="seeSaveConfirmation"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetAdvancedTierFixedPricingActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetAdvancedTierFixedPricingActionGroup.xml new file mode 100644 index 0000000000000..97d09fb3e1018 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetAdvancedTierFixedPricingActionGroup.xml @@ -0,0 +1,15 @@ +<?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="ProductSetAdvancedTierFixedPricingActionGroup" extends="ProductSetAdvancedPricingActionGroup"> + <remove keyForRemoval="selectProductTierPricePriceInput"/> + <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceFixedPriceInput('0')}}" userInput="{{amount}}" stepKey="selectProductTierPricePriceInput" after="selectProductTierPriceValueType"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetWebsiteActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetWebsiteActionGroup.xml new file mode 100644 index 0000000000000..a2439a34bc7be --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ProductSetWebsiteActionGroup.xml @@ -0,0 +1,28 @@ +<?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="ProductSetWebsiteActionGroup"> + <annotations> + <description>Sets the provided Website on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="website" type="string"/> + </arguments> + + <scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToWebsites"/> + <conditionalClick selector="{{ProductInWebsitesSection.sectionHeader}}" dependentSelector="{{ProductInWebsitesSection.website(website)}}" visible="false" stepKey="clickToOpenProductInWebsite"/> + <waitForPageLoad stepKey="waitForPageOpened"/> + <click selector="{{ProductInWebsitesSection.website(website)}}" stepKey="selectWebsite"/> + <click selector="{{AdminProductFormAdvancedPricingSection.save}}" stepKey="clickSaveProduct"/> + <waitForPageLoad time='60' stepKey="waitForProducrSaved"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSaveSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveCategoryFromProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveCategoryFromProductActionGroup.xml new file mode 100644 index 0000000000000..37e7d6173d3a4 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveCategoryFromProductActionGroup.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="RemoveCategoryFromProductActionGroup"> + <arguments> + <argument name="categoryName" type="string" defaultValue="{{_defaultCategory.name}}"/> + </arguments> + <click selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="clickCategoriesDropDown"/> + <click selector="{{AdminProductFormSection.unselectCategories(categoryName)}}" stepKey="unselectCategories"/> + <click selector="{{AdminProductFormSection.done}}" stepKey="clickOnDoneAdvancedCategory"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveCategoryImageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveCategoryImageActionGroup.xml new file mode 100644 index 0000000000000..4febb8fd82c91 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveCategoryImageActionGroup.xml @@ -0,0 +1,24 @@ +<?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="RemoveCategoryImageActionGroup"> + <annotations> + <description>Requires navigation to the Category creation/edit page. Removes the current Category image. Validates that the Image does not exist.</description> + </annotations> + + <conditionalClick selector="{{AdminCategoryContentSection.sectionHeader}}" dependentSelector="{{AdminCategoryContentSection.uploadButton}}" visible="false" stepKey="openContentSection"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForElementVisible selector="{{AdminCategoryContentSection.uploadButton}}" stepKey="seeImageSectionIsReady"/> + <click selector="{{AdminCategoryContentSection.removeImageButton}}" stepKey="clickRemoveImage"/> + <waitForAjaxLoad time="30" stepKey="waitForAjaxUpload"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoading"/> + <dontSee selector="{{AdminCategoryContentSection.imageFileName}}" stepKey="dontSeeImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveProductImageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveProductImageActionGroup.xml new file mode 100644 index 0000000000000..6a56828b30308 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveProductImageActionGroup.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="RemoveProductImageActionGroup"> + <annotations> + <description>Removes a Product Image on the Admin Products creation/edit page.</description> + </annotations> + + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/> + <waitForPageLoad time="30" stepKey="waitForPageRefresh"/> + <click selector="{{AdminProductImagesSection.removeImageButton}}" stepKey="clickRemoveImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveProductImageByNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveProductImageByNameActionGroup.xml new file mode 100644 index 0000000000000..fc931cbe37b25 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/RemoveProductImageByNameActionGroup.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="RemoveProductImageByNameActionGroup" extends="RemoveProductImageActionGroup"> + <annotations> + <description>Removes a Product Image on the Admin Products creation/edit page by name.</description> + </annotations> + + <arguments> + <argument name="image" defaultValue="ProductImage"/> + </arguments> + <click selector="{{AdminProductImagesSection.removeImageButtonForExactImage(image.fileName)}}" stepKey="clickRemoveImage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ResetImportOptionFilterActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ResetImportOptionFilterActionGroup.xml new file mode 100644 index 0000000000000..f73a4f4ed5e4f --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ResetImportOptionFilterActionGroup.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="ResetImportOptionFilterActionGroup"> + <annotations> + <description>Click on the Reset Filters button for the Import Options filters on the Product grid page.</description> + </annotations> + + <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/> + <click selector="{{AdminProductCustomizableOptionsSection.importOptions}}" stepKey="clickImportOptions"/> + <click selector="{{AdminProductImportOptionsSection.resetFiltersButton}}" stepKey="clickResetFilterButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ResetProductGridToDefaultViewActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ResetProductGridToDefaultViewActionGroup.xml new file mode 100644 index 0000000000000..441fe377bd435 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ResetProductGridToDefaultViewActionGroup.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"> + <!--Reset the product grid to the default view--> + <actionGroup name="ResetProductGridToDefaultViewActionGroup"> + <annotations> + <description>Sets the Admin Products grid view to the 'Default View'.</description> + </annotations> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <click selector="{{AdminProductGridFilterSection.viewDropdown}}" stepKey="openViewBookmarksTab"/> + <click selector="{{AdminProductGridFilterSection.viewBookmark('Default View')}}" stepKey="resetToDefaultGridView"/> + <waitForPageLoad stepKey="waitForProductGridLoad"/> + <see selector="{{AdminProductGridFilterSection.viewDropdown}}" userInput="Default View" stepKey="seeDefaultViewSelected"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveAttributeSetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveAttributeSetActionGroup.xml new file mode 100644 index 0000000000000..4e8efe0885425 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveAttributeSetActionGroup.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="SaveAttributeSetActionGroup"> + <annotations> + <description>Save an Attribute Set on the Attribute Set creation/edit page.</description> + </annotations> + + <click selector="{{AdminProductAttributeSetActionSection.save}}" stepKey="clickSave"/> + <see userInput="You saved the attribute set" selector="{{AdminMessagesSection.success}}" stepKey="successMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveCategoryFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveCategoryFormActionGroup.xml new file mode 100644 index 0000000000000..ff6afb4aaf0e9 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveCategoryFormActionGroup.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="SaveCategoryFormActionGroup"> + <annotations> + <description>Requires navigation to the Category creation/edit page. Checks that the url contains the AdminCategoryPage url. Saves the Category.</description> + </annotations> + + <seeInCurrentUrl url="{{AdminCategoryPage.url}}" stepKey="seeOnCategoryPage"/> + <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategory"/> + <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccess"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductAttributeActionGroup.xml new file mode 100644 index 0000000000000..e1bf2dea21318 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductAttributeActionGroup.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="SaveProductAttributeActionGroup"> + <annotations> + <description>Clicks on Save. Validates that the Success Message is present.</description> + </annotations> + + <waitForElementVisible selector="{{AttributePropertiesSection.Save}}" stepKey="waitForSaveButton"/> + <click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSaveButton"/> + <waitForPageLoad stepKey="waitForAttributeToSave"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductAttributeInUseActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductAttributeInUseActionGroup.xml new file mode 100644 index 0000000000000..4da8232e8405d --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductAttributeInUseActionGroup.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="SaveProductAttributeInUseActionGroup"> + <annotations> + <description>Clicks on Save. Validates that the Success Message is present.</description> + </annotations> + + <waitForElementVisible selector="{{AttributePropertiesSection.Save}}" stepKey="waitForSaveButton"/> + <click selector="{{AttributePropertiesSection.Save}}" stepKey="clickSaveButton"/> + <waitForPageLoad stepKey="waitForAttributeToSave"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormActionGroup.xml new file mode 100644 index 0000000000000..f2524d6e68bfc --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormActionGroup.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="SaveProductFormActionGroup"> + <annotations> + <description>Clicks on the Save button. Validates that the Success Message is present and correct.</description> + </annotations> + + <scrollToTopOfPage stepKey="scrollTopPageProduct"/> + <waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveProductButton"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitProductSaveSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormNoSuccessCheckActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormNoSuccessCheckActionGroup.xml new file mode 100644 index 0000000000000..eb1cc33de9de8 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SaveProductFormNoSuccessCheckActionGroup.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="SaveProductFormNoSuccessCheckActionGroup" extends="SaveProductFormActionGroup"> + <annotations> + <description>EXTENDS: saveProductForm. Removes 'waitProductSaveSuccessMessage' and 'seeSaveConfirmation'.</description> + </annotations> + + <remove keyForRemoval="waitProductSaveSuccessMessage"/> + <remove keyForRemoval="seeSaveConfirmation"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchForProductOnBackendActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchForProductOnBackendActionGroup.xml index 8b289f21f76b4..4c34feff4c943 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchForProductOnBackendActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchForProductOnBackendActionGroup.xml @@ -23,26 +23,4 @@ <fillField userInput="{{product.sku}}" selector="{{AdminProductFiltersSection.skuInput}}" stepKey="fillSkuFieldOnFiltersSection"/> <click selector="{{AdminProductFiltersSection.apply}}" stepKey="clickApplyFiltersButton"/> </actionGroup> - - <actionGroup name="SearchForProductOnBackendByNameActionGroup" extends="SearchForProductOnBackendActionGroup"> - <annotations> - <description>Search for the provided Product Name.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - </arguments> - - <remove keyForRemoval="fillSkuFieldOnFiltersSection"/> - <fillField userInput="{{productName}}" selector="{{AdminProductFiltersSection.nameInput}}" after="cleanFiltersIfTheySet" stepKey="fillNameFieldOnFiltersSection"/> - </actionGroup> - - <actionGroup name="ClearProductsFilterActionGroup"> - <annotations> - <description>Goto the Product grid page. Clear the Search Filters for the grid.</description> - </annotations> - - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> - <waitForPageLoad time="30" stepKey="waitForProductsPageToLoad"/> - <conditionalClick selector="{{AdminProductFiltersSection.clearFiltersButton}}" dependentSelector="{{AdminProductFiltersSection.clearFiltersButton}}" visible="true" stepKey="cleanFiltersIfTheySet"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchForProductOnBackendByNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchForProductOnBackendByNameActionGroup.xml new file mode 100644 index 0000000000000..b46a3f5818aff --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchForProductOnBackendByNameActionGroup.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="SearchForProductOnBackendByNameActionGroup" extends="SearchForProductOnBackendActionGroup"> + <annotations> + <description>Search for the provided Product Name.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + + <remove keyForRemoval="fillSkuFieldOnFiltersSection"/> + <fillField userInput="{{productName}}" selector="{{AdminProductFiltersSection.nameInput}}" after="cleanFiltersIfTheySet" stepKey="fillNameFieldOnFiltersSection"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByKeyword2ActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByKeyword2ActionGroup.xml new file mode 100644 index 0000000000000..bf9ca75f144b5 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByKeyword2ActionGroup.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="SearchProductGridByKeyword2ActionGroup"> + <annotations> + <description>Searches the Admin Products grid for the provided Keyword.</description> + </annotations> + <arguments> + <argument name="keyword" type="string"/> + </arguments> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <fillField selector="{{AdminProductGridFilterSection.keywordSearch}}" userInput="{{keyword}}" stepKey="fillKeywordSearchField"/> + <click selector="{{AdminProductGridFilterSection.keywordSearchButton}}" stepKey="clickKeywordSearch"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByKeywordActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByKeywordActionGroup.xml new file mode 100644 index 0000000000000..e3370864e7f61 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SearchProductGridByKeywordActionGroup.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="SearchProductGridByKeywordActionGroup"> + <annotations> + <description>Searches the Admin Products grid for the provided Keyword.</description> + </annotations> + <arguments> + <argument name="keyword"/> + </arguments> + + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <fillField selector="{{AdminProductGridFilterSection.keywordSearch}}" userInput="{{keyword}}" stepKey="fillKeywordSearchField"/> + <click selector="{{AdminProductGridFilterSection.keywordSearchButton}}" stepKey="clickKeywordSearch"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SelectProductInWebsitesActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SelectProductInWebsitesActionGroup.xml new file mode 100644 index 0000000000000..bc3a865c3c365 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SelectProductInWebsitesActionGroup.xml @@ -0,0 +1,24 @@ +<?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="SelectProductInWebsitesActionGroup"> + <annotations> + <description>Sets the provided Website on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="website" type="string"/> + </arguments> + + <scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToWebsites"/> + <conditionalClick selector="{{ProductInWebsitesSection.sectionHeader}}" dependentSelector="{{AdminProductContentSection.sectionHeaderShow}}" visible="false" stepKey="expandSection"/> + <waitForPageLoad stepKey="waitForPageOpened"/> + <checkOption selector="{{ProductInWebsitesSection.website(website)}}" stepKey="selectWebsite"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetCategoryByNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetCategoryByNameActionGroup.xml new file mode 100644 index 0000000000000..feca7e59e7b23 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetCategoryByNameActionGroup.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="SetCategoryByNameActionGroup"> + <annotations> + <description>Sets the provided Category Name for a Product on the Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="categoryName" type="string"/> + </arguments> + + <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{categoryName}}]" stepKey="searchAndSelectCategory"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetProductUrlKeyActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetProductUrlKeyActionGroup.xml new file mode 100644 index 0000000000000..a75e8f6b764b1 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetProductUrlKeyActionGroup.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="SetProductUrlKeyActionGroup"> + <annotations> + <description>Fills the Product details (URL) for the SEO section.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> + <fillField userInput="{{product.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetProductUrlKeyByStringActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetProductUrlKeyByStringActionGroup.xml new file mode 100644 index 0000000000000..d4c654523a40b --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetProductUrlKeyByStringActionGroup.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="SetProductUrlKeyByStringActionGroup"> + <annotations> + <description>Fills the Product SEO URL Key.</description> + </annotations> + <arguments> + <argument name="urlKey" type="string"/> + </arguments> + + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> + <fillField userInput="{{urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SortProductsByIdAscendingActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SortProductsByIdAscendingActionGroup.xml new file mode 100644 index 0000000000000..38585277476f8 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SortProductsByIdAscendingActionGroup.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="SortProductsByIdAscendingActionGroup"> + <annotations> + <description>Filters the ID column in Ascending Order.</description> + </annotations> + + <conditionalClick selector="{{AdminProductGridTableHeaderSection.id('descend')}}" dependentSelector="{{AdminProductGridTableHeaderSection.id('ascend')}}" visible="false" stepKey="sortById"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SortProductsByIdDescendingActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SortProductsByIdDescendingActionGroup.xml new file mode 100644 index 0000000000000..635e36c458519 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SortProductsByIdDescendingActionGroup.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="SortProductsByIdDescendingActionGroup"> + <annotations> + <description>Filters the ID column in Descending Order.</description> + </annotations> + + <conditionalClick selector="{{AdminProductGridTableHeaderSection.id('ascend')}}" dependentSelector="{{AdminProductGridTableHeaderSection.id('descend')}}" visible="false" stepKey="sortById"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCompareActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCompareActionGroup.xml new file mode 100644 index 0000000000000..d4678a97c5bc2 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddCategoryProductToCompareActionGroup.xml @@ -0,0 +1,25 @@ +<?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"> + <!-- Add Product to Compare from the category page and check message --> + <actionGroup name="StorefrontAddCategoryProductToCompareActionGroup"> + <annotations> + <description>Add a Product to the Compare Product list from a Category page.</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(productVar.name)}}" stepKey="moveMouseOverProduct"/> + <click selector="{{StorefrontCategoryProductSection.ProductAddToCompareByName(productVar.name)}}" stepKey="clickAddProductToCompare"/> + <waitForElement selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForAddCategoryProductToCompareSuccessMessage"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="You added product {{productVar.name}} to the comparison list." stepKey="assertAddCategoryProductToCompareSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddProductToCompareActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddProductToCompareActionGroup.xml new file mode 100644 index 0000000000000..ee3a5067449dc --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddProductToCompareActionGroup.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="StorefrontAddProductToCompareActionGroup"> + <annotations> + <description>Add a Product to the Compare Product list. Validate that the Success Message is present.</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <click selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="clickAddToCompare"/> + <waitForElement selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForAddProductToCompareSuccessMessage"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="You added product {{productVar.name}} to the comparison list." stepKey="assertAddProductToCompareSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddSimpleProductWithQtyActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddSimpleProductWithQtyActionGroup.xml new file mode 100644 index 0000000000000..273893aa49445 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAddSimpleProductWithQtyActionGroup.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="StorefrontAddSimpleProductWithQtyActionGroup" extends="AddSimpleProductToCartActionGroup"> + <arguments> + <argument name="quantity" type="string" defaultValue="1"/> + </arguments> + <fillField userInput="{{quantity}}" selector="{{StorefrontProductPageSection.qtyInput}}" stepKey="fillProductQty" after="goToProductPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertActiveProductImageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertActiveProductImageActionGroup.xml new file mode 100644 index 0000000000000..0e7da54bd4028 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertActiveProductImageActionGroup.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="StorefrontAssertActiveProductImageActionGroup"> + <arguments> + <argument name="fileName" defaultValue="magento-logo" type="string"/> + </arguments> + <seeElement selector="{{StorefrontProductMediaSection.productImageActive(fileName)}}" stepKey="seeActiveImageDefault"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertFotoramaImageAvailabilityActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertFotoramaImageAvailabilityActionGroup.xml new file mode 100644 index 0000000000000..79ea22403646f --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertFotoramaImageAvailabilityActionGroup.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="StorefrontAssertFotoramaImageAvailabilityActionGroup"> + <arguments> + <argument name="fileName" type="string" defaultValue="magento-logo"/> + </arguments> + <seeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(fileName)}}" stepKey="seeActiveImageDefault"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductImagesOnProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductImagesOnProductPageActionGroup.xml index ad9fa9a576c7d..d15686ec3bddc 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductImagesOnProductPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductImagesOnProductPageActionGroup.xml @@ -24,12 +24,4 @@ <click selector="{{StorefrontProductMediaSection.closeFullscreenImage}}" stepKey="closeFullScreenImage"/> <waitForPageLoad stepKey="waitForGalleryDisappear"/> </actionGroup> - - <!--Check availability image in fotorama--> - <actionGroup name="StorefrontAssertFotoramaImageAvailablity"> - <arguments> - <argument name="fileName" type="string" defaultValue="magento-logo"/> - </arguments> - <seeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(fileName)}}" stepKey="seeActiveImageDefault"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInRecentlyComparedWidgetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInRecentlyComparedWidgetActionGroup.xml new file mode 100644 index 0000000000000..43db9d96a4f50 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInRecentlyComparedWidgetActionGroup.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="StorefrontAssertProductInRecentlyComparedWidgetActionGroup"> + <annotations> + <description>Validate that the provided Product appears in the Recently Compared Products widget.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontWidgetsSection.widgetRecentlyComparedProductsGrid}}" stepKey="waitWidgetRecentlyComparedProductsGrid"/> + <see selector="{{StorefrontWidgetsSection.widgetRecentlyComparedProductsGrid}}" userInput="{{product.name}}" stepKey="seeProductInRecentlyComparedWidget"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInRecentlyOrderedWidgetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInRecentlyOrderedWidgetActionGroup.xml new file mode 100644 index 0000000000000..de0cb05f7c5a1 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInRecentlyOrderedWidgetActionGroup.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="StorefrontAssertProductInRecentlyOrderedWidgetActionGroup"> + <annotations> + <description>Validate that the provided Product appears in the Recently Ordered Products widget.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <waitForElementVisible selector="{{StorefrontWidgetsSection.widgetRecentlyOrderedProductsGrid}}" stepKey="waitWidgetRecentlyOrderedProductsGrid"/> + <see selector="{{StorefrontWidgetsSection.widgetRecentlyOrderedProductsGrid}}" userInput="{{product.name}}" stepKey="seeProductInRecentlyOrderedWidget"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInWidgetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInWidgetActionGroup.xml index 3caa58e16654f..81bce368a0c06 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInWidgetActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductInWidgetActionGroup.xml @@ -20,30 +20,4 @@ <waitForElementVisible selector="{{StorefrontWidgetsSection.widgetRecentlyViewedProductsGrid}}" stepKey="waitWidgetRecentlyViewedProductsGrid"/> <see selector="{{StorefrontWidgetsSection.widgetRecentlyViewedProductsGrid}}" userInput="{{product.name}}" stepKey="seeProductInRecentlyViewedWidget"/> </actionGroup> - - <!-- Check the product in recently compared widget --> - <actionGroup name="StorefrontAssertProductInRecentlyComparedWidgetActionGroup"> - <annotations> - <description>Validate that the provided Product appears in the Recently Compared Products widget.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <waitForElementVisible selector="{{StorefrontWidgetsSection.widgetRecentlyComparedProductsGrid}}" stepKey="waitWidgetRecentlyComparedProductsGrid"/> - <see selector="{{StorefrontWidgetsSection.widgetRecentlyComparedProductsGrid}}" userInput="{{product.name}}" stepKey="seeProductInRecentlyComparedWidget"/> - </actionGroup> - - <!-- Check the product in recently ordered widget --> - <actionGroup name="StorefrontAssertProductInRecentlyOrderedWidgetActionGroup"> - <annotations> - <description>Validate that the provided Product appears in the Recently Ordered Products widget.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <waitForElementVisible selector="{{StorefrontWidgetsSection.widgetRecentlyOrderedProductsGrid}}" stepKey="waitWidgetRecentlyOrderedProductsGrid"/> - <see selector="{{StorefrontWidgetsSection.widgetRecentlyOrderedProductsGrid}}" userInput="{{product.name}}" stepKey="seeProductInRecentlyOrderedWidget"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductPriceOnCategoryPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductPriceOnCategoryPageActionGroup.xml new file mode 100644 index 0000000000000..bc341fa09bfab --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductPriceOnCategoryPageActionGroup.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="StorefrontAssertProductPriceOnCategoryPageActionGroup" extends="StorefrontAssertProductPriceOnProductPageActionGroup"> + <annotations> + <description>Validate that the provided Product Price is correct on category page.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + + <see userInput="{{productPrice}}" selector="{{StorefrontCategoryProductSection.ProductPriceByName(productName)}}" stepKey="seeProductPrice"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryActionGroup.xml deleted file mode 100644 index 9393669f6e46d..0000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryActionGroup.xml +++ /dev/null @@ -1,124 +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"> - <!-- Go to storefront category product page by given parameters --> - <actionGroup name="GoToStorefrontCategoryPageByParameters"> - <annotations> - <description>Goes to the Storefront Category page using URI Search Parameters.</description> - </annotations> - <arguments> - <argument name="category" type="string"/> - <argument name="mode" type="string"/> - <argument name="numOfProductsPerPage" type="string"/> - <argument name="sortBy" type="string" defaultValue="position"/> - <argument name="sort" type="string" defaultValue="asc"/> - </arguments> - - <!-- Go to storefront category page --> - <amOnPage url="{{StorefrontCategoryPage.url(category)}}?product_list_limit={{numOfProductsPerPage}}&product_list_mode={{mode}}&product_list_order={{sortBy}}&product_list_dir={{sort}}" stepKey="onCategoryPage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <actionGroup name="VerifyCategoryPageParameters"> - <annotations> - <description>Validate that the Category Page parameters are present and correct.</description> - </annotations> - <arguments> - <argument name="category"/> - <argument name="mode" type="string"/> - <argument name="numOfProductsPerPage" type="string"/> - <argument name="sortBy" type="string" defaultValue="position"/> - </arguments> - - <seeInCurrentUrl url="/{{category.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> - <seeInTitle userInput="{{category.name}}" stepKey="assertCategoryNameInTitle"/> - <see userInput="{{category.name}}" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryName"/> - <see userInput="{{mode}}" selector="{{StorefrontCategoryMainSection.modeGridIsActive}}" stepKey="assertViewMode"/> - <see userInput="{{numOfProductsPerPage}}" selector="{{StorefrontCategoryMainSection.perPage}}" stepKey="assertNumberOfProductsPerPage"/> - <see userInput="{{sortBy}}" selector="{{StorefrontCategoryMainSection.sortedBy}}" stepKey="assertSortedBy"/> - </actionGroup> - - <!-- Check the category page --> - <actionGroup name="StorefrontCheckCategoryActionGroup"> - <annotations> - <description>Validate that the Storefront Category is present and correct.</description> - </annotations> - <arguments> - <argument name="category"/> - <argument name="productCount" type="string"/> - </arguments> - - <seeInCurrentUrl url="/{{category.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> - <seeInTitle userInput="{{category.name}}" stepKey="assertCategoryNameInTitle"/> - <see userInput="{{category.name}}" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryName"/> - <see userInput="{{productCount}}" selector="{{StorefrontCategoryMainSection.productCount}} span" stepKey="assertProductCount"/> - </actionGroup> - - <!-- Check simple product on the category page --> - <actionGroup name="StorefrontCheckCategorySimpleProduct"> - <annotations> - <description>Validate that the provided Simple Product is present and correct on a Category page.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName(product.name)}}" stepKey="assertProductName"/> - <see userInput="${{product.price}}.00" selector="{{StorefrontCategoryProductSection.ProductPriceByName(product.name)}}" stepKey="AssertProductPrice"/> - <!-- @TODO: MAGETWO-80272 Move to Magento_Checkout --> - <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> - <!-- @TODO: MAGETWO-80272 Move to Magento_Checkout --> - <seeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="AssertAddToCart"/> - </actionGroup> - - <actionGroup name="AssertProductOnCategoryPageActionGroup" extends="StorefrontCheckCategorySimpleProduct"> - <annotations> - <description>EXTENDS:StorefrontCheckCategorySimpleProduct. Removes 'AssertProductPrice', 'moveMouseOverProduct', 'AssertAddToCart'</description> - </annotations> - <remove keyForRemoval="AssertProductPrice"/> - <remove keyForRemoval="moveMouseOverProduct"/> - <remove keyForRemoval="AssertAddToCart"/> - </actionGroup> - - <actionGroup name="StorefrontCheckAddToCartButtonAbsence"> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct" /> - <dontSeeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="checkAddToCartButtonAbsence"/> - </actionGroup> - <actionGroup name="StorefrontSwitchCategoryViewToListMode"> - <annotations> - <description>Switch the Storefront Category view to List.</description> - </annotations> - - <click selector="{{StorefrontCategoryMainSection.modeListButton}}" stepKey="switchCategoryViewToListMode"/> - <waitForElement selector="{{StorefrontCategoryMainSection.CategoryTitle}}" time="30" stepKey="waitForCategoryReload"/> - </actionGroup> - - <actionGroup name="GoToSubCategoryPage"> - <annotations> - <description>Goes to the Storefront page. Open the Parent Category menu in the Top Nav Menu. Click on a Subcategory. Validate that the Subcategory is present and correct.</description> - </annotations> - <arguments> - <argument name="parentCategory"/> - <argument name="subCategory"/> - <argument name="urlPath" type="string"/> - </arguments> - - <moveMouseOver selector="{{StorefrontHeaderSection.NavigationCategoryByName(parentCategory.name)}}" stepKey="moveMouseOnMainCategory"/> - <waitForElementVisible selector="{{StorefrontHeaderSection.NavigationCategoryByName(subCategory.name)}}" stepKey="waitForSubCategoryVisible"/> - <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(subCategory.name)}}" stepKey="goToCategory"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <seeInCurrentUrl url="{{urlPath}}.html" stepKey="checkUrl"/> - <seeInTitle userInput="{{subCategory.name}}" stepKey="assertCategoryNameInTitle"/> - <see userInput="{{subCategory.name}}" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryName"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortAscendingActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortAscendingActionGroup.xml new file mode 100644 index 0000000000000..f456ca6bece55 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortAscendingActionGroup.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="StorefrontCategoryPageSortAscendingActionGroup"> + <annotations> + <description>Set Ascending Direction for sorting Products on Category page</description> + </annotations> + <click selector="{{StorefrontCategoryTopToolbarSection.sortDirectionAsc}}" stepKey="setAscendingDirection"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortDescendingActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortDescendingActionGroup.xml new file mode 100644 index 0000000000000..839260b3339c8 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortDescendingActionGroup.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="StorefrontCategoryPageSortDescendingActionGroup"> + <annotations> + <description>Set Descending Direction for sorting Products on Category page</description> + </annotations> + <click selector="{{StorefrontCategoryTopToolbarSection.sortDirectionDesc}}" stepKey="setDescendingDirection"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortProductActionGroup.xml index 64dd2c97a382f..5744ddaf6c69a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortProductActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCategoryPageSortProductActionGroup.xml @@ -17,16 +17,4 @@ </arguments> <selectOption selector="{{StorefrontCategoryTopToolbarSection.sortByDropdown}}" userInput="{{sortBy}}" stepKey="selectSortByParameter"/> </actionGroup> - <actionGroup name="StorefrontCategoryPageSortAscendingActionGroup"> - <annotations> - <description>Set Ascending Direction for sorting Products on Category page</description> - </annotations> - <click selector="{{StorefrontCategoryTopToolbarSection.sortDirectionAsc}}" stepKey="setAscendingDirection"/> - </actionGroup> - <actionGroup name="StorefrontCategoryPageSortDescendingActionGroup"> - <annotations> - <description>Set Descending Direction for sorting Products on Category page</description> - </annotations> - <click selector="{{StorefrontCategoryTopToolbarSection.sortDirectionDesc}}" stepKey="setDescendingDirection"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckAddToCartButtonAbsenceActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckAddToCartButtonAbsenceActionGroup.xml new file mode 100644 index 0000000000000..66eb61b4aa8ec --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckAddToCartButtonAbsenceActionGroup.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="StorefrontCheckAddToCartButtonAbsenceActionGroup"> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct" /> + <dontSeeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="checkAddToCartButtonAbsence"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCategoryActionGroup.xml new file mode 100644 index 0000000000000..695ba39f5d397 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCategoryActionGroup.xml @@ -0,0 +1,25 @@ +<?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="StorefrontCheckCategoryActionGroup"> + <annotations> + <description>Validate that the Storefront Category is present and correct.</description> + </annotations> + <arguments> + <argument name="category"/> + <argument name="productCount" type="string"/> + </arguments> + + <seeInCurrentUrl url="/{{category.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> + <seeInTitle userInput="{{category.name}}" stepKey="assertCategoryNameInTitle"/> + <see userInput="{{category.name}}" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryName"/> + <see userInput="{{productCount}}" selector="{{StorefrontCategoryMainSection.productCount}} span" stepKey="assertProductCount"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCategorySimpleProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCategorySimpleProductActionGroup.xml new file mode 100644 index 0000000000000..1f8234498ffa7 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCategorySimpleProductActionGroup.xml @@ -0,0 +1,26 @@ +<?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="StorefrontCheckCategorySimpleProductActionGroup"> + <annotations> + <description>Validate that the provided Simple Product is present and correct on a Category page.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName(product.name)}}" stepKey="assertProductName"/> + <see userInput="${{product.price}}.00" selector="{{StorefrontCategoryProductSection.ProductPriceByName(product.name)}}" stepKey="AssertProductPrice"/> + <!-- @TODO: MAGETWO-80272 Move to Magento_Checkout --> + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> + <!-- @TODO: MAGETWO-80272 Move to Magento_Checkout --> + <seeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="AssertAddToCart"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCompareSidebarProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCompareSidebarProductActionGroup.xml new file mode 100644 index 0000000000000..220fe29337d5a --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCompareSidebarProductActionGroup.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="StorefrontCheckCompareSidebarProductActionGroup"> + <annotations> + <description>Validate that the Product Name is present and correct in the Compare Product list.</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <waitForElement selector="{{StorefrontComparisonSidebarSection.ProductTitleByName(productVar.name)}}" stepKey="waitForProduct"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCompareSimpleProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCompareSimpleProductActionGroup.xml new file mode 100644 index 0000000000000..d7515d19ffbbd --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckCompareSimpleProductActionGroup.xml @@ -0,0 +1,25 @@ +<?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="StorefrontCheckCompareSimpleProductActionGroup"> + <annotations> + <description>Validate that the Simple Product is present and correct in the Compare Product area.</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName(productVar.name)}}" stepKey="assertProductName"/> + <see userInput="${{productVar.price}}.00" selector="{{StorefrontProductCompareMainSection.ProductPriceByName(productVar.name)}}" stepKey="assertProductPrice1"/> + <see userInput="{{productVar.sku}}" selector="{{StorefrontProductCompareMainSection.ProductAttributeByCodeAndProductName('SKU', productVar.name)}}" stepKey="assertProductPrice2"/> + <!-- @TODO: MAGETWO-80272 Move to Magento_Checkout --> + <seeElement selector="{{StorefrontProductCompareMainSection.ProductAddToCartByName(productVar.name)}}" stepKey="assertProductAddToCart"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductIsMissingInCategoryProductsPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductIsMissingInCategoryProductsPageActionGroup.xml index 01751a32d2e06..a386d81f31999 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductIsMissingInCategoryProductsPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductIsMissingInCategoryProductsPageActionGroup.xml @@ -15,11 +15,4 @@ </arguments> <dontSee selector="{{StorefrontCategoryProductSection.ProductTitleByName(productName)}}" stepKey="dontSeeCorrectProductsOnStorefront"/> </actionGroup> - <actionGroup name="StorefrontCheckProductPositionActionGroup"> - <arguments> - <argument name="position" type="string"/> - <argument name="productName" type="string"/> - </arguments> - <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber(position)}}" userInput="{{productName}}" stepKey="assertProductPosition"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductPositionActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductPositionActionGroup.xml new file mode 100644 index 0000000000000..ce92966eb1fbf --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductPositionActionGroup.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="StorefrontCheckProductPositionActionGroup"> + <arguments> + <argument name="position" type="string"/> + <argument name="productName" type="string"/> + </arguments> + <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber(position)}}" userInput="{{productName}}" stepKey="assertProductPosition"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductPriceInCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductPriceInCategoryActionGroup.xml index ac33727564505..fd843a68b9720 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductPriceInCategoryActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckProductPriceInCategoryActionGroup.xml @@ -9,7 +9,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <!-- You must already be on the category page --> - <actionGroup name="StorefrontCheckProductPriceInCategoryActionGroup" extends="StorefrontCheckCategorySimpleProduct"> + <actionGroup name="StorefrontCheckProductPriceInCategoryActionGroup" extends="StorefrontCheckCategorySimpleProductActionGroup"> <annotations> <description>EXTENDS: StorefrontCheckCategorySimpleProduct. Removes 'AssertProductPrice'. Validates that the provided Product Price is present and correct on a Storefront Product page.</description> </annotations> @@ -17,14 +17,4 @@ <remove keyForRemoval="AssertProductPrice"/> <see userInput="{{product.price}}" selector="{{StorefrontCategoryProductSection.ProductPriceByName(product.name)}}" stepKey="AssertProductPrice"/> </actionGroup> - <actionGroup name="StorefrontAssertProductPriceOnCategoryPageActionGroup" extends="StorefrontAssertProductPriceOnProductPageActionGroup"> - <annotations> - <description>Validate that the provided Product Price is correct on category page.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - </arguments> - - <see userInput="{{productPrice}}" selector="{{StorefrontCategoryProductSection.ProductPriceByName(productName)}}" stepKey="seeProductPrice"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckSimpleProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckSimpleProductActionGroup.xml new file mode 100644 index 0000000000000..a2ebf93805819 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCheckSimpleProductActionGroup.xml @@ -0,0 +1,30 @@ +<?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"> + <!-- Check the simple product on the product page --> + <actionGroup name="StorefrontCheckSimpleProductActionGroup"> + <annotations> + <description>Validates that the provided Simple Product information is present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> + <seeInTitle userInput="{{product.name}}" stepKey="AssertProductNameInTitle"/> + <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> + <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> + <see userInput="${{product.price}}.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/> + <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertInStock"/> + <seeElement selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="assertAddToCart"/> + <see userInput="{{product.custom_attributes[description]}}" selector="{{StorefrontProductInfoMainSection.productDescription}}" stepKey="assertProductDescription"/> + <see userInput="{{product.custom_attributes[short_description]}}" selector="{{StorefrontProductInfoMainSection.productShortDescription}}" stepKey="assertProductShortDescription"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontClearCompareActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontClearCompareActionGroup.xml new file mode 100644 index 0000000000000..995bf7efd3f39 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontClearCompareActionGroup.xml @@ -0,0 +1,24 @@ +<?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="StorefrontClearCompareActionGroup"> + <annotations> + <description>Clear the Compare Products list. Validate that the Compare Products list is empty.</description> + </annotations> + + <waitForElementVisible selector="{{StorefrontComparisonSidebarSection.ClearAll}}" time="30" stepKey="waitForClearAll"/> + <click selector="{{StorefrontComparisonSidebarSection.ClearAll}}" stepKey="clickClearAll"/> + <waitForElementVisible selector="{{ModalConfirmationSection.OkButton}}" time="30" stepKey="waitForClearOk"/> + <scrollTo selector="{{ModalConfirmationSection.OkButton}}" stepKey="scrollToClearOk"/> + <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="clickClearOk"/> + <waitForElement selector="{{StorefrontMessagesSection.message('You cleared the comparison list.')}}" time="30" stepKey="AssertMessageCleared"/> + <waitForElement selector="{{StorefrontComparisonSidebarSection.NoItemsMessage}}" time="30" stepKey="assertNoItems"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCompareActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCompareActionGroup.xml deleted file mode 100644 index b10b74c919918..0000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontCompareActionGroup.xml +++ /dev/null @@ -1,95 +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"> - <!-- Add Product to Compare from the category page and check message --> - <actionGroup name="StorefrontAddCategoryProductToCompareActionGroup"> - <annotations> - <description>Add a Product to the Compare Product list from a Category page.</description> - </annotations> - <arguments> - <argument name="productVar"/> - </arguments> - - <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(productVar.name)}}" stepKey="moveMouseOverProduct"/> - <click selector="{{StorefrontCategoryProductSection.ProductAddToCompareByName(productVar.name)}}" stepKey="clickAddProductToCompare"/> - <waitForElement selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForAddCategoryProductToCompareSuccessMessage"/> - <see selector="{{StorefrontMessagesSection.success}}" userInput="You added product {{productVar.name}} to the comparison list." stepKey="assertAddCategoryProductToCompareSuccessMessage"/> - </actionGroup> - - <!-- Add Product to Compare from the product page and check message --> - <actionGroup name="StorefrontAddProductToCompareActionGroup"> - <annotations> - <description>Add a Product to the Compare Product list. Validate that the Success Message is present.</description> - </annotations> - <arguments> - <argument name="productVar"/> - </arguments> - - <click selector="{{StorefrontProductInfoMainSection.productAddToCompare}}" stepKey="clickAddToCompare"/> - <waitForElement selector="{{StorefrontMessagesSection.success}}" time="30" stepKey="waitForAddProductToCompareSuccessMessage"/> - <see selector="{{StorefrontMessagesSection.success}}" userInput="You added product {{productVar.name}} to the comparison list." stepKey="assertAddProductToCompareSuccessMessage"/> - </actionGroup> - - <!-- Check the product in compare sidebar --> - <actionGroup name="StorefrontCheckCompareSidebarProductActionGroup"> - <annotations> - <description>Validate that the Product Name is present and correct in the Compare Product list.</description> - </annotations> - <arguments> - <argument name="productVar"/> - </arguments> - - <waitForElement selector="{{StorefrontComparisonSidebarSection.ProductTitleByName(productVar.name)}}" stepKey="waitForProduct"/> - </actionGroup> - - <!-- Open and check comparison page --> - <actionGroup name="StorefrontOpenAndCheckComparisionActionGroup"> - <annotations> - <description>Open the Storefront Compare Product page. Validate that the Compare Product fields are present.</description> - </annotations> - - <click selector="{{StorefrontComparisonSidebarSection.Compare}}" stepKey="clickCompare"/> - <waitForLoadingMaskToDisappear stepKey="waitForComparePageloaded"/> - <seeInCurrentUrl url="{{StorefrontProductComparePage.url}}" stepKey="checkUrl"/> - <seeInTitle userInput="Products Comparison List" stepKey="assertPageNameInTitle"/> - <see userInput="Compare Products" selector="{{StorefrontProductCompareMainSection.PageName}}" stepKey="assertPageName"/> - </actionGroup> - - <!-- Check the simple product in comparison page --> - <actionGroup name="StorefrontCheckCompareSimpleProductActionGroup"> - <annotations> - <description>Validate that the Simple Product is present and correct in the Compare Product area.</description> - </annotations> - <arguments> - <argument name="productVar"/> - </arguments> - - <seeElement selector="{{StorefrontProductCompareMainSection.ProductLinkByName(productVar.name)}}" stepKey="assertProductName"/> - <see userInput="${{productVar.price}}.00" selector="{{StorefrontProductCompareMainSection.ProductPriceByName(productVar.name)}}" stepKey="assertProductPrice1"/> - <see userInput="{{productVar.sku}}" selector="{{StorefrontProductCompareMainSection.ProductAttributeByCodeAndProductName('SKU', productVar.name)}}" stepKey="assertProductPrice2"/> - <!-- @TODO: MAGETWO-80272 Move to Magento_Checkout --> - <seeElement selector="{{StorefrontProductCompareMainSection.ProductAddToCartByName(productVar.name)}}" stepKey="assertProductAddToCart"/> - </actionGroup> - - <!-- Clear the compare list --> - <actionGroup name="StorefrontClearCompareActionGroup"> - <annotations> - <description>Clear the Compare Products list. Validate that the Compare Products list is empty.</description> - </annotations> - - <waitForElementVisible selector="{{StorefrontComparisonSidebarSection.ClearAll}}" time="30" stepKey="waitForClearAll"/> - <click selector="{{StorefrontComparisonSidebarSection.ClearAll}}" stepKey="clickClearAll"/> - <waitForElementVisible selector="{{ModalConfirmationSection.OkButton}}" time="30" stepKey="waitForClearOk"/> - <scrollTo selector="{{ModalConfirmationSection.OkButton}}" stepKey="scrollToClearOk"/> - <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="clickClearOk"/> - <waitForElement selector="{{StorefrontMessagesSection.message('You cleared the comparison list.')}}" time="30" stepKey="AssertMessageCleared"/> - <waitForElement selector="{{StorefrontComparisonSidebarSection.NoItemsMessage}}" time="30" stepKey="assertNoItems"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontGoToCategoryPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontGoToCategoryPageActionGroup.xml index e8be0db38fe2c..080f3264c037b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontGoToCategoryPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontGoToCategoryPageActionGroup.xml @@ -17,11 +17,4 @@ <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(categoryName)}}" stepKey="toCategory"/> <waitForPageLoad stepKey="waitForCategoryPage"/> </actionGroup> - <actionGroup name="StorefrontGoToSubCategoryPageActionGroup" extends="StorefrontGoToCategoryPageActionGroup"> - <arguments> - <argument name="subCategoryName" type="string"/> - </arguments> - <moveMouseOver selector="{{StorefrontHeaderSection.NavigationCategoryByName(categoryName)}}" stepKey="toCategory"/> - <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(subCategoryName)}}" stepKey="openSubCategory" after="toCategory"/> - </actionGroup> -</actionGroups> \ No newline at end of file +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontGoToSubCategoryPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontGoToSubCategoryPageActionGroup.xml new file mode 100644 index 0000000000000..71c51a9b9f567 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontGoToSubCategoryPageActionGroup.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="StorefrontGoToSubCategoryPageActionGroup" extends="StorefrontGoToCategoryPageActionGroup"> + <arguments> + <argument name="subCategoryName" type="string"/> + </arguments> + <moveMouseOver selector="{{StorefrontHeaderSection.NavigationCategoryByName(categoryName)}}" stepKey="toCategory"/> + <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(subCategoryName)}}" stepKey="openSubCategory" after="toCategory"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenAndCheckComparisionActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenAndCheckComparisionActionGroup.xml new file mode 100644 index 0000000000000..1bb58d15bc096 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenAndCheckComparisionActionGroup.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="StorefrontOpenAndCheckComparisionActionGroup"> + <annotations> + <description>Open the Storefront Compare Product page. Validate that the Compare Product fields are present.</description> + </annotations> + + <click selector="{{StorefrontComparisonSidebarSection.Compare}}" stepKey="clickCompare"/> + <waitForLoadingMaskToDisappear stepKey="waitForComparePageloaded"/> + <seeInCurrentUrl url="{{StorefrontProductComparePage.url}}" stepKey="checkUrl"/> + <seeInTitle userInput="Products Comparison List" stepKey="assertPageNameInTitle"/> + <see userInput="Compare Products" selector="{{StorefrontProductCompareMainSection.PageName}}" stepKey="assertPageName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenProductPageActionGroup.xml index e0229906ad558..899603aa27d75 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenProductPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenProductPageActionGroup.xml @@ -18,15 +18,4 @@ <amOnPage url="{{StorefrontProductPage.url(productUrl)}}" stepKey="openProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoaded"/> </actionGroup> - <actionGroup name="StorefrontOpenProductPageOnSecondStore"> - <annotations> - <description>Goes to the Storefront Product page for the provided store code and Product URL.</description> - </annotations> - <arguments> - <argument name="storeCode" type="string"/> - <argument name="productUrl" type="string"/> - </arguments> - - <amOnPage url="{{StorefrontStoreViewProductPage.url(storeCode,productUrl)}}" stepKey="openProductPage"/> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenProductPageOnSecondStoreActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenProductPageOnSecondStoreActionGroup.xml new file mode 100644 index 0000000000000..00956e2099085 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenProductPageOnSecondStoreActionGroup.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="StorefrontOpenProductPageOnSecondStoreActionGroup"> + <annotations> + <description>Goes to the Storefront Product page for the provided store code and Product URL.</description> + </annotations> + <arguments> + <argument name="storeCode" type="string"/> + <argument name="productUrl" type="string"/> + </arguments> + + <amOnPage url="{{StorefrontStoreViewProductPage.url(storeCode,productUrl)}}" stepKey="openProductPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml deleted file mode 100644 index 403b5b853d80c..0000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml +++ /dev/null @@ -1,90 +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"> - <!-- Check the simple product on the product page --> - <actionGroup name="StorefrontCheckSimpleProduct"> - <annotations> - <description>Validates that the provided Simple Product information is present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> - <seeInTitle userInput="{{product.name}}" stepKey="AssertProductNameInTitle"/> - <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> - <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> - <see userInput="${{product.price}}.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/> - <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertInStock"/> - <seeElement selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="assertAddToCart"/> - <see userInput="{{product.custom_attributes[description]}}" selector="{{StorefrontProductInfoMainSection.productDescription}}" stepKey="assertProductDescription"/> - <see userInput="{{product.custom_attributes[short_description]}}" selector="{{StorefrontProductInfoMainSection.productShortDescription}}" stepKey="assertProductShortDescription"/> - </actionGroup> - - <!-- Assert product image in Storefront Product page --> - <actionGroup name="assertProductImageStorefrontProductPage"> - <annotations> - <description>Validates that the provided Product Image is present.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="image" defaultValue="MagentoLogo"/> - </arguments> - - <seeInCurrentUrl url="/{{product.urlKey}}.html" stepKey="checkUrl"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <seeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeImage"/> - </actionGroup> - - <!-- Assert product image in Storefront Product page --> - <actionGroup name="assertProductImageStorefrontProductPage2"> - <annotations> - <description>Validates that the provided Product Image is present.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="image" defaultValue="MagentoLogo"/> - </arguments> - - <seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <seeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeImage"/> - </actionGroup> - - <!-- Assert no product image in Storefront Product page --> - <actionGroup name="assertProductImageNotInStorefrontProductPage"> - <annotations> - <description>Validates that the provided Product Image is not present.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="image" defaultValue="MagentoLogo"/> - </arguments> - - <seeInCurrentUrl url="/{{product.urlKey}}.html" stepKey="checkUrl"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <dontSeeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeImage"/> - </actionGroup> - - <!-- Assert no product image in Storefront Product page --> - <actionGroup name="assertProductImageNotInStorefrontProductPage2"> - <annotations> - <description>Validates that the provided Product Image is not present.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="image" defaultValue="MagentoLogo"/> - </arguments> - - <seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <dontSeeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeImage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageActionGroup.xml deleted file mode 100644 index c960f14b1cd48..0000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageActionGroup.xml +++ /dev/null @@ -1,87 +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"> - <!--Click Add to Cart button in storefront product page--> - <actionGroup name="addToCartFromStorefrontProductPage"> - <annotations> - <description>Click on the Add to Cart button. Validates that the Success Message is present.</description> - </annotations> - <arguments> - <argument name="productName"/> - </arguments> - - <click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addToCart"/> - <waitForPageLoad stepKey="waitForAddToCart"/> - <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdding}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdding"/> - <waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdded}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdded"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> - <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{productName}} to your shopping cart." stepKey="seeAddToCartSuccessMessage"/> - </actionGroup> - - <actionGroup name="AddProductWithQtyToCartFromStorefrontProductPage" extends="addToCartFromStorefrontProductPage"> - <annotations> - <description>EXTENDS: addToCartFromStorefrontProductPage. Fills in the provided Product Quantity for the provided Product Name.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - <argument name="productQty" type="string"/> - </arguments> - - <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="{{productQty}}" stepKey="fillProductQuantity" before="addToCart"/> - </actionGroup> - - <!--Verify text length validation hint with multiple inputs--> - <actionGroup name="testDynamicValidationHint"> - <annotations> - <description>Validates that the Product Text Option Text Length Hint displays the correct Count for multiple inputs based on the provided Character Limit.</description> - </annotations> - <arguments> - <argument name="charLimit"/> - </arguments> - - <fillField userInput="abcde" selector="{{StorefrontProductPageSection.customTextOptionInput}}" stepKey="textInput1"/> - <see selector="{{StorefrontProductPageSection.charCounter}}" userInput="(15 remaining)" stepKey="assertHint1"/> - <fillField userInput="abcdefghjklansdmnbv" selector="{{StorefrontProductPageSection.customTextOptionInput}}" stepKey="textInput2"/> - <see selector="{{StorefrontProductPageSection.charCounter}}" userInput="(1 remaining)" stepKey="assertHint2"/> - <fillField userInput="abcdefghjklansdmnbvd" selector="{{StorefrontProductPageSection.customTextOptionInput}}" stepKey="textInput3"/> - <see selector="{{StorefrontProductPageSection.charCounter}}" userInput="(0 remaining)" stepKey="assertHint3"/> - <fillField userInput="abcdefghjklansdmnbvds" selector="{{StorefrontProductPageSection.customTextOptionInput}}" stepKey="textInput4"/> - <see selector="{{StorefrontProductPageSection.charCounter}}" userInput="(1 too many)" stepKey="assertHint4"/> - <fillField userInput="abcdefghjklansdmnbvdsasdfghjmn" selector="{{StorefrontProductPageSection.customTextOptionInput}}" stepKey="textInput5"/> - <see selector="{{StorefrontProductPageSection.charCounter}}" userInput="(10 too many)" stepKey="assertHint5"/> - </actionGroup> - - <actionGroup name="checkAttributeInMoreInformationTab"> - <annotations> - <description>Validates that the Product More Information area contains the provided Text.</description> - </annotations> - <arguments> - <argument name="attributeLabel" type="string"/> - <argument name="attributeValue" type="string"/> - </arguments> - - <click selector="{{StorefrontProductMoreInformationSection.moreInformation}}" stepKey="clickTab"/> - <see userInput="{{attributeLabel}}" selector="{{StorefrontProductMoreInformationSection.moreInformationTextArea}}" stepKey="seeAttributeLabel"/> - <see userInput="{{attributeValue}}" selector="{{StorefrontProductMoreInformationSection.moreInformationTextArea}}" stepKey="seeAttributeValue"/> - </actionGroup> - - <actionGroup name="checkAttributeNotInMoreInformationTab"> - <annotations> - <description>Validate that the More Information area does not contain the provided Text.</description> - </annotations> - <arguments> - <argument name="attributeLabel" type="string"/> - </arguments> - - <click selector="{{StorefrontProductMoreInformationSection.moreInformation}}" stepKey="clickTab"/> - <dontSee userInput="{{attributeLabel}}" selector="{{StorefrontProductMoreInformationSection.moreInformationTextArea}}" stepKey="seeAttributeLabel"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontSwitchCategoryViewToListModeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontSwitchCategoryViewToListModeActionGroup.xml new file mode 100644 index 0000000000000..7e549294ecfe0 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontSwitchCategoryViewToListModeActionGroup.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="StorefrontSwitchCategoryViewToListModeActionGroup"> + <annotations> + <description>Switch the Storefront Category view to List.</description> + </annotations> + + <click selector="{{StorefrontCategoryMainSection.modeListButton}}" stepKey="switchCategoryViewToListMode"/> + <waitForElement selector="{{StorefrontCategoryMainSection.CategoryTitle}}" time="30" stepKey="waitForCategoryReload"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchCategoryStoreViewActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchCategoryStoreViewActionGroup.xml new file mode 100644 index 0000000000000..e75a63581fb3c --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchCategoryStoreViewActionGroup.xml @@ -0,0 +1,33 @@ +<?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="SwitchCategoryStoreViewActionGroup"> + <annotations> + <description>Navigates to category page, selects a category and changes store view to specified store.</description> + </annotations> + <arguments> + <argument name="Store"/> + <argument name="CatName"/> + </arguments> + + <amOnPage url="{{AdminCategoryPage.page}}" stepKey="amOnCategoryPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(CatName)}}" stepKey="navigateToCreatedCategory"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <waitForLoadingMaskToDisappear stepKey="waitForSpinner"/> + <scrollToTopOfPage stepKey="scrollToToggle"/> + <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}" stepKey="openStoreViewDropDown"/> + <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewOption(Store)}}" stepKey="selectStoreView"/> + <waitForPageLoad stepKey="waitForPageLoad3"/> + <waitForLoadingMaskToDisappear stepKey="waitForSpinner2"/> + <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}" stepKey="selectStoreViewAccept"/> + <waitForPageLoad stepKey="waitForStoreViewChangeLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchCategoryToAllStoreViewActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchCategoryToAllStoreViewActionGroup.xml new file mode 100644 index 0000000000000..28ca577bb98f5 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchCategoryToAllStoreViewActionGroup.xml @@ -0,0 +1,31 @@ +<?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="SwitchCategoryToAllStoreViewActionGroup"> + <annotations> + <description>Navigates to category page, selects a category and changes store view to all stores.</description> + </annotations> + <arguments> + <argument name="CatName"/> + </arguments> + + <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(CatName)}}" stepKey="navigateToCreatedCategory"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <waitForLoadingMaskToDisappear stepKey="waitForSpinner1"/> + <scrollToTopOfPage stepKey="scrollToToggle"/> + <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewDropdownToggle}}" stepKey="openStoreViewDropDown"/> + <click selector="{{AdminCategoryMainActionsSection.allStoreViews}}" stepKey="clickStoreViewByName"/> + <see selector="{{AdminCategoryMainActionsSection.storeSwitcher}}" userInput="All Store Views" stepKey="seeAllStoreView"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <waitForLoadingMaskToDisappear stepKey="waitForSpinner2"/> + <click selector="{{AdminCategoryMainActionsSection.CategoryStoreViewModalAccept}}" stepKey="selectStoreViewAccept"/> + <waitForPageLoad stepKey="waitForStoreViewChangeLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchToTheNewStoreViewActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchToTheNewStoreViewActionGroup.xml new file mode 100644 index 0000000000000..9dd1a2dc56d1e --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/SwitchToTheNewStoreViewActionGroup.xml @@ -0,0 +1,26 @@ +<?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="SwitchToTheNewStoreViewActionGroup"> + <annotations> + <description>Switches the New Store View.</description> + </annotations> + <arguments> + <argument name="storeViewName" type="string"/> + </arguments> + + <scrollTo selector="{{AdminProductContentSection.pageHeader}}" stepKey="scrollToUp"/> + <waitForElementVisible selector="{{AdminProductFormActionSection.changeStoreButton}}" stepKey="waitForElementBecomeVisible"/> + <click selector="{{AdminProductFormActionSection.changeStoreButton}}" stepKey="clickStoreviewSwitcher"/> + <click selector="{{AdminProductFormActionSection.selectStoreView(storeViewName)}}" stepKey="chooseStoreView"/> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="acceptStoreSwitchingMessage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/TestDynamicValidationHintActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/TestDynamicValidationHintActionGroup.xml new file mode 100644 index 0000000000000..9e3f46e0400b2 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/TestDynamicValidationHintActionGroup.xml @@ -0,0 +1,30 @@ +<?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="TestDynamicValidationHintActionGroup"> + <annotations> + <description>Validates that the Product Text Option Text Length Hint displays the correct Count for multiple inputs based on the provided Character Limit.</description> + </annotations> + <arguments> + <argument name="charLimit"/> + </arguments> + + <fillField userInput="abcde" selector="{{StorefrontProductPageSection.customTextOptionInput}}" stepKey="textInput1"/> + <see selector="{{StorefrontProductPageSection.charCounter}}" userInput="(15 remaining)" stepKey="assertHint1"/> + <fillField userInput="abcdefghjklansdmnbv" selector="{{StorefrontProductPageSection.customTextOptionInput}}" stepKey="textInput2"/> + <see selector="{{StorefrontProductPageSection.charCounter}}" userInput="(1 remaining)" stepKey="assertHint2"/> + <fillField userInput="abcdefghjklansdmnbvd" selector="{{StorefrontProductPageSection.customTextOptionInput}}" stepKey="textInput3"/> + <see selector="{{StorefrontProductPageSection.charCounter}}" userInput="(0 remaining)" stepKey="assertHint3"/> + <fillField userInput="abcdefghjklansdmnbvds" selector="{{StorefrontProductPageSection.customTextOptionInput}}" stepKey="textInput4"/> + <see selector="{{StorefrontProductPageSection.charCounter}}" userInput="(1 too many)" stepKey="assertHint4"/> + <fillField userInput="abcdefghjklansdmnbvdsasdfghjmn" selector="{{StorefrontProductPageSection.customTextOptionInput}}" stepKey="textInput5"/> + <see selector="{{StorefrontProductPageSection.charCounter}}" userInput="(10 too many)" stepKey="assertHint5"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ToggleProductEnabledActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ToggleProductEnabledActionGroup.xml new file mode 100644 index 0000000000000..220d254f70c97 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ToggleProductEnabledActionGroup.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="ToggleProductEnabledActionGroup"> + <annotations> + <description>Clicks on the Enable Product toggle.</description> + </annotations> + + <click selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="toggleEnabled"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/UnassignAttributeFromGroupActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/UnassignAttributeFromGroupActionGroup.xml new file mode 100644 index 0000000000000..d58fa1e71061d --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/UnassignAttributeFromGroupActionGroup.xml @@ -0,0 +1,26 @@ +<?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="UnassignAttributeFromGroupActionGroup"> + <annotations> + <description>Unassign the provided Attribute from an Attribute Set from the Attribute Sets creation/edit page.</description> + </annotations> + <arguments> + <argument name="group" type="string"/> + <argument name="attribute" type="string"/> + </arguments> + + <conditionalClick selector="{{AdminProductAttributeSetEditSection.attributeGroupExtender(group)}}" dependentSelector="{{AdminProductAttributeSetEditSection.attributeGroupCollapsed(group)}}" visible="true" stepKey="extendGroup"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <dragAndDrop selector1="{{AdminProductAttributeSetEditSection.assignedAttribute(attribute)}}" selector2="{{AdminProductAttributeSetEditSection.xThLineItemUnassignedAttribute('1')}}" stepKey="dragAndDropToUnassigned"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <see userInput="{{attribute}}" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassigned"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/UnassignWebsiteFromProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/UnassignWebsiteFromProductActionGroup.xml new file mode 100644 index 0000000000000..cee17cbc4b45e --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/UnassignWebsiteFromProductActionGroup.xml @@ -0,0 +1,15 @@ +<?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="UnassignWebsiteFromProductActionGroup" extends="SelectProductInWebsitesActionGroup"> + <remove keyForRemoval="selectWebsite"/> + <uncheckOption selector="{{ProductInWebsitesSection.website(website)}}" stepKey="unSelectWebsite" after="waitForPageOpened"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/VerifyCategoryPageParametersActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/VerifyCategoryPageParametersActionGroup.xml new file mode 100644 index 0000000000000..dff3ca46640df --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/VerifyCategoryPageParametersActionGroup.xml @@ -0,0 +1,29 @@ +<?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="VerifyCategoryPageParametersActionGroup"> + <annotations> + <description>Validate that the Category Page parameters are present and correct.</description> + </annotations> + <arguments> + <argument name="category"/> + <argument name="mode" type="string"/> + <argument name="numOfProductsPerPage" type="string"/> + <argument name="sortBy" type="string" defaultValue="position"/> + </arguments> + + <seeInCurrentUrl url="/{{category.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> + <seeInTitle userInput="{{category.name}}" stepKey="assertCategoryNameInTitle"/> + <see userInput="{{category.name}}" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="assertCategoryName"/> + <see userInput="{{mode}}" selector="{{StorefrontCategoryMainSection.modeGridIsActive}}" stepKey="assertViewMode"/> + <see userInput="{{numOfProductsPerPage}}" selector="{{StorefrontCategoryMainSection.perPage}}" stepKey="assertNumberOfProductsPerPage"/> + <see userInput="{{sortBy}}" selector="{{StorefrontCategoryMainSection.sortedBy}}" stepKey="assertSortedBy"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ViewProductInAdminGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ViewProductInAdminGridActionGroup.xml new file mode 100644 index 0000000000000..9e9c7bc323eb3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/ViewProductInAdminGridActionGroup.xml @@ -0,0 +1,31 @@ +<?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="ViewProductInAdminGridActionGroup"> + <annotations> + <description>Filters the Admin Products grid by the provided Product (Name, SKU and Type).</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <waitForPageLoad stepKey="waitForPageLoadInitial"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> + <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionProductType"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="{{product.name}}" stepKey="seeProductNameInGrid"/> + <see selector="{{AdminProductGridSection.productGridCell('1', 'Price')}}" userInput="{{product.price}}" stepKey="seeProductPriceInGrid"/> + <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AddToCartCrossSellTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AddToCartCrossSellTest.xml index 53bb12fda4833..7c0161d443df6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AddToCartCrossSellTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AddToCartCrossSellTest.xml @@ -45,10 +45,10 @@ <amOnPage url="{{AdminProductEditPage.url($simpleProduct1.id$)}}" stepKey="goToProduct1"/> <click stepKey="openHeader1" selector="{{AdminProductFormRelatedUpSellCrossSellSection.sectionHeader}}"/> - <actionGroup ref="addCrossSellProductBySku" stepKey="addProduct2ToSimp1"> + <actionGroup ref="AddCrossSellProductBySkuActionGroup" stepKey="addProduct2ToSimp1"> <argument name="sku" value="$simpleProduct2.sku$"/> </actionGroup> - <actionGroup ref="addCrossSellProductBySku" stepKey="addProduct3ToSimp1"> + <actionGroup ref="AddCrossSellProductBySkuActionGroup" stepKey="addProduct3ToSimp1"> <argument name="sku" value="$simpleProduct3.sku$"/> </actionGroup> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSave"/> @@ -58,17 +58,17 @@ <amOnPage url="{{AdminProductEditPage.url($simpleProduct3.id$)}}" stepKey="goToProduct3"/> <click stepKey="openHeader2" selector="{{AdminProductFormRelatedUpSellCrossSellSection.sectionHeader}}"/> - <actionGroup ref="addCrossSellProductBySku" stepKey="addProduct1ToSimp3"> + <actionGroup ref="AddCrossSellProductBySkuActionGroup" stepKey="addProduct1ToSimp3"> <argument name="sku" value="$simpleProduct1.sku$"/> </actionGroup> - <actionGroup ref="addCrossSellProductBySku" stepKey="addProduct2ToSimp3"> + <actionGroup ref="AddCrossSellProductBySkuActionGroup" stepKey="addProduct2ToSimp3"> <argument name="sku" value="$simpleProduct2.sku$"/> </actionGroup> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSave2"/> <waitForPageLoad stepKey="waitForPageLoad2"/> <!-- Go to frontend, add simpleProduct1 to cart--> - <actionGroup ref="AddSimpleProductToCart" stepKey="addSimp1ToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimp1ToCart"> <argument name="product" value="$simpleProduct1$"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageSimpleProductTest.xml index 117f094ee0607..ac1f967b66e41 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageSimpleProductTest.xml @@ -28,32 +28,32 @@ <!--Create product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateSimpleProduct"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateSimpleProduct"> <argument name="product" value="SimpleProduct3"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillSimpleProductMain"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillSimpleProductMain"> <argument name="product" value="SimpleProduct3"/> </actionGroup> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProductSimple"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProductSimple"> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="assertProductImageAdminProductPage" stepKey="assertProductImageAdminProductPage"> + <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"> <argument name="image" value="MagentoLogo"/> </actionGroup> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="SimpleProduct3"/> </actionGroup> <!-- Assert product image in storefront product page --> - <actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertProductImageStorefrontProductPage"> + <actionGroup ref="AssertProductImageStorefrontProductPageActionGroup" stepKey="assertProductImageStorefrontProductPage"> <argument name="product" value="SimpleProduct3"/> <argument name="image" value="MagentoLogo"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageVirtualProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageVirtualProductTest.xml index 3f857c258924f..367827f8c0c28 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageVirtualProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultImageVirtualProductTest.xml @@ -28,30 +28,30 @@ <!--Create product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductMain"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductMain"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="assertProductImageAdminProductPage" stepKey="assertProductImageAdminProductPage"/> + <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> <!-- Assert product image in storefront product page --> - <actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertProductImageStorefrontProductPage"> + <actionGroup ref="AssertProductImageStorefrontProductPageActionGroup" stepKey="assertProductImageStorefrontProductPage"> <argument name="product" value="defaultVirtualProduct"/> <argument name="image" value="MagentoLogo"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml index f657fbbdae607..0b33ef0ac0783 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml @@ -29,19 +29,19 @@ <!-- Create product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="adminProductIndexPageAdd"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="ApiSimpleProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillMainProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="ApiSimpleProduct"/> </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="ApiSimpleProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoVirtualProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoVirtualProductTest.xml index eab36bc90dc18..e89cf6f4242e7 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoVirtualProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoVirtualProductTest.xml @@ -21,13 +21,13 @@ <!-- Replacing steps in base AdminAddDefaultVideoSimpleProductTest --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillMainProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageForCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageForCategoryTest.xml index 8ac0cfa512b03..ed9eb686d2c86 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageForCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageForCategoryTest.xml @@ -22,27 +22,27 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="DeleteCategory" stepKey="DeleteCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="DeleteCategory"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Go to create a new category with image --> - <actionGroup ref="goToCreateCategoryPage" stepKey="goToCreateCategoryPage"/> - <actionGroup ref="fillCategoryForm" stepKey="fillCategoryForm"> + <actionGroup ref="GoToCreateCategoryPageActionGroup" stepKey="goToCreateCategoryPage"/> + <actionGroup ref="FillCategoryFormActionGroup" stepKey="fillCategoryForm"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> - <actionGroup ref="addCategoryImage" stepKey="addCategoryImage"/> - <actionGroup ref="saveCategoryForm" stepKey="saveCategoryForm"/> + <actionGroup ref="AddCategoryImageActionGroup" stepKey="addCategoryImage"/> + <actionGroup ref="SaveCategoryFormActionGroup" stepKey="saveCategoryForm"/> <!-- Verify category with image in admin --> - <actionGroup ref="checkCategoryImageInAdmin" stepKey="checkCategoryImageInAdmin"/> + <actionGroup ref="CheckCategoryImageInAdminActionGroup" stepKey="checkCategoryImageInAdmin"/> <!-- Verify category with image in storefront --> - <actionGroup ref="CheckCategoryOnStorefront" stepKey="CheckCategoryOnStorefront"> + <actionGroup ref="CheckCategoryOnStorefrontActionGroup" stepKey="CheckCategoryOnStorefront"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> <seeElement selector="{{StorefrontCategoryMainSection.imageSource(ProductImage.filename)}}" stepKey="seeImage"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml index c36c29ce594d0..4bb41ff906f61 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGCatalogTest.xml @@ -51,7 +51,7 @@ <seeElement selector="{{StorefrontCategoryMainSection.mediaDescription(ImageUpload3.content)}}" stepKey="assertMediaDescription"/> <seeElementInDOM selector="{{StorefrontCategoryMainSection.imageSource(ImageUpload3.fileName)}}" stepKey="assertMediaSource"/> <after> - <actionGroup ref="DeleteCategory" stepKey="DeleteCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="DeleteCategory"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml index 4044490c92334..e1772a975f714 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml @@ -29,7 +29,7 @@ <amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToNewProduct"/> <waitForPageLoad stepKey="waitForPageLoadProductCreatePage"/> - <actionGroup ref="fillMainProductForm" stepKey="fillBasicProductInfo" /> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillBasicProductInfo" /> <click selector="{{AdminProductFormSection.contentTab}}" stepKey="clickContentTab" /> <waitForElementVisible selector="{{ProductDescriptionWYSIWYGToolbarSection.TinyMCE4}}" stepKey="waitForDescription" /> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml index 51ef7fb77d74c..b98ca3a375a17 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml @@ -36,7 +36,7 @@ <!--Open Product Index Page and filter the product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> <!-- Update product Advanced Inventory setting --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest.xml index 545e7c10379bf..87acf14172ef6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest.xml @@ -32,7 +32,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex1"/> <waitForPageLoad time="30" stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetGridToDefaultKeywordSearch"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> <actionGroup ref="logout" stepKey="logoutFromAdmin"/> </after> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> @@ -51,7 +51,7 @@ <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceValueTypeSelect('0')}}" userInput="Discount" stepKey="selectProductTierPriceValueType1"/> <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('0')}}" userInput="10" stepKey="selectProductTierPricePriceInput"/> <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton1"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct1"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1"/> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin1"> <argument name="Customer" value="$$createSimpleUSCustomer$$" /> </actionGroup> @@ -79,7 +79,7 @@ <waitForElement selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect('0')}}" time="30" stepKey="waitForSelectCustomerGroupNameAttribute1"/> <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect('0')}}" userInput="General" stepKey="selectCustomerGroupGeneral"/> <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton2"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct2"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2"/> <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage3"/> <waitForPageLoad time="30" stepKey="waitForPageLoad4"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('100')}}" stepKey="assertProductFinalPriceIs100_1"/> @@ -110,7 +110,7 @@ <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceValueTypeSelect('1')}}" userInput="Discount" stepKey="selectProductTierPriceValueType2"/> <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('1')}}" userInput="18" stepKey="selectProductTierPricePriceInput18"/> <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton3"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct3"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct3"/> <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage5"/> <waitForPageLoad time="30" stepKey="waitForPageLoad6"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('100')}}" stepKey="assertProductFinalPriceIs100_2"/> @@ -132,7 +132,7 @@ <seeElement selector="{{StorefrontProductInfoMainSection.productTierPriceSavePercentageAmount('1', '10')}}" stepKey="assertProductTierPriceSavePercentageAmountForFirstRow1"/> <seeElement selector="{{StorefrontProductInfoMainSection.productTierPriceSavePercentageAmount('2', '18')}}" stepKey="assertProductTierPriceSavePercentageAmountForSecondRow1"/> <fillField userInput="10" selector="{{StorefrontProductInfoMainSection.qty}}" stepKey="fillProductQuantity1"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToCheckoutFromMinicart"/> @@ -169,7 +169,7 @@ <waitForElement selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForcustomerGroupPriceAddButton4"/> <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('1')}}" userInput="25" stepKey="selectProductTierPricePercentageValue2"/> <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton4"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct4"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct4"/> <amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToShoppingCartPage1"/> <waitForPageLoad time="30" stepKey="waitForShoppingCartPagePageLoad1"/> <seeInField userInput="20" selector="{{CheckoutCartProductSection.ProductQuantityByName($$createSimpleProduct.name$$)}}" stepKey="seeInQtyField20"/> @@ -239,7 +239,7 @@ <click selector="(//tr//button[@data-action='remove_row'])[1]" userInput=".product_form_product_form_advanced_pricing_modal" stepKey="deleteFirstRowOfCustomerGroupPrice"/> <click selector="//tr//button[@data-action='remove_row']" userInput=".product_form_product_form_advanced_pricing_modal" stepKey="deleteSecondRowOfCustomerGroupPrice"/> <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" userInput=".product_form_product_form_advanced_pricing_modal" stepKey="clickDoneButton5"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct5"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct5"/> <scrollToTopOfPage stepKey="scrollToTopOfPage6"/> <click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton6"/> <waitForElement selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForcustomerGroupPriceAddButton5"/> @@ -291,7 +291,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad time="30" stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetGridToDefaultKeywordSearch"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> <actionGroup ref="logout" stepKey="logoutFromAdmin"/> </after> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> @@ -309,7 +309,7 @@ <selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceValueTypeSelect('0')}}" userInput="Discount" stepKey="selectProductTierPriceValueType"/> <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('0')}}" userInput="0.1" stepKey="selectProductTierPricePriceInput"/> <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct1"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1"/> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.sku$$)}}" stepKey="goProductPageOnStorefront"/> <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> <seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('99.90')}}" stepKey="assertProductFinalPriceProductPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAssignProductAttributeToAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAssignProductAttributeToAttributeSetTest.xml index 4261721d36064..41b358bbf760e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAssignProductAttributeToAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAssignProductAttributeToAttributeSetTest.xml @@ -40,14 +40,14 @@ <!-- Assert created attribute in unassigned section --> <see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassigned"/> <!-- Assign attribute to a group --> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="$$attribute.attribute_code$$"/> </actionGroup> <!-- Assert attribute in a group --> <see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/> <!-- Save attribute set --> - <actionGroup ref="SaveAttributeSet" stepKey="SaveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="SaveAttributeSet"/> <!-- Go to create new product page --> <amOnPage url="{{AdminProductCreatePage.url(AddToDefaultSet.attributeSetId, 'simple')}}" stepKey="navigateToNewProduct"/> <waitForPageLoad stepKey="waitForPageLoad"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminBackorderAllowedAddProductToCartTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminBackorderAllowedAddProductToCartTest.xml index 88c524eff387c..9361637a0a935 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminBackorderAllowedAddProductToCartTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminBackorderAllowedAddProductToCartTest.xml @@ -35,7 +35,7 @@ </after> <!-- Go to the storefront and add the product to the cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="gotoAndAddProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="gotoAndAddProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSet.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSet.xml index bcfab6ccfdf1f..95620bf75b6d0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSet.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminChangeProductAttributeSet.xml @@ -35,11 +35,11 @@ <actionGroup ref="LoginAsAdmin" stepKey="login"/> <amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$$createAttributeSet.attribute_set_id$$/" stepKey="onAttributeSetEdit"/> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="$$createProductAttribute.attribute_code$$"/> </actionGroup> - <actionGroup ref="SaveAttributeSet" stepKey="SaveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="SaveAttributeSet"/> </before> <after> <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml index 86978a4121a43..b4381a674827d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml @@ -145,7 +145,7 @@ <!-- Open Product Index Page and Filter First Child product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct"> <argument name="product" value="ApiSimpleOne"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="selectFirstRow"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsNotVisibleInCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsNotVisibleInCategoryTest.xml index ee8b48a94b20d..cd03d868838f3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsNotVisibleInCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsNotVisibleInCategoryTest.xml @@ -36,7 +36,7 @@ <!--Open Product Index Page and filter the product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> <!-- Update product Advanced Inventory Setting --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsVisibleInCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsVisibleInCategoryTest.xml index a863de2716c97..bfea4fa7557f5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsVisibleInCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckOutOfStockProductIsVisibleInCategoryTest.xml @@ -39,7 +39,7 @@ <!--Open Product Index Page and filter the product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> <!-- Update product Advanced Inventory Setting --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCloneProductWithDuplicateUrlTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCloneProductWithDuplicateUrlTest.xml index 99adaeb522786..ee9e364758899 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCloneProductWithDuplicateUrlTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCloneProductWithDuplicateUrlTest.xml @@ -28,10 +28,10 @@ <after> <!--Delete created data--> <comment userInput="Delete created data" stepKey="commentDeleteCreatedData"/> - <actionGroup ref="deleteAllDuplicateProductUsingProductGrid" stepKey="deleteAllDuplicateProducts"> + <actionGroup ref="DeleteAllDuplicateProductUsingProductGridActionGroup" stepKey="deleteAllDuplicateProducts"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetFiltersIfExist"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetFiltersIfExist"/> <actionGroup ref="logout" stepKey="logoutOfAdmin"/> </after> <amOnPage url="{{AdminProductEditPage.url($$createSimpleProduct.id$$)}}" stepKey="goToProductEditPage"/> @@ -47,16 +47,16 @@ <comment userInput="Add duplicated product to the simple product" stepKey="commentAddProduct"/> <amOnPage url="{{AdminProductEditPage.url($$createSimpleProduct.id$$)}}" stepKey="goToSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPageLoad1"/> - <actionGroup ref="addCrossSellProductBySku" stepKey="addCrossSellProduct"> + <actionGroup ref="AddCrossSellProductBySkuActionGroup" stepKey="addCrossSellProduct"> <argument name="sku" value="$$createSimpleProduct.sku$$"/> </actionGroup> - <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct"> <argument name="sku" value="$$createSimpleProduct.sku$$"/> </actionGroup> - <actionGroup ref="addUpSellProductBySku" stepKey="addUpSellProduct"> + <actionGroup ref="AddUpSellProductBySkuActionGroup" stepKey="addUpSellProduct"> <argument name="sku" value="$$createSimpleProduct.sku$$"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveProduct"/> <conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.sectionHeader}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.AddRelatedProductsButton}}" visible="false" stepKey="openProductRUSSection"/> <see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedProductSku('related')}}" userInput="$$createSimpleProduct.sku$$-1" stepKey="seeRelatedProduct"/> <see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedProductSku('upsell')}}" userInput="$$createSimpleProduct.sku$$-1" stepKey="seeUpSellProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditSimpleProductSettingsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditSimpleProductSettingsTest.xml index 8ffab42653b49..80c20a7e0b5d9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditSimpleProductSettingsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditSimpleProductSettingsTest.xml @@ -38,16 +38,16 @@ </after> <!-- Create new simple product --> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createSimpleProduct"/> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createSimpleProduct"/> <!-- Fill all main fields --> - <actionGroup ref="fillMainProductForm" stepKey="fillAllNecessaryFields"/> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillAllNecessaryFields"/> <!-- Add two related products --> - <actionGroup ref="addRelatedProductBySku" stepKey="addFirstRelatedProduct"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addFirstRelatedProduct"> <argument name="sku" value="$$createFirstRelatedProduct.sku$$"/> </actionGroup> - <actionGroup ref="addRelatedProductBySku" stepKey="addSecondRelatedProduct"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addSecondRelatedProduct"> <argument name="sku" value="$$createSecondRelatedProduct.sku$$"/> </actionGroup> @@ -60,7 +60,7 @@ </actionGroup> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveButton"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveButton"/> <!-- Open product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> @@ -96,7 +96,7 @@ </actionGroup> <!-- Edit related products --> - <actionGroup ref="addRelatedProductBySku" stepKey="addThirdRelatedProduct"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addThirdRelatedProduct"> <argument name="sku" value="$$createThirdRelatedProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.removeRelatedProduct($$createFirstRelatedProduct.sku$$)}}" stepKey="removeFirstRelatedProduct"/> @@ -110,7 +110,7 @@ <actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="disableGiftMessageSettings"/> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveProduct"/> <!-- Verify Url Key after changing --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> @@ -129,7 +129,7 @@ <dontSeeElement selector="{{StorefrontProductCartGiftOptionSection.giftOptions}}" stepKey="dontSeeGiftOptionBtn"/> <!-- Delete created simple product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml index 90cbab59bd71d..5e7cb461e9667 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndEditVirtualProductSettingsTest.xml @@ -33,7 +33,7 @@ </before> <after> <!-- Delete created virtual product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> @@ -54,12 +54,12 @@ <actionGroup ref="DisabledWYSIWYG" stepKey="disableWYSIWYG"/> <!-- Create new virtual product --> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createVirtualProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createVirtualProduct"> <argument name="productType" value="virtual"/> </actionGroup> <!-- Fill all main fields --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillMainProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> @@ -70,10 +70,10 @@ <fillField selector="{{AdminProductContentSection.shortDescriptionTextArea}}" userInput="{{ApiProductShortDescription.value}}" stepKey="fillShortDescription"/> <!-- Add two related products --> - <actionGroup ref="addRelatedProductBySku" stepKey="addFirstRelatedProduct"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addFirstRelatedProduct"> <argument name="sku" value="$$createFirstRelatedProduct.sku$$"/> </actionGroup> - <actionGroup ref="addRelatedProductBySku" stepKey="addSecondRelatedProduct"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addSecondRelatedProduct"> <argument name="sku" value="$$createSecondRelatedProduct.sku$$"/> </actionGroup> @@ -93,7 +93,7 @@ </actionGroup> <!-- Save product form--> - <actionGroup ref="saveProductForm" stepKey="clickSaveButton"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveButton"/> <!-- Open product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> @@ -139,12 +139,12 @@ </actionGroup> <!-- Edit related products --> - <actionGroup ref="addRelatedProductBySku" stepKey="addThirdRelatedProduct"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addThirdRelatedProduct"> <argument name="sku" value="$$createThirdRelatedProduct.sku$$"/> </actionGroup> <!-- Assert product in assigned to websites --> - <actionGroup ref="AssertProductIsAssignedToWebsite" stepKey="seeCustomWebsiteIsChecked"> + <actionGroup ref="AssertProductIsAssignedToWebsiteActionGroup" stepKey="seeCustomWebsiteIsChecked"> <argument name="website" value="$createWebsite.website[name]$"/> </actionGroup> @@ -162,7 +162,7 @@ <actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="disableGiftMessageSettings"/> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveProduct"/> <!-- Verify Url Key after changing --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml index 4deca73504677..12082e1daa6c3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml @@ -23,11 +23,11 @@ <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> </before> <after> - <actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteSimpleProduct"> + <actionGroup ref="GoToProductCatalogPageActionGroup" stepKey="goToProductCatalogPage"/> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteSimpleProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetSearch"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetSearch"/> <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> </after> @@ -35,28 +35,28 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> <!-- Open Dropdown and select simple product option --> <comment stepKey="beforeOpenProductFillForm" userInput="Selecting Product from the Add Product Dropdown"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="openProductFillForm"> <argument name="productType" value="simple"/> </actionGroup> <!-- Fill form for Virtual Product Type --> <comment stepKey="beforeFillProductForm" userInput="Filling Product Form"/> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductForm"> <argument name="product" value="_defaultProduct"/> </actionGroup> - <actionGroup ref="SetProductUrlKey" stepKey="setProductUrl"> + <actionGroup ref="SetProductUrlKeyActionGroup" stepKey="setProductUrl"> <argument name="product" value="_defaultProduct"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <!-- Check that product was added with implicit type change --> <comment stepKey="beforeVerify" userInput="Verify Product Type Assigned Correctly"/> - <actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetSearch"/> - <actionGroup ref="filterProductGridByName" stepKey="searchForProduct"> + <actionGroup ref="GoToProductCatalogPageActionGroup" stepKey="goToProductCatalogPage"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetSearch"/> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="searchForProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="Virtual Product" stepKey="seeProductTypeInGrid"/> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="_defaultProduct"/> </actionGroup> </test> @@ -71,11 +71,11 @@ <group value="catalog"/> <group value="mtf_migrated"/> </annotations> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="openProductFillForm"> <argument name="productType" value="virtual"/> </actionGroup> <!-- Fill form for Virtual Product Type --> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="_defaultProduct"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="Simple Product" stepKey="seeProductTypeInGrid"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml index d9e410a9a3009..51518dffaf87e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateAttributeSetEntityTest.xml @@ -30,7 +30,7 @@ <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/> <waitForPageLoad stepKey="waitForPageLoad"/> - <actionGroup ref="goToAttributeSetByName" stepKey="filterProductAttributeSetGridByLabel"> + <actionGroup ref="GoToAttributeSetByNameActionGroup" stepKey="filterProductAttributeSetGridByLabel"> <argument name="name" value="$$createAttributeSet.attribute_set_name$$"/> </actionGroup> @@ -38,17 +38,17 @@ <see userInput="$$createProductAttribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassignedAttr"/> <!-- Assign attribute in the group --> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="$$createProductAttribute.attribute_code$$"/> </actionGroup> <see userInput="$$createProductAttribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/> - <actionGroup ref="SaveAttributeSet" stepKey="SaveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="SaveAttributeSet"/> <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets2"/> <waitForPageLoad stepKey="waitForPageLoad2"/> <!-- Assert an attribute in the group--> - <actionGroup ref="goToAttributeSetByName" stepKey="filterProductAttributeSetGridByLabel2"> + <actionGroup ref="GoToAttributeSetByNameActionGroup" stepKey="filterProductAttributeSetGridByLabel2"> <argument name="name" value="$$createAttributeSet.attribute_set_name$$"/> </actionGroup> <see userInput="$$createProductAttribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup2"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryFromProductPageTest.xml index a5150a0fb7f24..ef21b53c7613b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryFromProductPageTest.xml @@ -26,7 +26,7 @@ <after> <!-- Delete the created category --> - <actionGroup ref="DeleteMostRecentCategory" stepKey="getRidOfCreatedCategory"/> + <actionGroup ref="DeleteMostRecentCategoryActionGroup" stepKey="getRidOfCreatedCategory"/> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> </after> @@ -35,7 +35,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductGridLoad"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct"> <argument name="product" value="SimpleTwo"/> </actionGroup> <waitForPageLoad stepKey="waitForFiltersToBeApplied"/> @@ -43,12 +43,12 @@ <waitForPageLoad stepKey="waitForProductPageLoad"/> <!-- Fill out the form for the new category --> - <actionGroup ref="FillNewProductCategory" stepKey="FillNewProductCategory"> + <actionGroup ref="FillNewProductCategoryActionGroup" stepKey="FillNewProductCategory"> <argument name="categoryName" value="{{_defaultCategory.name}}"/> </actionGroup> <!-- Check that category was created --> - <actionGroup ref="CategoryPresent" stepKey="checkIfCategoryPresent"> + <actionGroup ref="CategoryPresentActionGroup" stepKey="checkIfCategoryPresent"> <argument name="categoryName" value="{{_defaultCategory.name}}"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml index a6890c2ad4905..7de1d38f097c5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml @@ -23,7 +23,7 @@ <createData entity="defaultSimpleProduct" stepKey="simpleProduct" /> </before> <after> - <actionGroup ref="DeleteCategory" stepKey="deleteCategory"/> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"/> <actionGroup ref="logout" stepKey="logout"/> <deleteData createDataKey="createDefaultCMSBlock" stepKey="deleteDefaultCMSBlock"/> <deleteData stepKey="deleteSimpleProduct" createDataKey="simpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithCustomRootCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithCustomRootCategoryTest.xml index e8c6da476a3d6..a68a585bbf31d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithCustomRootCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithCustomRootCategoryTest.xml @@ -26,7 +26,7 @@ <actionGroup ref="DeleteCustomStoreActionGroup" stepKey="deleteCustomStore"> <argument name="storeGroupName" value="customStore.name"/> </actionGroup> - <actionGroup ref="DeleteCategory" stepKey="deleteCreatedNewRootCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCreatedNewRootCategory"> <argument name="categoryEntity" value="NewRootCategory"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -41,7 +41,7 @@ <scrollToTopOfPage stepKey="scrollToTopOfPage"/> <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(NewRootCategory.name)}}" stepKey="clickOnCreatedNewRootCategory"/> <scrollToTopOfPage stepKey="scrollToTopOfPage1"/> - <actionGroup ref="CreateCategory" stepKey="createSubcategory"> + <actionGroup ref="CreateCategoryActionGroup" stepKey="createSubcategory"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> <!--Create a Store--> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveCategoryTest.xml index 96f945da138b0..fae1a1fa8c2e4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveCategoryTest.xml @@ -21,7 +21,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> </before> <after> - <actionGroup ref="DeleteCategory" stepKey="deleteCategory"/> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Create In active Category --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveIncludeInMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveIncludeInMenuTest.xml index c983089163f78..a695aa33079bd 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveIncludeInMenuTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithInactiveIncludeInMenuTest.xml @@ -21,7 +21,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> </before> <after> - <actionGroup ref="DeleteCategory" stepKey="deleteCategory"/> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> <!--Create Category with not included in menu Subcategory --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithProductsGridFilter.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithProductsGridFilter.xml index 79eec02a828f6..6a49b47b75078 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithProductsGridFilter.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithProductsGridFilter.xml @@ -21,14 +21,14 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> </before> <after> - <actionGroup ref="DeleteCategory" stepKey="deleteCategory"/> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct1"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"/> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct1"> <argument name="product" value="defaultSimpleProduct"/> </actionGroup> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct2"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct2"> <argument name="product" value="SimpleProduct"/> </actionGroup> - <actionGroup ref="NavigateToAndResetProductGridToDefaultView" stepKey="NavigateToAndResetProductGridToDefaultView"/> + <actionGroup ref="NavigateToAndResetProductGridToDefaultViewActionGroup" stepKey="NavigateToAndResetProductGridToDefaultView"/> <actionGroup ref="logout" stepKey="logout"/> </after> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductList"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithRequiredFieldsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithRequiredFieldsTest.xml index 1b6c9707b0656..dac2a121d107f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithRequiredFieldsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithRequiredFieldsTest.xml @@ -21,7 +21,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> </before> <after> - <actionGroup ref="DeleteCategory" stepKey="deleteCategory"/> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Create subcategory with required fields --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml index a3f543e9cf32a..2d1a58764e20a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml @@ -38,7 +38,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> - <actionGroup ref="deleteProductAttribute" stepKey="deleteCreatedAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteCreatedAttribute"> <argument name="ProductAttribute" value="newProductAttribute"/> </actionGroup> @@ -50,7 +50,7 @@ <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> <!-- Select Created Product--> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku"> <argument name="product" value="$$createConfigProduct$$"/> </actionGroup> <click stepKey="openFirstProduct" selector="{{AdminProductGridSection.productRowBySku($$createConfigProduct.sku$$)}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeTest.xml index 525f81de6c48c..4118356b07e74 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeTest.xml @@ -21,7 +21,7 @@ </before> <after> <!-- Remove attribute --> - <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteAttribute"> <argument name="ProductAttribute" value="productDropDownAttribute"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -60,7 +60,7 @@ <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> - <actionGroup ref="navigateToCreatedProductAttribute" stepKey="navigateToAttribute"> + <actionGroup ref="NavigateToCreatedProductAttributeActionGroup" stepKey="navigateToAttribute"> <argument name="ProductAttribute" value="productDropDownAttribute"/> </actionGroup> <!-- Check attribute data --> @@ -69,4 +69,4 @@ <assertEquals actual="$secondOptionAdminLabel" expected="'Fish & Chips'" stepKey="assertSecondOption"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml index 1bc69be642a37..557f0768c98a3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml @@ -39,7 +39,7 @@ <!-- Filter product attribute set by attribute set name --> <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="amOnAttributeSetPage"/> - <actionGroup ref="FilterProductAttributeSetGridByAttributeSetName" stepKey="filterProductAttrSetGridByAttrSetName"> + <actionGroup ref="FilterProductAttributeSetGridByAttributeSetNameActionGroup" stepKey="filterProductAttrSetGridByAttrSetName"> <argument name="name" value="$$createAttributeSet.attribute_set_name$$"/> </actionGroup> @@ -47,12 +47,12 @@ <see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassignedAttr"/> <!-- Assign attribute in the group --> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="$$attribute.attribute_code$$"/> </actionGroup> <see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/> - <actionGroup ref="SaveAttributeSet" stepKey="saveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/> <!-- Go to Product Attribute Grid page --> <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateCategoryTest.xml index 37ec4e0d32528..cbef9566b2b78 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateCategoryTest.xml @@ -27,10 +27,10 @@ </after> <!-- Open Category Page and select Add category --> - <actionGroup ref="goToCreateCategoryPage" stepKey="goToCategoryPage"/> + <actionGroup ref="GoToCreateCategoryPageActionGroup" stepKey="goToCategoryPage"/> <!-- Fill the Category form with same name and urlKey as initially created category(SimpleSubCategory) --> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillCategoryForm"> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillCategoryForm"> <argument name="categoryName" value="$$category.name$$"/> <argument name="categoryUrlKey" value="$$category.custom_attributes[url_key]$$"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateProductTest.xml index 575bb56912b25..4507e1f880a86 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDuplicateProductTest.xml @@ -32,10 +32,10 @@ </after> <!-- Go to new simple product page --> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="goToCreateProductPage"/> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="goToCreateProductPage"/> <!-- Fill the main fields in the form --> - <actionGroup ref="FillMainProductFormByString" stepKey="fillMainProductForm"> + <actionGroup ref="FillMainProductFormByStringActionGroup" stepKey="fillMainProductForm"> <argument name="productName" value="$$subCategory.name$$"/> <argument name="productSku" value="{{defaultSimpleProduct.sku}}"/> <argument name="productPrice" value="{{defaultSimpleProduct.price}}"/> @@ -45,17 +45,17 @@ </actionGroup> <!-- Select the category that we created in the before block --> - <actionGroup ref="SetCategoryByName" stepKey="setCategory"> + <actionGroup ref="SetCategoryByNameActionGroup" stepKey="setCategory"> <argument name="categoryName" value="$$category.name$$"/> </actionGroup> <!-- Set the url key to match the subcategory created in the before block --> - <actionGroup ref="SetProductUrlKeyByString" stepKey="fillUrlKey"> + <actionGroup ref="SetProductUrlKeyByStringActionGroup" stepKey="fillUrlKey"> <argument name="urlKey" value="$$subCategory.custom_attributes[url_key]$$"/> </actionGroup> <!-- Save the product and expect to see an error message --> - <actionGroup ref="SaveProductFormNoSuccessCheck" stepKey="tryToSaveProduct"/> + <actionGroup ref="SaveProductFormNoSuccessCheckActionGroup" stepKey="tryToSaveProduct"/> <see selector="{{AdminProductFormSection.successMessage}}" userInput="The value specified in the URL Key field would generate a URL that already exists." stepKey="seeErrorMessage"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml index 4e096b7ebb142..6bfd012bc88b2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml @@ -45,7 +45,7 @@ <!-- Filter product attribute set by attribute set name --> <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="amOnAttributeSetPage"/> - <actionGroup ref="FilterProductAttributeSetGridByAttributeSetName" stepKey="filterProductAttrSetGridByAttrSetName"> + <actionGroup ref="FilterProductAttributeSetGridByAttributeSetNameActionGroup" stepKey="filterProductAttrSetGridByAttrSetName"> <argument name="name" value="$$createAttributeSet.attribute_set_name$$"/> </actionGroup> @@ -53,12 +53,12 @@ <see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassignedAttr"/> <!-- Assign attribute in the group --> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="$$attribute.attribute_code$$"/> </actionGroup> <see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/> - <actionGroup ref="SaveAttributeSet" stepKey="saveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/> <!-- Go to Product Attribute Grid page --> <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductPageTest.xml index 2706d00038e4b..51c4a3250d609 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductPageTest.xml @@ -26,8 +26,8 @@ <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToProductCatalogPageActionGroup" stepKey="goToProductCatalogPage"/> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> <actionGroup ref="AdminClickAddAttributeOnProductEditPageActionGroup" stepKey="clickAddAttribute"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductTest.xml index 02615ca5dd254..8fb226f5f5585 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewAttributeFromProductTest.xml @@ -38,7 +38,7 @@ </actionGroup> <!--Delete Attribute--> - <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteAttribute"> <argument name="ProductAttribute" value="productDropDownAttribute"/> </actionGroup> @@ -55,7 +55,7 @@ <!--Go to created product page and create new attribute--> <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="openAdminEditPage"/> - <actionGroup ref="AdminCreateAttributeWithValueWithTwoStoreViesFromProductPage" stepKey="createAttribute"> + <actionGroup ref="AdminCreateAttributeWithValueWithTwoStoreViesFromProductPageActionGroup" stepKey="createAttribute"> <argument name="attributeName" value="{{productDropDownAttribute.attribute_code}}"/> <argument name="attributeType" value="Dropdown"/> <argument name="firstStoreViewName" value="{{customStoreEN.name}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewGroupForAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewGroupForAttributeSetTest.xml index 3219bca233bee..a105f343d3e21 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewGroupForAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateNewGroupForAttributeSetTest.xml @@ -29,13 +29,13 @@ <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> <actionGroup ref="logout" stepKey="logout"/> </after> - + <!-- Navigate to Stores > Attributes > Attribute Set --> <amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSetPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> <!-- Search and open Attribute Set from preconditions --> - <actionGroup ref="goToAttributeSetByName" stepKey="searchAttribute"> + <actionGroup ref="GoToAttributeSetByNameActionGroup" stepKey="searchAttribute"> <argument name="name" value="$$createAttributeSet.attribute_set_name$$"/> </actionGroup> @@ -68,9 +68,9 @@ <see userInput="$$createConfigProductAttribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttribute"/> <!-- Click 'Save' --> - <actionGroup ref="SaveAttributeSet" stepKey="saveAttribute"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttribute"/> - <actionGroup ref="goToAttributeSetByName" stepKey="backTohAttributeSet"> + <actionGroup ref="GoToAttributeSetByNameActionGroup" stepKey="backTohAttributeSet"> <argument name="name" value="$$createAttributeSet.attribute_set_name$$"/> </actionGroup> @@ -85,7 +85,7 @@ <!-- Empty group is created. No attributes are assigned to it. --> <seeElement selector="{{AdminProductAttributeSetEditSection.attributeGroup(emptyGroup.name)}}" stepKey="assertEmptyGroup"/> <dontSeeElement selector="{{AdminProductAttributeSetEditSection.attributesInGroup(emptyGroup.name)}}" stepKey="seeNoAttributes"/> - + <!-- Navigate to Catalog > Products --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> @@ -93,8 +93,8 @@ <!-- Start to create a new simple product with the custom attribute set from the preconditions --> <click selector="{{AdminProductGridActionSection.addProductBtn}}" stepKey="clickAddProduct"/> <waitForPageLoad stepKey="waitForNewProductPage"/> - - <actionGroup ref="AdminProductPageSelectAttributeSet" stepKey="selectAttribute"> + + <actionGroup ref="AdminProductPageSelectAttributeSetActionGroup" stepKey="selectAttribute"> <argument name="attributeSetName" value="$$createAttributeSet.attribute_set_name$$"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml index 63a964f4b5e91..2e502f58041e6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml @@ -35,7 +35,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!--<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>--> - <actionGroup ref="deleteProductAttribute" stepKey="deleteCreatedAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteCreatedAttribute"> <argument name="ProductAttribute" value="newProductAttribute"/> </actionGroup> @@ -47,7 +47,7 @@ <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> <!-- Select Created Product--> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <click stepKey="openFirstProduct" selector="{{AdminProductGridSection.productRowBySku($$createSimpleProduct.sku$$)}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml index d4d6496e018f5..63eed37b1e84f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml @@ -34,7 +34,7 @@ <!--Delete created entity --> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> - <actionGroup ref="deleteProductAttribute" stepKey="deleteCreatedAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteCreatedAttribute"> <argument name="ProductAttribute" value="newProductAttribute"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -45,7 +45,7 @@ <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> <!-- Select Created Product--> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <click stepKey="openFirstProduct" selector="{{AdminProductGridSection.productRowBySku($$createSimpleProduct.sku$$)}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSet.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSet.xml index 713e1b7d6dfd1..7f6feaff3ed5d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSet.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSet.xml @@ -71,10 +71,10 @@ <dontSeeElementInDOM selector="{{AdminProductFormSection.divByDataIndex('meta_keyword')}}" stepKey="dontSeeMetaKeyword"/> <!-- Finish filling the new product page --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillSimpleProductMain"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillSimpleProductMain"> <argument name="product" value="_defaultProduct"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> <!-- Check the storefront --> <amOnPage url="{{_defaultProduct.name}}.html" stepKey="goToProductPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest.xml index 291b6985bd3e5..f5e42bb84549c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductDuplicateUrlkeyTest.xml @@ -58,7 +58,7 @@ </before> <after> <!--Delete all products by filtering grid and using mass delete action--> - <actionGroup ref="deleteAllDuplicateProductUsingProductGrid" stepKey="deleteAllDuplicateProducts"> + <actionGroup ref="DeleteAllDuplicateProductUsingProductGridActionGroup" stepKey="deleteAllDuplicateProducts"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <deleteData createDataKey="createCategory" stepKey="deletePreReqCatalog" /> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateRootCategoryAndSubcategoriesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateRootCategoryAndSubcategoriesTest.xml index 11d919ddefa2c..7a99750c00e53 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateRootCategoryAndSubcategoriesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateRootCategoryAndSubcategoriesTest.xml @@ -33,7 +33,7 @@ <selectOption userInput="Default Category" selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" stepKey="selectOptionDefaultCategory"/> <click selector="{{AdminStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreButton"/> <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickOkOnModalDialog2"/> - <actionGroup ref="DeleteCategory" stepKey="deleteCreatedNewRootCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCreatedNewRootCategory"> <argument name="categoryEntity" value="NewRootCategory"/> </actionGroup> <actionGroup ref="logout" stepKey="logout2"/> @@ -48,13 +48,13 @@ </actionGroup> <scrollToTopOfPage stepKey="scrollToTopOfPage2"/> <!--Create subcategory--> - <actionGroup ref="CreateCategory" stepKey="createSubcategory1"> + <actionGroup ref="CreateCategoryActionGroup" stepKey="createSubcategory1"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(NewRootCategory.name)}}" stepKey="clickOnCreatedNewRootCategory1"/> <scrollToTopOfPage stepKey="scrollToTopOfPage3"/> <!--Create another subcategory--> - <actionGroup ref="CreateCategory" stepKey="createSubcategory2"> + <actionGroup ref="CreateCategoryActionGroup" stepKey="createSubcategory2"> <argument name="categoryEntity" value="SubCategoryWithParent"/> </actionGroup> <!--Assign new created root category to store--> @@ -74,11 +74,11 @@ <!--Go to storefront and verify created subcategory on frontend--> <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToStorefrontPage"/> <waitForPageLoad stepKey="waitForPageAdminSystemStoreLoad2"/> - <actionGroup ref="CheckCategoryOnStorefront" stepKey="checkCreatedSubcategory1OnFrontend"> + <actionGroup ref="CheckCategoryOnStorefrontActionGroup" stepKey="checkCreatedSubcategory1OnFrontend"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> - <actionGroup ref="CheckCategoryOnStorefront" stepKey="checkCreatedSubcategory2OnFrontend"> + <actionGroup ref="CheckCategoryOnStorefrontActionGroup" stepKey="checkCreatedSubcategory2OnFrontend"> <argument name="categoryEntity" value="SubCategoryWithParent"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateRootCategoryRequiredFieldsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateRootCategoryRequiredFieldsTest.xml index f98f9acc46961..2b824554b9bd4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateRootCategoryRequiredFieldsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateRootCategoryRequiredFieldsTest.xml @@ -23,7 +23,7 @@ <actionGroup ref = "LoginAsAdmin" stepKey="LoginToAdminPanel"/> </before> <after> - <actionGroup ref="DeleteCategory" stepKey="deleteCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"> <argument name="categoryEntity" value="_defaultCategory" /> </actionGroup> <actionGroup ref="logout" stepKey="logout" /> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest.xml index a7587a5ed31fe..052f6b1924e89 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductTest.xml @@ -26,7 +26,7 @@ </after> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> - <actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="_defaultProduct"/> </actionGroup> @@ -34,7 +34,7 @@ <argument name="category" value="$$createPreReqCategory$$"/> <argument name="product" value="_defaultProduct"/> </actionGroup> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="assertProductInStorefront2"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="assertProductInStorefront2"> <argument name="product" value="_defaultProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithCountryOfManufactureAttributeSKUMaskTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithCountryOfManufactureAttributeSKUMaskTest.xml index 3487de656173f..bbaabffcc5ecd 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithCountryOfManufactureAttributeSKUMaskTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithCountryOfManufactureAttributeSKUMaskTest.xml @@ -25,7 +25,7 @@ </before> <after> <magentoCLI stepKey="setName" command="config:set catalog/fields_masks/sku" arguments="{{name}}"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{nameAndAttributeSkuMaskSimpleProduct.name}}-{{nameAndAttributeSkuMaskSimpleProduct.country_of_manufacture_label}}" /> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml index 94d488f216b49..93f01964ffdb5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml @@ -27,7 +27,7 @@ </after> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> - <actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="ProductWithUnicode"/> </actionGroup> @@ -35,7 +35,7 @@ <argument name="category" value="$$createPreReqCategory$$"/> <argument name="product" value="ProductWithUnicode"/> </actionGroup> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="assertProductInStorefront2"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="assertProductInStorefront2"> <argument name="product" value="ProductWithUnicode"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateTextEditorProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateTextEditorProductAttributeTest.xml index fc7482c353136..848e765d34d70 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateTextEditorProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateTextEditorProductAttributeTest.xml @@ -30,12 +30,12 @@ </before> <after> <!-- Delete attribute --> - <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteAttribute"> <argument name="ProductAttribute" value="productTextEditorAttribute"/> </actionGroup> <!-- Delete product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> @@ -71,7 +71,7 @@ <selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="{{productTextEditorAttribute.frontend_input}}" stepKey="returnInputType"/> <!-- Save Product Attribute --> - <actionGroup ref="saveProductAttribute" stepKey="saveAttribute"/> + <actionGroup ref="SaveProductAttributeActionGroup" stepKey="saveAttribute"/> <!-- Go to Store > Attribute Set --> <actionGroup ref="AdminOpenAttributeSetGridPageActionGroup" stepKey="openAttributeSetPage"/> @@ -80,20 +80,20 @@ <actionGroup ref="AdminOpenAttributeSetByNameActionGroup" stepKey="openDefaultAttributeSet"/> <!-- Add Product Attribute to Default attribute by dragging and dropping this to the 'Project Details' folder. Then Save. --> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="{{productTextEditorAttribute.attribute_code}}"/> </actionGroup> - <actionGroup ref="SaveAttributeSet" stepKey="saveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/> <!-- Go Catalog > Product to create new product page --> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="goToProductIndexPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> <!-- On product page, select Attribute Set: "Default" --> - <actionGroup ref="AdminProductPageSelectAttributeSet" stepKey="selectAttributeSet"> + <actionGroup ref="AdminProductPageSelectAttributeSetActionGroup" stepKey="selectAttributeSet"> <argument name="attributeSetName" value="Default"/> </actionGroup> @@ -115,8 +115,8 @@ <fillField selector="{{ProductDescriptionWysiwygSection.attributeEditArea(productTextEditorAttribute.attribute_code)}}" userInput="This content from product page" stepKey="setContent"/> <!-- Fill up all required fields for product form --> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"/> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <!-- Assert product attribute on Storefront --> <actionGroup ref="OpenStorefrontProductPageByProductNameActionGroup" stepKey="openProductPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml index 0b929eaddc96e..84eacc54a6e22 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml @@ -24,7 +24,7 @@ </before> <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteVirtualProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteVirtualProduct"> <argument name="sku" value="{{virtualProductOutOfStock.sku}}"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilter"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml index 23f772a395a7d..8dd7671ac0295 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml @@ -24,7 +24,7 @@ </before> <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteVirtualProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteVirtualProduct"> <argument name="sku" value="{{virtualProductCustomImportOptions.sku}}"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="resetOrderFilter"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceForGeneralGroupTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceForGeneralGroupTest.xml index 9055e961f889f..976f714d7b3e1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceForGeneralGroupTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithTierPriceForGeneralGroupTest.xml @@ -24,7 +24,7 @@ <createData entity="Simple_US_CA_Customer" stepKey="customer" /> </before> <after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteVirtualProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteVirtualProduct"> <argument name="product" value="virtualProductGeneralGroup"/> </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="categoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteAttributeSetTest.xml index cbe2f40e0dd25..973ff0381584a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteAttributeSetTest.xml @@ -47,7 +47,7 @@ <!-- Search for the product by sku and name on the product page --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToAdminProductIndex"/> <waitForPageLoad stepKey="waitForAdminProductIndex"/> - <actionGroup ref="filterProductGridBySkuAndName" stepKey="filerProductsBySkuAndName"> + <actionGroup ref="FilterProductGridBySkuAndNameActionGroup" stepKey="filerProductsBySkuAndName"> <argument name="product" value="SimpleProductWithCustomAttributeSet"/> </actionGroup> <!-- Should not see the product --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml index 0df9dd0b57545..4a305b8dfec75 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml @@ -95,10 +95,10 @@ <see selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="$$createConfigProductAttribute.default_value$$" stepKey="seeProductAttributeLabel"/> <seeElement selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="seeProductAttributeOptions"/> <!-- Delete Child products --> - <actionGroup ref="deleteProductBySku" stepKey="deleteFirstChildProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteFirstChildProduct"> <argument name="sku" value="$$createConfigChildProduct1.sku$$"/> </actionGroup> - <actionGroup ref="deleteProductBySku" stepKey="deleteSecondChildProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteSecondChildProduct"> <argument name="sku" value="$$createConfigChildProduct2.sku$$"/> </actionGroup> <!--Verify product is not visible in category store front page --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml index 3841c061c2629..84a116fb4bcd6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml @@ -41,7 +41,7 @@ <click selector="{{AdminProductAttributeSetGridSection.AttributeSetName($$createAttributeSet.attribute_set_name$$)}}" stepKey="clickOnAttributeSet"/> <waitForPageLoad stepKey="waitForAttributeSetEditPageToLoad"/> <!--Assign Attribute to the Group and save the attribute set --> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttribute"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttribute"> <argument name="group" value="Product Details"/> <argument name="attribute" value="$$attribute.attribute_code$$"/> </actionGroup> @@ -49,11 +49,11 @@ <waitForPageLoad stepKey="waitForPageToSave"/> <see userInput="You saved the attribute set" selector="{{AdminMessagesSection.success}}" stepKey="successMessage"/> <!--Delete product attribute from product attribute grid --> - <actionGroup ref="deleteProductAttributeByAttributeCode" stepKey="deleteProductAttribute"> + <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttributeCode" value="$$attribute.attribute_code$$"/> </actionGroup> <!--Confirm Attribute is not present in Product Attribute Grid --> - <actionGroup ref="filterProductAttributeByAttributeCode" stepKey="filterAttribute"> + <actionGroup ref="FilterProductAttributeByAttributeCodeActionGroup" stepKey="filterAttribute"> <argument name="ProductAttributeCode" value="$$attribute.attribute_code$$"/> </actionGroup> <see selector="{{AdminProductAttributeGridSection.FirstRow}}" userInput="We couldn't find any records." stepKey="seeEmptyRow"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml index d0036a2adea5a..cc3242310ca11 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml @@ -24,16 +24,16 @@ <after> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="deleteProductAttributeByAttributeCode" stepKey="deleteProductAttribute"> + <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttributeCode" value="$$createProductAttribute.attribute_code$$"/> </actionGroup> <!-- Assert the product attribute is not in the grid by Attribute code --> - <actionGroup ref="filterProductAttributeByAttributeCode" stepKey="filterByAttributeCode"> + <actionGroup ref="FilterProductAttributeByAttributeCodeActionGroup" stepKey="filterByAttributeCode"> <argument name="ProductAttributeCode" value="$$createProductAttribute.attribute_code$$"/> </actionGroup> <see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage"/> <!--Assert the product attribute is not in the grid by Default Label --> - <actionGroup ref="filterProductAttributeByDefaultLabel" stepKey="filterByDefaultLabel"> + <actionGroup ref="FilterProductAttributeByDefaultLabelActionGroup" stepKey="filterByDefaultLabel"> <argument name="productAttributeLabel" value="$$createProductAttribute.default_frontend_label$$"/> </actionGroup> <see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage2"/> @@ -48,7 +48,7 @@ <waitForPageLoad stepKey="waitForAttributeAdded"/> <!-- Filter By Attribute Label on Add Attribute Page --> <click selector="{{AdminProductFiltersSection.filter}}" stepKey="clickOnFilter"/> - <actionGroup ref="filterProductAttributeByAttributeLabel" stepKey="filterByAttributeLabel"> + <actionGroup ref="FilterProductAttributeByAttributeLabelActionGroup" stepKey="filterByAttributeLabel"> <argument name="productAttributeLabel" value="$$createProductAttribute.default_frontend_label$$"/> </actionGroup> <see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage3"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml index 7f6a1333b721a..dec911ec84a8d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml @@ -30,7 +30,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteSimpleProductFilteredBySkuAndName"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteSimpleProductFilteredBySkuAndName"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml index f334cbc218b7c..55c98bcc13d34 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductsImageInCaseOfMultipleStoresTest.xml @@ -43,17 +43,17 @@ <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad0"/> <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="['Default Category', $$createRootCategory.name$$, $$createSubCategory.name$$]" stepKey="fillCategory"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Add images to the product--> <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="visitAdminProductPage2"/> <waitForPageLoad stepKey="waitForProductPageLoad1"/> - <actionGroup ref="addProductImage" stepKey="addImageToProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageToProduct"> <argument name="image" value="ProductImage"/> </actionGroup> - <actionGroup ref="addProductImage" stepKey="addImage1ToProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage1ToProduct"> <argument name="image" value="TestImageNew"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct1"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1"/> <!--Enable config to view created store view on store front--> <createData entity="EnableWebUrlOptionsConfig" stepKey="enableWebUrlOptionsConfig"/> </before> @@ -86,12 +86,12 @@ <actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectWebsiteInProduct2"> <argument name="website" value="{{NewWebSiteData.name}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct2"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2"/> <!--Reindex and flush cache--> <magentoCLI command="indexer:reindex" stepKey="reindex"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> <!--Switch to 'Default Store View' scope and open product page--> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="SwitchDefaultStoreView"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="SwitchDefaultStoreView"> <argument name="storeViewName" value="'Default Store View'"/> </actionGroup> <waitForPageLoad stepKey="waitForProductPageLoad3"/> @@ -99,9 +99,9 @@ <actionGroup ref="AdminAssignImageRolesIfUnassignedActionGroup" stepKey="assignAllRolesToFirstImage"> <argument name="image" value="ProductImage"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct3"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct3"/> <!--Switch to newly created Store View scope and open product page--> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="SwitchNewStoreView"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="SwitchNewStoreView"> <argument name="storeViewName" value="{{NewStoreViewData.name}}"/> </actionGroup> <waitForPageLoad stepKey="waitForProductPageLoad4"/> @@ -109,17 +109,17 @@ <actionGroup ref="AdminAssignImageRolesIfUnassignedActionGroup" stepKey="assignAllRolesToFirstImage2"> <argument name="image" value="ProductImage"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct4"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct4"/> <!--Switch to 'All Store Views' scope and open product page--> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="SwitchAllStoreView"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="SwitchAllStoreView"> <argument name="storeViewName" value="'All Store Views'"/> </actionGroup> <waitForPageLoad stepKey="waitForProductPageLoad5"/> <!--Remove product image and save--> - <actionGroup ref="RemoveProductImageByName" stepKey="removeProductImage"> + <actionGroup ref="RemoveProductImageByNameActionGroup" stepKey="removeProductImage"> <argument name="image" value="ProductImage"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct5"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct5"/> <!--Assert notification and success messages--> <see selector="{{StorefrontMessagesSection.success}}" userInput="{{ProductFormMessages.save_success}}" stepKey="seeSuccessMessage"/> <see selector="{{StorefrontMessagesSection.noticeMessage}}" userInput="{{ProductFormMessages.remove_image_notice}}" stepKey="seeNotification"/> @@ -128,7 +128,7 @@ <waitForPageLoad stepKey="waitForImagesLoad"/> <seeElement selector="{{AdminProductImagesSection.imageFile(ProductImage.fileName)}}" stepKey="seeImageIsNotDeleted"/> <!--Switch to newly created Store View scope and open product page--> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="SwitchNewStoreView2"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="SwitchNewStoreView2"> <argument name="storeViewName" value="{{NewStoreViewData.name}}"/> </actionGroup> <waitForPageLoad stepKey="waitForProductPageLoad6"/> @@ -136,17 +136,17 @@ <actionGroup ref="AdminAssignImageRolesIfUnassignedActionGroup" stepKey="assignAllRolesToSecondImage"> <argument name="image" value="TestImageNew"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct6"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct6"/> <!--Switch to 'All Store Views' scope and open product page--> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="SwitchAllStoreView2"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="SwitchAllStoreView2"> <argument name="storeViewName" value="'All Store Views'"/> </actionGroup> <waitForPageLoad stepKey="waitForProductPageLoad7"/> <!--Remove product image and save--> - <actionGroup ref="RemoveProductImageByName" stepKey="removeProductFirstImage"> + <actionGroup ref="RemoveProductImageByNameActionGroup" stepKey="removeProductFirstImage"> <argument name="image" value="ProductImage"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct7"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct7"/> <!--Assert notification and success messages--> <see selector="{{StorefrontMessagesSection.success}}" userInput="{{ProductFormMessages.save_success}}" stepKey="seeSuccessMessage2"/> <see selector="{{StorefrontMessagesSection.noticeMessage}}" userInput="{{ProductFormMessages.remove_image_notice}}" stepKey="seeNotification2"/> @@ -155,15 +155,15 @@ <waitForPageLoad stepKey="waitForImagesLoad2"/> <seeElement selector="{{AdminProductImagesSection.imageFile(ProductImage.fileName)}}" stepKey="seeImageIsNotDeleted2"/> <!--Switch to newly created Store View scope and open product page--> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="SwitchNewStoreView3"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="SwitchNewStoreView3"> <argument name="storeViewName" value="{{NewStoreViewData.name}}"/> </actionGroup> <waitForPageLoad stepKey="waitForProductPageLoad8"/> <!--Remove second image and save--> - <actionGroup ref="RemoveProductImageByName" stepKey="removeProductSecondImage"> + <actionGroup ref="RemoveProductImageByNameActionGroup" stepKey="removeProductSecondImage"> <argument name="image" value="TestImageNew"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct8"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct8"/> <!--Assert success messages--> <see selector="{{StorefrontMessagesSection.success}}" userInput="{{ProductFormMessages.save_success}}" stepKey="seeSuccessMessage3"/> <!--Reopen image tab and see the image is deleted--> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml index 7c460a3dfc51e..5b8ac5157514d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml @@ -29,7 +29,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteSimpleProductFilteredBySkuAndName"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteSimpleProductFilteredBySkuAndName"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml index c3cafb17c5eac..4b97fb38e994f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml @@ -47,7 +47,7 @@ <!--Open Product Index Page and filter the product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct"> <argument name="product" value="SimpleProduct2"/> </actionGroup> <!--Verify Created Product Attribute displayed in Product page --> @@ -55,11 +55,11 @@ <waitForPageLoad stepKey="waitForProductToLoad"/> <seeElement selector="{{AdminProductFormSection.newAddedAttribute($$attribute.attribute_code$$)}}" stepKey="seeProductAttributeIsAdded"/> <!--Delete product attribute from product attribute grid --> - <actionGroup ref="deleteProductAttributeByAttributeCode" stepKey="deleteProductAttribute"> + <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttributeCode" value="$$attribute.attribute_code$$"/> </actionGroup> <!-- Confirm attribute is not present in product attribute grid --> - <actionGroup ref="filterProductAttributeByAttributeCode" stepKey="filterAttribute"> + <actionGroup ref="FilterProductAttributeByAttributeCodeActionGroup" stepKey="filterAttribute"> <argument name="ProductAttributeCode" value="$$attribute.attribute_code$$"/> </actionGroup> <see stepKey="seeEmptyRow" selector="{{AdminProductAttributeGridSection.FirstRow}}" userInput="We couldn't find any records."/> @@ -77,7 +77,7 @@ <!--Verify Product Attribute is not present in Product Index Page --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="openProductIndexPage"/> <waitForPageLoad stepKey="waitForProductIndexPageToLoad1"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProduct1"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct1"> <argument name="product" value="SimpleProduct2"/> </actionGroup> <!--Verify Product Attribute is not present in Product page --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml index 413d53d1c3746..86f253f358532 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml @@ -30,7 +30,7 @@ <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteVirtualProductFilteredBySkuAndName"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteVirtualProductFilteredBySkuAndName"> <argument name="product" value="$$createVirtualProduct$$"/> </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDisableProductOnChangingAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDisableProductOnChangingAttributeSetTest.xml index dab1704d50bf3..0fc2c022b81e9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDisableProductOnChangingAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDisableProductOnChangingAttributeSetTest.xml @@ -33,7 +33,7 @@ </after> <actionGroup ref="LoginAsAdmin" stepKey="login"/> <amOnPage url="{{AdminProductAttributeSetEditPage.url}}/$$createAttributeSet.attribute_set_id$$/" stepKey="onAttributeSetEdit"/> - <actionGroup ref="SaveAttributeSet" stepKey="SaveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="SaveAttributeSet"/> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml index 53040993beb8f..392d3c6ff5320 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminEditTextEditorProductAttributeTest.xml @@ -26,7 +26,7 @@ <requiredEntity createDataKey="myProductAttributeCreation"/> </createData> </before> - <actionGroup ref="navigateToCreatedProductAttribute" stepKey="navigateToAttribute"> + <actionGroup ref="NavigateToCreatedProductAttributeActionGroup" stepKey="navigateToAttribute"> <argument name="ProductAttribute" value="productAttributeWysiwyg"/> </actionGroup> <seeOptionIsSelected selector="{{AttributePropertiesSection.InputType}}" userInput="Text Editor" stepKey="seeTextEditorSelected" /> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilterByNameByStoreViewOnProductGridTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilterByNameByStoreViewOnProductGridTest.xml index f3ec225540c75..0b230b0b8e002 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilterByNameByStoreViewOnProductGridTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilterByNameByStoreViewOnProductGridTest.xml @@ -35,11 +35,11 @@ <scrollToTopOfPage stepKey="scrollToTopOfAdminProductFormSection"/> <click selector="{{AdminProductFormSection.productNameUseDefault}}" stepKey="uncheckUseDefault"/> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="fillNewName"/> - <actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> - <actionGroup ref="filterProductGridByName" stepKey="filterGridByName"> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterGridByName"> <argument name="product" value="SimpleProduct"/> </actionGroup> <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{SimpleProduct2.name}}" stepKey="seeProductNameInGrid"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml index 41b446b474078..f75bdf18ccfc4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml @@ -60,7 +60,7 @@ <click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="clickToOpenWebsiteSection"/> <waitForPageLoad stepKey="waitForToOpenedWebsiteSection"/> <uncheckOption selector="{{ProductInWebsitesSection.website('Main Website')}}" stepKey="uncheckWebsite"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct1"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1"/> <!-- Set filter to product name and product2 in website 2 only --> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForProduct2"> @@ -73,7 +73,7 @@ <argument name="website" value="{{secondCustomWebsite.name}}"/> </actionGroup> <uncheckOption selector="{{ProductInWebsitesSection.website('Main Website')}}" stepKey="uncheckWebsite1"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct2"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2"/> <!-- Set filter to product name and product12 assigned to both websites 1 and 2 --> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForProduct12"> @@ -85,7 +85,7 @@ <actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectProductInWebsites1"> <argument name="website" value="{{secondCustomWebsite.name}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct3"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct3"/> </before> <after> <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberAfterSaveAndCloseActionTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberAfterSaveAndCloseActionTest.xml index eb4a561760070..9c0fbbb78451d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberAfterSaveAndCloseActionTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminGridPageNumberAfterSaveAndCloseActionTest.xml @@ -25,8 +25,8 @@ <comment userInput="Clear product grid" stepKey="commentClearProductGrid"/> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="goToProductCatalog"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridToDefaultView"/> - <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteProductIfTheyExist"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridToDefaultView"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteProductIfTheyExist"/> <createData stepKey="category1" entity="SimpleSubCategory"/> <createData stepKey="product1" entity="SimpleProduct"> <requiredEntity createDataKey="category1"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml index dfadfdf00481b..3cc21920d239c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminImportCustomizableOptionToProductWithSKUTest.xml @@ -42,7 +42,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createFirstProduct" stepKey="deleteFirstProduct"/> <!--Delete second product with changed sku--> - <actionGroup ref="deleteProductBySku" stepKey="deleteSecondProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteSecondProduct"> <argument name="sku" value="$$createFirstProduct.sku$$-1"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductGridFilter"/> @@ -54,19 +54,19 @@ <fillField selector="{{AdminProductFormSection.productSku}}" userInput="$$createFirstProduct.sku$$" stepKey="fillProductSku1"/> <!--Import customizable options and check--> <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/> - <actionGroup ref="importProductCustomizableOptions" stepKey="importOptions"> + <actionGroup ref="ImportProductCustomizableOptionsActionGroup" stepKey="importOptions"> <argument name="productName" value="$$createFirstProduct.name$$"/> </actionGroup> - <actionGroup ref="checkCustomizableOptionImport" stepKey="checkFirstOptionImport"> + <actionGroup ref="CheckCustomizableOptionImportActionGroup" stepKey="checkFirstOptionImport"> <argument name="option" value="ProductOptionField"/> <argument name="optionIndex" value="0"/> </actionGroup> - <actionGroup ref="checkCustomizableOptionImport" stepKey="checkSecondOptionImport"> + <actionGroup ref="CheckCustomizableOptionImportActionGroup" stepKey="checkSecondOptionImport"> <argument name="option" value="ProductOptionField2"/> <argument name="optionIndex" value="1"/> </actionGroup> <!--Save product and check sku changed message--> - <actionGroup ref="saveProductForm" stepKey="saveSecondProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSecondProduct"/> <see selector="{{AdminMessagesSection.notice}}" userInput="SKU for product $$createSecondProduct.name$$ has been changed to $$createFirstProduct.sku$$-1." stepKey="seeSkuChangedMessage"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassChangeProductsStatusTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassChangeProductsStatusTest.xml index 8d5121cf21461..6896b11196cf2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassChangeProductsStatusTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassChangeProductsStatusTest.xml @@ -39,10 +39,10 @@ <!-- Search and select products --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="searchProductGridByKeyword2" stepKey="searchByKeyword"> + <actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword"> <argument name="keyword" value="api-simple-product"/> </actionGroup> - <actionGroup ref="sortProductsByIdDescending" stepKey="sortProductsByIdDescending"/> + <actionGroup ref="SortProductsByIdDescendingActionGroup" stepKey="sortProductsByIdDescending"/> <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox1"/> <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('2')}}" stepKey="clickCheckbox2"/> <!-- Mass change status --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassProductPriceUpdateTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassProductPriceUpdateTest.xml index f5ad5b8079d1f..e98b145f01401 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassProductPriceUpdateTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassProductPriceUpdateTest.xml @@ -34,12 +34,12 @@ <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> <!--Search products using keyword --> - <actionGroup ref="searchProductGridByKeyword2" stepKey="searchByKeyword"> + <actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword"> <argument name="keyword" value="Testp"/> </actionGroup> <!--Sort Products by ID in descending order--> - <actionGroup ref="sortProductsByIdDescending" stepKey="sortProductsByIdDescending"/> + <actionGroup ref="SortProductsByIdDescendingActionGroup" stepKey="sortProductsByIdDescending"/> <!--Select products--> <checkOption selector="{{AdminProductGridSection.productRowCheckboxBySku($$simpleProduct1.sku$$)}}" stepKey="selectFirstProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesGlobalScopeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesGlobalScopeTest.xml index 989431941b279..71873fe5b0960 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesGlobalScopeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesGlobalScopeTest.xml @@ -21,7 +21,7 @@ </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="deleteAllProductsUsingProductGrid" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView" /> <createData entity="_defaultCategory" stepKey="createCategory"/> <createData entity="ApiSimpleProduct" stepKey="createProductOne"> @@ -44,10 +44,10 @@ <!-- Search and select products --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="searchProductGridByKeyword2" stepKey="searchByKeyword"> + <actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword"> <argument name="keyword" value="api-simple-product"/> </actionGroup> - <actionGroup ref="sortProductsByIdDescending" stepKey="sortProductsByIdDescending"/> + <actionGroup ref="SortProductsByIdDescendingActionGroup" stepKey="sortProductsByIdDescending"/> <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox1"/> <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('2')}}" stepKey="clickCheckbox2"/> <!-- Mass update attributes --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesMissingRequiredFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesMissingRequiredFieldTest.xml index fe0e46369c5e6..a4c8f5e8cff6c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesMissingRequiredFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesMissingRequiredFieldTest.xml @@ -39,7 +39,7 @@ <!-- Search and select products --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="searchProductGridByKeyword2" stepKey="searchByKeyword"> + <actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword"> <argument name="keyword" value="api-simple-product"/> </actionGroup> <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox1"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest.xml index 18d4b9e341cc6..c9840fe455f84 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductAttributesStoreViewScopeTest.xml @@ -38,10 +38,10 @@ <!-- Search and select products --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="searchProductGridByKeyword2" stepKey="searchByKeyword"> + <actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword"> <argument name="keyword" value="api-simple-product"/> </actionGroup> - <actionGroup ref="sortProductsByIdDescending" stepKey="sortProductsByIdDescending"/> + <actionGroup ref="SortProductsByIdDescendingActionGroup" stepKey="sortProductsByIdDescending"/> <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox1"/> <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('2')}}" stepKey="clickCheckbox2"/> <!-- Mass update attributes --> @@ -114,10 +114,10 @@ <!-- Search and select products --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="searchProductGridByKeyword2" stepKey="searchByKeyword"> + <actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword"> <argument name="keyword" value="api-simple-product"/> </actionGroup> - <actionGroup ref="sortProductsByIdDescending" stepKey="sortProductsByIdDescending"/> + <actionGroup ref="SortProductsByIdDescendingActionGroup" stepKey="sortProductsByIdDescending"/> <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox1"/> <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('2')}}" stepKey="clickCheckbox2"/> <!-- Mass update attributes --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductStatusStoreViewScopeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductStatusStoreViewScopeTest.xml index 02e8157282dee..21c6c56adfd96 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductStatusStoreViewScopeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMassUpdateProductStatusStoreViewScopeTest.xml @@ -55,13 +55,13 @@ <see userInput="You saved the store view." stepKey="seeSavedMessage" /> <!--Create a Simple Product 1 --> - <actionGroup ref="createSimpleProductAndAddToWebsite" stepKey="createSimpleProduct1"> + <actionGroup ref="CreateSimpleProductAndAddToWebsiteActionGroup" stepKey="createSimpleProduct1"> <argument name="product" value="simpleProductForMassUpdate"/> <argument name="website" value="Second Website"/> </actionGroup> <!--Create a Simple Product 2 --> - <actionGroup ref="createSimpleProductAndAddToWebsite" stepKey="createSimpleProduct2"> + <actionGroup ref="CreateSimpleProductAndAddToWebsiteActionGroup" stepKey="createSimpleProduct2"> <argument name="product" value="simpleProductForMassUpdate2"/> <argument name="website" value="Second Website"/> </actionGroup> @@ -86,10 +86,10 @@ <!-- Search and select products --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="searchProductGridByKeyword2" stepKey="searchByKeyword"> + <actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword"> <argument name="keyword" value="{{simpleProductForMassUpdate.keyword}}"/> </actionGroup> - <actionGroup ref="sortProductsByIdDescending" stepKey="sortProductsByIdDescending"/> + <actionGroup ref="SortProductsByIdDescendingActionGroup" stepKey="sortProductsByIdDescending"/> <!-- Filter to Second Store View --> <actionGroup ref="AdminFilterStoreViewActionGroup" stepKey="filterStoreView" > @@ -205,13 +205,13 @@ <see userInput="You saved the store view." stepKey="seeSavedMessage" /> <!--Create a Simple Product 1 --> - <actionGroup ref="createSimpleProductAndAddToWebsite" stepKey="createSimpleProduct1"> + <actionGroup ref="CreateSimpleProductAndAddToWebsiteActionGroup" stepKey="createSimpleProduct1"> <argument name="product" value="simpleProductForMassUpdate"/> <argument name="website" value="Second Website"/> </actionGroup> <!--Create a Simple Product 2 --> - <actionGroup ref="createSimpleProductAndAddToWebsite" stepKey="createSimpleProduct2"> + <actionGroup ref="CreateSimpleProductAndAddToWebsiteActionGroup" stepKey="createSimpleProduct2"> <argument name="product" value="simpleProductForMassUpdate2"/> <argument name="website" value="Second Website"/> </actionGroup> @@ -236,10 +236,10 @@ <!-- Search and select products --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="searchProductGridByKeyword2" stepKey="searchByKeyword"> + <actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword"> <argument name="keyword" value="{{simpleProductForMassUpdate.keyword}}"/> </actionGroup> - <actionGroup ref="sortProductsByIdDescending" stepKey="sortProductsByIdDescending"/> + <actionGroup ref="SortProductsByIdDescendingActionGroup" stepKey="sortProductsByIdDescending"/> <!-- Filter to Second Store View --> <actionGroup ref="AdminFilterStoreViewActionGroup" stepKey="filterStoreView" > @@ -299,4 +299,4 @@ <actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResultDefault2"/> <see userInput="We can't find any items matching these search criteria." selector="{{StorefrontCatalogSearchAdvancedResultMainSection.message}}" stepKey="seeInDefault2"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml index b613068893b0e..271d78ab9cdb0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml @@ -25,7 +25,7 @@ <after> <deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="createDefaultCategory" stepKey="deleteDefaultCategory"/> - <actionGroup ref="DeleteCategory" stepKey="deleteCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml index 9831f73e07877..6c403fc7714eb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml @@ -25,7 +25,7 @@ </before> <after> <deleteData createDataKey="createDefaultCategory" stepKey="deleteDefaultCategory"/> - <actionGroup ref="DeleteCategory" stepKey="SecondLevelSubCat"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="SecondLevelSubCat"> <argument name="categoryEntity" value="SecondLevelSubCat"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml index da985fc2ce34d..7e6e79cd08c26 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml @@ -94,7 +94,7 @@ <waitForPageLoad stepKey="waitForProductPage"/> <!-- Click on <product1>: Product page opens--> - <actionGroup ref="filterProductGridByName" stepKey="filterProduct"> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterProduct"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> <click selector="{{AdminProductGridSection.productGridNameProduct($$simpleProduct.name$$)}}" stepKey="clickProduct1"/> @@ -159,16 +159,16 @@ <see userInput="$$createAnchoredCategory1.name$$" selector="{{StorefrontCategoryMainSection.CategoryTitle}}" stepKey="seeCategory1Name"/> <see userInput="We can't find products matching the selection." stepKey="seeEmptyNotice"/> <dontSee userInput="$$simpleProduct.name$$" selector="{{StorefrontCategoryMainSection.productName}}" stepKey="dontseeProduct"/> - + <!-- Log in to the backend: Admin user is logged in--> <actionGroup ref="LoginAsAdmin" stepKey="LoginAdmin"/> - + <!-- Navigate to the Catalog > Products: Navigate to the Catalog>Products --> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="amOnProductPage"/> <waitForPageLoad stepKey="waitForProductsPage"/> <!-- Click on <product1> --> - <actionGroup ref="filterAndSelectProduct" stepKey="openSimpleProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openSimpleProduct"> <argument name="productSku" value="$$simpleProduct.sku$$"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml index bcd4ca8531203..5dd8b2e430941 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml @@ -97,7 +97,7 @@ <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> <!--Select SimpleProduct --> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <click stepKey="openFirstProduct" selector="{{AdminProductGridSection.productRowBySku($$createSimpleProduct.sku$$)}}"/> @@ -106,7 +106,7 @@ <!--Add SimpleProduct1 and ConfigProduct as Up sell products--> <click stepKey="clickOnRelatedProducts" selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedProductsHeader}}"/> <click stepKey="clickOnAddUpSellProducts" selector="{{AdminProductFormRelatedUpSellCrossSellSection.addUpSellProduct}}"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProduct"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProduct"> <argument name="sku" value="$$createSimpleProduct1.sku$$"/> </actionGroup> <waitForPageLoad stepKey="waitForTheProductToLoad"/> @@ -114,7 +114,7 @@ <click stepKey="addSelectedProduct" selector="{{AdminAddRelatedProductsModalSection.AddUpSellProductsButton}}"/> <waitForPageLoad stepKey="waitForProductToBeAdded"/> <click stepKey="clickOnAddUpSellProductsButton" selector="{{AdminProductFormRelatedUpSellCrossSellSection.addUpSellProduct}}"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterConfigurableProduct"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterConfigurableProduct"> <argument name="sku" value="$$createConfigProduct.sku$$"/> </actionGroup> <waitForPageLoad stepKey="waitForTheConfigProductToLoad"/> @@ -131,7 +131,7 @@ <waitForPageLoad stepKey="waitForProductsToBeLoaded"/> <!--Select Configurable Product--> - <actionGroup ref="filterProductGridBySku" stepKey="findConfigProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findConfigProduct"> <argument name="product" value="$$createConfigProduct$$"/> </actionGroup> <click stepKey="openConfigProduct" selector="{{AdminProductGridSection.productRowBySku($$createConfigProduct.sku$$)}}"/> @@ -140,7 +140,7 @@ <!--Add SimpleProduct1 as Up Sell Product--> <click stepKey="clickOnRelatedProductsHeader" selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedProductsHeader}}"/> <click stepKey="clickOnAddUpSellProductsButton1" selector="{{AdminProductFormRelatedUpSellCrossSellSection.addUpSellProduct}}"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterSimpleProduct2"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterSimpleProduct2"> <argument name="sku" value="$$createSimpleProduct1.sku$$"/> </actionGroup> <waitForPageLoad stepKey="waitForTheSimpleProduct2ToBeLoaded"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCategoryIndexerInUpdateOnScheduleModeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCategoryIndexerInUpdateOnScheduleModeTest.xml index 41d3ca3020c98..2283a0e4d6158 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCategoryIndexerInUpdateOnScheduleModeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCategoryIndexerInUpdateOnScheduleModeTest.xml @@ -148,7 +148,7 @@ <waitForPageLoad stepKey="waitForProductC1PageLoad"/> <click selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="clickOffEnableToggleAgain"/> <!-- Saved successfully --> - <actionGroup ref="saveProductForm" stepKey="saveProductC1"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductC1"/> <!-- 12. Open category B on Storefront --> <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="toCategoryBStorefront"> @@ -205,7 +205,7 @@ <click selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="clickOnEnableToggleAgain"/> <!-- Saved successfully --> - <actionGroup ref="saveProductForm" stepKey="saveChangedProductC1"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveChangedProductC1"/> <!-- 17.12. Open category B on Storefront --> <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryB"> @@ -264,7 +264,7 @@ stepKey="changeVisibility"/> <!-- Saved successfully --> - <actionGroup ref="saveProductForm" stepKey="productC1Saved"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="productC1Saved"/> <!-- 18.12. Open category B on Storefront --> <actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="goPageCategoryB"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKey.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKey.xml index bae81513de632..df09768139533 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKey.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCustomURLKeyPreservedWhenAssignedToCategoryWithoutCustomURLKey.xml @@ -61,20 +61,20 @@ <conditionalClick selector="{{AdminProductSEOSection.sectionHeader}}" dependentSelector="{{AdminProductSEOSection.urlKeyInput}}" visible="false" stepKey="openSeoSection"/> <uncheckOption selector="{{AdminProductSEOSection.useDefaultUrl}}" stepKey="uncheckUseDefaultUrlKey"/> <fillField userInput="U2" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> - <actionGroup ref="goToAdminCategoryPageById" stepKey="openCategory"> + <actionGroup ref="GoToAdminCategoryPageByIdActionGroup" stepKey="openCategory"> <argument name="id" value="$createCategory.id$"/> </actionGroup> - <actionGroup ref="AdminCategoryAssignProduct" stepKey="assignSimpleProductFirst"> + <actionGroup ref="AdminCategoryAssignProductActionGroup" stepKey="assignSimpleProductFirst"> <argument name="productSku" value="$createSimpleProductFirst.sku$"/> </actionGroup> - <actionGroup ref="AdminCategoryAssignProduct" stepKey="assignSimpleProductSecond"> + <actionGroup ref="AdminCategoryAssignProductActionGroup" stepKey="assignSimpleProductSecond"> <argument name="productSku" value="$createSimpleProductSecond.sku$"/> </actionGroup> - <actionGroup ref="saveCategoryForm" stepKey="saveCategory"/> + <actionGroup ref="SaveCategoryFormActionGroup" stepKey="saveCategory"/> <executeJS function="return '$createCategory.name$'.toLowerCase();" stepKey="categoryNameLower" /> <executeJS function="return '$createSimpleProductFirst.name$'.toLowerCase();" stepKey="simpleProductFirstNameLower" /> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByCustomAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByCustomAttributeTest.xml index 72c270aad585c..f4f86f3a65a12 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByCustomAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByCustomAttributeTest.xml @@ -22,7 +22,7 @@ <before> <!--Login as admin and delete all products --> <actionGroup ref="LoginAsAdmin" stepKey="login"/> - <actionGroup ref="deleteAllProductsUsingProductGrid" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> <!--Create dropdown product attribute--> <createData entity="productDropDownAttribute" stepKey="createDropdownAttribute"/> <!--Create attribute options--> @@ -59,7 +59,7 @@ <argument name="product" value="$$createFirstProduct$$"/> </actionGroup> <selectOption selector="{{AdminProductFormSection.customSelectField($$createDropdownAttribute.attribute[attribute_code]$$)}}" userInput="$$createFirstProductAttributeOption.option[store_labels][0][label]$$" stepKey="setFirstAttributeValue"/> - <actionGroup ref="saveProductForm" stepKey="saveFirstProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveFirstProduct"/> <!--Update second product--> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSecondProduct"> <argument name="product" value="$$createSecondProduct$$"/> @@ -68,7 +68,7 @@ <argument name="product" value="$$createSecondProduct$$"/> </actionGroup> <selectOption selector="{{AdminProductFormSection.customSelectField($$createDropdownAttribute.attribute[attribute_code]$$)}}" userInput="$$createSecondProductAttributeOption.option[store_labels][0][label]$$" stepKey="setSecondAttributeValue"/> - <actionGroup ref="saveProductForm" stepKey="saveSecondProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSecondProduct"/> <!--Update third product--> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForThirdProduct"> <argument name="product" value="$$createThirdProduct$$"/> @@ -77,7 +77,7 @@ <argument name="product" value="$$createThirdProduct$$"/> </actionGroup> <selectOption selector="{{AdminProductFormSection.customSelectField($$createDropdownAttribute.attribute[attribute_code]$$)}}" userInput="$$createThirdProductAttributeOption.option[store_labels][0][label]$$" stepKey="setThirdAttributeValue"/> - <actionGroup ref="saveProductForm" stepKey="saveThirdProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveThirdProduct"/> </before> <after> <!--Delete products--> @@ -88,7 +88,7 @@ <deleteData createDataKey="createDropdownAttribute" stepKey="deleteDropdownAttribute"/> <!--Delete category--> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <actionGroup ref="NavigateToAndResetProductGridToDefaultView" stepKey="NavigateToAndResetProductGridToDefaultViewAfterTest"/> + <actionGroup ref="NavigateToAndResetProductGridToDefaultViewActionGroup" stepKey="NavigateToAndResetProductGridToDefaultViewAfterTest"/> <actionGroup ref="logout" stepKey="logout"/> </after> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByDateAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByDateAttributeTest.xml index 2884cb26cf813..df2b525a56086 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByDateAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductGridFilteringByDateAttributeTest.xml @@ -45,7 +45,7 @@ <click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="closeColumnsDropdown1"/> <seeElement selector="{{AdminProductGridSection.columnHeader('Set Product as New from Date')}}" stepKey="seeNewFromDateColumn"/> <waitForPageLoad stepKey="waitforFiltersToApply"/> - <actionGroup ref="filterProductGridBySetNewFromDate" stepKey="filterProductGridToCheckSetAsNewColumn"/> + <actionGroup ref="FilterProductGridBySetNewFromDateActionGroup" stepKey="filterProductGridToCheckSetAsNewColumn"/> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnFirstRowProductGrid"/> <waitForPageLoad stepKey="waitForProductEditPageToLoad"/> <actionGroup ref="AdminFormSaveAndClose" stepKey="saveAndCloseProductForm"/> @@ -57,4 +57,4 @@ <click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="closeColumnsDropdown2"/> <click selector="{{AdminProductGridFilterSection.clearAll}}" stepKey="clearGridFilters"/> </test> - </tests> \ No newline at end of file + </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml index 8149bc34087fb..44829f0c06b84 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductImageAssignmentForMultipleStoresTest.xml @@ -73,8 +73,8 @@ </actionGroup> <!-- Upload Image English --> - <actionGroup ref="addProductImage" stepKey="uploadImageEnglish"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct1"/> + <actionGroup ref="AddProductImageActionGroup" stepKey="uploadImageEnglish"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1"/> <!-- Switch to the French store view --> <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchStoreViewFrenchProduct"> @@ -82,19 +82,19 @@ </actionGroup> <!-- Upload Image French --> - <actionGroup ref="addProductImage" stepKey="uploadImageFrench"> + <actionGroup ref="AddProductImageActionGroup" stepKey="uploadImageFrench"> <argument name="image" value="Magento3"/> </actionGroup> <actionGroup ref="AdminAssignImageRolesActionGroup" stepKey="assignImageRole1"> <argument name="image" value="Magento3"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct2"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2"/> <!-- Switch to the All store view --> <actionGroup ref="AdminSwitchToAllStoreViewActionGroup" stepKey="switchAllStoreViewProduct"/> <!-- Upload Image All Store View --> - <actionGroup ref="addProductImage" stepKey="uploadImageAllStoreView"> + <actionGroup ref="AddProductImageActionGroup" stepKey="uploadImageAllStoreView"> <argument name="image" value="TestImageNew"/> </actionGroup> <actionGroup ref="AdminAssignImageRolesActionGroup" stepKey="assignImageRole"> @@ -105,7 +105,7 @@ <click selector="{{AdminProductContentSection.sectionHeader}}" stepKey="openDescriptionDropDown"/> <fillField selector="{{AdminProductContentSection.descriptionTextArea}}" userInput="This is the long description" stepKey="fillLongDescription"/> <fillField selector="{{AdminProductContentSection.shortDescriptionTextArea}}" userInput="This is the short description" stepKey="fillShortDescription"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Go to Product Page and see Default Store View--> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="goToDefaultStorefrontProductPage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml index de065d2d930cb..40880291330e7 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml @@ -45,11 +45,11 @@ <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveDownloadableProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveDownloadableProductForm"/> <!--Assert downloadable product on Admin product page grid--> <comment userInput="Assert configurable product in Admin product page grid" stepKey="commentAssertDownloadableProductOnAdmin"/> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGridBySku"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGridBySku"> <argument name="sku" value="$$createProduct.sku$$"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="$$createProduct.name$$" stepKey="seeDownloadableProductNameInGrid"/> @@ -80,11 +80,11 @@ <waitForPageLoad stepKey="waitForProductPageLoad"/> <actionGroup ref="AdminAddDownloadableLinkInformationActionGroup" stepKey="addDownloadableLinkInformation"/> <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has weight" stepKey="selectWeightForProduct"/> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <!--Assert simple product on Admin product page grid--> <comment userInput="Assert simple product in Admin product page grid" stepKey="commentAssertProductOnAdmin"/> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogSimpleProductPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterSimpleProductGridBySku"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterSimpleProductGridBySku"> <argument name="sku" value="$$createProduct.sku$$"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="$$createProduct.name$$" stepKey="seeSimpleProductNameInGrid"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveCustomOptionsFromProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveCustomOptionsFromProductTest.xml index b5f212d1144be..71c1ccd4de9b5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveCustomOptionsFromProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveCustomOptionsFromProductTest.xml @@ -34,59 +34,59 @@ <!-- Edit Simple Product --> <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="goToProduct"/> <!-- See 3 options are present --> - <actionGroup ref="AdminAssertProductCustomOptionVisible" stepKey="assertCustomOptionsField"> + <actionGroup ref="AdminAssertProductCustomOptionVisibleActionGroup" stepKey="assertCustomOptionsField"> <argument name="option" value="ProductOptionField"/> </actionGroup> - <actionGroup ref="AdminAssertProductCustomOptionVisible" stepKey="assertCustomOptionsArea"> + <actionGroup ref="AdminAssertProductCustomOptionVisibleActionGroup" stepKey="assertCustomOptionsArea"> <argument name="option" value="ProductOptionArea"/> </actionGroup> - <actionGroup ref="AdminAssertProductCustomOptionVisible" stepKey="assertCustomOptionsFile"> + <actionGroup ref="AdminAssertProductCustomOptionVisibleActionGroup" stepKey="assertCustomOptionsFile"> <argument name="option" value="ProductOptionFile"/> </actionGroup> <!-- Click delete "Area" and "File" options --> - <actionGroup ref="AdminDeleteProductCustomOption" stepKey="deleteCustomOptionArea"> + <actionGroup ref="AdminDeleteProductCustomOptionActionGroup" stepKey="deleteCustomOptionArea"> <argument name="option" value="ProductOptionArea"/> </actionGroup> - <actionGroup ref="AdminDeleteProductCustomOption" stepKey="deleteCustomOptionFile"> + <actionGroup ref="AdminDeleteProductCustomOptionActionGroup" stepKey="deleteCustomOptionFile"> <argument name="option" value="ProductOptionFile"/> </actionGroup> - <actionGroup ref="AdminAssertProductCustomOptionVisible" stepKey="assertVisibleCustomOptionField"> + <actionGroup ref="AdminAssertProductCustomOptionVisibleActionGroup" stepKey="assertVisibleCustomOptionField"> <argument name="option" value="ProductOptionField"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- See only "Field option" left Also we shouldn't see any other options --> - <actionGroup ref="AdminAssertProductCustomOptionVisible" stepKey="assertVisibleSecondCustomOptionField"> + <actionGroup ref="AdminAssertProductCustomOptionVisibleActionGroup" stepKey="assertVisibleSecondCustomOptionField"> <argument name="option" value="ProductOptionField"/> </actionGroup> - <actionGroup ref="AdminAssertProductHasNoCustomOption" stepKey="assertNoCustomOptionsFile"> + <actionGroup ref="AdminAssertProductHasNoCustomOptionActionGroup" stepKey="assertNoCustomOptionsFile"> <argument name="option" value="ProductOptionFileSecond"/> </actionGroup> - <actionGroup ref="AdminAssertProductHasNoCustomOption" stepKey="assertNoCustomOptionsField"> + <actionGroup ref="AdminAssertProductHasNoCustomOptionActionGroup" stepKey="assertNoCustomOptionsField"> <argument name="option" value="ProductOptionFieldSecond"/> </actionGroup> <!-- Click Add option "File" --> - <actionGroup ref="AddProductCustomOptionFile" stepKey="createAddOptionFile"> + <actionGroup ref="AddProductCustomOptionFileActionGroup" stepKey="createAddOptionFile"> <argument name="option" value="ProductOptionFileSecond"/> </actionGroup> <!-- Click Add option "Field" --> - <actionGroup ref="AddProductCustomOptionField" stepKey="createCustomOptionField"> + <actionGroup ref="AddProductCustomOptionFieldActionGroup" stepKey="createCustomOptionField"> <argument name="option" value="ProductOptionFieldSecond"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProductWithNewlyAddedOptions"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductWithNewlyAddedOptions"/> <!-- See 3 options are present --> - <actionGroup ref="AdminAssertProductCustomOptionVisible" stepKey="assertPresentCustomOptionField"> + <actionGroup ref="AdminAssertProductCustomOptionVisibleActionGroup" stepKey="assertPresentCustomOptionField"> <argument name="option" value="ProductOptionField"/> </actionGroup> - <actionGroup ref="AdminAssertProductCustomOptionVisible" stepKey="assertPresenceOfFileOption"> + <actionGroup ref="AdminAssertProductCustomOptionVisibleActionGroup" stepKey="assertPresenceOfFileOption"> <argument name="option" value="ProductOptionFileSecond"/> </actionGroup> - <actionGroup ref="AdminAssertProductCustomOptionVisible" stepKey="assertPresenceOfFieldOption"> + <actionGroup ref="AdminAssertProductCustomOptionVisibleActionGroup" stepKey="assertPresenceOfFieldOption"> <argument name="option" value="ProductOptionFieldSecond"/> </actionGroup> <!-- Delete All options and See no more options present on the page --> - <actionGroup ref="AdminDeleteAllProductCustomOptions" stepKey="deleteAllCustomOptions"/> + <actionGroup ref="AdminDeleteAllProductCustomOptionsActionGroup" stepKey="deleteAllCustomOptions"/> <!-- Product successfully saved and it has no options --> - <actionGroup ref="saveProductForm" stepKey="saveProductWithoutCustomOptions"/> - <actionGroup ref="AdminAssertProductHasNoCustomOptions" stepKey="assertNoCustomOptions"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductWithoutCustomOptions"/> + <actionGroup ref="AdminAssertProductHasNoCustomOptionsActionGroup" stepKey="assertNoCustomOptions"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageSimpleProductTest.xml index 9760dc579b10b..3b750c2cdb21c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageSimpleProductTest.xml @@ -28,35 +28,35 @@ <!--Create product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateSimpleProduct"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateSimpleProduct"> <argument name="product" value="SimpleProduct3"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillSimpleProductMain"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillSimpleProductMain"> <argument name="product" value="SimpleProduct3"/> </actionGroup> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProductSimple"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProductSimple"> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> <!-- Remove image from product --> - <actionGroup ref="removeProductImage" stepKey="removeProductImage"/> + <actionGroup ref="RemoveProductImageActionGroup" stepKey="removeProductImage"/> - <actionGroup ref="saveProductForm" stepKey="saveProductFormAfterRemove"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductFormAfterRemove"/> <!-- Assert product image not in admin product form --> - <actionGroup ref="assertProductImageNotInAdminProductPage" stepKey="assertProductImageNotInAdminProductPage"/> + <actionGroup ref="AssertProductImageNotInAdminProductPageActionGroup" stepKey="assertProductImageNotInAdminProductPage"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPageAfterRemove"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPageAfterRemove"> <argument name="product" value="SimpleProduct3"/> </actionGroup> <!-- Assert product image not in storefront product page --> - <actionGroup ref="assertProductImageNotInStorefrontProductPage" stepKey="assertProductImageNotInStorefrontProductPage"> + <actionGroup ref="AssertProductImageNotInStorefrontProductPageActionGroup" stepKey="assertProductImageNotInStorefrontProductPage"> <argument name="product" value="SimpleProduct3"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageVirtualProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageVirtualProductTest.xml index a740b700c3026..6a68928be8c70 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageVirtualProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultImageVirtualProductTest.xml @@ -28,35 +28,35 @@ <!--Create product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductMain"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductMain"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Remove image from product --> - <actionGroup ref="removeProductImage" stepKey="removeProductImage"/> + <actionGroup ref="RemoveProductImageActionGroup" stepKey="removeProductImage"/> - <actionGroup ref="saveProductForm" stepKey="saveProductFormAfterRemove"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductFormAfterRemove"/> <!-- Assert product image not in admin product form --> - <actionGroup ref="assertProductImageNotInAdminProductPage" stepKey="assertProductImageNotInAdminProductPage"/> + <actionGroup ref="AssertProductImageNotInAdminProductPageActionGroup" stepKey="assertProductImageNotInAdminProductPage"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPageAfterRemove"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPageAfterRemove"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> <!-- Assert product image not in storefront product page --> - <actionGroup ref="assertProductImageNotInStorefrontProductPage" stepKey="assertProductImageNotInStorefrontProductPage"> + <actionGroup ref="AssertProductImageNotInStorefrontProductPageActionGroup" stepKey="assertProductImageNotInStorefrontProductPage"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml index 876eedb9347c7..8c80a2bf9a851 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml @@ -30,21 +30,21 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="adminProductIndexPageAdd"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> <actionGroup ref="EnableAdminAccountSharingActionGroup" stepKey="enableAdminAccountSharing"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="ApiSimpleProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillMainProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="ApiSimpleProduct"/> </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProductFormAfterRemove"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductFormAfterRemove"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="ApiSimpleProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoVirtualProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoVirtualProductTest.xml index 8b3b38d0ece31..8d89e0d9b535b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoVirtualProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoVirtualProductTest.xml @@ -21,13 +21,13 @@ <!-- Replacing steps in base AdminRemoveDefaultVideoSimpleProductTest --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillMainProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml index 8316f54c15a52..a4887d5b29796 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageAffectsAllScopesTest.xml @@ -73,26 +73,26 @@ <!--Create product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> <!--Open created product--> <click selector="{{AdminProductGridSection.productGridNameProduct($$product.name$$)}}" stepKey="createdProduct"/> <waitForPageLoad stepKey="waitForOpenedCreatedProduct"/> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addFirstImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addFirstImageForProduct"> <argument name="image" value="TestImageNew"/> </actionGroup> <!-- Add second image to product --> - <actionGroup ref="addProductImage" stepKey="addSecondImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addSecondImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> <!--"Product in Websites": select both Websites--> - <actionGroup ref="ProductSetWebsite" stepKey="ProductSetWebsite1"> + <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsite1"> <argument name="website" value="FirstWebSite"/> </actionGroup> - <actionGroup ref="ProductSetWebsite" stepKey="ProductSetWebsite2"> + <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsite2"> <argument name="website" value="SecondWebSite"/> </actionGroup> @@ -103,28 +103,28 @@ <waitForPageLoad stepKey="waitForCreatedProductOpened"/> <!--Delete Image 1--> - <actionGroup ref="removeProductImage" stepKey="removeProductImage"/> + <actionGroup ref="RemoveProductImageActionGroup" stepKey="removeProductImage"/> <!--Click "Save" in the upper right corner--> - <actionGroup ref="saveProductForm" stepKey="saveProductFormAfterRemove"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductFormAfterRemove"/> <!--Switch to "Store view 1"--> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="selectStoreView"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="selectStoreView"> <argument name="storeViewName" value="Store View"/> </actionGroup> <!-- Assert product first image not in admin product form --> - <actionGroup ref="assertProductImageNotInAdminProductPage" stepKey="assertProductImageNotInAdminProductPage"> + <actionGroup ref="AssertProductImageNotInAdminProductPageActionGroup" stepKey="assertProductImageNotInAdminProductPage"> <argument name="image" value="TestImageNew"/> </actionGroup> <!--Switch to "Store view 2"--> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="selectSecondStoreView"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="selectSecondStoreView"> <argument name="storeViewName" value="Second Store View"/> </actionGroup> <!-- Verify that Image 1 is deleted from the Second Store View list --> - <actionGroup ref="assertProductImageNotInAdminProductPage" stepKey="assertProductImageNotInSecondStoreViewPage"> + <actionGroup ref="AssertProductImageNotInAdminProductPageActionGroup" stepKey="assertProductImageNotInSecondStoreViewPage"> <argument name="image" value="TestImageNew"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageFromCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageFromCategoryTest.xml index fb33e18379982..ef276114b4de5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageFromCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveImageFromCategoryTest.xml @@ -22,30 +22,30 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="DeleteCategory" stepKey="DeleteCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="DeleteCategory"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Go to create a new category with image --> - <actionGroup ref="goToCreateCategoryPage" stepKey="goToCreateCategoryPage"/> - <actionGroup ref="fillCategoryForm" stepKey="fillCategoryForm"> + <actionGroup ref="GoToCreateCategoryPageActionGroup" stepKey="goToCreateCategoryPage"/> + <actionGroup ref="FillCategoryFormActionGroup" stepKey="fillCategoryForm"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> - <actionGroup ref="addCategoryImage" stepKey="addCategoryImage"/> - <actionGroup ref="saveCategoryForm" stepKey="saveCategoryForm"/> - <actionGroup ref="checkCategoryImageInAdmin" stepKey="checkCategoryImageInAdmin"/> + <actionGroup ref="AddCategoryImageActionGroup" stepKey="addCategoryImage"/> + <actionGroup ref="SaveCategoryFormActionGroup" stepKey="saveCategoryForm"/> + <actionGroup ref="CheckCategoryImageInAdminActionGroup" stepKey="checkCategoryImageInAdmin"/> <!-- Remove image from category --> - <actionGroup ref="removeCategoryImage" stepKey="removeCategoryImage"/> - <actionGroup ref="saveCategoryForm" stepKey="saveCategoryFormAfterRemove"/> + <actionGroup ref="RemoveCategoryImageActionGroup" stepKey="removeCategoryImage"/> + <actionGroup ref="SaveCategoryFormActionGroup" stepKey="saveCategoryFormAfterRemove"/> - <actionGroup ref="CheckCategoryOnStorefront" stepKey="CheckCategoryOnStorefront"> + <actionGroup ref="CheckCategoryOnStorefrontActionGroup" stepKey="CheckCategoryOnStorefront"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> <!-- Verify category with no image in storefront --> <dontSee selector="{{StorefrontCategoryMainSection.categoryImage}}" stepKey="dontSeeImage"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRestrictedUserAddCategoryFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRestrictedUserAddCategoryFromProductPageTest.xml index 7b5455951fb27..bb0f883e4d439 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRestrictedUserAddCategoryFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRestrictedUserAddCategoryFromProductPageTest.xml @@ -28,10 +28,10 @@ <after> <!--Delete created product--> <comment userInput="Delete created product" stepKey="commentDeleteProduct"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetFiltersIfExist"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetFiltersIfExist"/> <actionGroup ref="logout" stepKey="logoutOfUser"/> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!--Delete created data--> @@ -80,15 +80,15 @@ </actionGroup> <!--Go to create product page--> <comment userInput="Go to create product page" stepKey="commentGoCreateProductPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"/> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"/> <dontSeeElement selector="{{AdminProductFormSection.newCategoryButton}}" stepKey="dontSeeNewCategoryButton"/> <!--Fill product data and assign to category--> <comment userInput="Fill product data and assign to category" stepKey="commentFillProductData"/> - <actionGroup ref="fillMainProductForm" stepKey="fillMainProductForm"/> - <actionGroup ref="SetCategoryByName" stepKey="addCategoryToProduct"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillMainProductForm"/> + <actionGroup ref="SetCategoryByNameActionGroup" stepKey="addCategoryToProduct"> <argument name="categoryName" value="$$createCategory.name$$"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Assert that category exist in field--> <comment userInput="Assert that category exist in field" stepKey="commentAssertion"/> <grabTextFrom selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="grabCategoryName"/> @@ -98,10 +98,10 @@ </assertContains> <!--Remove the category from the product and assert that it removed--> <comment userInput="Remove the category from the product and assert that it removed" stepKey="assertCategoryRemoved"/> - <actionGroup ref="removeCategoryFromProduct" stepKey="removeCategoryFromProduct"> + <actionGroup ref="RemoveCategoryFromProductActionGroup" stepKey="removeCategoryFromProduct"> <argument name="categoryName" value="$$createCategory.name$$"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProductAfterRemovingCategory"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductAfterRemovingCategory"/> <grabTextFrom selector="{{AdminProductFormSection.categoriesDropdown}}" stepKey="grabCategoryFieldContent"/> <assertNotContains stepKey="assertThatCategoryRemoved"> <expectedResult type="variable">$$createCategory.name$$</expectedResult> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml index 061c30b224828..54224c73135b6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml @@ -49,7 +49,7 @@ <!-- 1. Go to product page in admin panel to edit --> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPageToAssociateToSecondWebsite"/> - <actionGroup ref="filterProductGridByName2" stepKey="filterProductInGrid"> + <actionGroup ref="FilterProductGridByName2ActionGroup" stepKey="filterProductInGrid"> <argument name="name" value="$$createSimpleProduct.name$$"/> </actionGroup> @@ -59,10 +59,10 @@ <argument name="websiteToUnassign" value="_defaultWebsite"/> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> - <actionGroup ref="AssertProductIsAssignedToWebsite" stepKey="seeCustomWebsiteIsChecked"> + <actionGroup ref="AssertProductIsAssignedToWebsiteActionGroup" stepKey="seeCustomWebsiteIsChecked"> <argument name="website" value="$createCustomWebsite.website[name]$"/> </actionGroup> - <actionGroup ref="AssertProductIsNotAssignedToWebsite" stepKey="seeMainWebsiteIsNotChecked"> + <actionGroup ref="AssertProductIsNotAssignedToWebsiteActionGroup" stepKey="seeMainWebsiteIsNotChecked"> <argument name="website" value="{{_defaultWebsite.name}}"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest.xml index df50edd20410a..ff8240655ca03 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductImagesTest.xml @@ -40,11 +40,11 @@ <!-- Go to the first product edit page --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/> <waitForPageLoad stepKey="wait1"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku"> <argument name="product" value="$$firstProduct$$"/> </actionGroup> - <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openProducForEditByClickingRow1Column2InProductGrid"/> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProducForEditByClickingRow1Column2InProductGrid"/> <!-- Set url key --> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> @@ -126,11 +126,11 @@ <!-- Go to the second product edit page --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex2"/> <waitForPageLoad stepKey="wait2"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid2"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku2"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid2"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku2"> <argument name="product" value="$$secondProduct$$"/> </actionGroup> - <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openProducForEditByClickingRow1Column2InProductGrid2"/> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProducForEditByClickingRow1Column2InProductGrid2"/> <!-- Upload an image --> <click selector="{{AdminProductImagesSection.productImagesToggle}}" stepKey="expandImages2"/> @@ -150,8 +150,8 @@ <!-- Go to the admin grid and see the uploaded image --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex3"/> <waitForPageLoad stepKey="wait3"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid3"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku3"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid3"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku3"> <argument name="product" value="$$secondProduct$$"/> </actionGroup> <seeElement selector="img.admin__control-thumbnail[src*='/large']" stepKey="seeImgInGrid"/> @@ -194,11 +194,11 @@ <!-- Go to the product edit page --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/> <waitForPageLoad stepKey="wait1"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku"> <argument name="product" value="$$product$$"/> </actionGroup> - <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openProduct"/> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProduct"/> <!-- Set url key --> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> @@ -259,8 +259,8 @@ <!-- Go to the admin grid and see the Thumbnail image --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex2"/> <waitForPageLoad stepKey="wait2"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid2"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku2"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid2"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku2"> <argument name="product" value="$$product$$"/> </actionGroup> <seeElement selector="{{AdminProductGridSection.productThumbnailBySrc('/adobe-thumb')}}" stepKey="seeBaseInGrid"/> @@ -268,11 +268,11 @@ <!-- Go to the product edit page again --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex3"/> <waitForPageLoad stepKey="wait5"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid3"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku3"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid3"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku3"> <argument name="product" value="$$product$$"/> </actionGroup> - <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openProduct3"/> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProduct3"/> <click selector="{{AdminProductImagesSection.productImagesToggle}}" stepKey="expandImages2"/> <!-- Remove all images --> @@ -284,8 +284,8 @@ <!-- Check admin grid for placeholder --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex4"/> <waitForPageLoad stepKey="wait6"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid4"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku4"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid4"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku4"> <argument name="product" value="$$product$$"/> </actionGroup> <dontSeeElement selector="{{AdminProductGridSection.productThumbnailBySrc('/adobe-thumb')}}" stepKey="dontSeeBaseInGrid"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml index f5e5911352c86..b7e14c336ec5f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleProductSetEditContentTest.xml @@ -26,7 +26,7 @@ </before> <after> <!-- Delete simple product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> <!--Admin Logout--> @@ -36,10 +36,10 @@ <!-- Create product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductForm"> <argument name="product" value="SimpleProduct"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml index 4803c1be6c936..0c0b8751a732e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml @@ -30,7 +30,7 @@ </before> <after> <!-- Delete simple product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="SimpleProduct3"/> </actionGroup> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> @@ -46,15 +46,15 @@ <!--Create product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="SimpleProduct3"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductForm"> <argument name="product" value="SimpleProduct3"/> </actionGroup> <!--Add related product--> - <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct0"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct0"> <argument name="sku" value="$$simpleProduct0.sku$$"/> </actionGroup> @@ -63,7 +63,7 @@ <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown"/> <!--Add another related product--> - <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct1"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct1"> <argument name="sku" value="$$simpleProduct1.sku$$"/> </actionGroup> @@ -80,19 +80,19 @@ <see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct1.sku$$" stepKey="seeRelatedProduct"/> <!--See more related products in admin--> - <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct2"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct2"> <argument name="sku" value="$$simpleProduct2.sku$$"/> </actionGroup> - <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct3"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct3"> <argument name="sku" value="$$simpleProduct3.sku$$"/> </actionGroup> - <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct4"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct4"> <argument name="sku" value="$$simpleProduct4.sku$$"/> </actionGroup> - <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct5"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct5"> <argument name="sku" value="$$simpleProduct5.sku$$"/> </actionGroup> - <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct6"> + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addRelatedProduct6"> <argument name="sku" value="$$simpleProduct6.sku$$"/> </actionGroup> <scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" stepKey="scrollTo2"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml index 5b6207e135796..e385ef70cf4a0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSortingByWebsitesTest.xml @@ -40,8 +40,8 @@ <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteTestWebsite"> <argument name="websiteName" value="{{customWebsite.name}}"/> </actionGroup> - <actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="GoToProductCatalogPageActionGroup" stepKey="goToProductCatalogPage"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> <actionGroup ref="ResetWebUrlOptions" stepKey="resetUrlOption"/> <magentoCLI command="indexer:reindex" stepKey="reindex"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUnassignProductAttributeFromAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUnassignProductAttributeFromAttributeSetTest.xml index bcc8636c65b1e..1c9cdad681d98 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUnassignProductAttributeFromAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUnassignProductAttributeFromAttributeSetTest.xml @@ -40,7 +40,7 @@ <!-- Assert attribute presence in storefront product additional information --> <amOnPage url="/$$product.custom_attributes[url_key]$$.html" stepKey="onProductPage1"/> <waitForPageLoad stepKey="wait1"/> - <actionGroup ref="checkAttributeInMoreInformationTab" stepKey="checkAttributeInMoreInformationTab"> + <actionGroup ref="CheckAttributeInMoreInformationTabActionGroup" stepKey="checkAttributeInMoreInformationTab"> <argument name="attributeLabel" value="$$attribute.attribute[frontend_labels][0][label]$$"/> <argument name="attributeValue" value="$$option2.option[store_labels][0][label]$$"/> </actionGroup> @@ -49,14 +49,14 @@ <!-- Assert created attribute in a group --> <see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/> <!-- Unassign attribute from group --> - <actionGroup ref="UnassignAttributeFromGroup" stepKey="UnassignAttributeFromGroup"> + <actionGroup ref="UnassignAttributeFromGroupActionGroup" stepKey="UnassignAttributeFromGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="$$attribute.attribute_code$$"/> </actionGroup> <!-- Assert attribute in unassigned section --> <see userInput="$$attribute.attribute_code$$" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassigned"/> <!-- Save attribute set --> - <actionGroup ref="SaveAttributeSet" stepKey="SaveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="SaveAttributeSet"/> <!-- Clear cache --> <actionGroup ref="ClearPageCacheActionGroup" stepKey="clearPageCacheActionGroup"/> <!-- Go to create new product page --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryStoreUrlKeyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryStoreUrlKeyTest.xml index 0f63a72844452..01eba2976c3d6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryStoreUrlKeyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryStoreUrlKeyTest.xml @@ -19,7 +19,7 @@ <group value="category"/> </annotations> <after> - <actionGroup ref="DeleteCategory" stepKey="deleteCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"> <argument name="categoryEntity" value="_defaultCategory"/> </actionGroup> <actionGroup ref="logout" stepKey="adminLogout"/> @@ -29,12 +29,12 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPage"/> <waitForPageLoad stepKey="waitForPageLoad1"/> - <actionGroup ref="CreateCategory" stepKey="createCategory"> + <actionGroup ref="CreateCategoryActionGroup" stepKey="createCategory"> <argument name="categoryEntity" value="_defaultCategory"/> </actionGroup> <!--Switch to "Default Store View" scope--> - <actionGroup ref="switchCategoryStoreView" stepKey="SwitchStoreView"> + <actionGroup ref="SwitchCategoryStoreViewActionGroup" stepKey="SwitchStoreView"> <argument name="Store" value="_defaultStore.name"/> <argument name="CatName" value="_defaultCategory.name"/> </actionGroup> @@ -58,7 +58,7 @@ <!-- Update SEO key to original, uncheck "Create Redirect", confirm in frontend, delete category --> <!--Switch to "Default Store View" scope--> - <actionGroup ref="switchCategoryStoreView" stepKey="SwitchStoreView2"> + <actionGroup ref="SwitchCategoryStoreViewActionGroup" stepKey="SwitchStoreView2"> <argument name="Store" value="_defaultStore.name"/> <argument name="CatName" value="_defaultCategory.name"/> </actionGroup> @@ -74,4 +74,4 @@ <seeInTitle userInput="{{_defaultCategory.name}}" stepKey="seeCategoryNameInTitle2"/> <seeInCurrentUrl stepKey="verifyUrlKeyAfterOriginalSeoKey" url="{{_defaultCategory.name_lwr}}.html"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml index 80f0c8ad10ede..57499c1332020 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml @@ -32,7 +32,7 @@ <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{defaultSimpleProduct.sku}}"/> </actionGroup> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView"> @@ -44,7 +44,7 @@ <!-- Search default simple product in grid --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml index f698b3d89ffe9..630e47250f11f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml @@ -32,7 +32,7 @@ <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{defaultSimpleProduct.sku}}"/> </actionGroup> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView"> @@ -44,7 +44,7 @@ <!-- Search default simple product in grid --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml index 10ff1151cd9b3..a848eb3d11e61 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml @@ -33,7 +33,7 @@ <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{simpleProductTierPrice300InStock.sku}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -42,7 +42,7 @@ <!-- Search default simple product in the grid --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml index 6e8f1ba6f12a6..ff3f56b566b38 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml @@ -27,7 +27,7 @@ </before> <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{simpleProductDisabled.sku}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -36,7 +36,7 @@ <!-- Search default simple product in the grid page --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml index afb8b40a6dbd4..09ddc18aff4bd 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml @@ -30,7 +30,7 @@ <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{simpleProductEnabledFlat.sku}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -40,7 +40,7 @@ <!-- Search default simple product in the grid page --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml index 2436fc0fc7f12..94aec4cc95d1d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml @@ -29,7 +29,7 @@ <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{simpleProductNotVisibleIndividually.sku}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -38,7 +38,7 @@ <!-- Search default simple product in the grid page --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml index 3433a09117322..fa3317aa815d9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml @@ -27,7 +27,7 @@ </before> <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -36,7 +36,7 @@ <!--Search default simple product in the grid page --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml index 82395e5d6e0eb..95b74f4d38b3f 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml @@ -29,7 +29,7 @@ <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{simpleProductRegularPrice245InStock.sku}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -38,7 +38,7 @@ <!-- Search default simple product in the grid page --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml index 4817b3497c97e..af190890ac351 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml @@ -29,7 +29,7 @@ <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{simpleProductRegularPrice32501InStock.sku}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -38,7 +38,7 @@ <!-- Search default simple product in the grid --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml index 214f9b0273b6a..626c3d00a5caf 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml @@ -29,7 +29,7 @@ <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{simpleProductRegularPrice325InStock.sku}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -38,7 +38,7 @@ <!-- Search default simple product in the grid --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml index b145328890a91..13782da076f69 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml @@ -29,7 +29,7 @@ <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{simpleProductRegularPriceCustomOptions.sku}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -38,7 +38,7 @@ <!-- Search default simple product in the grid --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml index 27c7e77a94ad1..285ceb3c4d722 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml @@ -29,7 +29,7 @@ <after> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{simpleProductRegularPrice32503OutOfStock.sku}}"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -38,7 +38,7 @@ <!-- Search default simple product in the grid --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="OpenProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGrid"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGrid"> <argument name="sku" value="$$initialSimpleProduct.sku$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml index 9fa0e155a4fe7..0e9b9431dcfa6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml @@ -28,7 +28,7 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteVirtualProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteVirtualProduct"> <argument name="product" value="updateVirtualProductRegularPrice"/> </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryAndSearchTest.xml index e0e8360850983..10347584b4cda 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryAndSearchTest.xml @@ -28,7 +28,7 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteVirtualProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteVirtualProduct"> <argument name="product" value="updateVirtualProductTierPriceInStock"/> </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml index 677cc4c65ce88..0edc487e71edf 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml @@ -28,7 +28,7 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteVirtualProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteVirtualProduct"> <argument name="product" value="updateVirtualProductWithTierPriceInStock"/> </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml index f0148f3d384c1..e513d007e6a09 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml @@ -28,7 +28,7 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteVirtualProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteVirtualProduct"> <argument name="product" value="updateVirtualTierPriceOutOfStock"/> </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVerifyProductOrderTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVerifyProductOrderTest.xml index a81c26b6e6eaf..b61be7fd95a58 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVerifyProductOrderTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVerifyProductOrderTest.xml @@ -25,7 +25,7 @@ <after> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/> + <actionGroup ref="GoToProductCatalogPageActionGroup" stepKey="goToProductCatalogPage"/> <actionGroup ref="VerifyProductTypeOrder" stepKey="verifyProductTypeOrder"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualProductSetEditContentTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualProductSetEditContentTest.xml index c9932de808006..1e7b7cc14f9cc 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualProductSetEditContentTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualProductSetEditContentTest.xml @@ -21,16 +21,16 @@ </annotations> <after> <!-- Delete virtual product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> </after> <!-- Create product --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductForm"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml index e630545fff8fb..a8d8face1a1e6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml @@ -21,16 +21,16 @@ <before></before> <after> <!-- Delete virtual product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> </after> <!-- Create product --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductForm"> <argument name="product" value="defaultVirtualProduct"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest.xml index d8fa20c7cc469..3125ba3decce6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest.xml @@ -20,7 +20,7 @@ </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="deleteAllProductsUsingProductGrid" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> <createData entity="ApiProductWithDescription" stepKey="product"/> </before> <after> @@ -91,7 +91,7 @@ </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="deleteAllProductsUsingProductGrid" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> <createData entity="ApiProductWithDescription" stepKey="product"/> <getData entity="GetProduct" stepKey="arg1"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml index cee40241185b4..7cb49c18ec6e9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml @@ -61,10 +61,10 @@ <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct1"> <argument name="product" value="$$product1$$"/> </actionGroup> - <actionGroup ref="ProductSetWebsite" stepKey="ProductSetWebsite"> + <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsite"> <argument name="website" value="secondWebsite"/> </actionGroup> - <actionGroup ref="ProductSetAdvancedPricing" stepKey="ProductSetAdvancedPricing1"> + <actionGroup ref="ProductSetAdvancedPricingActionGroup" stepKey="ProductSetAdvancedPricing1"> <argument name="website" value="secondWebsite"/> </actionGroup> @@ -74,10 +74,10 @@ <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct2"> <argument name="product" value="$$product2$$"/> </actionGroup> - <actionGroup ref="ProductSetWebsite" stepKey="ProductSetWebsite2"> + <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsite2"> <argument name="website" value="secondWebsite"/> </actionGroup> - <actionGroup ref="ProductSetAdvancedPricing" stepKey="ProductSetAdvancedPricing2"> + <actionGroup ref="ProductSetAdvancedPricingActionGroup" stepKey="ProductSetAdvancedPricing2"> <argument name="website" value="secondWebsite"/> </actionGroup> @@ -87,10 +87,10 @@ <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct3"> <argument name="product" value="$$product3$$"/> </actionGroup> - <actionGroup ref="ProductSetWebsite" stepKey="ProductSetWebsite3"> + <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsite3"> <argument name="website" value="secondWebsite"/> </actionGroup> - <actionGroup ref="ProductSetAdvancedPricing" stepKey="ProductSetAdvancedPricing3"> + <actionGroup ref="ProductSetAdvancedPricingActionGroup" stepKey="ProductSetAdvancedPricing3"> <argument name="website" value="secondWebsite"/> </actionGroup> @@ -100,10 +100,10 @@ <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct4"> <argument name="product" value="$$product4$$"/> </actionGroup> - <actionGroup ref="ProductSetWebsite" stepKey="ProductSetWebsite4"> + <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsite4"> <argument name="website" value="secondWebsite"/> </actionGroup> - <actionGroup ref="ProductSetAdvancedPricing" stepKey="ProductSetAdvancedPricing4"> + <actionGroup ref="ProductSetAdvancedPricingActionGroup" stepKey="ProductSetAdvancedPricing4"> <argument name="website" value="secondWebsite"/> </actionGroup> <actionGroup ref="ClearProductsFilterActionGroup" stepKey="ClearProductsFilterActionGroup"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/ConfigurableOptionTextInputLengthValidationHint.xml b/app/code/Magento/Catalog/Test/Mftf/Test/ConfigurableOptionTextInputLengthValidationHint.xml index 899f3e61b5b86..a4785e25d39bb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/ConfigurableOptionTextInputLengthValidationHint.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/ConfigurableOptionTextInputLengthValidationHint.xml @@ -27,7 +27,7 @@ </after> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> - <actionGroup ref="AdminCreateSimpleProductWithTextOptionCharLimit" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="AdminCreateSimpleProductWithTextOptionCharLimitActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="_defaultProduct"/> <argument name="charLimit" value="20"/> @@ -36,10 +36,10 @@ <argument name="category" value="$$createPreReqCategory$$"/> <argument name="product" value="_defaultProduct"/> </actionGroup> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="assertProductInStorefront2"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="assertProductInStorefront2"> <argument name="product" value="_defaultProduct"/> </actionGroup> - <actionGroup ref="testDynamicValidationHint" stepKey="testDynamicValidationHint1"> + <actionGroup ref="TestDynamicValidationHintActionGroup" stepKey="testDynamicValidationHint1"> <argument name="charLimit" value="20"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml index d895993217e32..1e297586ecb65 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml @@ -24,7 +24,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> <argument name="ProductAttribute" value="{{textProductAttribute.attribute_code}}"/> </actionGroup> <click stepKey="clickDelete" selector="{{AttributePropertiesSection.DeleteAttribute}}"/> @@ -37,12 +37,12 @@ <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/> <!--Create new Product Attribute as TextField, with code and default value.--> - <actionGroup ref="createProductAttributeWithTextField" stepKey="createAttribute"> + <actionGroup ref="CreateProductAttributeWithTextFieldActionGroup" stepKey="createAttribute"> <argument name="attribute" value="textProductAttribute"/> </actionGroup> <!--Navigate to Product Attribute.--> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> <argument name="ProductAttribute" value="{{textProductAttribute.attribute_code}}"/> </actionGroup> @@ -55,7 +55,7 @@ <!--Go to New Product page, add Attribute and check values--> <amOnPage url="{{AdminProductCreatePage.url('4', 'simple')}}" stepKey="goToCreateSimpleProductPage"/> - <actionGroup ref="addProductAttributeInProductModal" stepKey="addAttributeToProduct"> + <actionGroup ref="AddProductAttributeInProductModalActionGroup" stepKey="addAttributeToProduct"> <argument name="attributeCode" value="{{textProductAttribute.attribute_code}}"/> </actionGroup> <click stepKey="openAttributes" selector="{{AdminProductAttributesSection.sectionHeader}}"/> @@ -83,7 +83,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> <argument name="ProductAttribute" value="{{dateProductAttribute.attribute_code}}"/> </actionGroup> <click stepKey="clickDelete" selector="{{AttributePropertiesSection.DeleteAttribute}}"/> @@ -99,13 +99,13 @@ <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/> <!--Create new Product Attribute as TextField, with code and default value.--> - <actionGroup ref="createProductAttributeWithDateField" stepKey="createAttribute"> + <actionGroup ref="CreateProductAttributeWithDateFieldActionGroup" stepKey="createAttribute"> <argument name="attribute" value="dateProductAttribute"/> <argument name="date" value="{$generateDefaultDate}"/> </actionGroup> <!--Navigate to Product Attribute.--> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> <argument name="ProductAttribute" value="{{dateProductAttribute.attribute_code}}"/> </actionGroup> @@ -118,7 +118,7 @@ <!--Go to New Product page, add Attribute and check values--> <amOnPage url="{{AdminProductCreatePage.url('4', 'simple')}}" stepKey="goToCreateSimpleProductPage"/> - <actionGroup ref="addProductAttributeInProductModal" stepKey="addAttributeToProduct"> + <actionGroup ref="AddProductAttributeInProductModalActionGroup" stepKey="addAttributeToProduct"> <argument name="attributeCode" value="{{dateProductAttribute.attribute_code}}"/> </actionGroup> <click stepKey="openAttributes" selector="{{AdminProductAttributesSection.sectionHeader}}"/> @@ -143,7 +143,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> <argument name="ProductAttribute" value="{{priceProductAttribute.attribute_code}}"/> </actionGroup> <click stepKey="clickDelete" selector="{{AttributePropertiesSection.DeleteAttribute}}"/> @@ -156,12 +156,12 @@ <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/> <!--Create new Product Attribute with Price--> - <actionGroup ref="createProductAttribute" stepKey="createAttribute"> + <actionGroup ref="CreateProductAttributeActionGroup" stepKey="createAttribute"> <argument name="attribute" value="priceProductAttribute"/> </actionGroup> <!--Navigate to Product Attribute.--> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> <argument name="ProductAttribute" value="{{priceProductAttribute.attribute_code}}"/> </actionGroup> @@ -173,7 +173,7 @@ <!--Go to New Product page, add Attribute and check values--> <amOnPage url="{{AdminProductCreatePage.url('4', 'simple')}}" stepKey="goToCreateSimpleProductPage"/> - <actionGroup ref="addProductAttributeInProductModal" stepKey="addAttributeToProduct"> + <actionGroup ref="AddProductAttributeInProductModalActionGroup" stepKey="addAttributeToProduct"> <argument name="attributeCode" value="{{priceProductAttribute.attribute_code}}"/> </actionGroup> <click stepKey="openAttributes" selector="{{AdminProductAttributesSection.sectionHeader}}"/> @@ -197,7 +197,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> <argument name="ProductAttribute" value="{{dropdownProductAttribute.attribute_code}}"/> </actionGroup> <click stepKey="clickDelete" selector="{{AttributePropertiesSection.DeleteAttribute}}"/> @@ -210,25 +210,25 @@ <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/> <!--Create new Product Attribute as TextField, with code and default value.--> - <actionGroup ref="createProductAttribute" stepKey="createAttribute"> + <actionGroup ref="CreateProductAttributeActionGroup" stepKey="createAttribute"> <argument name="attribute" value="dropdownProductAttribute"/> </actionGroup> <!--Navigate to Product Attribute, add Product Options and Save - 1--> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage1"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage1"> <argument name="ProductAttribute" value="{{dropdownProductAttribute.attribute_code}}"/> </actionGroup> - <actionGroup ref="createAttributeDropdownNthOption" stepKey="createOption1"> + <actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption1"> <argument name="adminName" value="{{dropdownProductAttribute.option1_admin}}"/> <argument name="frontName" value="{{dropdownProductAttribute.option1_frontend}}"/> <argument name="row" value="1"/> </actionGroup> - <actionGroup ref="createAttributeDropdownNthOption" stepKey="createOption2"> + <actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption2"> <argument name="adminName" value="{{dropdownProductAttribute.option2_admin}}"/> <argument name="frontName" value="{{dropdownProductAttribute.option2_frontend}}"/> <argument name="row" value="2"/> </actionGroup> - <actionGroup ref="createAttributeDropdownNthOptionAsDefault" stepKey="createOption3"> + <actionGroup ref="CreateAttributeDropdownNthOptionAsDefaultActionGroup" stepKey="createOption3"> <argument name="adminName" value="{{dropdownProductAttribute.option3_admin}}"/> <argument name="frontName" value="{{dropdownProductAttribute.option3_frontend}}"/> <argument name="row" value="3"/> @@ -236,7 +236,7 @@ <click stepKey="saveAttribute" selector="{{AttributePropertiesSection.Save}}"/> <!--Perform appropriate assertions against dropdownProductAttribute entity--> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPageForAssertions"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPageForAssertions"> <argument name="ProductAttribute" value="{{dropdownProductAttribute.attribute_code}}"/> </actionGroup> <seeInField stepKey="assertLabel" selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{dropdownProductAttribute.attribute_code}}"/> @@ -257,7 +257,7 @@ <!--Go to New Product page, add Attribute and check dropdown values--> <amOnPage url="{{AdminProductCreatePage.url('4', 'simple')}}" stepKey="goToCreateSimpleProductPage"/> - <actionGroup ref="addProductAttributeInProductModal" stepKey="addAttributeToProduct"> + <actionGroup ref="AddProductAttributeInProductModalActionGroup" stepKey="addAttributeToProduct"> <argument name="attributeCode" value="{{dropdownProductAttribute.attribute_code}}"/> </actionGroup> <click stepKey="openAttributes" selector="{{AdminProductAttributesSection.sectionHeader}}"/> @@ -284,7 +284,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> <argument name="ProductAttribute" value="{{dropdownProductAttributeWithQuote.attribute_code}}"/> </actionGroup> <click stepKey="clickDelete" selector="{{AttributePropertiesSection.DeleteAttribute}}"/> @@ -297,15 +297,15 @@ <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/> <!--Create new Product Attribute as TextField, with code and default value.--> - <actionGroup ref="createProductAttribute" stepKey="createAttribute"> + <actionGroup ref="CreateProductAttributeActionGroup" stepKey="createAttribute"> <argument name="attribute" value="dropdownProductAttributeWithQuote"/> </actionGroup> <!--Navigate to Product Attribute, add Product Option and Save - 1--> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage1"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage1"> <argument name="ProductAttribute" value="{{dropdownProductAttributeWithQuote.attribute_code}}"/> </actionGroup> - <actionGroup ref="createAttributeDropdownNthOptionAsDefault" stepKey="createOption1"> + <actionGroup ref="CreateAttributeDropdownNthOptionAsDefaultActionGroup" stepKey="createOption1"> <argument name="adminName" value="{{dropdownProductAttributeWithQuote.option1_admin}}"/> <argument name="frontName" value="{{dropdownProductAttributeWithQuote.option1_frontend}}"/> <argument name="row" value="1"/> @@ -313,7 +313,7 @@ <click stepKey="saveAttribute" selector="{{AttributePropertiesSection.Save}}"/> <!--Perform appropriate assertions against dropdownProductAttribute entity--> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPageForAssertions"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPageForAssertions"> <argument name="ProductAttribute" value="{{dropdownProductAttributeWithQuote.attribute_code}}"/> </actionGroup> <seeInField stepKey="assertLabel" selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{dropdownProductAttributeWithQuote.attribute_code}}"/> @@ -328,7 +328,7 @@ <!--Go to New Product page, add Attribute and check dropdown values--> <amOnPage url="{{AdminProductCreatePage.url('4', 'simple')}}" stepKey="goToCreateSimpleProductPage"/> - <actionGroup ref="addProductAttributeInProductModal" stepKey="addAttributeToProduct"> + <actionGroup ref="AddProductAttributeInProductModalActionGroup" stepKey="addAttributeToProduct"> <argument name="attributeCode" value="{{dropdownProductAttributeWithQuote.attribute_code}}"/> </actionGroup> <click stepKey="openAttributes" selector="{{AdminProductAttributesSection.sectionHeader}}"/> @@ -352,7 +352,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage"> <argument name="ProductAttribute" value="{{multiselectProductAttribute.attribute_code}}"/> </actionGroup> <click stepKey="clickDelete" selector="{{AttributePropertiesSection.DeleteAttribute}}"/> @@ -365,25 +365,25 @@ <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/> <!--Create new Product Attribute as TextField, with code and default value.--> - <actionGroup ref="createProductAttribute" stepKey="createAttribute"> + <actionGroup ref="CreateProductAttributeActionGroup" stepKey="createAttribute"> <argument name="attribute" value="multiselectProductAttribute"/> </actionGroup> <!--Navigate to Product Attribute, add Product Options and Save - 1--> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPage1"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPage1"> <argument name="ProductAttribute" value="{{multiselectProductAttribute.attribute_code}}"/> </actionGroup> - <actionGroup ref="createAttributeDropdownNthOption" stepKey="createOption1"> + <actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption1"> <argument name="adminName" value="{{multiselectProductAttribute.option1_admin}}"/> <argument name="frontName" value="{{multiselectProductAttribute.option1_frontend}}"/> <argument name="row" value="1"/> </actionGroup> - <actionGroup ref="createAttributeDropdownNthOption" stepKey="createOption2"> + <actionGroup ref="CreateAttributeDropdownNthOptionActionGroup" stepKey="createOption2"> <argument name="adminName" value="{{multiselectProductAttribute.option2_admin}}"/> <argument name="frontName" value="{{multiselectProductAttribute.option2_frontend}}"/> <argument name="row" value="2"/> </actionGroup> - <actionGroup ref="createAttributeDropdownNthOptionAsDefault" stepKey="createOption3"> + <actionGroup ref="CreateAttributeDropdownNthOptionAsDefaultActionGroup" stepKey="createOption3"> <argument name="adminName" value="{{multiselectProductAttribute.option3_admin}}"/> <argument name="frontName" value="{{multiselectProductAttribute.option3_frontend}}"/> <argument name="row" value="3"/> @@ -391,7 +391,7 @@ <click stepKey="saveAttribute" selector="{{AttributePropertiesSection.Save}}"/> <!--Perform appropriate assertions against multiselectProductAttribute entity--> - <actionGroup ref="navigateToEditProductAttribute" stepKey="goToEditPageForAssertions"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="goToEditPageForAssertions"> <argument name="ProductAttribute" value="{{multiselectProductAttribute.attribute_code}}"/> </actionGroup> <seeInField stepKey="assertLabel" selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{multiselectProductAttribute.attribute_code}}"/> @@ -412,7 +412,7 @@ <!--Go to New Product page, add Attribute and check multiselect values--> <amOnPage url="{{AdminProductCreatePage.url('4', 'simple')}}" stepKey="goToCreateSimpleProductPage"/> - <actionGroup ref="addProductAttributeInProductModal" stepKey="addAttributeToProduct"> + <actionGroup ref="AddProductAttributeInProductModalActionGroup" stepKey="addAttributeToProduct"> <argument name="attributeCode" value="{{multiselectProductAttribute.attribute_code}}"/> </actionGroup> <click stepKey="openAttributes" selector="{{AdminProductAttributesSection.sectionHeader}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/DeleteCategoriesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/DeleteCategoriesTest.xml index 674d46b9c18b1..8609d50fecaf2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/DeleteCategoriesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/DeleteCategoriesTest.xml @@ -98,7 +98,7 @@ <!--<argument name="category" value="$$createCategoryC$$"/>--> <!--<argument name="productCount" value="2"/>--> <!--</actionGroup>--> - <!--<actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct1">--> + <!--<actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct1">--> <!--<argument name="product" value="$$createProduct1$$"/>--> <!--</actionGroup>--> @@ -109,7 +109,7 @@ <argument name="category" value="$$createSubCategory$$"/> <argument name="productCount" value="1"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct2"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct2"> <argument name="product" value="$$createProduct2$$"/> </actionGroup> @@ -118,17 +118,17 @@ <!--<argument name="category" value="$$createCategoryB$$"/>--> <!--<argument name="productCount" value="1"/>--> <!--</actionGroup>--> - <!--<actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct3">--> + <!--<actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct3">--> <!--<argument name="product" value="$$createProduct3$$"/>--> <!--</actionGroup>--> <!-- Delete Categories 1(with subcategory) and 3. --> <amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPageAfterStoreFrontCategoryAssertions"/> <waitForPageLoad time="30" stepKey="waitForCategoryPageLoadAfterStoreFrontCategoryAssertions"/> - <actionGroup ref="DeleteCategory" stepKey="deleteCategoryC"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategoryC"> <argument name="categoryEntity" value="$$createCategoryC$$"/> </actionGroup> - <actionGroup ref="DeleteCategory" stepKey="deleteCategoryB"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategoryB"> <argument name="categoryEntity" value="$$createCategoryB$$"/> </actionGroup> <!-- Verify categories 1 and 3 are absent --> @@ -139,17 +139,17 @@ <!-- Verify products 1-3 are available on storefront --> <amOnPage url="{{StorefrontHomePage.url}}$$createProduct1.custom_attributes[url_key]$$.html" stepKey="amOnProduct1Page"/> <waitForPageLoad stepKey="product1WaitForPageLoad"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct1Page"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="browseAssertProduct1Page"> <argument name="product" value="$$createProduct1$$"/> </actionGroup> <amOnPage url="{{StorefrontHomePage.url}}$$createProduct2.custom_attributes[url_key]$$.html" stepKey="amOnProduct2Page"/> <waitForPageLoad stepKey="product2WaitForPageLoad"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct2Page"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="browseAssertProduct2Page"> <argument name="product" value="$$createProduct2$$"/> </actionGroup> <amOnPage url="{{StorefrontHomePage.url}}$$createProduct3.custom_attributes[url_key]$$.html" stepKey="amOnProduct3Page"/> <waitForPageLoad stepKey="product3WaitForPageLoad"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct3Page"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="browseAssertProduct3Page"> <argument name="product" value="$$createProduct3$$"/> </actionGroup> <!-- Rename New Root Category to Default category --> @@ -161,4 +161,4 @@ <click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategoryDefaultCategory"/> <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccessMessageAfterSaveDefaultCategory"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/DeleteUsedInConfigurableProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/DeleteUsedInConfigurableProductAttributeTest.xml index e79e4cea408fb..6706175a4da54 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/DeleteUsedInConfigurableProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/DeleteUsedInConfigurableProductAttributeTest.xml @@ -81,7 +81,7 @@ <!-- Click Delete Attribute button --> <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttributeByAttributeCode"> - <argument name="productAttributeCode" value="$$productAttributeHandle.attribute_code$$"/> + <argument name="ProductAttributeCode" value="$$productAttributeHandle.attribute_code$$"/> </actionGroup> <!-- Should see error message: This attribute is used in configurable products. --> @@ -102,4 +102,4 @@ <argument name="productAttribute" value="$$productAttributeHandle$$"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/DisplayRefreshCacheAfterChangingCategoryPageLayoutTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/DisplayRefreshCacheAfterChangingCategoryPageLayoutTest.xml index 02df8db5c2121..1f71ec1e6a850 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/DisplayRefreshCacheAfterChangingCategoryPageLayoutTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/DisplayRefreshCacheAfterChangingCategoryPageLayoutTest.xml @@ -35,7 +35,7 @@ </after> <!-- Navigate to category details page --> <comment userInput="Navigate to category details page" stepKey="navigateToAdminCategoryPage"/> - <actionGroup ref="goToAdminCategoryPageById" stepKey="goToAdminCategoryPage"> + <actionGroup ref="GoToAdminCategoryPageByIdActionGroup" stepKey="goToAdminCategoryPage"> <argument name="id" value="$$simpleCategory.id$$"/> </actionGroup> <!-- Open design tab and set layout --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CAdminTest.xml index 1419ca4cb42ef..232321610eadc 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -31,40 +31,40 @@ <!--Create Simple Product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageSimple"/> <waitForPageLoad time="30" stepKey="waitForProductPageLoadSimple"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateSimpleProduct"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateSimpleProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> - <actionGroup ref="checkRequiredFieldsInProductForm" stepKey="checkRequiredFieldsProductSimple"/> - <actionGroup ref="fillMainProductForm" stepKey="fillSimpleProductMain"> + <actionGroup ref="CheckRequiredFieldsInProductFormActionGroup" stepKey="checkRequiredFieldsProductSimple"/> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillSimpleProductMain"> <argument name="product" value="SimpleProduct"/> </actionGroup> - <actionGroup ref="addProductImage" stepKey="addImageForProductSimple"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProductSimple"> <argument name="image" value="ProductImage"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> <click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackToGridSimple"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridSimple"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridSimple"> <argument name="product" value="SimpleProduct"/> </actionGroup> <grabAttributeFrom selector="{{AdminProductGridSection.productThumbnail('1')}}" userInput="src" stepKey="getSimpleProductThumbnail"/> <assertNotRegExp expected="'/placeholder\/thumbnail\.jpg/'" actual="$getSimpleProductThumbnail" stepKey="simpleThumbnailIsNotDefault"/> - <actionGroup ref="viewProductInAdminGrid" stepKey="seeSimpleProductInGrid"> + <actionGroup ref="ViewProductInAdminGridActionGroup" stepKey="seeSimpleProductInGrid"> <argument name="product" value="SimpleProduct"/> </actionGroup> <!--Create Virtual Product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageVirtual"/> <waitForPageLoad time="30" stepKey="waitForProductPageLoadVirtual"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateVirtualProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateVirtualProduct"> <argument name="product" value="VirtualProduct"/> </actionGroup> <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{VirtualProduct.sku}}" stepKey="fillVirtualName"/> <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{VirtualProduct.name}}" stepKey="fillVirtualSku"/> <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{VirtualProduct.price}}" stepKey="fillVirtualPrice"/> <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{VirtualProduct.quantity}}" stepKey="fillVirtualQty"/> - <actionGroup ref="saveProductForm" stepKey="saveVirtualProduct"/> - <actionGroup ref="viewProductInAdminGrid" stepKey="viewVirtualProductInGrid"> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveVirtualProduct"/> + <actionGroup ref="ViewProductInAdminGridActionGroup" stepKey="viewVirtualProductInGrid"> <argument name="product" value="VirtualProduct"/> </actionGroup> @@ -74,15 +74,15 @@ <waitForPageLoad stepKey="waitForProductGridPageLoad"/> <!--Search by keyword--> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetGridToDefaultKeywordSearch"/> - <actionGroup ref="searchProductGridByKeyword" stepKey="useKeywordSearchSimpleProduct"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> + <actionGroup ref="SearchProductGridByKeywordActionGroup" stepKey="useKeywordSearchSimpleProduct"> <argument name="keyword" value="SimpleProduct.name"/> </actionGroup> <seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="1" stepKey="seeOnlyOneProductInGrid"/> <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="{{SimpleProduct.name}}" stepKey="seeOnlySimpleProductInGrid"/> <!--Paging works--> - <actionGroup ref="resetProductGridToDefaultView" stepKey="setProductGridToDefaultPagination"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="setProductGridToDefaultPagination"/> <comment userInput="Admin uses paging on product grid" stepKey="usePagingProductGridComment"/> <click selector="{{AdminProductGridPaginationSection.perPageDropdown}}" stepKey="clickProductPerPageDropdown"/> <click selector="{{AdminProductGridPaginationSection.perPageOption('50')}}" stepKey="selectProductsPerPage"/> @@ -100,14 +100,14 @@ <seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" parameterArray="[1,5]" stepKey="seeProductsOnSecondPage"/> <!--Filtering works (by Name, By Price, by Status)--> - <actionGroup ref="resetProductGridToDefaultView" stepKey="setProductGridToDefaultFiltering"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridByGroupedSku"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="setProductGridToDefaultFiltering"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridByGroupedSku"> <argument name="product" value="GroupedProduct"/> </actionGroup> <seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="1" stepKey="seeOneMatchingSkuInProductGrid"/> <see selector="{{AdminProductGridSection.productGridCell('1','SKU')}}" userInput="{{GroupedProduct.sku}}" stepKey="seeProductInFilteredGridSku"/> <!--Filter by price--> - <actionGroup ref="filterProductGridByPriceRange" stepKey="filterProductGridByPrice"> + <actionGroup ref="FilterProductGridByPriceRangeActionGroup" stepKey="filterProductGridByPrice"> <argument name="filter" value="PriceFilterRange"/> </actionGroup> <click selector="{{AdminProductGridSection.columnHeader('Price')}}" stepKey="clickPriceHeaderToSortAscForFilter"/> @@ -118,17 +118,17 @@ <assertRegExp expected="'/\$[0-9]{2}\.[0-9]{2}/'" actual="$getMaximumPriceInGrid" stepKey="assertMaximumPriceIsCorrect"/> <assertLessThan expected="$getMaximumPriceInGrid" actual="$getMinimumPriceInGrid" stepKey="checkPriceSortCorrect"/> <!--Filter by status--> - <actionGroup ref="filterProductGridByEnabledStatus" stepKey="filterGridByEnabledProducts"/> + <actionGroup ref="FilterProductGridByEnabledStatusActionGroup" stepKey="filterGridByEnabledProducts"/> <seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" parameterArray="[1,20]" stepKey="seeEnabledProductsNotEmpty"/> <see selector="{{AdminProductGridSection.column('Status')}}" userInput="Enabled" stepKey="seeOnlyEnabledProducts"/> - <actionGroup ref="filterProductGridByDisabledStatus" stepKey="filterGridByDisabledProducts"/> + <actionGroup ref="FilterProductGridByDisabledStatusActionGroup" stepKey="filterGridByDisabledProducts"/> <dontSee selector="{{AdminProductGridSection.column('Status')}}" userInput="Enabled" stepKey="dontSeeEnabledProducts"/> <!--Sorting works (By Price, by ID)--> <!--By Price--> - <actionGroup ref="resetProductGridToDefaultView" stepKey="setProductGridToDefaultSortingPrice"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="setProductGridToDefaultSortingPrice"/> <!--Filter by price so grid contains prices that we can compare correctly--> - <actionGroup ref="filterProductGridByPriceRange" stepKey="filterProductGridByPriceForCompare"> + <actionGroup ref="FilterProductGridByPriceRangeActionGroup" stepKey="filterProductGridByPriceForCompare"> <argument name="filter" value="PriceFilterRange"/> </actionGroup> <!--Sort Ascending--> @@ -142,7 +142,7 @@ <grabTextFrom selector="{{AdminProductGridSection.productGridCell('2', 'Price')}}" stepKey="getSecondPriceSortDesc"/> <assertGreaterThanOrEqual expected="$getSecondPriceSortDesc" actual="$getFirstPriceSortDesc" stepKey="checkPriceDescSortCorrect"/> <!--By Product ID--> - <actionGroup ref="resetProductGridToDefaultView" stepKey="setProductGridToDefaultSortingId"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="setProductGridToDefaultSortingId"/> <!--Sort Ascending--> <grabTextFrom selector="{{AdminProductGridSection.productGridCell('1', 'ID')}}" stepKey="getFirstProductIdSortAsc"/> <grabTextFrom selector="{{AdminProductGridSection.productGridCell('2', 'ID')}}" stepKey="getSecondProductIdSortAsc"/> @@ -154,7 +154,7 @@ <assertGreaterThan expected="$getSecondProductIdSortDesc" actual="$getFirstProductIdSortDesc" stepKey="checkProductIdDescSortCorrect"/> <!--Adding column works--> - <actionGroup ref="resetProductGridToDefaultView" stepKey="setProductGridToDefaultColumns"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="setProductGridToDefaultColumns"/> <click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="openColumnsDropdownToReset"/> <click selector="{{AdminProductGridFilterSection.resetGridColumns}}" stepKey="resetProductGridColumns"/> <click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="closeColumnsDropdownAfterReset"/> @@ -170,7 +170,7 @@ <checkOption selector="{{AdminProductGridFilterSection.viewColumnOption('Weight')}}" stepKey="showWeightColumn"/> <click selector="{{AdminProductGridFilterSection.columnsDropdown}}" stepKey="closeColumnsDropdownWeight"/> <seeElement selector="{{AdminProductGridSection.columnHeader('Weight')}}" stepKey="seeWeightColumn"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridToCheckWeightColumn"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridToCheckWeightColumn"> <argument name="product" value="SimpleProduct"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1','Weight')}}" userInput="{{SimpleProduct.weight}}" stepKey="seeCorrectProductWeightInGrid"/> @@ -182,13 +182,13 @@ <waitForPageLoad time="30" stepKey="waitForCategoryPageLoad"/> <!--Create category under Default Category--> <click selector="{{AdminCategorySidebarTreeSection.categoryTreeRoot}}" stepKey="clickDefaultCategory"/> - <actionGroup ref="CheckCategoryNameIsRequiredField" stepKey="checkCategoryNameIsRequired"/> - <actionGroup ref="CreateCategory" stepKey="createCategory"> + <actionGroup ref="CheckCategoryNameIsRequiredFieldActionGroup" stepKey="checkCategoryNameIsRequired"/> + <actionGroup ref="CreateCategoryActionGroup" stepKey="createCategory"> <argument name="categoryEntity" value="_defaultCategory"/> </actionGroup> <!--Create category under newly created category--> <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(_defaultCategory.name)}}" stepKey="clickCreatedCategoryInTree"/> - <actionGroup ref="CreateCategory" stepKey="createSubCategory"> + <actionGroup ref="CreateCategoryActionGroup" stepKey="createSubCategory"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> @@ -211,24 +211,24 @@ <comment userInput="Admin deletes category" stepKey="deleteCategoryComment"/> <amOnPage url="{{AdminCategoryPage.url}}" stepKey="onCategoryPageToDeleteCategory"/> <waitForPageLoad time="30" stepKey="waitForCategoryPageDelete"/> - <actionGroup ref="DeleteCategory" stepKey="deleteCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"> <argument name="categoryEntity" value="_defaultCategory"/> </actionGroup> <!--@TODO Move cleanup to "after" when MQE-830 is resolved--> <!--Clean up categories--> <comment userInput="Clean up categories" stepKey="cleanupCategoriesComment"/> - <actionGroup ref="DeleteCategory" stepKey="cleanSimpleSubCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="cleanSimpleSubCategory"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> <!--Clean up products--> <comment userInput="Clean up simple product" stepKey="cleanUpSimpleProduct"/> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteSimpleProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteSimpleProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> <comment userInput="Clean up virtual product" stepKey="cleanUpVirtualProduct"/> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteVirtualProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteVirtualProduct"> <argument name="product" value="VirtualProduct"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml index ad66214e902fe..f7ebb090124d6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml @@ -76,7 +76,7 @@ </actionGroup> <!-- Check simple product 1 in category --> <comment userInput="Check simple product 1 in category" stepKey="commentCheckSimpleProductInCategory" /> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct1"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct1"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -84,7 +84,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$browseGrabSimpleProduct1ImageSrc" stepKey="browseAssertSimpleProduct1ImageNotDefault"/> <!-- Check simple product 2 in category --> <comment userInput="Check simple product 2 in category" stepKey="commentCheckSimpleProduct2InCategory" /> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct2"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct2"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -95,7 +95,7 @@ <comment userInput="View simple product 1" stepKey="commentViewSimpleProduct1" after="browseAssertSimpleProduct2ImageNotDefault"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="browseClickCategorySimpleProduct1View" after="commentViewSimpleProduct1"/> <waitForLoadingMaskToDisappear stepKey="waitForSimpleProduct1Viewloaded" /> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct1Page"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="browseAssertProduct1Page"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -107,7 +107,7 @@ <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="clickCategory1"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct2.name$$)}}" stepKey="browseClickCategorySimpleProduct2View"/> <waitForLoadingMaskToDisappear stepKey="waitForSimpleProduct2ViewLoaded" /> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct2Page"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="browseAssertProduct2Page"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -125,7 +125,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="compareAssertSimpleProduct1"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="compareAssertSimpleProduct1"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -133,7 +133,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$compareGrabSimpleProduct1ImageSrc" stepKey="compareAssertSimpleProduct1ImageNotDefault"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="compareClickSimpleProduct1"/> <waitForLoadingMaskToDisappear stepKey="waitForCompareSimpleProduct1loaded" /> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="compareAssertProduct1Page"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="compareAssertProduct1Page"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -151,7 +151,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="compareAssertSimpleProduct2"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="compareAssertSimpleProduct2"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -269,7 +269,7 @@ </actionGroup> <!-- Check simple product 1 in category --> <comment userInput="Check simple product 1 in category" stepKey="commentCheckSimpleProductInCategory" /> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct1"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct1"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -277,7 +277,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$browseGrabSimpleProduct1ImageSrc" stepKey="browseAssertSimpleProduct1ImageNotDefault"/> <!-- Check simple product 2 in category --> <comment userInput="Check simple product 2 in category" stepKey="commentCheckSimpleProduct2InCategory" /> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct2"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct2"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -288,7 +288,7 @@ <comment userInput="View simple product 1" stepKey="commentViewSimpleProduct1" after="browseAssertSimpleProduct2ImageNotDefault"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="browseClickCategorySimpleProduct1View" after="commentViewSimpleProduct1"/> <waitForLoadingMaskToDisappear stepKey="waitForSimpleProduct1Viewloaded" /> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct1Page"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="browseAssertProduct1Page"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -300,7 +300,7 @@ <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="clickCategory1"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct2.name$$)}}" stepKey="browseClickCategorySimpleProduct2View"/> <waitForLoadingMaskToDisappear stepKey="waitForSimpleProduct2ViewLoaded" /> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct2Page"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="browseAssertProduct2Page"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -318,7 +318,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="compareAssertSimpleProduct1"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="compareAssertSimpleProduct1"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -326,7 +326,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$compareGrabSimpleProduct1ImageSrc" stepKey="compareAssertSimpleProduct1ImageNotDefault"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="compareClickSimpleProduct1"/> <waitForLoadingMaskToDisappear stepKey="waitForCompareSimpleProduct1loaded" /> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="compareAssertProduct1Page"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="compareAssertProduct1Page"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -344,7 +344,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="compareAssertSimpleProduct2"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="compareAssertSimpleProduct2"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml index 3f48c3ca811e3..74c6da1c47f60 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml @@ -61,7 +61,7 @@ </actionGroup> <!-- Check simple product 1 in category --> <comment userInput="Check simple product 1 in category" stepKey="commentCheckSimpleProductInCategory" after="browseAssertCategory"/> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct1" after="commentCheckSimpleProductInCategory"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct1" after="commentCheckSimpleProductInCategory"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -69,7 +69,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$browseGrabSimpleProduct1ImageSrc" stepKey="browseAssertSimpleProduct1ImageNotDefault" after="browseGrabSimpleProduct1ImageSrc"/> <!-- Check simple product 2 in category --> <comment userInput="Check simple product 2 in category" stepKey="commentCheckSimpleProduct2InCategory" after="browseAssertSimpleProduct1ImageNotDefault"/> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct2" after="commentCheckSimpleProduct2InCategory"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct2" after="commentCheckSimpleProduct2InCategory"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -80,7 +80,7 @@ <comment userInput="View simple product 1" stepKey="commentViewSimpleProduct1" after="browseAssertSimpleProduct2ImageNotDefault"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="browseClickCategorySimpleProduct1View" after="commentViewSimpleProduct1"/> <waitForLoadingMaskToDisappear stepKey="waitForSimpleProduct1Viewloaded" after="browseClickCategorySimpleProduct1View"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct1Page" after="waitForSimpleProduct1Viewloaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="browseAssertProduct1Page" after="waitForSimpleProduct1Viewloaded"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -92,7 +92,7 @@ <click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="clickCategory1" after="commentViewSimpleProduct2"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct2.name$$)}}" stepKey="browseClickCategorySimpleProduct2View" after="clickCategory1"/> <waitForLoadingMaskToDisappear stepKey="waitForSimpleProduct2ViewLoaded" after="browseClickCategorySimpleProduct2View"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="browseAssertProduct2Page" after="waitForSimpleProduct2ViewLoaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="browseAssertProduct2Page" after="waitForSimpleProduct2ViewLoaded"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -110,7 +110,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="compareAssertSimpleProduct1" after="compareAssertCategory"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="compareAssertSimpleProduct1" after="compareAssertCategory"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -118,7 +118,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$compareGrabSimpleProduct1ImageSrc" stepKey="compareAssertSimpleProduct1ImageNotDefault" after="compareGrabSimpleProduct1ImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="compareClickSimpleProduct1" after="compareAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForCompareSimpleProduct1loaded" after="compareClickSimpleProduct1"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="compareAssertProduct1Page" after="waitForCompareSimpleProduct1loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="compareAssertProduct1Page" after="waitForCompareSimpleProduct1loaded"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -136,7 +136,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="compareAssertSimpleProduct2" after="compareAssertCategory1"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="compareAssertSimpleProduct2" after="compareAssertCategory1"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/SimpleProductTwoCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/SimpleProductTwoCustomOptionsTest.xml index 0049dcb504335..41bacc69baca4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/SimpleProductTwoCustomOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/SimpleProductTwoCustomOptionsTest.xml @@ -25,16 +25,16 @@ <!--Create product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateSimpleProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateSimpleProduct"> <argument name="product" value="SimpleProduct3"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillSimpleProductMain"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillSimpleProductMain"> <argument name="product" value="SimpleProduct3"/> </actionGroup> </before> <after> <!-- Delete the created product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="SimpleProduct3"/> </actionGroup> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> @@ -45,14 +45,14 @@ <waitForPageLoad stepKey="waitForCustomOptionsOpen"/> <!-- Create a custom option with 2 values --> - <actionGroup ref="CreateCustomRadioOptions" stepKey="createCustomOption1"> + <actionGroup ref="CreateCustomRadioOptionsActionGroup" stepKey="createCustomOption1"> <argument name="customOptionName" value="ProductOptionRadiobutton.title"/> <argument name="productOption" value="ProductOptionField"/> <argument name="productOption2" value="ProductOptionField2"/> </actionGroup> <!-- Create another custom option with 2 values --> - <actionGroup ref="CreateCustomRadioOptions" stepKey="createCustomOption2"> + <actionGroup ref="CreateCustomRadioOptionsActionGroup" stepKey="createCustomOption2"> <argument name="customOptionName" value="ProductOptionRadiobutton.title"/> <argument name="productOption" value="ProductOptionField"/> <argument name="productOption2" value="ProductOptionField2"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCatalogNavigationMenuUIDesktopTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCatalogNavigationMenuUIDesktopTest.xml index ae54b72a5a702..22ec0048497fa 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCatalogNavigationMenuUIDesktopTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontCatalogNavigationMenuUIDesktopTest.xml @@ -21,10 +21,10 @@ <before> <!-- Login as admin --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="DeleteDefaultCategoryChildren" stepKey="deleteRootCategoryChildren"/> + <actionGroup ref="DeleteDefaultCategoryChildrenActionGroup" stepKey="deleteRootCategoryChildren"/> </before> <after> - <actionGroup ref="DeleteDefaultCategoryChildren" stepKey="deleteRootCategoryChildren"/> + <actionGroup ref="DeleteDefaultCategoryChildrenActionGroup" stepKey="deleteRootCategoryChildren"/> <actionGroup ref="AdminChangeStorefrontThemeActionGroup" stepKey="changeThemeToDefault"> <argument name="theme" value="{{MagentoLumaTheme.name}}"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontEnsureThatAccordionAnchorIsVisibleOnViewportOnceClickedTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontEnsureThatAccordionAnchorIsVisibleOnViewportOnceClickedTest.xml index 0f9f542a97d02..034347dc32d82 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontEnsureThatAccordionAnchorIsVisibleOnViewportOnceClickedTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontEnsureThatAccordionAnchorIsVisibleOnViewportOnceClickedTest.xml @@ -84,7 +84,7 @@ <selectOption selector="{{AdminProductFormSection.customSelectField($$createFourthAttribute.attribute[attribute_code]$$)}}" userInput="$$createSecondOption.option[store_labels][0][label]$$" stepKey="setFourthAttributeValue"/> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> <!-- Go to frontend and make a user account and login with it --> <actionGroup ref="SignUpNewUserFromStorefrontActionGroup" stepKey="signUpNewUser"> @@ -133,19 +133,19 @@ </actionGroup> <!-- Assert that product page has all product attributes in More Info tab --> - <actionGroup ref="checkAttributeInMoreInformationTab" stepKey="checkFirstAttributeInMoreInformationTab"> + <actionGroup ref="CheckAttributeInMoreInformationTabActionGroup" stepKey="checkFirstAttributeInMoreInformationTab"> <argument name="attributeLabel" value="$$createFirstAttribute.attribute[frontend_labels][0][label]$$"/> <argument name="attributeValue" value="$$createOption.option[store_labels][0][label]$$"/> </actionGroup> - <actionGroup ref="checkAttributeInMoreInformationTab" stepKey="checkSecondAttributeInMoreInformationTab"> + <actionGroup ref="CheckAttributeInMoreInformationTabActionGroup" stepKey="checkSecondAttributeInMoreInformationTab"> <argument name="attributeLabel" value="$$createSecondAttribute.attribute[frontend_labels][0][label]$$"/> <argument name="attributeValue" value="{{ProductAttributeOption8.value}}"/> </actionGroup> - <actionGroup ref="checkAttributeInMoreInformationTab" stepKey="checkThirdAttributeInMoreInformationTab"> + <actionGroup ref="CheckAttributeInMoreInformationTabActionGroup" stepKey="checkThirdAttributeInMoreInformationTab"> <argument name="attributeLabel" value="$$createThirdAttribute.attribute[frontend_labels][0][label]$$"/> <argument name="attributeValue" value="{{ProductAttributeOption8.value}}"/> </actionGroup> - <actionGroup ref="checkAttributeInMoreInformationTab" stepKey="checkFourthAttributeInMoreInformationTab"> + <actionGroup ref="CheckAttributeInMoreInformationTabActionGroup" stepKey="checkFourthAttributeInMoreInformationTab"> <argument name="attributeLabel" value="$$createFourthAttribute.attribute[frontend_labels][0][label]$$"/> <argument name="attributeValue" value="$$createSecondOption.option[store_labels][0][label]$$"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuote.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuote.xml index 21f8e2e070e32..07c2e8a972596 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuote.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuote.xml @@ -29,17 +29,17 @@ <!--Create product via admin--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToProductCreatePage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToProductCreatePage"> <argument name="product" value="SimpleProductNameWithDoubleQuote"/> </actionGroup> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="SimpleProductNameWithDoubleQuote"/> </actionGroup> <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="selectCategory"/> - <actionGroup ref="addProductImage" stepKey="addImageToProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageToProduct"> <argument name="image" value="ProductImage"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Run re-index task--> <magentoCLI command="indexer:reindex" stepKey="reindex"/> @@ -61,7 +61,7 @@ <see selector="{{StorefrontNavigationSection.breadcrumbs}}" userInput="{{SimpleProductNameWithDoubleQuote.name}}" stepKey="seeCorrectBreadCrumbProduct"/> <!--Remove product--> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="SimpleProductNameWithDoubleQuote"/> </actionGroup> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithEmptyAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithEmptyAttributeTest.xml index 1c1b47a6bded9..db693b7229b17 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithEmptyAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithEmptyAttributeTest.xml @@ -23,7 +23,7 @@ <createData entity="productAttributeWithDropdownTwoOptions" stepKey="createProductAttribute"/> </before> <after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteSimpleProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteSimpleProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> @@ -38,7 +38,7 @@ <click selector="{{AttributeSetSection.Save}}" stepKey="saveAttributeSet"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear" /> <seeElement selector=".message-success" stepKey="assertSuccess"/> - <actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="SimpleProduct"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontRememberCategoryPaginationTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontRememberCategoryPaginationTest.xml index 0ed61b8636c4f..c8872425552be 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontRememberCategoryPaginationTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontRememberCategoryPaginationTest.xml @@ -1,68 +1,68 @@ -<?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="StorefrontRememberCategoryPaginationTest"> - <annotations> - <title value="Verify that Number of Products per page retained when visiting a different category"/> - <stories value="MAGETWO-61478: Number of Products displayed per page not retained when visiting a different category"/> - <description value="Verify that Number of Products per page retained when visiting a different category"/> - <features value="Catalog"/> - <severity value="MAJOR"/> - <testCaseId value="MAGETWO-94210"/> - <group value="Catalog"/> - </annotations> - - <before> - <createData entity="_defaultCategory" stepKey="defaultCategory1"/> - <createData entity="SimpleProduct" stepKey="simpleProduct1"> - <requiredEntity createDataKey="defaultCategory1"/> - </createData> - - <createData entity="_defaultCategory" stepKey="defaultCategory2"/> - <createData entity="SimpleProduct" stepKey="simpleProduct2"> - <requiredEntity createDataKey="defaultCategory2"/> - </createData> - - <createData entity="RememberPaginationCatalogStorefrontConfig" stepKey="setRememberPaginationCatalogStorefrontConfig"/> - </before> - - <actionGroup ref="GoToStorefrontCategoryPageByParameters" stepKey="GoToStorefrontCategory1Page"> - <argument name="category" value="$$defaultCategory1.custom_attributes[url_key]$$"/> - <argument name="mode" value="grid"/> - <argument name="numOfProductsPerPage" value="12"/> - </actionGroup> - - <actionGroup ref="VerifyCategoryPageParameters" stepKey="verifyCategory1PageParameters"> - <argument name="category" value="$$defaultCategory1$$"/> - <argument name="mode" value="grid"/> - <argument name="numOfProductsPerPage" value="12"/> - </actionGroup> - - <amOnPage url="{{StorefrontCategoryPage.url($$defaultCategory2.name$$)}}" stepKey="navigateToCategory2Page"/> - <waitForPageLoad stepKey="waitForCategory2PageToLoad"/> - - <actionGroup ref="VerifyCategoryPageParameters" stepKey="verifyCategory2PageParameters"> - <argument name="category" value="$$defaultCategory2$$"/> - <argument name="mode" value="grid"/> - <argument name="numOfProductsPerPage" value="12"/> - </actionGroup> - - <after> - <createData entity="DefaultCatalogStorefrontConfiguration" stepKey="setDefaultCatalogStorefrontConfiguration"/> - - <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> - <deleteData createDataKey="defaultCategory1" stepKey="deleteCategory1"/> - <deleteData createDataKey="simpleProduct2" stepKey="deleteProduct2"/> - <deleteData createDataKey="defaultCategory2" stepKey="deleteCategory2"/> - - <magentoCLI command="cache:flush" stepKey="flushCache"/> - - </after> - </test> -</tests> +<?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="StorefrontRememberCategoryPaginationTest"> + <annotations> + <title value="Verify that Number of Products per page retained when visiting a different category"/> + <stories value="MAGETWO-61478: Number of Products displayed per page not retained when visiting a different category"/> + <description value="Verify that Number of Products per page retained when visiting a different category"/> + <features value="Catalog"/> + <severity value="MAJOR"/> + <testCaseId value="MAGETWO-94210"/> + <group value="Catalog"/> + </annotations> + + <before> + <createData entity="_defaultCategory" stepKey="defaultCategory1"/> + <createData entity="SimpleProduct" stepKey="simpleProduct1"> + <requiredEntity createDataKey="defaultCategory1"/> + </createData> + + <createData entity="_defaultCategory" stepKey="defaultCategory2"/> + <createData entity="SimpleProduct" stepKey="simpleProduct2"> + <requiredEntity createDataKey="defaultCategory2"/> + </createData> + + <createData entity="RememberPaginationCatalogStorefrontConfig" stepKey="setRememberPaginationCatalogStorefrontConfig"/> + </before> + + <actionGroup ref="GoToStorefrontCategoryPageByParametersActionGroup" stepKey="GoToStorefrontCategory1Page"> + <argument name="category" value="$$defaultCategory1.custom_attributes[url_key]$$"/> + <argument name="mode" value="grid"/> + <argument name="numOfProductsPerPage" value="12"/> + </actionGroup> + + <actionGroup ref="VerifyCategoryPageParametersActionGroup" stepKey="verifyCategory1PageParameters"> + <argument name="category" value="$$defaultCategory1$$"/> + <argument name="mode" value="grid"/> + <argument name="numOfProductsPerPage" value="12"/> + </actionGroup> + + <amOnPage url="{{StorefrontCategoryPage.url($$defaultCategory2.name$$)}}" stepKey="navigateToCategory2Page"/> + <waitForPageLoad stepKey="waitForCategory2PageToLoad"/> + + <actionGroup ref="VerifyCategoryPageParametersActionGroup" stepKey="verifyCategory2PageParameters"> + <argument name="category" value="$$defaultCategory2$$"/> + <argument name="mode" value="grid"/> + <argument name="numOfProductsPerPage" value="12"/> + </actionGroup> + + <after> + <createData entity="DefaultCatalogStorefrontConfiguration" stepKey="setDefaultCatalogStorefrontConfiguration"/> + + <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> + <deleteData createDataKey="defaultCategory1" stepKey="deleteCategory1"/> + <deleteData createDataKey="simpleProduct2" stepKey="deleteProduct2"/> + <deleteData createDataKey="defaultCategory2" stepKey="deleteCategory2"/> + + <magentoCLI command="cache:flush" stepKey="flushCache"/> + + </after> + </test> +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontSpecialPriceForDifferentTimezonesForWebsitesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontSpecialPriceForDifferentTimezonesForWebsitesTest.xml index 514e12bb355a8..3e887a0a83aa4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontSpecialPriceForDifferentTimezonesForWebsitesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontSpecialPriceForDifferentTimezonesForWebsitesTest.xml @@ -61,7 +61,7 @@ <actionGroup ref="AddSpecialPriceToProductActionGroup" stepKey="setSpecialPriceToCreatedProduct"> <argument name="price" value="15"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <!--Login to storefront from customer and check price--> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="logInFromCustomer"> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml index deb6700c56990..e91f9742b2841 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyCategoryProductAndProductCategoryPartialReindexTest.xml @@ -50,7 +50,7 @@ <createData entity="SimpleProduct2" stepKey="productC"/> <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> - <actionGroup ref="AdminAssignProductToCategory" stepKey="assignCategoryNAndMToProductC"> + <actionGroup ref="AdminAssignProductToCategoryActionGroup" stepKey="assignCategoryNAndMToProductC"> <argument name="productId" value="$$productC.id$$"/> <argument name="categoryName" value="$$categoryN.name$$, $$categoryM.name$$"/> </actionGroup> @@ -97,7 +97,7 @@ <!-- Open Products A, B, C to edit. Assign/unassign categories to/from them. Save changes --> <!-- Assign category K to Product A --> - <actionGroup ref="AdminAssignProductToCategory" stepKey="assignCategoryK"> + <actionGroup ref="AdminAssignProductToCategoryActionGroup" stepKey="assignCategoryK"> <argument name="productId" value="$$productA.id$$"/> <argument name="categoryName" value="$$categoryK.name$$"/> </actionGroup> @@ -109,7 +109,7 @@ </actionGroup> <!-- Assign category L to Product C --> - <actionGroup ref="AdminAssignProductToCategory" stepKey="assignCategoryNAndM"> + <actionGroup ref="AdminAssignProductToCategoryActionGroup" stepKey="assignCategoryNAndM"> <argument name="productId" value="$$productC.id$$"/> <argument name="categoryName" value="$$categoryL.name$$"/> </actionGroup> @@ -176,7 +176,7 @@ </actionGroup> <!-- Add Product B assignment for category N --> - <actionGroup ref="AdminAssignProductToCategory" stepKey="assignCategoryN"> + <actionGroup ref="AdminAssignProductToCategoryActionGroup" stepKey="assignCategoryN"> <argument name="productId" value="$$productB.id$$"/> <argument name="categoryName" value="$$categoryN.name$$"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyChildCategoriesShouldNotIncludeInMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyChildCategoriesShouldNotIncludeInMenuTest.xml index 455e9b58156eb..d39d54400279c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/VerifyChildCategoriesShouldNotIncludeInMenuTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/VerifyChildCategoriesShouldNotIncludeInMenuTest.xml @@ -22,7 +22,7 @@ <amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToCategoryPage2"/> <waitForPageLoad stepKey="waitForPageLoad3"/> <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(SimpleSubCategory.name)}}" stepKey="clickOnCreatedSimpleSubCategoryBeforeDelete"/> - <actionGroup ref="DeleteCategory" stepKey="deleteCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -32,11 +32,11 @@ <waitForPageLoad stepKey="waitForPageLoad1"/> <scrollToTopOfPage stepKey="scrollToTopOfPage"/> <!--Create new category under Default Category--> - <actionGroup ref="CreateCategory" stepKey="createSubcategory1"> + <actionGroup ref="CreateCategoryActionGroup" stepKey="createSubcategory1"> <argument name="categoryEntity" value="SimpleSubCategory"/> </actionGroup> <!--Create another subcategory under created category--> - <actionGroup ref="CreateCategory" stepKey="createSubcategory2"> + <actionGroup ref="CreateCategoryActionGroup" stepKey="createSubcategory2"> <argument name="categoryEntity" value="SubCategoryWithParent"/> </actionGroup> <!--Go to storefront and verify visibility of categories--> @@ -85,4 +85,4 @@ <dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="dontSeeSimpleSubCategoryOnStorefront3"/> <dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SubCategoryWithParent.name)}}" stepKey="dontSeeSubCategoryWithParentOnStorefront4"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml index f0ec7dbd0706b..87e4f2d5b3be0 100644 --- a/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml +++ b/app/code/Magento/CatalogImportExport/Test/Mftf/Test/AdminExportImportConfigurableProductWithImagesTest.xml @@ -150,7 +150,7 @@ <deleteData createDataKey="createExportImportCategory" stepKey="deleteExportImportCategory"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> <!-- Admin logout--> <actionGroup ref="logout" stepKey="adminLogout"/> </after> @@ -174,7 +174,7 @@ </actionGroup> <!-- Go to Catalog > Products. Find ConfProd and delete it --> - <actionGroup ref="deleteProductBySku" stepKey="deleteConfigurableProductBySku"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteConfigurableProductBySku"> <argument name="sku" value="$$createExportImportConfigurableProduct.sku$$"/> </actionGroup> @@ -187,7 +187,7 @@ </actionGroup> <!-- Go to Catalog > Products: Configurable product exists --> - <actionGroup ref="filterAndSelectProduct" stepKey="openConfigurableProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openConfigurableProduct"> <argument name="productSku" value="$$createExportImportConfigurableProduct.sku$$"/> </actionGroup> @@ -204,7 +204,7 @@ <!-- Go to "Images and Videos" section: assert image --> <scrollTo selector="{{AdminProductFormConfigurationsSection.sectionHeader}}" stepKey="scrollToProductGalleryTab"/> - <actionGroup ref="assertProductImageAdminProductPage" stepKey="assertProductImageAdminProductPage"> + <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"> <argument name="image" value="MagentoLogo"/> </actionGroup> @@ -214,7 +214,7 @@ <waitForPageLoad stepKey="waitForProductPageLoad"/> <!-- Go to "Images and Videos" section: assert image --> <scrollTo selector="{{AdminProductFormConfigurationsSection.sectionHeader}}" stepKey="scrollToChildProductGalleryTab"/> - <actionGroup ref="assertProductImageAdminProductPage" stepKey="assertChildProductImageAdminProductPage"> + <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertChildProductImageAdminProductPage"> <argument name="image" value="MagentoLogo"/> </actionGroup> <closeTab stepKey="closeConfigChildProductPage"/> diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml b/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml index f7cf0a4deba4b..b6831738923e1 100644 --- a/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/Test/AdminCreateProductWithZeroMaximumQtyAllowedInShoppingCartTest.xml @@ -75,6 +75,6 @@ <argument name="qty" value="50"/> </actionGroup> <waitForElementNotVisible selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryModal}}" stepKey="waitForModalFormToDisappear"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> </test> </tests> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml index 4df08fcca696b..6e3d87fb812a3 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminApplyCatalogRuleForConfigurableProductWithSpecialPricesTest.xml @@ -95,21 +95,21 @@ </after> <!-- Add special prices for products --> - <actionGroup ref="goToProductPageViaID" stepKey="goToFirstChildProduct"> + <actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="goToFirstChildProduct"> <argument name="productId" value="$$createFirstConfigChildProduct.id$$"/> </actionGroup> <actionGroup ref="AddSpecialPriceToProductActionGroup" stepKey="addSpecialPriceForFirstProduct"> <argument name="price" value="{{specialProductPrice.price}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveFirstProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveFirstProduct"/> - <actionGroup ref="goToProductPageViaID" stepKey="goToSecondChildProduct"> + <actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="goToSecondChildProduct"> <argument name="productId" value="$$createSecondConfigChildProduct.id$$"/> </actionGroup> <actionGroup ref="AddSpecialPriceToProductActionGroup" stepKey="addSpecialPriceForSecondProduct"> <argument name="price" value="{{specialProductPrice.price}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveSecondProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSecondProduct"/> <!-- Create a new catalog price rule --> <actionGroup ref="newCatalogPriceRuleByUIWithConditionIsCategory" stepKey="newCatalogPriceRuleByUIWithConditionIsCategory"> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest.xml index d80759531ecae..84f4a84b6fb05 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest.xml @@ -78,7 +78,7 @@ <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createProduct1.price$$" stepKey="seeTrueProductPrice1"/> <!-- Assert that the rule isn't present in the Shopping Cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToShoppingCart1"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProductToShoppingCart1"> <argument name="productName" value="$$createProduct1.name$$"/> </actionGroup> <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="openMiniShoppingCart1"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml index 16fbca2697702..aea03b61eb153 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml @@ -36,7 +36,7 @@ <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteConfigurableProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteConfigurableProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogPriceRuleByProductAttributeTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogPriceRuleByProductAttributeTest.xml index b9d601238ac73..1615985370182 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogPriceRuleByProductAttributeTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/ApplyCatalogPriceRuleByProductAttributeTest.xml @@ -140,49 +140,49 @@ <selectOption selector="{{StorefrontPropertiesSection.useForPromoRuleConditions}}" userInput="Yes" stepKey="selectYes"/> <!-- Save the attribute --> - <actionGroup ref="saveProductAttribute" stepKey="saveAttribute"/> + <actionGroup ref="SaveProductAttributeActionGroup" stepKey="saveAttribute"/> <!-- Add this product attribute to Default attribute set --> <actionGroup ref="AdminOpenAttributeSetGridPageActionGroup" stepKey="openAttributeSetPage"/> <actionGroup ref="AdminOpenAttributeSetByNameActionGroup" stepKey="openDefaultAttributeSet"/> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="{{productAttributeDropdownTwoOptions.attribute_code}}"/> </actionGroup> - <actionGroup ref="SaveAttributeSet" stepKey="saveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/> <!-- First Simple Product: choose green as attribute value --> - <actionGroup ref="filterAndSelectProduct" stepKey="openFirstSimpleProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openFirstSimpleProduct"> <argument name="productSku" value="$$createFirstProduct.sku$$"/> </actionGroup> <selectOption userInput="green" selector="{{AdminProductFormSection.customSelectField(productAttributeDropdownTwoOptions.attribute_code)}}" stepKey="selectGreen"/> - <actionGroup ref="saveProductForm" stepKey="saveFirstProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveFirstProduct"/> <!-- Second Simple Product: choose red as attribute value --> - <actionGroup ref="filterAndSelectProduct" stepKey="openSecondSimpleProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openSecondSimpleProduct"> <argument name="productSku" value="$$createSecondProduct.sku$$"/> </actionGroup> <selectOption userInput="red" selector="{{AdminProductFormSection.customSelectField(productAttributeDropdownTwoOptions.attribute_code)}}" stepKey="selectRed"/> - <actionGroup ref="saveProductForm" stepKey="saveSecondProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSecondProduct"/> <!-- Configurable child product1: choose green as attribute value --> - <actionGroup ref="filterAndSelectProduct" stepKey="openConfigChild1Product"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openConfigChild1Product"> <argument name="productSku" value="$$createConfigChildProduct1.sku$$"/> </actionGroup> <selectOption userInput="green" selector="{{AdminProductFormSection.customSelectField(productAttributeDropdownTwoOptions.attribute_code)}}" stepKey="selectGreenAttr"/> - <actionGroup ref="saveProductForm" stepKey="saveConfigChild1Product"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveConfigChild1Product"/> <!-- Configurable child product2: choose green as attribute value --> - <actionGroup ref="filterAndSelectProduct" stepKey="openConfigChild2Product"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openConfigChild2Product"> <argument name="productSku" value="$$createConfigChildProduct2.sku$$"/> </actionGroup> <selectOption userInput="green" selector="{{AdminProductFormSection.customSelectField(productAttributeDropdownTwoOptions.attribute_code)}}" stepKey="selectGreenAttribute"/> - <actionGroup ref="saveProductForm" stepKey="saveConfigChild2Product"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveConfigChild2Product"/> <!-- Navigate to Marketing - Promotions - Catalog Price Rules --> <amOnPage url="{{AdminCatalogPriceRuleGridPage.url}}" stepKey="amOnCatalogPriceRule"/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml index aa7cf933f6328..57940e39e9281 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml @@ -23,7 +23,7 @@ <waitForLoadingMaskToDisappear stepKey="waitForSearchProductsloaded" after="searchClickAdvancedSearchSubmitButton"/> <actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="searchCheckAdvancedSearchResult" after="waitForSearchProductsloaded"/> <see userInput="4" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.productCount}} span" stepKey="searchAdvancedAssertProductCount" after="searchCheckAdvancedSearchResult"/> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="searchAssertSimpleProduct1" after="searchAdvancedAssertProductCount"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="searchAssertSimpleProduct1" after="searchAdvancedAssertProductCount"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -31,7 +31,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$searchAdvancedGrabSimpleProduct1ImageSrc" stepKey="searchAdvancedAssertSimpleProduct1ImageNotDefault" after="searchAdvancedGrabSimpleProduct1ImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="searchClickSimpleProduct1View" after="searchAdvancedAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForSearchSimpleProduct1Viewloaded" after="searchClickSimpleProduct1View"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="searchAssertSimpleProduct1Page" after="waitForSearchSimpleProduct1Viewloaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="searchAssertSimpleProduct1Page" after="waitForSearchSimpleProduct1Viewloaded"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -51,14 +51,14 @@ <!-- Search simple product 1 --> <comment userInput="Search simple product 1" stepKey="commentSearchSimpleProduct1" after="searchAssertFilterCategoryProductCountCommonPart"/> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="searchAssertFilterCategorySimpleProduct1" after="commentSearchSimpleProduct1"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="searchAssertFilterCategorySimpleProduct1" after="commentSearchSimpleProduct1"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> <grabAttributeFrom selector="{{StorefrontCategoryProductSection.ProductImageByName($$createSimpleProduct1.name$$)}}" userInput="src" stepKey="searchGrabSimpleProduct1ImageSrc" after="searchAssertFilterCategorySimpleProduct1"/> <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$searchGrabSimpleProduct1ImageSrc" stepKey="searchAssertSimpleProduct1ImageNotDefault" after="searchGrabSimpleProduct1ImageSrc"/> <!-- Search simple product2 --> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="searchAssertFilterCategorySimpleProduct2" after="searchAssertSimpleProduct1ImageNotDefault"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="searchAssertFilterCategorySimpleProduct2" after="searchAssertSimpleProduct1ImageNotDefault"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -89,7 +89,7 @@ <waitForLoadingMaskToDisappear stepKey="waitForSearchProductsloaded" after="searchClickAdvancedSearchSubmitButton"/> <actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="searchCheckAdvancedSearchResult" after="waitForSearchProductsloaded"/> <see userInput="1" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.productCount}} span" stepKey="searchAdvancedAssertProductCount" after="searchCheckAdvancedSearchResult"/> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="searchAssertSimpleProduct1" after="searchAdvancedAssertProductCount"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="searchAssertSimpleProduct1" after="searchAdvancedAssertProductCount"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -97,7 +97,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$searchAdvancedGrabSimpleProduct1ImageSrc" stepKey="searchAdvancedAssertSimpleProduct1ImageNotDefault" after="searchAdvancedGrabSimpleProduct1ImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="searchClickSimpleProduct1View" after="searchAdvancedAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForSearchSimpleProduct1Viewloaded" after="searchClickSimpleProduct1View"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="searchAssertSimpleProduct1Page" after="waitForSearchSimpleProduct1Viewloaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="searchAssertSimpleProduct1Page" after="waitForSearchSimpleProduct1Viewloaded"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -117,14 +117,14 @@ <!-- Search simple product 1 --> <comment userInput="Search simple product 1" stepKey="commentSearchSimpleProduct1" after="searchAssertFilterCategoryProductCountCommonPart"/> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="searchAssertFilterCategorySimpleProduct1" after="commentSearchSimpleProduct1"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="searchAssertFilterCategorySimpleProduct1" after="commentSearchSimpleProduct1"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> <grabAttributeFrom selector="{{StorefrontCategoryProductSection.ProductImageByName($$createSimpleProduct1.name$$)}}" userInput="src" stepKey="searchGrabSimpleProduct1ImageSrc" after="searchAssertFilterCategorySimpleProduct1"/> <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$searchGrabSimpleProduct1ImageSrc" stepKey="searchAssertSimpleProduct1ImageNotDefault" after="searchGrabSimpleProduct1ImageSrc"/> <!-- Search simple product2 --> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="searchAssertFilterCategorySimpleProduct2" after="searchAssertSimpleProduct1ImageNotDefault"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="searchAssertFilterCategorySimpleProduct2" after="searchAssertSimpleProduct1ImageNotDefault"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml index 367cb6a6e214e..cd3dec912a3c1 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml @@ -23,7 +23,7 @@ <waitForLoadingMaskToDisappear stepKey="waitForSearchProductsloaded" after="searchClickAdvancedSearchSubmitButton"/> <actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="searchCheckAdvancedSearchResult" after="waitForSearchProductsloaded"/> <see userInput="1" selector="{{StorefrontCatalogSearchAdvancedResultMainSection.productCount}} span" stepKey="searchAdvancedAssertProductCount" after="searchCheckAdvancedSearchResult"/> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="searchAssertSimpleProduct1" after="searchAdvancedAssertProductCount"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="searchAssertSimpleProduct1" after="searchAdvancedAssertProductCount"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -31,7 +31,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$searchAdvancedGrabSimpleProduct1ImageSrc" stepKey="searchAdvancedAssertSimpleProduct1ImageNotDefault" after="searchAdvancedGrabSimpleProduct1ImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="searchClickSimpleProduct1View" after="searchAdvancedAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForSearchSimpleProduct1Viewloaded" after="searchClickSimpleProduct1View"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="searchAssertSimpleProduct1Page" after="waitForSearchSimpleProduct1Viewloaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="searchAssertSimpleProduct1Page" after="waitForSearchSimpleProduct1Viewloaded"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -51,14 +51,14 @@ <!-- Search simple product 1 --> <comment userInput="Search simple product 1" stepKey="commentSearchSimpleProduct1" after="searchAssertFilterCategoryProductCountCommonPart"/> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="searchAssertFilterCategorySimpleProduct1" after="commentSearchSimpleProduct1"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="searchAssertFilterCategorySimpleProduct1" after="commentSearchSimpleProduct1"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> <grabAttributeFrom selector="{{StorefrontCategoryProductSection.ProductImageByName($$createSimpleProduct1.name$$)}}" userInput="src" stepKey="searchGrabSimpleProduct1ImageSrc" after="searchAssertFilterCategorySimpleProduct1"/> <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$searchGrabSimpleProduct1ImageSrc" stepKey="searchAssertSimpleProduct1ImageNotDefault" after="searchGrabSimpleProduct1ImageSrc"/> <!-- Search simple product2 --> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="searchAssertFilterCategorySimpleProduct2" after="searchAssertSimpleProduct1ImageNotDefault"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="searchAssertFilterCategorySimpleProduct2" after="searchAssertSimpleProduct1ImageNotDefault"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/LayerNavigationOfCatalogSearchTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/LayerNavigationOfCatalogSearchTest.xml index c8f84c732d6ba..fa9407495e6e7 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/LayerNavigationOfCatalogSearchTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/LayerNavigationOfCatalogSearchTest.xml @@ -42,7 +42,7 @@ </after> <!--Update value for price attribute of Product 1--> <comment userInput="Update value for price attribute of Product 1" stepKey="comment1"/> - <actionGroup ref="navigateToCreatedProductEditPage" stepKey="navigateToCreatedProductEditPage1"> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="navigateToCreatedProductEditPage1"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <grabTextFrom selector="{{AdminProductFormSection.attributeLabelByText($$createPriceAttribute.attribute[frontend_labels][0][label]$$)}}" stepKey="grabAttributeLabel"/> @@ -51,7 +51,7 @@ <waitForPageLoad stepKey="waitForSimpleProductSaved1"/> <!--Update value for price attribute of Product 2--> <comment userInput="Update value for price attribute of Product 1" stepKey="comment2"/> - <actionGroup ref="navigateToCreatedProductEditPage" stepKey="navigateToCreatedProductEditPage2"> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="navigateToCreatedProductEditPage2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <fillField selector="{{AdminProductAttributeSection.customAttribute($$createPriceAttribute.attribute_code$$)}}" userInput="70" stepKey="fillCustomPrice2"/> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml index 3b60e4b09de28..3aa044b650943 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml @@ -203,47 +203,47 @@ <!-- Create and Assign Attribute to product1--> - <actionGroup ref="goToProductPageViaID" stepKey="goToProduct1"> + <actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="goToProduct1"> <argument name="productId" value="$product1.id$"/> </actionGroup> - <actionGroup ref="AdminCreateAttributeWithSearchWeight" stepKey="createProduct1Attribute"> + <actionGroup ref="AdminCreateAttributeWithSearchWeightActionGroup" stepKey="createProduct1Attribute"> <argument name="attributeType" value="Text Field"/> <argument name="attributeName" value="$product1.name$"/> <argument name="attributeSetName" value="$product1.name$"/> <argument name="weight" value="1"/> <argument name="defaultValue" value="{{_defaultProduct.name}}"/> </actionGroup> - <actionGroup ref="AdminProductPageSelectAttributeSet" stepKey="selectAttributeSet1"> + <actionGroup ref="AdminProductPageSelectAttributeSetActionGroup" stepKey="selectAttributeSet1"> <argument name="attributeSetName" value="$product1.name$"/> </actionGroup> <!--fill in default--> - <actionGroup ref="saveProductForm" stepKey="saveProduct1a"/> - <actionGroup ref="AdminProductPageFillTextAttributeValueByName" stepKey="fillDefault1"> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1a"/> + <actionGroup ref="AdminProductPageFillTextAttributeValueByNameActionGroup" stepKey="fillDefault1"> <argument name="attributeName" value="$product1.name$"/> <argument name="value" value="{{_defaultProduct.name}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct1b"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1b"/> <!-- Create and Assign Attribute to product2--> - <actionGroup ref="goToProductPageViaID" stepKey="goToProduct2"> + <actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="goToProduct2"> <argument name="productId" value="$product2.id$"/> </actionGroup> - <actionGroup ref="AdminCreateAttributeWithSearchWeight" stepKey="createProduct2Attribute"> + <actionGroup ref="AdminCreateAttributeWithSearchWeightActionGroup" stepKey="createProduct2Attribute"> <argument name="attributeType" value="Text Field"/> <argument name="attributeName" value="$product2.name$"/> <argument name="attributeSetName" value="$product2.name$"/> <argument name="weight" value="1"/> <argument name="defaultValue" value="{{_defaultProduct.name}}"/> </actionGroup> - <actionGroup ref="AdminProductPageSelectAttributeSet" stepKey="selectAttributeSet2"> + <actionGroup ref="AdminProductPageSelectAttributeSetActionGroup" stepKey="selectAttributeSet2"> <argument name="attributeSetName" value="$product2.name$"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct2a"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2a"/> <!--fill in default--> - <actionGroup ref="AdminProductPageFillTextAttributeValueByName" stepKey="fillDefault2"> + <actionGroup ref="AdminProductPageFillTextAttributeValueByNameActionGroup" stepKey="fillDefault2"> <argument name="attributeName" value="$product2.name$"/> <argument name="value" value="{{_defaultProduct.name}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct2b"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct2b"/> </before> <after> <deleteData stepKey="deleteProduct1" createDataKey="product1"/> @@ -275,7 +275,7 @@ <group value="mtf_migrated"/> </annotations> <before> - <actionGroup ref="AdminCreateAttributeWithSearchWeight" stepKey="createProduct1Attribute"> + <actionGroup ref="AdminCreateAttributeWithSearchWeightActionGroup" stepKey="createProduct1Attribute"> <argument name="attributeType" value="Text Field"/> <argument name="attributeName" value="$product1.name$"/> <argument name="attributeSetName" value="$product1.name$"/> @@ -377,7 +377,7 @@ </before> <after> <deleteData stepKey="deleteCategory" createDataKey="createCategory"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> @@ -446,7 +446,7 @@ </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="deleteAllProductsUsingProductGrid" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> <createData entity="ApiProductWithDescription" stepKey="simple1"/> <createData entity="ApiGroupedProduct" stepKey="createProduct"/> <createData entity="OneSimpleProductLink" stepKey="addProductOne"> @@ -503,7 +503,7 @@ <!--Finish bundle creation--> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <amOnPage url="{{AdminProductEditPage.url($$createBundleProduct.id$$)}}" stepKey="goToProductEditPage"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Perform reindex and flush cache --> <magentoCLI command="indexer:reindex" stepKey="reindex"/> @@ -570,7 +570,7 @@ <!--Finish bundle creation--> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <amOnPage url="{{AdminProductEditPage.url($$createBundleProduct.id$$)}}" stepKey="goToProductEditPage"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Perform reindex and flush cache --> <magentoCLI command="indexer:reindex" stepKey="reindex"/> @@ -629,14 +629,14 @@ <!-- Assign attribute to set --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <actionGroup ref="goToAttributeGridPage" stepKey="goToPage"/> - <actionGroup ref="goToAttributeSetByName" stepKey="goToSet"> + <actionGroup ref="GoToAttributeSetByNameActionGroup" stepKey="goToSet"> <argument name="name" value="$attributeSet.attribute_set_name$"/> </actionGroup> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignToAttributeSetAndGroup"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignToAttributeSetAndGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="$createConfigProductAttribute.attribute_code$"/> </actionGroup> - <actionGroup ref="SaveAttributeSet" stepKey="savePage"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="savePage"/> <!-- Get the first option of the attribute we created --> <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> @@ -682,11 +682,11 @@ </actionGroup> <!-- Disable Child Product --> - <actionGroup ref="goToProductPageViaID" stepKey="goToChildProduct"> + <actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="goToChildProduct"> <argument name="productId" value="$createConfigChildProduct1.id$"/> </actionGroup> - <actionGroup ref="toggleProductEnabled" stepKey="disableProduct"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="ToggleProductEnabledActionGroup" stepKey="disableProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToFrontPageAgain"/> <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="searchStorefrontAgain"> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchEntitySimpleProductTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchEntitySimpleProductTest.xml index 14df2133017d9..61f274cd13061 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchEntitySimpleProductTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/StorefrontAdvancedSearchEntitySimpleProductTest.xml @@ -21,7 +21,7 @@ <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Delete all products left by prev tests because it sensitive for search--> - <actionGroup ref="deleteAllProductsUsingProductGrid" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> <!-- Create Data --> <createData entity="ABC_dfj_SimpleProduct" stepKey="createProduct"/> </before> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminCategoryWithRestrictedUrlKeyNotCreatedTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminCategoryWithRestrictedUrlKeyNotCreatedTest.xml index 58b489da5082b..c3c7e3c3281f4 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminCategoryWithRestrictedUrlKeyNotCreatedTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminCategoryWithRestrictedUrlKeyNotCreatedTest.xml @@ -24,36 +24,36 @@ <after> <!--Delete created categories--> <comment userInput="Delete created categories" stepKey="commentDeleteCreatedCategories"/> - <actionGroup ref="AdminDeleteCategoryByName" stepKey="deleteAdminCategory"> + <actionGroup ref="AdminDeleteCategoryByNameActionGroup" stepKey="deleteAdminCategory"> <argument name="categoryName" value="admin"/> </actionGroup> - <actionGroup ref="AdminDeleteCategoryByName" stepKey="deleteSoapCategory"> + <actionGroup ref="AdminDeleteCategoryByNameActionGroup" stepKey="deleteSoapCategory"> <argument name="categoryName" value="soap"/> </actionGroup> - <actionGroup ref="AdminDeleteCategoryByName" stepKey="deleteRestCategory"> + <actionGroup ref="AdminDeleteCategoryByNameActionGroup" stepKey="deleteRestCategory"> <argument name="categoryName" value="rest"/> </actionGroup> - <actionGroup ref="AdminDeleteCategoryByName" stepKey="deleteGraphQlCategory"> + <actionGroup ref="AdminDeleteCategoryByNameActionGroup" stepKey="deleteGraphQlCategory"> <argument name="categoryName" value="graphql"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> </after> <!--Check category creation with restricted url key 'admin'--> <comment userInput="Check category creation with restricted url key 'admin'" stepKey="commentCheckAdminCategoryCreation"/> - <actionGroup ref="goToCreateCategoryPage" stepKey="goToCreateAdminCategoryPage"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillAdminFirstCategoryForm"> + <actionGroup ref="GoToCreateCategoryPageActionGroup" stepKey="goToCreateAdminCategoryPage"/> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillAdminFirstCategoryForm"> <argument name="categoryName" value="admin"/> <argument name="categoryUrlKey" value=""/> </actionGroup> <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlAdmin}}' stepKey="seeAdminFirstErrorMessage"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillAdminSecondCategoryForm"> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillAdminSecondCategoryForm"> <argument name="categoryName" value="{{SimpleSubCategory.name}}"/> <argument name="categoryUrlKey" value="admin"/> </actionGroup> <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlAdmin}}' stepKey="seeAdminSecondErrorMessage"/> <!--Create category with 'admin' name--> <comment userInput="Create category with 'admin' name" stepKey="commentAdminCategoryCreation"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillAdminThirdCategoryForm"> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillAdminThirdCategoryForm"> <argument name="categoryName" value="admin"/> <argument name="categoryUrlKey" value="{{SimpleSubCategory.name}}"/> </actionGroup> @@ -61,20 +61,20 @@ <seeElement selector="{{AdminCategorySidebarTreeSection.categoryByName('admin')}}" stepKey="seeAdminCategoryInTree"/> <!--Check category creation with restricted url key 'soap'--> <comment userInput="Check category creation with restricted url key 'soap'" stepKey="commentCheckSoapCategoryCreation"/> - <actionGroup ref="goToCreateCategoryPage" stepKey="goToCreateSoapCategoryPage"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillSoapFirstCategoryForm"> + <actionGroup ref="GoToCreateCategoryPageActionGroup" stepKey="goToCreateSoapCategoryPage"/> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillSoapFirstCategoryForm"> <argument name="categoryName" value="soap"/> <argument name="categoryUrlKey" value=""/> </actionGroup> <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlSoap}}' stepKey="seeSoapFirstErrorMessage"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillSoapSecondCategoryForm"> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillSoapSecondCategoryForm"> <argument name="categoryName" value="{{ApiCategory.name}}"/> <argument name="categoryUrlKey" value="soap"/> </actionGroup> <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlSoap}}' stepKey="seeSoapSecondErrorMessage"/> <!--Create category with 'soap' name--> <comment userInput="Create category with 'soap' name" stepKey="commentSoapCategoryCreation"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillSoapThirdCategoryForm"> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillSoapThirdCategoryForm"> <argument name="categoryName" value="soap"/> <argument name="categoryUrlKey" value="{{ApiCategory.name}}"/> </actionGroup> @@ -82,20 +82,20 @@ <seeElement selector="{{AdminCategorySidebarTreeSection.categoryByName('soap')}}" stepKey="seeSoapCategoryInTree"/> <!--Check category creation with restricted url key 'rest'--> <comment userInput="Check category creation with restricted url key 'rest'" stepKey="commentCheckRestCategoryCreation"/> - <actionGroup ref="goToCreateCategoryPage" stepKey="goToCreateRestCategoryPage"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillRestFirstCategoryForm"> + <actionGroup ref="GoToCreateCategoryPageActionGroup" stepKey="goToCreateRestCategoryPage"/> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillRestFirstCategoryForm"> <argument name="categoryName" value="rest"/> <argument name="categoryUrlKey" value=""/> </actionGroup> <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlRest}}' stepKey="seeRestFirstErrorMessage"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillRestSecondCategoryForm"> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillRestSecondCategoryForm"> <argument name="categoryName" value="{{SubCategoryWithParent.name}}"/> <argument name="categoryUrlKey" value="rest"/> </actionGroup> <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlRest}}' stepKey="seeRestSecondErrorMessage"/> <!--Create category with 'rest' name--> <comment userInput="Create category with 'rest' name" stepKey="commentRestCategoryCreation"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillRestThirdCategoryForm"> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillRestThirdCategoryForm"> <argument name="categoryName" value="rest"/> <argument name="categoryUrlKey" value="{{SubCategoryWithParent.name}}"/> </actionGroup> @@ -103,20 +103,20 @@ <seeElement selector="{{AdminCategorySidebarTreeSection.categoryByName('rest')}}" stepKey="seeRestCategoryInTree"/> <!--Check category creation with restricted url key 'graphql'--> <comment userInput="Check category creation with restricted url key 'graphql'" stepKey="commentCheckGraphQlCategoryCreation"/> - <actionGroup ref="goToCreateCategoryPage" stepKey="goToCreateCategoryPage"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillGraphQlFirstCategoryForm"> + <actionGroup ref="GoToCreateCategoryPageActionGroup" stepKey="goToCreateCategoryPage"/> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillGraphQlFirstCategoryForm"> <argument name="categoryName" value="graphql"/> <argument name="categoryUrlKey" value=""/> </actionGroup> <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlGraphql}}' stepKey="seeGraphQlFirstErrorMessage"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillGraphQlSecondCategoryForm"> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillGraphQlSecondCategoryForm"> <argument name="categoryName" value="{{NewSubCategoryWithParent.name}}"/> <argument name="categoryUrlKey" value="graphql"/> </actionGroup> <see selector="{{AdminMessagesSection.error}}" userInput='{{AdminCategoryRestrictedUrlErrorMessage.urlGraphql}}' stepKey="seeGraphQlSecondErrorMessage"/> <!--Create category with 'graphql' name--> <comment userInput="Create category with 'graphql' name" stepKey="commentGraphQlCategoryCreation"/> - <actionGroup ref="FillCategoryNameAndUrlKeyAndSave" stepKey="fillGraphQlThirdCategoryForm"> + <actionGroup ref="FillCategoryNameAndUrlKeyAndSaveActionGroup" stepKey="fillGraphQlThirdCategoryForm"> <argument name="categoryName" value="graphql"/> <argument name="categoryUrlKey" value="{{NewSubCategoryWithParent.name}}"/> </actionGroup> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminUrlForProductRewrittenCorrectlyTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminUrlForProductRewrittenCorrectlyTest.xml index 5423267676507..cc5f09faca57b 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminUrlForProductRewrittenCorrectlyTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/AdminUrlForProductRewrittenCorrectlyTest.xml @@ -41,7 +41,7 @@ <waitForPageLoad stepKey="waitForEditPage"/> <!--Switch to Default Store view--> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="selectSecondStoreView"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="selectSecondStoreView"> <argument name="storeViewName" value="Default Store View"/> </actionGroup> <waitForPageLoad stepKey="waitForStoreViewLoad"/> @@ -51,12 +51,12 @@ <waitForElementVisible selector="{{AdminProductSEOSection.useDefaultUrl}}" stepKey="waitForUseDefaultUrlCheckbox"/> <click selector="{{AdminProductSEOSection.useDefaultUrl}}" stepKey="clickUseDefaultUrlCheckbox"/> <fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="$$createProduct.sku$$-new" stepKey="changeUrlKey"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Select product and go toUpdate Attribute page--> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="GoToCatalogPageChangingView"/> <waitForPageLoad stepKey="WaitForPageToLoadFullyChangingView"/> - <actionGroup ref="filterProductGridByName" stepKey="filterBundleProductOptionsDownToName"> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName"> <argument name="product" value="ApiSimpleProduct"/> </actionGroup> <click selector="{{AdminProductFiltersSection.allCheckbox}}" stepKey="ClickOnSelectAllCheckBoxChangingView"/> diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/RewriteStoreLevelUrlKeyOfChildCategoryTest.xml b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/RewriteStoreLevelUrlKeyOfChildCategoryTest.xml index 67870c51140a6..c3a358bbbd292 100644 --- a/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/RewriteStoreLevelUrlKeyOfChildCategoryTest.xml +++ b/app/code/Magento/CatalogUrlRewrite/Test/Mftf/Test/RewriteStoreLevelUrlKeyOfChildCategoryTest.xml @@ -1,67 +1,67 @@ -<?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="RewriteStoreLevelUrlKeyOfChildCategoryTest"> - <annotations> - <title value="Rewriting Store-level URL key of child category"/> - <stories value="MAGETWO-91649: #13513: Magento ignore store-level url_key of child category in URL rewrite process for global scope"/> - <description value="Rewriting Store-level URL key of child category"/> - <features value="CatalogUrlRewrite"/> - <severity value="MAJOR"/> - <testCaseId value="MAGETWO-94934"/> - <group value="CatalogUrlRewrite"/> - </annotations> - - <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView" /> - - <createData entity="_defaultCategory" stepKey="defaultCategory"/> - <createData entity="SubCategoryWithParent" stepKey="subCategory"> - <requiredEntity createDataKey="defaultCategory"/> - </createData> - </before> - - <actionGroup ref="navigateToCreatedCategory" stepKey="navigateToCreatedSubCategory"> - <argument name="Category" value="$$subCategory$$"/> - </actionGroup> - - <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="AdminSwitchStoreViewForSubCategory"/> - - <actionGroup ref="ChangeSeoUrlKeyForSubCategory" stepKey="changeSeoUrlKeyForSubCategory"> - <argument name="value" value="bags-second"/> - </actionGroup> - - <actionGroup ref="navigateToCreatedCategory" stepKey="navigateToCreatedDefaultCategory"> - <argument name="Category" value="$$defaultCategory$$"/> - </actionGroup> - - <actionGroup ref="ChangeSeoUrlKey" stepKey="changeSeoUrlKeyForDefaultCategory"> - <argument name="value" value="gear-global"/> - </actionGroup> - - <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToStorefrontPage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - - <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="storefrontSwitchStoreView"/> - - <actionGroup ref="GoToSubCategoryPage" stepKey="goToSubCategoryPage"> - <argument name="parentCategory" value="$$defaultCategory$$"/> - <argument name="subCategory" value="$$subCategory$$"/> - <argument name="urlPath" value="gear-global/bags-second"/> - </actionGroup> - - <after> - <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView"/> - <actionGroup ref="logout" stepKey="logout"/> - - <deleteData createDataKey="subCategory" stepKey="deleteSubCategory"/> - <deleteData createDataKey="defaultCategory" stepKey="deleteNewRootCategory"/> - </after> - </test> -</tests> +<?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="RewriteStoreLevelUrlKeyOfChildCategoryTest"> + <annotations> + <title value="Rewriting Store-level URL key of child category"/> + <stories value="MAGETWO-91649: #13513: Magento ignore store-level url_key of child category in URL rewrite process for global scope"/> + <description value="Rewriting Store-level URL key of child category"/> + <features value="CatalogUrlRewrite"/> + <severity value="MAJOR"/> + <testCaseId value="MAGETWO-94934"/> + <group value="CatalogUrlRewrite"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView" /> + + <createData entity="_defaultCategory" stepKey="defaultCategory"/> + <createData entity="SubCategoryWithParent" stepKey="subCategory"> + <requiredEntity createDataKey="defaultCategory"/> + </createData> + </before> + + <actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="navigateToCreatedSubCategory"> + <argument name="Category" value="$$subCategory$$"/> + </actionGroup> + + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="AdminSwitchStoreViewForSubCategory"/> + + <actionGroup ref="ChangeSeoUrlKeyForSubCategoryActionGroup" stepKey="changeSeoUrlKeyForSubCategory"> + <argument name="value" value="bags-second"/> + </actionGroup> + + <actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="navigateToCreatedDefaultCategory"> + <argument name="Category" value="$$defaultCategory$$"/> + </actionGroup> + + <actionGroup ref="ChangeSeoUrlKeyActionGroup" stepKey="changeSeoUrlKeyForDefaultCategory"> + <argument name="value" value="gear-global"/> + </actionGroup> + + <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToStorefrontPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="storefrontSwitchStoreView"/> + + <actionGroup ref="GoToSubCategoryPageActionGroup" stepKey="goToSubCategoryPage"> + <argument name="parentCategory" value="$$defaultCategory$$"/> + <argument name="subCategory" value="$$subCategory$$"/> + <argument name="urlPath" value="gear-global/bags-second"/> + </actionGroup> + + <after> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView"/> + <actionGroup ref="logout" stepKey="logout"/> + + <deleteData createDataKey="subCategory" stepKey="deleteSubCategory"/> + <deleteData createDataKey="defaultCategory" stepKey="deleteNewRootCategory"/> + </after> + </test> +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest.xml index 163e71c50053f..971af9688e754 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/CheckCheckoutSuccessPageTest.xml @@ -45,7 +45,7 @@ <waitForPageLoad stepKey="waitForCatalogPageLoad"/> <!--Add Product to Shopping Cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> @@ -71,7 +71,7 @@ <waitForPageLoad stepKey="waitForCatalogPageLoad2"/> <!--Add Product to Shopping Cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage2"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage2"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> @@ -96,7 +96,7 @@ <waitForPageLoad stepKey="waitForCatalogPageLoad3"/> <!--Add Product to Shopping Cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage3"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage3"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> @@ -156,7 +156,7 @@ <waitForPageLoad stepKey="waitForCatalogPageLoad"/> <!--Add Product to Shopping Cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> @@ -193,7 +193,7 @@ <waitForPageLoad stepKey="waitForCatalogPageLoad2"/> <!--Add Product to Shopping Cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage2"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage2"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/CheckNotVisibleProductInMinicartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/CheckNotVisibleProductInMinicartTest.xml index 4b4ca1935fd78..f99678d9171b2 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/CheckNotVisibleProductInMinicartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/CheckNotVisibleProductInMinicartTest.xml @@ -27,7 +27,7 @@ <waitForPageLoad stepKey="waitForCatalogPageLoad"/> <!--Add simple product1 to Shopping Cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage1"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage1"> <argument name="productName" value="$$createSimpleProduct1.name$$"/> </actionGroup> @@ -47,7 +47,7 @@ <waitForPageLoad stepKey="waitForCatalogPageLoad2"/> <!--Add simple product2 to Shopping Cart for updating cart items--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage2"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage2"> <argument name="productName" value="$$createSimpleProduct2.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/ConfiguringInstantPurchaseFunctionalityTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/ConfiguringInstantPurchaseFunctionalityTest.xml index 0897e20f1b17d..aea0657cc2e3b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/ConfiguringInstantPurchaseFunctionalityTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/ConfiguringInstantPurchaseFunctionalityTest.xml @@ -64,7 +64,7 @@ </actionGroup> <!-- Add product to cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml index 166f5022d5aeb..c3fb83cd1a096 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml @@ -38,7 +38,7 @@ <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> </after> <!-- Add simple product to cart and go to checkout--> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleDynamicProductFromShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleDynamicProductFromShoppingCartTest.xml index 5ad4c764026f7..ef5f5b640b0a2 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleDynamicProductFromShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleDynamicProductFromShoppingCartTest.xml @@ -55,7 +55,7 @@ <!-- Add product to the cart --> <click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickCustomizeAndAddToCart"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$$createBundleDynamicProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleFixedProductFromShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleFixedProductFromShoppingCartTest.xml index d1008c5831983..e141d0628cc4d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleFixedProductFromShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/DeleteBundleFixedProductFromShoppingCartTest.xml @@ -47,7 +47,7 @@ <!-- Add product to the cart --> <click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickCustomizeAndAddToCart"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$$createFixedBundleProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/DeleteDownloadableProductFromShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/DeleteDownloadableProductFromShoppingCartTest.xml index e16ef70c23e3d..988e3b8d3129d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/DeleteDownloadableProductFromShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/DeleteDownloadableProductFromShoppingCartTest.xml @@ -39,7 +39,7 @@ <!-- Add downloadable product to the cart --> <amOnPage url="{{StorefrontProductPage.url($$createDownloadableProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToDownloadableProductPage"/> <waitForPageLoad stepKey="waitForDownloadableProductPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartDownloadableProductFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartDownloadableProductFromStorefrontProductPage"> <argument name="productName" value="$$createDownloadableProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/DeleteVirtualProductFromShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/DeleteVirtualProductFromShoppingCartTest.xml index 97dcdd52127fd..969a827a8a461 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/DeleteVirtualProductFromShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/DeleteVirtualProductFromShoppingCartTest.xml @@ -33,7 +33,7 @@ <!-- Add virtual product to the cart --> <amOnPage url="{{StorefrontProductPage.url($$createVirtualProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartVirtualProductFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartVirtualProductFromStorefrontProductPage"> <argument name="productName" value="$$createVirtualProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml index 4281a0eb77da8..7002479279a78 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/EndToEndB2CGuestUserTest.xml @@ -19,7 +19,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="cartAssertSimpleProduct1" after="cartAssertCategory"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="cartAssertSimpleProduct1" after="cartAssertCategory"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -27,7 +27,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartGrabSimpleProduct1ImageSrc" stepKey="cartAssertSimpleProduct1ImageNotDefault" after="cartGrabSimpleProduct1ImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="cartClickSimpleProduct1" after="cartAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForCartSimpleProduct1loaded" after="cartClickSimpleProduct1"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertProduct1Page" after="waitForCartSimpleProduct1loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertProduct1Page" after="waitForCartSimpleProduct1loaded"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -46,7 +46,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="cartAssertSimpleProduct2" after="cartAssertCategory1ForSimpleProduct2"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="cartAssertSimpleProduct2" after="cartAssertCategory1ForSimpleProduct2"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -69,7 +69,7 @@ <assertNotRegExp expected="'/placeholder\/thumbnail\.jpg/'" actual="$cartMinicartGrabSimpleProduct1ImageSrc" stepKey="cartMinicartAssertSimpleProduct1ImageNotDefault" after="cartMinicartGrabSimpleProduct1ImageSrc"/> <click selector="{{StorefrontMinicartSection.productLinkByName($$createSimpleProduct1.name$$)}}" stepKey="cartMinicartClickSimpleProduct1" after="cartMinicartAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForMinicartSimpleProduct1loaded" after="cartMinicartClickSimpleProduct1"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertMinicartProduct1Page" after="waitForMinicartSimpleProduct1loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertMinicartProduct1Page" after="waitForMinicartSimpleProduct1loaded"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -85,7 +85,7 @@ <assertNotRegExp expected="'/placeholder\/thumbnail\.jpg/'" actual="$cartMinicartGrabSimpleProduct2ImageSrc" stepKey="cartMinicartAssertSimpleProduct2ImageNotDefault" after="cartMinicartGrabSimpleProduct2ImageSrc"/> <click selector="{{StorefrontMinicartSection.productLinkByName($$createSimpleProduct2.name$$)}}" stepKey="cartMinicartClickSimpleProduct2" after="cartMinicartAssertSimpleProduct2ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForMinicartSimpleProduct2loaded" after="cartMinicartClickSimpleProduct2"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertMinicartProduct2Page" after="waitForMinicartSimpleProduct2loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertMinicartProduct2Page" after="waitForMinicartSimpleProduct2loaded"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -114,7 +114,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartCartGrabSimpleProduct1ImageSrc" stepKey="cartCartAssertSimpleProduct1ImageNotDefault" after="cartCartGrabSimpleProduct1ImageSrc"/> <click selector="{{CheckoutCartProductSection.ProductLinkByName($$createSimpleProduct1.name$$)}}" stepKey="cartClickCartSimpleProduct1" after="cartCartAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForCartSimpleProduct1loadedAgain" after="cartClickCartSimpleProduct1"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertCartProduct1Page" after="waitForCartSimpleProduct1loadedAgain"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertCartProduct1Page" after="waitForCartSimpleProduct1loadedAgain"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -134,7 +134,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartCartGrabSimpleProduct2ImageSrc" stepKey="cartCartAssertSimpleProduct2ImageNotDefault" after="cartCartGrabSimpleProduct2ImageSrc"/> <click selector="{{CheckoutCartProductSection.ProductLinkByName($$createSimpleProduct2.name$$)}}" stepKey="cartClickCartSimpleProduct2" after="cartCartAssertSimpleProduct2ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForCartSimpleProduct2loaded" after="cartClickCartSimpleProduct2"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertCartProduct2Page" after="waitForCartSimpleProduct2loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertCartProduct2Page" after="waitForCartSimpleProduct2loaded"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -207,7 +207,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="cartAssertSimpleProduct1" after="cartAssertCategory"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="cartAssertSimpleProduct1" after="cartAssertCategory"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -215,7 +215,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartGrabSimpleProduct1ImageSrc" stepKey="cartAssertSimpleProduct1ImageNotDefault" after="cartGrabSimpleProduct1ImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="cartClickSimpleProduct1" after="cartAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForCartSimpleProduct1loaded" after="cartClickSimpleProduct1"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertProduct1Page" after="waitForCartSimpleProduct1loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertProduct1Page" after="waitForCartSimpleProduct1loaded"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -234,7 +234,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="cartAssertSimpleProduct2" after="cartAssertCategory1ForSimpleProduct2"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="cartAssertSimpleProduct2" after="cartAssertCategory1ForSimpleProduct2"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -257,7 +257,7 @@ <assertNotRegExp expected="'/placeholder\/thumbnail\.jpg/'" actual="$cartMinicartGrabSimpleProduct1ImageSrc" stepKey="cartMinicartAssertSimpleProduct1ImageNotDefault" after="cartMinicartGrabSimpleProduct1ImageSrc"/> <click selector="{{StorefrontMinicartSection.productLinkByName($$createSimpleProduct1.name$$)}}" stepKey="cartMinicartClickSimpleProduct1" after="cartMinicartAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForMinicartSimpleProduct1loaded" after="cartMinicartClickSimpleProduct1"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertMinicartProduct1Page" after="waitForMinicartSimpleProduct1loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertMinicartProduct1Page" after="waitForMinicartSimpleProduct1loaded"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -273,7 +273,7 @@ <assertNotRegExp expected="'/placeholder\/thumbnail\.jpg/'" actual="$cartMinicartGrabSimpleProduct2ImageSrc" stepKey="cartMinicartAssertSimpleProduct2ImageNotDefault" after="cartMinicartGrabSimpleProduct2ImageSrc"/> <click selector="{{StorefrontMinicartSection.productLinkByName($$createSimpleProduct2.name$$)}}" stepKey="cartMinicartClickSimpleProduct2" after="cartMinicartAssertSimpleProduct2ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForMinicartSimpleProduct2loaded" after="cartMinicartClickSimpleProduct2"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertMinicartProduct2Page" after="waitForMinicartSimpleProduct2loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertMinicartProduct2Page" after="waitForMinicartSimpleProduct2loaded"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -302,7 +302,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartCartGrabSimpleProduct1ImageSrc" stepKey="cartCartAssertSimpleProduct1ImageNotDefault" after="cartCartGrabSimpleProduct1ImageSrc"/> <click selector="{{CheckoutCartProductSection.ProductLinkByName($$createSimpleProduct1.name$$)}}" stepKey="cartClickCartSimpleProduct1" after="cartCartAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForCartSimpleProduct1loadedAgain" after="cartClickCartSimpleProduct1"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertCartProduct1Page" after="waitForCartSimpleProduct1loadedAgain"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertCartProduct1Page" after="waitForCartSimpleProduct1loadedAgain"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -322,7 +322,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartCartGrabSimpleProduct2ImageSrc" stepKey="cartCartAssertSimpleProduct2ImageNotDefault" after="cartCartGrabSimpleProduct2ImageSrc"/> <click selector="{{CheckoutCartProductSection.ProductLinkByName($$createSimpleProduct2.name$$)}}" stepKey="cartClickCartSimpleProduct2" after="cartCartAssertSimpleProduct2ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForCartSimpleProduct2loaded" after="cartClickCartSimpleProduct2"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertCartProduct2Page" after="waitForCartSimpleProduct2loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertCartProduct2Page" after="waitForCartSimpleProduct2loaded"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml index 65627787e2a05..6df859c9972c3 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml @@ -19,7 +19,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="cartAssertSimpleProduct1" after="cartAssertCategory"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="cartAssertSimpleProduct1" after="cartAssertCategory"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -27,7 +27,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartGrabSimpleProduct1ImageSrc" stepKey="cartAssertSimpleProduct1ImageNotDefault" after="cartGrabSimpleProduct1ImageSrc"/> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct1.name$$)}}" stepKey="cartClickSimpleProduct1" after="cartAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForCartSimpleProduct1loaded" after="cartClickSimpleProduct1"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertProduct1Page" after="waitForCartSimpleProduct1loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertProduct1Page" after="waitForCartSimpleProduct1loaded"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -46,7 +46,7 @@ <argument name="category" value="$$createCategory$$"/> <argument name="productCount" value="3"/> </actionGroup> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="cartAssertSimpleProduct2" after="cartAssertCategory1ForSimpleProduct2"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="cartAssertSimpleProduct2" after="cartAssertCategory1ForSimpleProduct2"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -69,7 +69,7 @@ <assertNotRegExp expected="'/placeholder\/thumbnail\.jpg/'" actual="$cartMinicartGrabSimpleProduct1ImageSrc" stepKey="cartMinicartAssertSimpleProduct1ImageNotDefault" after="cartMinicartGrabSimpleProduct1ImageSrc"/> <click selector="{{StorefrontMinicartSection.productLinkByName($$createSimpleProduct1.name$$)}}" stepKey="cartMinicartClickSimpleProduct1" after="cartMinicartAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForMinicartSimpleProduct1loaded" after="cartMinicartClickSimpleProduct1"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertMinicartProduct1Page" after="waitForMinicartSimpleProduct1loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertMinicartProduct1Page" after="waitForMinicartSimpleProduct1loaded"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -85,7 +85,7 @@ <assertNotRegExp expected="'/placeholder\/thumbnail\.jpg/'" actual="$cartMinicartGrabSimpleProduct2ImageSrc" stepKey="cartMinicartAssertSimpleProduct2ImageNotDefault" after="cartMinicartGrabSimpleProduct2ImageSrc"/> <click selector="{{StorefrontMinicartSection.productLinkByName($$createSimpleProduct2.name$$)}}" stepKey="cartMinicartClickSimpleProduct2" after="cartMinicartAssertSimpleProduct2ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForMinicartSimpleProduct2loaded" after="cartMinicartClickSimpleProduct2"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertMinicartProduct2Page" after="waitForMinicartSimpleProduct2loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertMinicartProduct2Page" after="waitForMinicartSimpleProduct2loaded"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -114,7 +114,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartCartGrabSimpleProduct1ImageSrc" stepKey="cartCartAssertSimpleProduct1ImageNotDefault" after="cartCartGrabSimpleProduct1ImageSrc"/> <click selector="{{CheckoutCartProductSection.ProductLinkByName($$createSimpleProduct1.name$$)}}" stepKey="cartClickCartSimpleProduct1" after="cartCartAssertSimpleProduct1ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForCartSimpleProduct1loadedAgain" after="cartClickCartSimpleProduct1"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertCartProduct1Page" after="waitForCartSimpleProduct1loadedAgain"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertCartProduct1Page" after="waitForCartSimpleProduct1loadedAgain"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> @@ -134,7 +134,7 @@ <assertNotRegExp expected="'/placeholder\/small_image\.jpg/'" actual="$cartCartGrabSimpleProduct2ImageSrc" stepKey="cartCartAssertSimpleProduct2ImageNotDefault" after="cartCartGrabSimpleProduct2ImageSrc"/> <click selector="{{CheckoutCartProductSection.ProductLinkByName($$createSimpleProduct2.name$$)}}" stepKey="cartClickCartSimpleProduct2" after="cartCartAssertSimpleProduct2ImageNotDefault"/> <waitForLoadingMaskToDisappear stepKey="waitForCartSimpleProduct2loaded" after="cartClickCartSimpleProduct2"/> - <actionGroup ref="StorefrontCheckSimpleProduct" stepKey="cartAssertCartProduct2Page" after="waitForCartSimpleProduct2loaded"> + <actionGroup ref="StorefrontCheckSimpleProductActionGroup" stepKey="cartAssertCartProduct2Page" after="waitForCartSimpleProduct2loaded"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <!-- @TODO: Move Image check to action group after MQE-697 is fixed --> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/IdentityOfDefaultBillingAndShippingAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/IdentityOfDefaultBillingAndShippingAddressTest.xml index 89028e146c358..e2d1a1b9139c8 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/IdentityOfDefaultBillingAndShippingAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/IdentityOfDefaultBillingAndShippingAddressTest.xml @@ -36,7 +36,7 @@ </actionGroup> <!-- Add simple product to cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart1"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart1"> <argument name="product" value="$$product$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml index aa3665a81bbde..ad7d55e8f9205 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingDefaultAddressTest.xml @@ -45,7 +45,7 @@ <!-- Add Simple Product to cart --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml index bafad6f28a680..cb752c3b752de 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNewAddressTest.xml @@ -45,7 +45,7 @@ <!-- Add Simple Product to cart --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml index 2c341a5c4c1ab..e2e1039b301d1 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutAsCustomerUsingNonDefaultAddressTest.xml @@ -45,7 +45,7 @@ <!-- Add Simple Product to cart --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml index 990459d7c81b7..ddb732b785995 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutUsingSignInLinkTest.xml @@ -45,7 +45,7 @@ <!-- Add Simple Product to cart --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml index e85a47ab7a91d..67b159e42d9e1 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithAllProductTypesTest.xml @@ -116,7 +116,7 @@ <!-- Add Simple Product to cart --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> <waitForPageLoad stepKey="waitForSimpleProductPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> @@ -131,14 +131,14 @@ <!-- Add Virtual Product to cart --> <amOnPage url="{{StorefrontProductPage.url($$createVirtualProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToVirtualProductPage"/> <waitForPageLoad stepKey="waitForVirtualProductPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartVirtualProductFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartVirtualProductFromStorefrontProductPage"> <argument name="productName" value="$$createVirtualProduct.name$$"/> </actionGroup> <!-- Add Downloadable Product to cart --> <amOnPage url="{{StorefrontProductPage.url($$createDownloadableProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToDownloadableProductPage"/> <waitForPageLoad stepKey="waitForDownloadableProductPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartDownloadableProductFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartDownloadableProductFromStorefrontProductPage"> <argument name="productName" value="$$createDownloadableProduct.name$$"/> </actionGroup> @@ -146,7 +146,7 @@ <amOnPage url="{{StorefrontProductPage.url($$createGroupedProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToGroupedProductPage"/> <waitForPageLoad stepKey="waitForGroupedProductPageLoad"/> <fillField selector="{{StorefrontProductPageSection.qtyInput}}" userInput="1" stepKey="fillFieldQtyInput"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartGroupedProductFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartGroupedProductFromStorefrontProductPage"> <argument name="productName" value="$$createGroupedProduct.name$$"/> </actionGroup> @@ -154,7 +154,7 @@ <amOnPage url="{{StorefrontProductPage.url($$createFixedBundleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToBundleProductPage"/> <waitForPageLoad stepKey="waitForFixedBundleProductPageLoad"/> <click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickCustomizeAndAddToCart"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFixedBundleProductFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFixedBundleProductFromStorefrontProductPage"> <argument name="productName" value="$$createFixedBundleProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml index 84cdb8abd9344..97ff6d8e56243 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/ShoppingCartAndMiniShoppingCartPerCustomerTest.xml @@ -66,7 +66,7 @@ <waitForPageLoad stepKey="waitForFirstProductPageLoad"/> <!-- Add the product to the shopping cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addFirstProductToCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addFirstProductToCart"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> @@ -102,7 +102,7 @@ <waitForPageLoad stepKey="waitForProductPage"/> <!-- Add the product to the shopping cart --> - <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPage" stepKey="addProductToCart"> + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$$createSimpleProduct.name$$"/> <argument name="productQty" value="{{quoteQty2Price123.qty}}"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartWithoutAnySelectedOptionTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartWithoutAnySelectedOptionTest.xml index d108dc3657a40..450bfff27125a 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartWithoutAnySelectedOptionTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartWithoutAnySelectedOptionTest.xml @@ -31,7 +31,7 @@ </after> <!-- Open Product page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct1PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct1PageAndVerifyProduct"> <argument name="product" value="$$createProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml index 693c05684f292..c08a930ba6224 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml @@ -36,7 +36,7 @@ <amOnPage url="$$product.name$$.html" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForProductPage"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$product.name$$"/> </actionGroup> <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml index fb80b4880a6f4..2aa6530dea205 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontUpdateShoppingCartWhileUpdateMinicartTest.xml @@ -32,7 +32,7 @@ <!--Add product to cart--> <amOnPage url="$$createProduct.name$$.html" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForProductPage"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml index 071311b78b3fa..fdfa7f192232e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartTest.xml @@ -57,7 +57,7 @@ </after> <!--Open Product page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$createBundleProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartWithDisableMiniCartSidebarTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartWithDisableMiniCartSidebarTest.xml index d67800e21afc2..5d5e2b3a91f49 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartWithDisableMiniCartSidebarTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddBundleDynamicProductToShoppingCartWithDisableMiniCartSidebarTest.xml @@ -61,7 +61,7 @@ </after> <!--Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$createBundleProduct$$"/> </actionGroup> <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seePriceRangeIsVisible"> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml index 9b8e5a4521115..9153693923c09 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddOneBundleMultiSelectOptionToTheShoppingCartTest.xml @@ -57,7 +57,7 @@ </after> <!--Open Product page in StoreFront and assert product details --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$createBundleProduct$$"/> </actionGroup> <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seePriceRangeIsVisible"> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartTest.xml index e90f69e88cec7..319183d4641e6 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartTest.xml @@ -30,7 +30,7 @@ <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> </after> <!-- Open Product page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct1PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct1PageAndVerifyProduct"> <argument name="product" value="$$createProduct$$"/> </actionGroup> @@ -111,4 +111,4 @@ <argument name="qty" value="2"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml index 71e99f41f79e1..2625ca2f1a6fe 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddTwoBundleMultiSelectOptionsToTheShoppingCartTest.xml @@ -57,7 +57,7 @@ </after> <!--Open Product page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$createBundleProduct$$"/> </actionGroup> <actionGroup ref="AssertStorefrontElementVisibleActionGroup" stepKey="seePriceRangeIsVisible"> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontApplyPromoCodeDuringCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontApplyPromoCodeDuringCheckoutTest.xml index bdfdfceab53f9..9f50e9c9f8f74 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontApplyPromoCodeDuringCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontApplyPromoCodeDuringCheckoutTest.xml @@ -42,7 +42,7 @@ </after> <!-- Go to Storefront as Guest and add simple product to cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndCheckoutItemsCountTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndCheckoutItemsCountTest.xml index 0327deaf18968..c3f173961f0c5 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndCheckoutItemsCountTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndCheckoutItemsCountTest.xml @@ -33,13 +33,13 @@ <!-- Add simpleProduct1 to cart --> <amOnPage url="{{StorefrontProductPage.url($$simpleProduct1.custom_attributes[url_key]$)}}" stepKey="amOnProduct1Page"/> - <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPage" stepKey="addProduct1ToCart"> + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addProduct1ToCart"> <argument name="productName" value="$$simpleProduct1.name$$"/> <argument name="productQty" value="2"/> </actionGroup> <!-- Add simpleProduct2 to cart --> <amOnPage url="{{StorefrontProductPage.url($$simpleProduct2.custom_attributes[url_key]$)}}" stepKey="amOnProduct2Page"/> - <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPage" stepKey="addProduct2ToCart"> + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addProduct2ToCart"> <argument name="productName" value="$$simpleProduct2.name$$"/> <argument name="productQty" value="1"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndSummaryBlockItemDisplayWithDefaultDisplayLimitationTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndSummaryBlockItemDisplayWithDefaultDisplayLimitationTest.xml index beb2d40f94cad..0b52caa7165af 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndSummaryBlockItemDisplayWithDefaultDisplayLimitationTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndSummaryBlockItemDisplayWithDefaultDisplayLimitationTest.xml @@ -67,102 +67,102 @@ </after> <!-- Open Product1 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct1PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct1PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <!-- Add Product1 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct1ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct1ToTheCart"> <argument name="productName" value="$$simpleProduct1.name$$"/> </actionGroup> <!-- Open Product2 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct2PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct2PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <!-- Add Product2 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct2ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct2ToTheCart"> <argument name="productName" value="$$simpleProduct2.name$$"/> </actionGroup> <!-- Open Product3 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct3PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct3PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct3$$"/> </actionGroup> <!-- Add Product3 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct3ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct3ToTheCart"> <argument name="productName" value="$$simpleProduct3.name$$"/> </actionGroup> <!-- Open Product4 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct4PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct4PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct4$$"/> </actionGroup> <!-- Add Product4 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct4ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct4ToTheCart"> <argument name="productName" value="$$simpleProduct4.name$$"/> </actionGroup> <!-- Open Product5 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct5PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct5PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct5$$"/> </actionGroup> <!-- Add Product5 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct5ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct5ToTheCart"> <argument name="productName" value="$$simpleProduct5.name$$"/> </actionGroup> <!-- Open Product6 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct6PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct6PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct6$$"/> </actionGroup> <!-- Add Product6 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct6ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct6ToTheCart"> <argument name="productName" value="$$simpleProduct6.name$$"/> </actionGroup> <!-- Open Product7 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct7PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct7PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct7$$"/> </actionGroup> <!-- Add Product7 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct7ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct7ToTheCart"> <argument name="productName" value="$$simpleProduct7.name$$"/> </actionGroup> <!-- Open Product8 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct8PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct8PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct8$$"/> </actionGroup> <!-- Add Product8 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct8ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct8ToTheCart"> <argument name="productName" value="$$simpleProduct8.name$$"/> </actionGroup> <!-- Open Product9 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct9PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct9PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct9$$"/> </actionGroup> <!-- Add Product9 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct9ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct9ToTheCart"> <argument name="productName" value="$$simpleProduct9.name$$"/> </actionGroup> <!-- Open Product10 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPage10AndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPage10AndVerifyProduct"> <argument name="product" value="$$simpleProduct10$$"/> </actionGroup> <!-- Add Product10 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct10ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct10ToTheCart"> <argument name="productName" value="$$simpleProduct10.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWhenMoreItemsAddedToTheCartThanDefaultDisplayLimitTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWhenMoreItemsAddedToTheCartThanDefaultDisplayLimitTest.xml index 8b8aed3ac6204..a496ff68c0cd0 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWhenMoreItemsAddedToTheCartThanDefaultDisplayLimitTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWhenMoreItemsAddedToTheCartThanDefaultDisplayLimitTest.xml @@ -72,112 +72,112 @@ </after> <!-- Open Product1 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct1PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct1PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <!-- Add Product1 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct1ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct1ToTheCart"> <argument name="productName" value="$$simpleProduct1.name$$"/> </actionGroup> <!-- Open Product2 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct2PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct2PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <!-- Add Product2 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct2ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct2ToTheCart"> <argument name="productName" value="$$simpleProduct2.name$$"/> </actionGroup> <!-- Open Product3 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct3PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct3PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct3$$"/> </actionGroup> <!-- Add Product3 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct3ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct3ToTheCart"> <argument name="productName" value="$$simpleProduct3.name$$"/> </actionGroup> <!-- Open Product4 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct4PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct4PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct4$$"/> </actionGroup> <!-- Add Product4 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct4ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct4ToTheCart"> <argument name="productName" value="$$simpleProduct4.name$$"/> </actionGroup> <!-- Open Product5 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct5PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct5PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct5$$"/> </actionGroup> <!-- Add Product5 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct5ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct5ToTheCart"> <argument name="productName" value="$$simpleProduct5.name$$"/> </actionGroup> <!-- Open Product6 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct6PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct6PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct6$$"/> </actionGroup> <!-- Add Product6 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct6ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct6ToTheCart"> <argument name="productName" value="$$simpleProduct6.name$$"/> </actionGroup> <!-- Open Product7 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct7PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct7PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct7$$"/> </actionGroup> <!-- Add Product7 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct7ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct7ToTheCart"> <argument name="productName" value="$$simpleProduct7.name$$"/> </actionGroup> <!-- Open Product8 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct8PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct8PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct8$$"/> </actionGroup> <!-- Add Product8 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct8ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct8ToTheCart"> <argument name="productName" value="$$simpleProduct8.name$$"/> </actionGroup> <!-- Open Product9 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct9PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct9PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct9$$"/> </actionGroup> <!-- Add Product9 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct9ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct9ToTheCart"> <argument name="productName" value="$$simpleProduct9.name$$"/> </actionGroup> <!-- Open Product10 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPage10AndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPage10AndVerifyProduct"> <argument name="product" value="$$simpleProduct10$$"/> </actionGroup> <!-- Add Product10 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct10ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct10ToTheCart"> <argument name="productName" value="$$simpleProduct10.name$$"/> </actionGroup> <!-- Open Product11 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPage11AndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPage11AndVerifyProduct"> <argument name="product" value="$$simpleProduct11$$"/> </actionGroup> <!-- Add Product11 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct11ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct11ToTheCart"> <argument name="productName" value="$$simpleProduct11.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWithDefaultDisplayLimitAndDefaultTotalQuantityTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWithDefaultDisplayLimitAndDefaultTotalQuantityTest.xml index 2339789bd85d1..8e84deafea9f2 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWithDefaultDisplayLimitAndDefaultTotalQuantityTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartItemDisplayWithDefaultDisplayLimitAndDefaultTotalQuantityTest.xml @@ -65,102 +65,102 @@ </after> <!-- Open Product1 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct1PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct1PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <!-- Add Product1 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct1ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct1ToTheCart"> <argument name="productName" value="$$simpleProduct1.name$$"/> </actionGroup> <!-- Open Product2 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct2PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct2PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <!-- Add Product2 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct2ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct2ToTheCart"> <argument name="productName" value="$$simpleProduct2.name$$"/> </actionGroup> <!-- Open Product3 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct3PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct3PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct3$$"/> </actionGroup> <!-- Add Product3 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct3ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct3ToTheCart"> <argument name="productName" value="$$simpleProduct3.name$$"/> </actionGroup> <!-- Open Product4 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct4PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct4PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct4$$"/> </actionGroup> <!-- Add Product4 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct4ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct4ToTheCart"> <argument name="productName" value="$$simpleProduct4.name$$"/> </actionGroup> <!-- Open Product5 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct5PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct5PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct5$$"/> </actionGroup> <!-- Add Product5 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct5ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct5ToTheCart"> <argument name="productName" value="$$simpleProduct5.name$$"/> </actionGroup> <!-- Open Product6 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct6PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct6PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct6$$"/> </actionGroup> <!-- Add Product6 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct6ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct6ToTheCart"> <argument name="productName" value="$$simpleProduct6.name$$"/> </actionGroup> <!-- Open Product7 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct7PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct7PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct7$$"/> </actionGroup> <!-- Add Product7 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct7ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct7ToTheCart"> <argument name="productName" value="$$simpleProduct7.name$$"/> </actionGroup> <!-- Open Product8 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct8PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct8PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct8$$"/> </actionGroup> <!-- Add Product8 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct8ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct8ToTheCart"> <argument name="productName" value="$$simpleProduct8.name$$"/> </actionGroup> <!-- Open Product9 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct9PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct9PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct9$$"/> </actionGroup> <!-- Add Product9 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct9ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct9ToTheCart"> <argument name="productName" value="$$simpleProduct9.name$$"/> </actionGroup> <!-- Open Product10 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPage10AndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPage10AndVerifyProduct"> <argument name="product" value="$$simpleProduct10$$"/> </actionGroup> <!-- Add Product10 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct10ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct10ToTheCart"> <argument name="productName" value="$$simpleProduct10.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckPagerShoppingCartWithMoreThan20ProductsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckPagerShoppingCartWithMoreThan20ProductsTest.xml index 9dbd5daba6f23..caec34c5ef1aa 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckPagerShoppingCartWithMoreThan20ProductsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckPagerShoppingCartWithMoreThan20ProductsTest.xml @@ -24,87 +24,87 @@ <magentoCLI stepKey="allowSpecificValue" command="config:set checkout/cart/number_items_to_display_pager 20" /> <createData entity="SimpleTwo" stepKey="simpleProduct1"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem1"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem1"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct2"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem2"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem2"> <argument name="product" value="$simpleProduct2$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct3"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem3"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem3"> <argument name="product" value="$simpleProduct3$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct4"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem4"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem4"> <argument name="product" value="$simpleProduct4$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct5"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem5"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem5"> <argument name="product" value="$simpleProduct5$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct6"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem6"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem6"> <argument name="product" value="$simpleProduct6$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct7"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem7"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem7"> <argument name="product" value="$simpleProduct7$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct8"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem8"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem8"> <argument name="product" value="$simpleProduct8$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct9"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem9"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem9"> <argument name="product" value="$simpleProduct9$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct10"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem10"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem10"> <argument name="product" value="$$simpleProduct10$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct11"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem11"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem11"> <argument name="product" value="$$simpleProduct11$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct12"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem12"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem12"> <argument name="product" value="$$simpleProduct12$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct13"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem13"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem13"> <argument name="product" value="$$simpleProduct13$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct14"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem14"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem14"> <argument name="product" value="$$simpleProduct14$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct15"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem15"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem15"> <argument name="product" value="$$simpleProduct15$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct16"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem16"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem16"> <argument name="product" value="$$simpleProduct16$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct17"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem17"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem17"> <argument name="product" value="$$simpleProduct17$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct18"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem18"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem18"> <argument name="product" value="$$simpleProduct18$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct19"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem19"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem19"> <argument name="product" value="$$simpleProduct19$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct20"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem20"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem20"> <argument name="product" value="$$simpleProduct20$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct21"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem21"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem21"> <argument name="product" value="$$simpleProduct21$$"/> </actionGroup> </before> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckSimpleProductCartItemDisplayWithDefaultLimitationTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckSimpleProductCartItemDisplayWithDefaultLimitationTest.xml index 084c89312cc7e..79e46d093c2f6 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckSimpleProductCartItemDisplayWithDefaultLimitationTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckSimpleProductCartItemDisplayWithDefaultLimitationTest.xml @@ -71,112 +71,112 @@ </after> <!-- Open Product1 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct1PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct1PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <!-- Add Product1 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct1ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct1ToTheCart"> <argument name="productName" value="$$simpleProduct1.name$$"/> </actionGroup> <!-- Open Product2 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct2PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct2PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <!-- Add Product2 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct2ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct2ToTheCart"> <argument name="productName" value="$$simpleProduct2.name$$"/> </actionGroup> <!-- Open Product3 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct3PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct3PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct3$$"/> </actionGroup> <!-- Add Product3 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct3ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct3ToTheCart"> <argument name="productName" value="$$simpleProduct3.name$$"/> </actionGroup> <!-- Open Product4 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct4PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct4PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct4$$"/> </actionGroup> <!-- Add Product4 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct4ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct4ToTheCart"> <argument name="productName" value="$$simpleProduct4.name$$"/> </actionGroup> <!-- Open Product5 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct5PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct5PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct5$$"/> </actionGroup> <!-- Add Product5 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct5ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct5ToTheCart"> <argument name="productName" value="$$simpleProduct5.name$$"/> </actionGroup> <!-- Open Product6 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct6PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct6PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct6$$"/> </actionGroup> <!-- Add Product6 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct6ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct6ToTheCart"> <argument name="productName" value="$$simpleProduct6.name$$"/> </actionGroup> <!-- Open Product7 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct7PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct7PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct7$$"/> </actionGroup> <!-- Add Product7 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct7ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct7ToTheCart"> <argument name="productName" value="$$simpleProduct7.name$$"/> </actionGroup> <!-- Open Product8 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct8PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct8PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct8$$"/> </actionGroup> <!-- Add Product8 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct8ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct8ToTheCart"> <argument name="productName" value="$$simpleProduct8.name$$"/> </actionGroup> <!-- Open Product9 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct9PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct9PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct9$$"/> </actionGroup> <!-- Add Product9 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct9ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct9ToTheCart"> <argument name="productName" value="$$simpleProduct9.name$$"/> </actionGroup> <!-- Open Product10 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPage10AndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPage10AndVerifyProduct"> <argument name="product" value="$$simpleProduct10$$"/> </actionGroup> <!-- Add Product10 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct10ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct10ToTheCart"> <argument name="productName" value="$$simpleProduct10.name$$"/> </actionGroup> <!-- Open Product11 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPage11AndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPage11AndVerifyProduct"> <argument name="product" value="$$simpleProduct11$$"/> </actionGroup> <!-- Add Product11 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct11ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct11ToTheCart"> <argument name="productName" value="$$simpleProduct11.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckVirtualProductCountDisplayWithCustomDisplayConfigurationTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckVirtualProductCountDisplayWithCustomDisplayConfigurationTest.xml index 1f63565899f88..9f3eacbf5f455 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckVirtualProductCountDisplayWithCustomDisplayConfigurationTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckVirtualProductCountDisplayWithCustomDisplayConfigurationTest.xml @@ -46,42 +46,42 @@ </after> <!-- Open Product1 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct1PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct1PageAndVerifyProduct"> <argument name="product" value="$$virtualProduct1$$"/> </actionGroup> <!-- Add Product1 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct1ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct1ToTheCart"> <argument name="productName" value="$$virtualProduct1.name$$"/> </actionGroup> <!-- Open Product2 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct2PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct2PageAndVerifyProduct"> <argument name="product" value="$$virtualProduct2$$"/> </actionGroup> <!-- Add Product2 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct2ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct2ToTheCart"> <argument name="productName" value="$$virtualProduct2.name$$"/> </actionGroup> <!-- Open Product3 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct3PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct3PageAndVerifyProduct"> <argument name="product" value="$$virtualProduct3$$"/> </actionGroup> <!-- Add Product3 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct3ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct3ToTheCart"> <argument name="productName" value="$$virtualProduct3.name$$"/> </actionGroup> <!-- Open Product4 page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct4PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct4PageAndVerifyProduct"> <argument name="product" value="$$virtualProduct4$$"/> </actionGroup> <!-- Add Product4 to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct4ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct4ToTheCart"> <argument name="productName" value="$$virtualProduct4.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml index c5d1c34a93b32..64591872d8dfe 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml @@ -23,10 +23,10 @@ <createData entity="SimpleProduct2" stepKey="simpleProduct"> <field key="price">50.00</field> </createData> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheProduct"> <argument name="productSku" value="$$simpleProduct.sku$$"/> </actionGroup> - <actionGroup ref="ProductSetAdvancedTierFixedPricing" stepKey="setTierPrice"> + <actionGroup ref="ProductSetAdvancedTierFixedPricingActionGroup" stepKey="setTierPrice"> <argument name="website" value=""/> <argument name="group" value=""/> <argument name="quantity" value="3"/> @@ -49,7 +49,7 @@ </after> <!--Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -127,4 +127,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml index 34dc6617d25d5..30abf9a871ee9 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml @@ -35,7 +35,7 @@ </after> <!--Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -98,4 +98,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml index 6ccb05bf4c4f7..f4997ef65f47e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml @@ -24,7 +24,7 @@ <field key="price">10.00</field> </createData> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheProduct"> <argument name="productSku" value="$$simpleProduct.sku$$"/> </actionGroup> @@ -81,7 +81,7 @@ <requiredEntity createDataKey="createConfigChildProduct2"/> </createData> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct2"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheProduct2"> <argument name="productSku" value="$$createConfigChildProduct2.sku$$"/> </actionGroup> <actionGroup ref="AddSpecialPriceToProductActionGroup" stepKey="addSpecialPriceTopTheProduct2"> @@ -105,7 +105,7 @@ </after> <!--Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -168,4 +168,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml index 0e704e5336db9..080a468bd5cd9 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutDisabledProductAndCouponTest.xml @@ -36,7 +36,7 @@ <deleteData createDataKey="createUSCustomer" stepKey="deleteCustomer"/> <deleteData createDataKey="createSalesRule" stepKey="deleteSalesRule"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductListing"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetGridToDefaultKeywordSearch"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> </after> <!-- Login as Customer --> @@ -46,7 +46,7 @@ <!-- Add product to shopping cart --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="amOnSimpleProductPage"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="cartAddSimpleProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="cartAddSimpleProductToCart"> <argument name="product" value="$$createSimpleProduct$$"/> <argument name="productCount" value="1"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml index b0b72515611e8..1dd693bdc2f09 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml @@ -39,7 +39,7 @@ </after> <!--Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -91,4 +91,4 @@ <!-- Ship the order and assert the shipping status --> <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml index f7e54867b1ae4..c2735c8615beb 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml @@ -39,7 +39,7 @@ </after> <!--Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -129,4 +129,4 @@ <!-- Ship the order and assert the shipping status --> <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithoutRegionTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithoutRegionTest.xml index 0cc0dcf38e312..4c2a9c1db46f7 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithoutRegionTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithoutRegionTest.xml @@ -43,7 +43,7 @@ <argument name="Customer" value="$$createCustomer$$" /> </actionGroup> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml index 651c5bd8d4375..994a6d2a8b4df 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml @@ -39,7 +39,7 @@ </actionGroup> <!-- Add simple product to cart and go to checkout--> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart" /> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml index 8f3ddbb27f62f..01a420ed24d0a 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteBundleProductFromMiniShoppingCartTest.xml @@ -50,7 +50,7 @@ </after> <!--Open Product page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$createBundleProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest.xml index cca5268564b12..0b5d002253217 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteProductsWithCartItemsDisplayDefaultLimitationFromMiniShoppingCartTest.xml @@ -67,92 +67,92 @@ </after> <!--Open Product1 page in StoreFront--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct1PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct1PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <!--Add Product1 to the cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct1ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct1ToTheCart"> <argument name="productName" value="$$simpleProduct1.name$$"/> </actionGroup> <!--Open Product2 page in StoreFront--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct2PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct2PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <!--Add Product2 to the cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct2ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct2ToTheCart"> <argument name="productName" value="$$simpleProduct2.name$$"/> </actionGroup> <!--Open Product3 page in StoreFront--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct3PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct3PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct3$$"/> </actionGroup> <!--Add Product3 to the cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct3ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct3ToTheCart"> <argument name="productName" value="$$simpleProduct3.name$$"/> </actionGroup> <!--Open Product4 page in StoreFront--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct4PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct4PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct4$$"/> </actionGroup> <!--Add Product4 to the cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct4ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct4ToTheCart"> <argument name="productName" value="$$simpleProduct4.name$$"/> </actionGroup> <!--Open Product5 page in StoreFront--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct5PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct5PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct5$$"/> </actionGroup> <!--Add Product5 to the cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct5ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct5ToTheCart"> <argument name="productName" value="$$simpleProduct5.name$$"/> </actionGroup> <!--Open Product6 page in StoreFront--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct6PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct6PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct6$$"/> </actionGroup> <!--Add Product6 to the cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct6ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct6ToTheCart"> <argument name="productName" value="$$simpleProduct6.name$$"/> </actionGroup> <!--Open Product7 page in StoreFront--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct7PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct7PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct7$$"/> </actionGroup> <!--Add Product7 to the cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct7ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct7ToTheCart"> <argument name="productName" value="$$simpleProduct7.name$$"/> </actionGroup> <!--Open Product8 page in StoreFront--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct8PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct8PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct8$$"/> </actionGroup> <!--Add Product8 to the cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct8ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct8ToTheCart"> <argument name="productName" value="$$simpleProduct8.name$$"/> </actionGroup> <!--Open Product9 page in StoreFront--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProduct9PageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProduct9PageAndVerifyProduct"> <argument name="product" value="$$simpleProduct9$$"/> </actionGroup> <!--Add Product9 to the cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct9ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct9ToTheCart"> <argument name="productName" value="$$simpleProduct9.name$$"/> </actionGroup> <!--Open Product10 page in StoreFront--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPage10AndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPage10AndVerifyProduct"> <argument name="product" value="$$simpleProduct10$$"/> </actionGroup> <!--Add Product10 to the cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct10ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct10ToTheCart"> <argument name="productName" value="$$simpleProduct10.name$$"/> </actionGroup> @@ -282,4 +282,4 @@ <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct9.name$$)}}" stepKey="verifyAssertProduct9AbsentInMiniShoppingCart"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct10.name$$)}}" stepKey="verifyAssertProduct10AbsentInMiniShoppingCart"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml index b8092ccdcdce7..90f6860dfa736 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleAndVirtualProductFromMiniShoppingCartTest.xml @@ -36,13 +36,13 @@ </after> <!-- Add Simple Product to the cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addSimpleProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> <!-- Add virtual Product to the cart --> <amOnPage url="{{StorefrontProductPage.url($$virtualProduct.name$$)}}" stepKey="amOnStorefrontVirtualProductPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct1ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct1ToTheCart"> <argument name="productName" value="$$virtualProduct.name$$"/> </actionGroup> @@ -85,4 +85,4 @@ <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct.name$$)}}" stepKey="verifyAssertSimpleProductAbsentInMiniShoppingCart"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$virtualProduct.name$$)}}" stepKey="verifyAssertVirtualProductAbsentInMiniShoppingCart"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleProductFromMiniShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleProductFromMiniShoppingCartTest.xml index 05198060f5de4..4ef0ad977a779 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleProductFromMiniShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontDeleteSimpleProductFromMiniShoppingCartTest.xml @@ -31,7 +31,7 @@ </after> <!-- Add Simple Product to the cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -60,4 +60,4 @@ <actionGroup ref="assertMiniCartEmpty" stepKey="miniCartEnpty"/> <dontSee selector="{{StorefrontMinicartSection.productLinkByName($$simpleProduct.name$$)}}" stepKey="verifyAssertProductAbsentInMiniShoppingCart"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutDataPersistTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutDataPersistTest.xml index 626f095604fa2..a43bbef57d0c8 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutDataPersistTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutDataPersistTest.xml @@ -30,7 +30,7 @@ </after> <!-- Add simple product to cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <!-- Navigate to checkout --> @@ -40,7 +40,7 @@ <argument name="shippingMethod" value="Flat Rate"/> </actionGroup> <!-- Add simple product to cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart1"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart1"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <!-- Navigate to checkout --> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml index 2226e1ebc8292..1369c1a0fcbd2 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml @@ -129,7 +129,7 @@ <see selector="{{AdminTaxRuleGridSection.successMessage}}" userInput="You saved the tax rule." stepKey="assertTaxRuleSuccessMessage" /> <!--Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -147,7 +147,7 @@ </actionGroup> <!--Open Product page in StoreFront --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openBundleProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openBundleProduct"> <argument name="product" value="$$createBundleProduct$$"/> </actionGroup> @@ -220,4 +220,4 @@ <argument name="customerGroup" value=""/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml index 33ec099aa2ace..eb386975e1ad2 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml @@ -31,12 +31,12 @@ </after> <!--Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openVirtualProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openVirtualProductPageAndVerifyProduct"> <argument name="product" value="$$virtualProduct$$"/> </actionGroup> <!-- Add Product to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct1ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct1ToTheCart"> <argument name="productName" value="$$virtualProduct.name$$"/> </actionGroup> @@ -90,4 +90,4 @@ <see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$0.00" stepKey="seeGrandTotal"/> <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderStatus"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontMissingPagerShoppingCartWith20ProductsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontMissingPagerShoppingCartWith20ProductsTest.xml index afe4ebcfea40c..32b0985c290a3 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontMissingPagerShoppingCartWith20ProductsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontMissingPagerShoppingCartWith20ProductsTest.xml @@ -23,83 +23,83 @@ <!--Set the default number of items on cart which is 20--> <magentoCLI stepKey="allowSpecificValue" command="config:set checkout/cart/number_items_to_display_pager 20" /> <createData entity="SimpleTwo" stepKey="simpleProduct1"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem1"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem1"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct2"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem2"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct3"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem3"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem3"> <argument name="product" value="$$simpleProduct3$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct4"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem4"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem4"> <argument name="product" value="$$simpleProduct4$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct5"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem5"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem5"> <argument name="product" value="$$simpleProduct5$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct6"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem6"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem6"> <argument name="product" value="$$simpleProduct6$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct7"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem7"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem7"> <argument name="product" value="$$simpleProduct7$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct8"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem8"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem8"> <argument name="product" value="$$simpleProduct8$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct9"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem9"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem9"> <argument name="product" value="$$simpleProduct9$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct10"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem10"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem10"> <argument name="product" value="$$simpleProduct10$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct11"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem11"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem11"> <argument name="product" value="$$simpleProduct11$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct12"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem12"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem12"> <argument name="product" value="$$simpleProduct12$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct13"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem13"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem13"> <argument name="product" value="$$simpleProduct13$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct14"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem14"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem14"> <argument name="product" value="$$simpleProduct14$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct15"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem15"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem15"> <argument name="product" value="$$simpleProduct15$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct16"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem16"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem16"> <argument name="product" value="$$simpleProduct16$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct17"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem17"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem17"> <argument name="product" value="$$simpleProduct17$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct18"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem18"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem18"> <argument name="product" value="$$simpleProduct18$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct19"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem19"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem19"> <argument name="product" value="$$simpleProduct19$$"/> </actionGroup> <createData entity="SimpleTwo" stepKey="simpleProduct20"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="CartItem20"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="CartItem20"> <argument name="product" value="$$simpleProduct20$$"/> </actionGroup> </before> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutDataWhenChangeQtyTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutDataWhenChangeQtyTest.xml index 913eb34b34d07..ae7b8d2446380 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutDataWhenChangeQtyTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutDataWhenChangeQtyTest.xml @@ -30,7 +30,7 @@ <!--Add product to cart and checkout--> <amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="amOnSimpleProductPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$createProduct.name$$"/> </actionGroup> <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutJsValidationTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutJsValidationTest.xml index 8ed8e590eb229..66a4f417aed9d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutJsValidationTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutJsValidationTest.xml @@ -30,7 +30,7 @@ <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> </after> - <actionGroup ref="AddSimpleProductToCart" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="guestGoToCheckout"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontPersistentDataForGuestCustomerWithPhysicalQuoteTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontPersistentDataForGuestCustomerWithPhysicalQuoteTest.xml index 20ff67a076e1e..c106ec9c552ff 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontPersistentDataForGuestCustomerWithPhysicalQuoteTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontPersistentDataForGuestCustomerWithPhysicalQuoteTest.xml @@ -31,7 +31,7 @@ <createData entity="FreeShippinMethodDefault" stepKey="disableFreeShipping"/> </after> <!-- 1. Add simple product to cart and go to checkout--> - <actionGroup ref="AddSimpleProductToCart" stepKey="addSimpleProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <!-- 2. Go to Shopping Cart --> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductNameMinicartOnCheckoutPageDifferentStoreViewsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductNameMinicartOnCheckoutPageDifferentStoreViewsTest.xml index 5e7e76ae4f02a..b678cb835f503 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductNameMinicartOnCheckoutPageDifferentStoreViewsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductNameMinicartOnCheckoutPageDifferentStoreViewsTest.xml @@ -45,7 +45,7 @@ <waitForPageLoad stepKey="waitForProductPage"/> <!--Switch to second store view and change the product name--> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="switchToCustomStoreView"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="switchToCustomStoreView"> <argument name="storeViewName" value="{{customStore.name}}"/> </actionGroup> <waitForPageLoad stepKey="waitForPageLoad"/> @@ -56,7 +56,7 @@ <!--Add product to cart--> <amOnPage url="{{StorefrontProductPage.url($$createProduct.name$$)}}" stepKey="amOnSimpleProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$createProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml index 285dc28cb520e..2f5e687063806 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml @@ -32,7 +32,7 @@ </after> <!--Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -88,7 +88,7 @@ <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> <!-- Assert Product Quantity in backend reduced after order processed --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheProduct"> <argument name="productSku" value="$$simpleProduct.sku$$"/> </actionGroup> <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad"/> @@ -97,9 +97,9 @@ <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="Out of Stock" stepKey="seeProductStockStatus"/> <!-- Assert Product is Out of Stock in frontend --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="assertProductInStorefront"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="assertProductInStorefront"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="Out Of Stock" stepKey="seeProductDisplayedAsOutOfStock"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontShoppingCartPagerForOneItemPerPageAnd2ProductsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontShoppingCartPagerForOneItemPerPageAnd2ProductsTest.xml index 744401cf24d13..2691dc2b9fd06 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontShoppingCartPagerForOneItemPerPageAnd2ProductsTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontShoppingCartPagerForOneItemPerPageAnd2ProductsTest.xml @@ -24,10 +24,10 @@ <magentoCLI stepKey="allowSpecificValue" command="config:set checkout/cart/number_items_to_display_pager 1" /> <createData entity="SimpleTwo" stepKey="createSimpleProduct1"/> <createData entity="SimpleTwo" stepKey="createSimpleProduct2"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="addToCartFromStorefrontProductPage1"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addToCartFromStorefrontProductPage1"> <argument name="product" value="$$createSimpleProduct1$$"/> </actionGroup> - <actionGroup ref="AddSimpleProductToCart" stepKey="addToCartFromStorefrontProductPage2"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addToCartFromStorefrontProductPage2"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> </before> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml index 482e2fb6233a6..890a3eb748b6b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml @@ -57,12 +57,12 @@ </actionGroup> <!--Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openVirtualProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openVirtualProductPageAndVerifyProduct"> <argument name="product" value="$$virtualProduct$$"/> </actionGroup> <!-- Add Product to the cart --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct1ToTheCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProduct1ToTheCart"> <argument name="productName" value="$$virtualProduct.name$$"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml index deab32aede324..f390244fbd00b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml @@ -29,7 +29,7 @@ </after> <!--Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -83,7 +83,7 @@ <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> <!-- Assert Product Quantity in backend reduced after order processed --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheProduct"> <argument name="productSku" value="$$simpleProduct.sku$$"/> </actionGroup> <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad"/> @@ -92,9 +92,9 @@ <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="Out of Stock" stepKey="seeProductStockStatus"/> <!-- Assert Product is Out of Stock in frontend --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="assertProductInStorefront"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="assertProductInStorefront"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="Out Of Stock" stepKey="seeProductDisplayedAsOutOfStock"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml index 6d5f79f3aadf4..2a07604c806d7 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml @@ -36,7 +36,7 @@ </after> <!-- Open Product page in StoreFront and assert product and price range --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> @@ -94,4 +94,4 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdatePriceInShoppingCartAfterProductSaveTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdatePriceInShoppingCartAfterProductSaveTest.xml index b4747a6bf7273..4bff22950174f 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdatePriceInShoppingCartAfterProductSaveTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdatePriceInShoppingCartAfterProductSaveTest.xml @@ -37,7 +37,7 @@ <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> <!--Add Product to Shopping Cart--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> @@ -54,7 +54,7 @@ <openNewTab stepKey="openNewTab"/> <amOnPage url="{{AdminProductEditPage.url($$createSimpleProduct.id$$)}}" stepKey="goToProductEditPage"/> <fillField userInput="120" selector="{{AdminProductFormSection.productPrice}}" stepKey="setNewPrice"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <closeTab stepKey="closeTab"/> <!--Check price--> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleProductQtyTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleProductQtyTest.xml index 72f6cf95a6fbe..69aae3d94ee97 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleProductQtyTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUpdateShoppingCartSimpleProductQtyTest.xml @@ -26,7 +26,7 @@ </createData> <!-- Add the newly created product to the shopping cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="product" value="$$createProduct$$"/> </actionGroup> </before> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/UpdateProductFromMiniShoppingCartEntityTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/UpdateProductFromMiniShoppingCartEntityTest.xml index 7318f865a0dc1..6e484c30fa81e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/UpdateProductFromMiniShoppingCartEntityTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/UpdateProductFromMiniShoppingCartEntityTest.xml @@ -24,7 +24,7 @@ <createData entity="simpleProductWithoutCategory" stepKey="createProduct"/> <!--Add product to cart--> - <actionGroup ref="AddSimpleProductToCart" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="product" value="$$createProduct$$"/> </actionGroup> </before> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml index 4b3e18fb31877..280338239ef58 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml @@ -63,7 +63,7 @@ <!--Proceed to store front and place an order with free shipping using created coupon--> <!--Add product to card--> - <actionGroup ref="AddSimpleProductToCart" stepKey="AddProductToCard"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="AddProductToCard"> <argument name="product" value="$$simpleproduct$$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddDefaultImageConfigurableTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddDefaultImageConfigurableTest.xml index 92928c9384672..2f9347157ef33 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddDefaultImageConfigurableTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddDefaultImageConfigurableTest.xml @@ -93,28 +93,28 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="productIndexPage"/> <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGrid"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGrid"> <argument name="product" value="$$baseConfigProductHandle$$"/> </actionGroup> - <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openProducForEditByClickingRow1Column2InProductGrid1"/> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProducForEditByClickingRow1Column2InProductGrid1"/> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="assertProductImageAdminProductPage" stepKey="assertProductImageAdminProductPage"/> + <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="$$baseConfigProductHandle$$"/> </actionGroup> <!-- Assert product image in storefront product page --> - <actionGroup ref="assertProductImageStorefrontProductPage2" stepKey="assertProductImageStorefrontProductPage"> + <actionGroup ref="AssertProductImageStorefrontProductPage2ActionGroup" stepKey="assertProductImageStorefrontProductPageActionGroup"> <argument name="product" value="$$baseConfigProductHandle$$"/> <argument name="image" value="MagentoLogo"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml index 36c135c427365..67f432ca48fa4 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml @@ -104,7 +104,7 @@ <click selector="{{ConfigurableProductSection.generateConfigure}}" stepKey="clickGenerateConfigure"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Go to frontend and check image and price--> <amOnPage url="{{StorefrontProductPage.url($$createConfigProductCreateConfigurableProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAssertNoticeThatExistingSkuAutomaticallyChangedWhenSavingProductWithSameSkuTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAssertNoticeThatExistingSkuAutomaticallyChangedWhenSavingProductWithSameSkuTest.xml index c085229da8028..a1faa2b156808 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAssertNoticeThatExistingSkuAutomaticallyChangedWhenSavingProductWithSameSkuTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAssertNoticeThatExistingSkuAutomaticallyChangedWhenSavingProductWithSameSkuTest.xml @@ -22,12 +22,12 @@ </before> <after> <!-- Delete configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Delete product attribute --> - <actionGroup ref="deleteProductAttributeByLabel" stepKey="deleteProductAttribute"> + <actionGroup ref="DeleteProductAttributeByLabelActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttribute" value="colorProductAttribute"/> </actionGroup> @@ -38,12 +38,12 @@ <!-- Create configurable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="createConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Fill configurable product values --> - <actionGroup ref="fillMainProductForm" stepKey="fillConfigurableProductValues"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductValues"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckConfigurableProductAttributeValueUniquenessTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckConfigurableProductAttributeValueUniquenessTest.xml index df6afdcfd2243..3600d6e82bd82 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckConfigurableProductAttributeValueUniquenessTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckConfigurableProductAttributeValueUniquenessTest.xml @@ -26,11 +26,11 @@ <after> <!--Delete created data--> <comment userInput="Delete created data" stepKey="deleteCreatedData"/> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteConfigurableProductAndOptions"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteConfigurableProductAndOptions"> <argument name="product" value="$$createConfigProduct$$"/> </actionGroup> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createProductAttribute" stepKey="deleteAttribute"/> <actionGroup ref="logout" stepKey="logOut"/> @@ -45,7 +45,7 @@ <comment userInput="Go to created product page" stepKey="goToProdPage"/> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="goToProductGrid"/> <waitForPageLoad stepKey="waitForProductPage1"/> - <actionGroup ref="filterProductGridByName2" stepKey="filterByName"> + <actionGroup ref="FilterProductGridByName2ActionGroup" stepKey="filterByName"> <argument name="name" value="$$createConfigProduct.name$$"/> </actionGroup> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProductName"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml index de0cca11235ea..84fbab5fb4f02 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml @@ -71,7 +71,7 @@ <!-- Login as Admin --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Add created attributes with options to Attribute Set --> - <actionGroup ref="AdminAddUnassignedAttributeToGroup" stepKey="createDefaultAttributeSet"> + <actionGroup ref="AdminAddUnassignedAttributeToGroupActionGroup" stepKey="createDefaultAttributeSet"> <argument name="label" value="mySet"/> <argument name="firstOption" value="$$createConfigProductAttribute.attribute_code$$"/> <argument name="secondOption" value="$$createConfigProductAttribute2.attribute_code$$"/> @@ -86,7 +86,7 @@ <deleteData createDataKey="createThirdConfigurableProduct" stepKey="deleteThirdProduct"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> <!-- Delete attribute set --> - <actionGroup ref="deleteAttributeSetByLabel" stepKey="deleteAttributeSet"> + <actionGroup ref="DeleteAttributeSetByLabelActionGroup" stepKey="deleteAttributeSet"> <argument name="label" value="mySet"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearAttributeSetsFilter"/> @@ -95,14 +95,14 @@ <argument name="productAttributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttributeByAttributeCode"> - <argument name="productAttributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> + <argument name="ProductAttributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> <!-- Delete Second attribute --> <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="openSecondProductAttributeFromSearchResultInGrid"> <argument name="productAttributeCode" value="$$createConfigProductAttribute2.attribute_code$$"/> </actionGroup> <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteSecondProductAttributeByAttributeCode"> - <argument name="productAttributeCode" value="$$createConfigProductAttribute2.attribute_code$$"/> + <argument name="ProductAttributeCode" value="$$createConfigProductAttribute2.attribute_code$$"/> </actionGroup> <!-- Clear filters --> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductAttributesFilter"/> @@ -114,7 +114,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad time="30" stepKey="wait1"/> <!-- Edit created first product as configurable product with options --> - <actionGroup ref="filterProductGridBySku" stepKey="filterGridByFirstProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterGridByFirstProduct"> <argument name="product" value="$$createFirstConfigurableProduct$$"/> </actionGroup> <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProductFirst"> @@ -136,7 +136,7 @@ <waitForPageLoad stepKey="waitForMessage"/> <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessageFirst"/> <!-- Edit created second product as configurable product with options --> - <actionGroup ref="filterProductGridBySku" stepKey="filterGridBySecondProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterGridBySecondProduct"> <argument name="product" value="$$createSecondConfigurableProduct$$"/> </actionGroup> <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProductSecond"> @@ -159,7 +159,7 @@ <waitForPageLoad stepKey="waitForSuccessMessage"/> <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessageSecond"/> <!-- Edit created third product as configurable product with options --> - <actionGroup ref="filterProductGridBySku" stepKey="filterGridByThirdProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterGridByThirdProduct"> <argument name="product" value="$$createThirdConfigurableProduct$$"/> </actionGroup> <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProductThird"> @@ -181,7 +181,7 @@ <waitForPageLoad stepKey="waitForProductPage"/> <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveConfigurableProductMessage"/> <!-- Create Simple product with options --> - <actionGroup ref="filterProductGridBySku" stepKey="filterGridBySimpleProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterGridBySimpleProduct"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditSimpleProduct"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckValidatorConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckValidatorConfigurableProductTest.xml index dd641fd370ba7..5bdccf15b19d3 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckValidatorConfigurableProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckValidatorConfigurableProductTest.xml @@ -34,13 +34,13 @@ <!--Delete created data--> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{ApiConfigurableProduct.name}}-thisIsShortName"/> </actionGroup> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> <!-- Remove attribute --> - <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteAttribute"> <argument name="ProductAttribute" value="productDropDownAttribute"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -51,7 +51,7 @@ <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <waitForPageLoad stepKey="waitForProductFilterLoad"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml index 430007ae761f7..75d1745ebe7bc 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml @@ -130,7 +130,7 @@ <click selector="{{DropdownAttributeOptionsSection.deleteButton(1)}}" stepKey="deleteOption"/> <click selector="{{AttributePropertiesSection.Save}}" stepKey="saveAttribute"/> <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid2"/> - <actionGroup stepKey="deleteProduct1" ref="deleteProductBySku"> + <actionGroup stepKey="deleteProduct1" ref="DeleteProductBySkuActionGroup"> <argument name="sku" value="$grabTextFromContent"/> </actionGroup> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest.xml index 33a6da9dabf34..83e428b454c46 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest.xml @@ -82,7 +82,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> <waitForPageLoad stepKey="wait2"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" stepKey="clearAll" visible="true"/> - <actionGroup ref="searchProductGridByKeyword" stepKey="searchForProduct"> + <actionGroup ref="SearchProductGridByKeywordActionGroup" stepKey="searchForProduct"> <argument name="keyword" value="ApiConfigurableProduct.name"/> </actionGroup> <click selector="label.data-grid-checkbox-cell-inner" stepKey="clickCheckbox"/> @@ -231,7 +231,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> <waitForPageLoad stepKey="wait1"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" stepKey="clearAll" visible="true"/> - <actionGroup ref="searchProductGridByKeyword" stepKey="searchForProduct"> + <actionGroup ref="SearchProductGridByKeywordActionGroup" stepKey="searchForProduct"> <argument name="keyword" value="ApiConfigurableProduct.name"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml index cd09cbd295877..450e27f293893 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml @@ -44,7 +44,7 @@ <after> <!--Clean up products--> - <actionGroup ref="deleteProductByName" stepKey="cleanUpProducts"> + <actionGroup ref="DeleteProductByNameActionGroup" stepKey="cleanUpProducts"> <argument name="sku" value="{{ProductWithLongNameSku.sku}}"/> <argument name="name" value="{{ProductWithLongNameSku.name}}"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductOutOfStockTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductOutOfStockTest.xml index 51b3e49f51913..6bba4aa6b43ce 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductOutOfStockTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductOutOfStockTest.xml @@ -94,7 +94,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductGridLoad"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct"> <argument name="product" value="ApiSimpleOne"/> </actionGroup> <waitForPageLoad stepKey="waitForFiltersToBeApplied"/> @@ -114,7 +114,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage2"/> <waitForPageLoad stepKey="waitForAdminProductGridLoad2"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial2"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct2"> <argument name="product" value="ApiSimpleTwo"/> </actionGroup> <waitForPageLoad stepKey="waitForFiltersToBeApplied2"/> @@ -212,7 +212,7 @@ <see stepKey="checkForOutOfStock" selector="{{StorefrontProductInfoMainSection.stockIndication}}" userInput="IN STOCK" /> <!-- Delete the first simple product --> - <actionGroup stepKey="deleteProduct1" ref="deleteProductBySku"> + <actionGroup stepKey="deleteProduct1" ref="DeleteProductBySkuActionGroup"> <argument name="sku" value="{{ApiSimpleOne.sku}}"/> </actionGroup> @@ -222,7 +222,7 @@ <see stepKey="checkForOutOfStock2" selector="{{StorefrontProductInfoMainSection.stockIndication}}" userInput="IN STOCK"/> <!-- Delete the second simple product --> - <actionGroup stepKey="deleteProduct2" ref="deleteProductBySku"> + <actionGroup stepKey="deleteProduct2" ref="DeleteProductBySkuActionGroup"> <argument name="sku" value="{{ApiSimpleTwo.sku}}"/> </actionGroup> @@ -314,7 +314,7 @@ <see stepKey="checkForOutOfStock" selector="{{StorefrontProductInfoMainSection.stockIndication}}" userInput="IN STOCK" /> <!-- Delete the first simple product --> - <actionGroup stepKey="deleteProduct1" ref="deleteProductBySku"> + <actionGroup stepKey="deleteProduct1" ref="DeleteProductBySkuActionGroup"> <argument name="sku" value="{{ApiSimpleOne.sku}}"/> </actionGroup> @@ -327,7 +327,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage2"/> <waitForPageLoad stepKey="waitForAdminProductGridLoad2"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial2"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct2"> <argument name="product" value="ApiSimpleTwo"/> </actionGroup> <waitForPageLoad stepKey="waitForFiltersToBeApplied2"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSearchTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSearchTest.xml index 410c85d314904..889ca5b24b242 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSearchTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSearchTest.xml @@ -78,7 +78,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> <waitForPageLoad stepKey="wait1"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" stepKey="clearAll" visible="true"/> - <actionGroup ref="searchProductGridByKeyword" stepKey="searchForProduct"> + <actionGroup ref="SearchProductGridByKeywordActionGroup" stepKey="searchForProduct"> <argument name="keyword" value="ApiConfigurableProduct.name"/> </actionGroup> <waitForPageLoad stepKey="wait2"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSetEditContentTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSetEditContentTest.xml index 42e12852f563f..0da4c265a73af 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSetEditContentTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductSetEditContentTest.xml @@ -21,16 +21,16 @@ </annotations> <after> <!-- Delete configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> </after> <!-- Create product --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductForm"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateAttributeTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateAttributeTest.xml index dba481b64810a..c437b39a405cd 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateAttributeTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateAttributeTest.xml @@ -117,7 +117,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <waitForPageLoad stepKey="waitForProductFilterLoad"/> @@ -227,7 +227,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct"> <argument name="product" value="$$createConfigProduct$$"/> </actionGroup> <waitForPageLoad stepKey="waitForProductFilterLoad"/> @@ -265,7 +265,7 @@ <waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/> <!-- Find the simple product that we just created using the product grid and delete it --> - <actionGroup ref="deleteProductBySku" stepKey="findCreatedProduct2"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="findCreatedProduct2"> <argument name="sku" value="{{ApiConfigurableProduct.sku}}2-simple"/> </actionGroup> </test> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml index 7c6cd57097591..2fe4e1925ce6d 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml @@ -48,7 +48,7 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> <waitForPageLoad stepKey="wait1"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearAll}}" dependentSelector="{{AdminProductGridFilterSection.clearAll}}" visible="true" stepKey="clearAll"/> - <actionGroup ref="searchProductGridByKeyword" stepKey="searchForProduct"> + <actionGroup ref="SearchProductGridByKeywordActionGroup" stepKey="searchForProduct"> <argument name="keyword" value="ApiConfigurableProduct.name"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml index 11f1e9bb33c10..e15727b75d86e 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableSetEditRelatedProductsTest.xml @@ -24,7 +24,7 @@ </before> <after> <!-- Delete configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndEditConfigurableProductSettingsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndEditConfigurableProductSettingsTest.xml index fd80c41b64962..6632cbcee30f2 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndEditConfigurableProductSettingsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndEditConfigurableProductSettingsTest.xml @@ -29,12 +29,12 @@ <!-- Create a configurable product --> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndexPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="createConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <!-- Fill configurable product values --> - <actionGroup ref="fillMainProductForm" stepKey="fillConfigurableProductValues"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductValues"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> @@ -47,7 +47,7 @@ </actionGroup> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveButton"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveButton"/> <!-- Open product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> @@ -87,7 +87,7 @@ <actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="disableGiftMessageSettings"/> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveProduct"/> <!-- Verify Url Key after changing --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> @@ -102,7 +102,7 @@ <dontSeeElement selector="{{StorefrontProductCartGiftOptionSection.giftOptions}}" stepKey="dontSeeGiftOptionBtn"/> <!-- Delete created configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml index 2cc71964042a4..c1308bcf57f1e 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml @@ -19,10 +19,10 @@ <group value="catalog"/> <group value="mtf_migrated"/> </annotations> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="openProductFillForm"> <argument name="productType" value="configurable"/> </actionGroup> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="_defaultProduct"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="Simple Product" stepKey="seeProductTypeInGrid"/> @@ -38,7 +38,7 @@ <group value="catalog"/> <group value="mtf_migrated"/> </annotations> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="openProductFillForm"> <argument name="productType" value="configurable"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="Virtual Product" stepKey="seeProductTypeInGrid"/> @@ -63,10 +63,10 @@ <after> <deleteData stepKey="deleteAttribute" createDataKey="createConfigProductAttribute"/> </after> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="openProductFillForm"> <argument name="productType" value="virtual"/> </actionGroup> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="_defaultProduct"/> </actionGroup> <comment before="createConfiguration" stepKey="beforeCreateConfiguration" userInput="Adding Configuration to Product"/> @@ -100,12 +100,12 @@ <after> <deleteData stepKey="deleteAttribute" createDataKey="createConfigProductAttribute"/> </after> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="openProductFillForm"> <argument name="productType" value="simple"/> </actionGroup> <!-- Create configurable product from simple product page--> <comment userInput="Create configurable product" stepKey="commentCreateProduct"/> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="_defaultProduct"/> </actionGroup> <comment before="createConfiguration" stepKey="beforeCreateConfiguration" userInput="Adding Configuration to Product"/> @@ -141,11 +141,11 @@ </createData> </before> <after> - <actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteConfigurableProduct"> + <actionGroup ref="GoToProductCatalogPageActionGroup" stepKey="goToProductCatalogPage"/> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteConfigurableProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetSearch"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetSearch"/> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> <deleteData stepKey="deleteAttribute" createDataKey="createConfigProductAttribute"/> <actionGroup ref="logout" stepKey="logout"/> @@ -155,17 +155,17 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> <!-- Open Dropdown and select downloadable product option --> <comment stepKey="beforeOpenProductFillForm" userInput="Selecting Product from the Add Product Dropdown"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="openProductFillForm"> <argument name="productType" value="downloadable"/> </actionGroup> <scrollTo selector="{{AdminProductDownloadableSection.sectionHeader}}" stepKey="scrollToDownloadableInfo" /> <uncheckOption selector="{{AdminProductDownloadableSection.isDownloadableProduct}}" stepKey="checkIsDownloadable"/> <!-- Fill form for Downloadable Product Type --> <comment stepKey="beforeFillProductForm" userInput="Filling Product Form"/> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="_defaultProduct"/> </actionGroup> - <actionGroup ref="SetProductUrlKey" stepKey="setProductUrl"> + <actionGroup ref="SetProductUrlKeyActionGroup" stepKey="setProductUrl"> <argument name="product" value="_defaultProduct"/> </actionGroup> <comment before="createConfiguration" stepKey="beforeCreateConfiguration" userInput="Adding Configuration to Product"/> @@ -175,13 +175,13 @@ <actionGroup ref="saveConfiguredProduct" stepKey="saveProductForm"/> <!-- Check that product was added with implicit type change --> <comment stepKey="beforeVerify" userInput="Verify Product Type Assigned Correctly"/> - <actionGroup ref="GoToProductCatalogPage" stepKey="goToProductCatalogPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetSearch"/> - <actionGroup ref="filterProductGridByName" stepKey="searchForProduct"> + <actionGroup ref="GoToProductCatalogPageActionGroup" stepKey="goToProductCatalogPage"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetSearch"/> + <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="searchForProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('2', 'Type')}}" userInput="Configurable Product" stepKey="seeProductTypeInGrid"/> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="assertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="assertProductInStorefrontProductPage"> <argument name="product" value="_defaultProduct"/> </actionGroup> <actionGroup ref="VerifyOptionInProductStorefront" stepKey="verifyConfigurableOption"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductBasedOnParentSkuTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductBasedOnParentSkuTest.xml index f4f607e9119b6..36cc4363e22f3 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductBasedOnParentSkuTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductBasedOnParentSkuTest.xml @@ -22,12 +22,12 @@ </before> <after> <!-- Delete configurable product with children products --> - <actionGroup ref="deleteProductBySku" stepKey="deleteProducts"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProducts"> <argument name="sku" value="{{ApiConfigurableProduct.sku}}"/> </actionGroup> <!-- Delete product attribute --> - <actionGroup ref="deleteProductAttributeByLabel" stepKey="deleteProductAttribute"> + <actionGroup ref="DeleteProductAttributeByLabelActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttribute" value="colorProductAttribute"/> </actionGroup> @@ -38,12 +38,12 @@ <!-- Create configurable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="createConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Fill configurable product values --> - <actionGroup ref="fillMainProductForm" stepKey="fillConfigurableProductValues"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductValues"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -70,13 +70,13 @@ <!-- Assert child products generated sku in grid --> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="openProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPageLoad"/> - <actionGroup ref="filterProductGridByName2" stepKey="filterFirstProductByNameInGrid"> + <actionGroup ref="FilterProductGridByName2ActionGroup" stepKey="filterFirstProductByNameInGrid"> <argument name="name" value="{{colorConfigurableProductAttribute1.name}}"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'SKU')}}" userInput="{{ApiConfigurableProduct.sku}}-{{colorConfigurableProductAttribute1.name}}" stepKey="seeFirstProductSkuInGrid"/> - <actionGroup ref="filterProductGridByName2" stepKey="filterSecondProductByNameInGrid"> + <actionGroup ref="FilterProductGridByName2ActionGroup" stepKey="filterSecondProductByNameInGrid"> <argument name="name" value="{{colorConfigurableProductAttribute2.name}}"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'SKU')}}" userInput="{{ApiConfigurableProduct.sku}}-{{colorConfigurableProductAttribute2.name}}" stepKey="seeSecondProductSkuInGrid"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml index a7242b43c2b5f..00f166d0f29d0 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithCreatingCategoryAndAttributeTest.xml @@ -23,25 +23,25 @@ </before> <after> <!-- Delete configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Delete children products --> - <actionGroup ref="deleteProductBySku" stepKey="deleteFirstChildProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteFirstChildProduct"> <argument name="sku" value="{{colorConfigurableProductAttribute1.sku}}"/> </actionGroup> - <actionGroup ref="deleteProductBySku" stepKey="deleteSecondChildProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteSecondChildProduct"> <argument name="sku" value="{{colorConfigurableProductAttribute2.sku}}"/> </actionGroup> <!-- Delete product attribute --> - <actionGroup ref="deleteProductAttributeByLabel" stepKey="deleteProductAttribute"> + <actionGroup ref="DeleteProductAttributeByLabelActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttribute" value="colorProductAttribute"/> </actionGroup> <!-- Delete attribute set --> - <actionGroup ref="deleteAttributeSetByLabel" stepKey="deleteAttributeSet"> + <actionGroup ref="DeleteAttributeSetByLabelActionGroup" stepKey="deleteAttributeSet"> <argument name="label" value="{{ProductAttributeFrontendLabel.label}}"/> </actionGroup> @@ -55,7 +55,7 @@ <!-- Create configurable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="createConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -90,7 +90,7 @@ <!-- Find configurable product in grid --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedConfigurableProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml index 49f3f8b5ea931..3379e0d053ed9 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithDisabledChildrenProductsTest.xml @@ -43,7 +43,7 @@ <actionGroup ref="noDisplayOutOfStockProduct" stepKey="revertDisplayOutOfStockProduct"/> <!-- Delete configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -59,12 +59,12 @@ <!-- Create configurable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="createConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Fill configurable product values --> - <actionGroup ref="fillMainProductForm" stepKey="fillConfigurableProductValues"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductValues"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -83,12 +83,12 @@ </actionGroup> <!-- Save configurable product --> - <actionGroup ref="saveProductForm" stepKey="saveConfigurableProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveConfigurableProduct"/> <!-- Find configurable product in grid --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedConfigurableProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml index 9796c14f5519a..d536ed1b4b960 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithImagesTest.xml @@ -46,7 +46,7 @@ </before> <after> <!-- Delete configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -62,12 +62,12 @@ <!--Create configurable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="createConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Fill configurable product values --> - <actionGroup ref="fillMainProductForm" stepKey="fillConfigurableProductValues"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductValues"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -75,7 +75,7 @@ <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory" after="fillConfigurableProductValues"/> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> @@ -142,7 +142,7 @@ <!-- Assert product image in storefront product page --> <amOnPage url="{{ApiConfigurableProduct.urlKey}}.html" stepKey="amOnProductPage"/> - <actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertProductImageStorefrontProductPage"> + <actionGroup ref="AssertProductImageStorefrontProductPageActionGroup" stepKey="assertProductImageStorefrontProductPage"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="image" value="MagentoLogo"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml index 308e256543736..f12f34cbb02d6 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDisplayOutOfStockProductsTest.xml @@ -64,7 +64,7 @@ <actionGroup ref="noDisplayOutOfStockProduct" stepKey="revertDisplayOutOfStockProduct"/> <!-- Delete configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -82,12 +82,12 @@ <!--Create configurable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="createConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!--Fill configurable product values --> - <actionGroup ref="fillMainProductForm" stepKey="fillConfigurableProductValues"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductValues"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -116,7 +116,7 @@ </actionGroup> <!-- Save configurable product --> - <actionGroup ref="saveProductForm" stepKey="saveConfigurableProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveConfigurableProduct"/> <!-- Display out of stock product --> <actionGroup ref="displayOutOfStockProduct" stepKey="displayOutOfStockProduct"/> @@ -137,4 +137,4 @@ <waitForPageLoad stepKey="waitForProductPageLoad"/> <see userInput="$$createConfigProductAttributeOptionThree.option[store_labels][1][label]$$" selector="{{StorefrontProductInfoMainSection.optionByAttributeId($$createConfigProductAttribute.attribute_id$$)}}" stepKey="assertOptionNotAvailable" /> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml index e24ac07c30d1e..527900b1767bf 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithThreeProductDontDisplayOutOfStockProductsTest.xml @@ -61,7 +61,7 @@ </before> <after> <!-- Delete configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -79,12 +79,12 @@ <!--Create configurable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="createConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!--Fill configurable product values --> - <actionGroup ref="fillMainProductForm" stepKey="fillConfigurableProductValues"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductValues"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -113,7 +113,7 @@ </actionGroup> <!-- Save configurable product --> - <actionGroup ref="saveProductForm" stepKey="saveConfigurableProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveConfigurableProduct"/> <!-- Flash cache --> <magentoCLI command="cache:flush" stepKey="flushCache"/> @@ -131,4 +131,4 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <dontSee userInput="$$createConfigProductAttributeOptionThree.option[store_labels][1][label]$$" selector="{{StorefrontProductInfoMainSection.optionByAttributeId($$createConfigProductAttribute.attribute_id$$)}}" stepKey="assertOptionNotAvailable"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTierPriceForOneItemTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTierPriceForOneItemTest.xml index 51f4bf0279942..660651fecf69b 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTierPriceForOneItemTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTierPriceForOneItemTest.xml @@ -54,7 +54,7 @@ </before> <after> <!-- Delete configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -70,12 +70,12 @@ <!--Create configurable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitProductGridPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="createConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!--Fill configurable product values --> - <actionGroup ref="fillMainProductForm" stepKey="fillConfigurableProductValues"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductValues"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -96,7 +96,7 @@ </actionGroup> <!-- Save configurable product --> - <actionGroup ref="saveProductForm" stepKey="saveConfigurableProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveConfigurableProduct"/> <!-- Assert product tier price on product page --> <amOnPage url="{{ApiConfigurableProduct.urlKey}}.html" stepKey="amOnProductPage"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml index 1db9b3e5b79b2..2cee05be69bbe 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsAssignedToCategoryTest.xml @@ -26,25 +26,25 @@ </before> <after> <!-- Delete configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Delete children products --> - <actionGroup ref="deleteProductBySku" stepKey="deleteFirstChildProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteFirstChildProduct"> <argument name="sku" value="{{colorConfigurableProductAttribute1.sku}}"/> </actionGroup> - <actionGroup ref="deleteProductBySku" stepKey="deleteSecondChildProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteSecondChildProduct"> <argument name="sku" value="{{colorConfigurableProductAttribute2.sku}}"/> </actionGroup> <!-- Delete product attribute --> - <actionGroup ref="deleteProductAttributeByLabel" stepKey="deleteProductAttribute"> + <actionGroup ref="DeleteProductAttributeByLabelActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttribute" value="colorProductAttribute"/> </actionGroup> <!-- Delete attribute set --> - <actionGroup ref="deleteAttributeSetByLabel" stepKey="deleteAttributeSet"> + <actionGroup ref="DeleteAttributeSetByLabelActionGroup" stepKey="deleteAttributeSet"> <argument name="label" value="{{ProductAttributeFrontendLabel.label}}"/> </actionGroup> @@ -58,12 +58,12 @@ <!-- Create configurable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="createConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Fill configurable product values --> - <actionGroup ref="fillMainProductForm" stepKey="fillConfigurableProductValues"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductValues"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -91,15 +91,15 @@ <actionGroup ref="saveConfigurableProductWithNewAttributeSet" stepKey="saveConfigurableProduct"/> <!-- Assert child products in grid --> - <actionGroup ref="viewProductInAdminGrid" stepKey="viewFirstChildProductInAdminGrid"> + <actionGroup ref="ViewProductInAdminGridActionGroup" stepKey="viewFirstChildProductInAdminGrid"> <argument name="product" value="colorConfigurableProductAttribute1"/> </actionGroup> - <actionGroup ref="viewProductInAdminGrid" stepKey="viewSecondChildProductInAdminGrid"> + <actionGroup ref="ViewProductInAdminGridActionGroup" stepKey="viewSecondChildProductInAdminGrid"> <argument name="product" value="colorConfigurableProductAttribute2"/> </actionGroup> <!-- Assert configurable product in grid --> - <actionGroup ref="filterProductGridBySkuAndName" stepKey="findCreatedConfigurableProduct"> + <actionGroup ref="FilterProductGridBySkuAndNameActionGroup" stepKey="findCreatedConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="{{ApiConfigurableProduct.type_id}}" stepKey="seeProductTypeInGrid"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml index 934a410d58a8a..f36465b853317 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateConfigurableProductWithTwoOptionsWithoutAssignedToCategoryTest.xml @@ -22,25 +22,25 @@ </before> <after> <!-- Delete configurable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Delete children products --> - <actionGroup ref="deleteProductBySku" stepKey="deleteFirstChildProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteFirstChildProduct"> <argument name="sku" value="{{colorConfigurableProductAttribute1.sku}}"/> </actionGroup> - <actionGroup ref="deleteProductBySku" stepKey="deleteSecondChildProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteSecondChildProduct"> <argument name="sku" value="{{colorConfigurableProductAttribute2.sku}}"/> </actionGroup> <!-- Delete product attribute --> - <actionGroup ref="deleteProductAttributeByLabel" stepKey="deleteProductAttribute"> + <actionGroup ref="DeleteProductAttributeByLabelActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttribute" value="colorProductAttribute"/> </actionGroup> <!-- Delete attribute set --> - <actionGroup ref="deleteAttributeSetByLabel" stepKey="deleteAttributeSet"> + <actionGroup ref="DeleteAttributeSetByLabelActionGroup" stepKey="deleteAttributeSet"> <argument name="label" value="{{ProductAttributeFrontendLabel.label}}"/> </actionGroup> @@ -51,12 +51,12 @@ <!-- Create configurable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="createConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="createConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Fill configurable product values --> - <actionGroup ref="fillMainProductForm" stepKey="fillConfigurableProductValues"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductValues"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> @@ -81,15 +81,15 @@ <actionGroup ref="saveConfigurableProductWithNewAttributeSet" stepKey="saveConfigurableProduct"/> <!-- Assert Child Products in grid --> - <actionGroup ref="viewProductInAdminGrid" stepKey="viewFirstChildProductInAdminGrid"> + <actionGroup ref="ViewProductInAdminGridActionGroup" stepKey="viewFirstChildProductInAdminGrid"> <argument name="product" value="colorConfigurableProductAttribute1"/> </actionGroup> - <actionGroup ref="viewProductInAdminGrid" stepKey="viewSecondChildProductInAdminGrid"> + <actionGroup ref="ViewProductInAdminGridActionGroup" stepKey="viewSecondChildProductInAdminGrid"> <argument name="product" value="colorConfigurableProductAttribute2"/> </actionGroup> <!-- Assert Configurable Product in grid --> - <actionGroup ref="filterProductGridBySkuAndName" stepKey="findCreatedConfigurableProduct"> + <actionGroup ref="FilterProductGridBySkuAndNameActionGroup" stepKey="findCreatedConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="{{ApiConfigurableProduct.type_id}}" stepKey="seeProductTypeInGrid"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml index fb2920be528b6..c2edbaa4e6e87 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml @@ -28,7 +28,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteConfigurableProductFilteredBySkuAndName"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteConfigurableProductFilteredBySkuAndName"> <argument name="product" value="$$createConfigurableProduct$$"/> </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml index fa21d20eb4456..6dc77b691bb4f 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml @@ -39,7 +39,7 @@ <comment userInput="Delete product" stepKey="commentDeleteProduct"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteAttribute"/> - <actionGroup ref="deleteAllDuplicateProductUsingProductGrid" stepKey="deleteAllDuplicateProducts"> + <actionGroup ref="DeleteAllDuplicateProductUsingProductGridActionGroup" stepKey="deleteAllDuplicateProducts"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductFilters"/> @@ -56,7 +56,7 @@ <!--Assert configurable product on Admin product page grid--> <comment userInput="Assert configurable product in Admin product page grid" stepKey="commentAssertConfigProductOnAdmin"/> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGridBySku"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGridBySku"> <argument name="sku" value="$$createProduct.sku$$"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="$$createProduct.name$$" stepKey="seeProductNameInGrid"/> @@ -97,11 +97,11 @@ <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{SimpleProduct2.quantity}}" stepKey="fillProductQty"/> <clearField selector="{{AdminProductFormSection.productWeight}}" stepKey="clearWeightField"/> <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has no weight" stepKey="selectNoWeight"/> - <actionGroup ref="saveProductForm" stepKey="saveVirtualProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveVirtualProductForm"/> <!--Assert virtual product on Admin product page grid--> <comment userInput="Assert virtual product on Admin product page grid" stepKey="commentAssertVirtualProductOnAdmin"/> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPageForVirtual"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGridBySkuForVirtual"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGridBySkuForVirtual"> <argument name="sku" value="$$createProduct.sku$$"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="$$createProduct.name$$" stepKey="seeVirtualProductNameInGrid"/> @@ -143,7 +143,7 @@ <comment userInput="Delete product" stepKey="commentDeleteProduct"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteAttribute"/> - <actionGroup ref="deleteAllDuplicateProductUsingProductGrid" stepKey="deleteAllDuplicateProducts"> + <actionGroup ref="DeleteAllDuplicateProductUsingProductGridActionGroup" stepKey="deleteAllDuplicateProducts"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductFilters"/> @@ -161,7 +161,7 @@ <!--Assert configurable product on Admin product page grid--> <comment userInput="Assert configurable product in Admin product page grid" stepKey="commentAssertConfigurableProductOnAdmin"/> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPageForConfigurable"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGridBySkuForConfigurable"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGridBySkuForConfigurable"> <argument name="sku" value="$$createProduct.sku$$"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="$$createProduct.name$$" stepKey="seeConfigurableProductNameInGrid"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRelatedProductsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRelatedProductsTest.xml index aa34693ed82f0..166c31d0460a9 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRelatedProductsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRelatedProductsTest.xml @@ -94,18 +94,18 @@ <comment userInput="Filter and edit simple product 1" stepKey="filterAndEditComment1"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="productIndexPage"/> <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridSimple"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridSimple"> <argument name="product" value="$$simple1Handle$$"/> </actionGroup> - <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openProducForEditByClickingRow1Column2InProductGrid"/> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProducForEditByClickingRow1Column2InProductGrid"/> <conditionalClick selector="{{AdminProductFormSection.productFormTab('Related Products')}}" dependentSelector="{{AdminProductFormSection.productFormTabState('Related Products', 'closed')}}" visible="true" stepKey="openRelatedProductTab"/> <waitForPageLoad time="30" stepKey="waitForPageLoad3"/> <!-- TODO: move adding related product to a action group when nested action group is allowed (ref#: MQE-539)--> <comment userInput="Add related simple product to simple product" stepKey="addSimpleToSimpleComment"/> <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddRelatedProductsButton}}" stepKey="clickAddRelatedProductButton"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridSimple1"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridSimple1"> <argument name="product" value="$$simple2Handle$$"/> </actionGroup> <click selector="{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectSimpleTwo"/> @@ -114,7 +114,7 @@ <comment userInput="Add related config product to simple product" stepKey="addConfigToSimpleComment"/> <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddRelatedProductsButton}}" stepKey="clickAddRelatedProductButton2"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridSimpleForRelatedConfig1"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridSimpleForRelatedConfig1"> <argument name="product" value="$$baseConfigProductHandle$$"/> </actionGroup> <click selector="{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectConfigProduct"/> @@ -122,16 +122,16 @@ <click selector="{{AdminAddRelatedProductsModalSection.AddSelectedProductsButton}}" stepKey="addRelatedProductSelected2"/> <comment userInput="Save simple product" stepKey="saveSimpleProductComment"/> - <actionGroup ref="saveProductForm" stepKey="saveRelatedProduct1"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveRelatedProduct1"/> <comment userInput="Assert related simple products for simple product in Admin Product Form" stepKey="assertRelated1Comment"/> - <actionGroup ref="AssertTextInAdminProductRelatedUpSellCrossSellSection" stepKey="assertRelated1"> + <actionGroup ref="AssertTextInAdminProductRelatedUpSellCrossSellSectionActionGroup" stepKey="assertRelated1"> <argument name="element" value="AdminProductFormRelatedUpSellCrossSellSection.relatedProductSectionText"/> <argument name="expectedText" value="$$simple2Handle.name$$"/> </actionGroup> <comment userInput="Assert related config products for simple product in Admin Product Form" stepKey="assertRelated2Comment"/> - <actionGroup ref="AssertTextInAdminProductRelatedUpSellCrossSellSection" stepKey="assertRelated2"> + <actionGroup ref="AssertTextInAdminProductRelatedUpSellCrossSellSectionActionGroup" stepKey="assertRelated2"> <argument name="element" value="AdminProductFormRelatedUpSellCrossSellSection.relatedProductSectionText"/> <argument name="expectedText" value="$$baseConfigProductHandle.name$$"/> </actionGroup> @@ -139,17 +139,17 @@ <comment userInput="Filter and edit config product" stepKey="filterAndEditComment2"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="productIndexPage2"/> <waitForPageLoad time="30" stepKey="waitForPageLoad5"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial2"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridConfig"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial2"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridConfig"> <argument name="product" value="$$baseConfigProductHandle$$"/> </actionGroup> - <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openProducForEditByClickingRow1Column2InProductGrid2"/> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProducForEditByClickingRow1Column2InProductGrid2"/> <conditionalClick selector="{{AdminProductFormSection.productFormTab('Related Products')}}" dependentSelector="{{AdminProductFormSection.productFormTabState('Related Products', 'closed')}}" visible="true" stepKey="openRelatedProductTab2"/> <waitForPageLoad time="30" stepKey="waitForPageLoad7"/> <comment userInput="Add related simple product to config product" stepKey="addSimpleToConfigComment"/> <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddRelatedProductsButton}}" stepKey="clickAddRelatedProductButton3"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridForConfig3"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridForConfig3"> <argument name="product" value="$$simple2Handle$$"/> </actionGroup> <click selector="{{AdminProductModalSlideGridSection.productGridXRowYColumnButton('1', '1')}}" stepKey="selectSimpleTwo2"/> @@ -157,10 +157,10 @@ <click selector="{{AdminAddRelatedProductsModalSection.AddSelectedProductsButton}}" stepKey="addRelatedProductSelected3"/> <comment userInput="Save config product" stepKey="saveConfigProductComment"/> - <actionGroup ref="saveProductForm" stepKey="saveRelatedProduct2"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveRelatedProduct2"/> <comment userInput="Assert related simple product for config product in Admin Product Form" stepKey="assertRelated3Comment"/> - <actionGroup ref="AssertTextInAdminProductRelatedUpSellCrossSellSection" stepKey="assertRelated3"> + <actionGroup ref="AssertTextInAdminProductRelatedUpSellCrossSellSectionActionGroup" stepKey="assertRelated3"> <argument name="element" value="AdminProductFormRelatedUpSellCrossSellSection.relatedProductSectionText"/> <argument name="expectedText" value="$$simple2Handle.name$$"/> </actionGroup> @@ -187,7 +187,7 @@ <comment userInput="Check related product in product page" stepKey="checkRelatedProductInProductPageComment"/> <click selector="{{StorefrontProductRelatedProductsSection.relatedProductCheckBoxButton('$$simple2Handle.name$$')}}" stepKey="checkRelatedProcut"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$baseConfigProductHandle.name$$"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRemoveDefaultImageConfigurableTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRemoveDefaultImageConfigurableTest.xml index e7492f4eeaecf..0cc73f117aaad 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRemoveDefaultImageConfigurableTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminRemoveDefaultImageConfigurableTest.xml @@ -93,33 +93,33 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="productIndexPage"/> <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGrid"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGrid"> <argument name="product" value="$$baseConfigProductHandle$$"/> </actionGroup> - <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openProducForEditByClickingRow1Column2InProductGrid1"/> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProducForEditByClickingRow1Column2InProductGrid1"/> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Remove image from product --> - <actionGroup ref="removeProductImage" stepKey="removeProductImage"/> + <actionGroup ref="RemoveProductImageActionGroup" stepKey="removeProductImage"/> - <actionGroup ref="saveProductForm" stepKey="saveProductFormAfterRemove"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductFormAfterRemove"/> <!-- Assert product image not in admin product form --> - <actionGroup ref="assertProductImageNotInAdminProductPage" stepKey="assertProductImageNotInAdminProductPage"/> + <actionGroup ref="AssertProductImageNotInAdminProductPageActionGroup" stepKey="assertProductImageNotInAdminProductPage"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="AssertProductInStorefrontProductPageAfterRemove"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="AssertProductInStorefrontProductPageAfterRemove"> <argument name="product" value="$$baseConfigProductHandle$$"/> </actionGroup> <!-- Assert product image not in storefront product page --> - <actionGroup ref="assertProductImageNotInStorefrontProductPage2" stepKey="assertProductImageNotInStorefrontProductPage2"> + <actionGroup ref="AssertProductImageNotInStorefrontProductPage2ActionGroup" stepKey="assertProductImageNotInStorefrontProductPage2"> <argument name="product" value="$$baseConfigProductHandle$$"/> </actionGroup> </test> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml index 6bbb97c66cdd8..dccacbdc3d6f6 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -11,11 +11,11 @@ <!--Create configurable product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageConfigurable" after="seeSimpleProductInGrid"/> <waitForPageLoad stepKey="waitForProductPageLoadConfigurable" after="visitAdminProductPageConfigurable"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateConfigurableProduct" after="waitForProductPageLoadConfigurable"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateConfigurableProduct" after="waitForProductPageLoadConfigurable"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> - <actionGroup ref="checkRequiredFieldsInProductForm" stepKey="checkRequiredFieldsProductConfigurable" after="goToCreateConfigurableProduct"/> - <actionGroup ref="fillMainProductForm" stepKey="fillConfigurableProductMain" after="checkRequiredFieldsProductConfigurable"> + <actionGroup ref="CheckRequiredFieldsInProductFormActionGroup" stepKey="checkRequiredFieldsProductConfigurable" after="goToCreateConfigurableProduct"/> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillConfigurableProductMain" after="checkRequiredFieldsProductConfigurable"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <!--Create product configurations--> @@ -69,8 +69,8 @@ <!--@TODO Move cleanup to "after" when MQE-830 is resolved--> <comment userInput="Clean up configurable product" stepKey="cleanUpConfigurableProduct" after="deleteSimpleProduct"/> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteConfigurableProduct" after="cleanUpConfigurableProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteConfigurableProduct" after="cleanUpConfigurableProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml index fd607d2203c66..4f21e80844736 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml @@ -109,13 +109,13 @@ <amOnPage url="{{AdminProductEditPage.url($$createConfigChildProduct1.id$$)}}" stepKey="goToEditPage"/> <waitForPageLoad stepKey="waitForChildProductPageLoad"/> <click selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="disableProduct"/> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <!-- Set the second product out of stock --> <comment userInput="Set the second product out of stock" stepKey="outOfStockChildProduct"/> <amOnPage url="{{AdminProductEditPage.url($$createConfigChildProduct2.id$$)}}" stepKey="goToSecondProductEditPage"/> <waitForPageLoad stepKey="waitForSecondChildProductPageLoad"/> <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="Out of Stock" stepKey="outOfStockStatus"/> - <actionGroup ref="saveProductForm" stepKey="saveSecondProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSecondProductForm"/> <!-- Go to created customer page --> <comment userInput="Go to created customer page" stepKey="goToCreatedCustomerPage"/> <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="createNewOrder"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml index c3459aec34492..9152adc6c2e79 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/ProductsQtyReturnAfterOrderCancelTest.xml @@ -49,7 +49,7 @@ <waitForPageLoad stepKey="waitForProductPage"/> <fillField selector="{{StorefrontProductInfoMainSection.qty}}" userInput="4" stepKey="fillQuantity"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createConfigProduct.name$$"/> </actionGroup> @@ -91,7 +91,7 @@ <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="GoToCatalogProductPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGridBySku"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGridBySku"> <argument name="sku" value="$$createConfigProduct.sku$$"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Quantity')}}" userInput="99" stepKey="seeProductSkuInGrid"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductCategoryViewChildOnlyTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductCategoryViewChildOnlyTest.xml index 805727e29a17a..9d7807c543def 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductCategoryViewChildOnlyTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductCategoryViewChildOnlyTest.xml @@ -102,10 +102,10 @@ <!-- Go to the product page for the first product --> <amOnPage stepKey="goToProductGrid" url="{{ProductCatalogPage.url}}"/> <waitForPageLoad stepKey="waitForProductGridLoad"/> - <actionGroup stepKey="searchForSimpleProduct" ref="filterProductGridBySku2"> + <actionGroup stepKey="searchForSimpleProduct" ref="FilterProductGridBySku2ActionGroup"> <argument name="sku" value="$$createConfigChildProduct1.sku$$"/> </actionGroup> - <actionGroup stepKey="openProductEditPage" ref="openProducForEditByClickingRowXColumnYInProductGrid"/> + <actionGroup stepKey="openProductEditPage" ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup"/> <!-- Edit the visibility the first simple product --> <selectOption selector="{{AdminProductFormSection.visibility}}" userInput="Catalog, Search" stepKey="selectVisibilityCatalogSearch"/> <!--Add to category--> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml index 16400fa837b1c..294ab9fd0664d 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductChildSearchTest.xml @@ -119,10 +119,10 @@ <!-- Go to the product page for the first product --> <amOnPage stepKey="goToProductGrid" url="{{ProductCatalogPage.url}}"/> <waitForPageLoad stepKey="waitForProductGridLoad"/> - <actionGroup stepKey="searchForSimpleProduct" ref="filterProductGridBySku2"> + <actionGroup stepKey="searchForSimpleProduct" ref="FilterProductGridBySku2ActionGroup"> <argument name="sku" value="$$createConfigChildProduct1.sku$$"/> </actionGroup> - <actionGroup stepKey="openProductEditPage" ref="openProducForEditByClickingRowXColumnYInProductGrid"/> + <actionGroup stepKey="openProductEditPage" ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup"/> <!-- Edit the attribute for the first simple product --> <selectOption stepKey="editSelectAttribute" selector="{{ModifyAttributes.nthExistingAttribute($$createConfigProductAttributeSelect.default_frontend_label$$)}}" userInput="$$createConfigProductAttributeSelectOption1.option[store_labels][0][label]$$"/> @@ -156,4 +156,4 @@ <submitForm selector="#search_mini_form" parameterArray="['q' => $$createConfigChildProduct1.custom_attributes[short_description]$$]" stepKey="searchStorefront3" /> <seeElement stepKey="seeProduct3" selector="{{StorefrontCategoryProductSection.ProductTitleByName('$$createConfigProduct.name$$')}}"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml index 2f5ee036b1420..6a2d1867a691f 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest.xml @@ -31,7 +31,7 @@ </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> @@ -76,7 +76,7 @@ </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> @@ -121,7 +121,7 @@ </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> @@ -163,7 +163,7 @@ </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsGridFilters"/> @@ -213,7 +213,7 @@ </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{BaseConfigurableProduct.sku}}"/> </actionGroup> <deleteData createDataKey="createFirstAttribute" stepKey="deleteFirstAttribute"/> @@ -223,16 +223,16 @@ </after> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="navigateToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="navigateToCreateProductPage"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> - <actionGroup ref="SetCategoryByName" stepKey="addCategoryToProduct"> + <actionGroup ref="SetCategoryByNameActionGroup" stepKey="addCategoryToProduct"> <argument name="categoryName" value="$createCategory.name$"/> </actionGroup> - <actionGroup ref="SetProductUrlKeyByString" stepKey="fillUrlKey"> + <actionGroup ref="SetProductUrlKeyByStringActionGroup" stepKey="fillUrlKey"> <argument name="urlKey" value="{{BaseConfigurableProduct.urlKey}}"/> </actionGroup> <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurations"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest.xml index 65e1d3a74f060..d40b0efa8ad4b 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest.xml @@ -34,7 +34,7 @@ <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <actionGroup stepKey="deleteProduct" ref="deleteProductBySku"> + <actionGroup stepKey="deleteProduct" ref="DeleteProductBySkuActionGroup"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> <actionGroup ref="logout" stepKey="adminLogout"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml index 4c955f3385643..a9d7f35a50c8a 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductWithFileCustomOptionTest.xml @@ -36,9 +36,9 @@ <argument name="category" value="$$createCategory$$"/> </actionGroup> <!--Add custom option to configurable product--> - <actionGroup ref="AddProductCustomOptionFile" stepKey="addCustomOptionToProduct"/> + <actionGroup ref="AddProductCustomOptionFileActionGroup" stepKey="addCustomOptionToProduct"/> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/> - + <!--Go to storefront--> <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToHomePage"/> <waitForPageLoad stepKey="waitForHomePageLoad"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml index bc8f3e49272b7..8d08f599db6a0 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml @@ -89,10 +89,10 @@ </createData> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!--SKU Product Attribute is enabled for Promo Rule Conditions--> - <actionGroup ref="navigateToEditProductAttribute" stepKey="navigateToSkuProductAttribute"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="navigateToSkuProductAttribute"> <argument name="ProductAttribute" value="sku"/> </actionGroup> - <actionGroup ref="changeUseForPromoRuleConditionsProductAttribute" stepKey="changeUseForPromoRuleConditionsProductAttributeToYes"> + <actionGroup ref="ChangeUseForPromoRuleConditionsProductAttributeActionGroup" stepKey="changeUseForPromoRuleConditionsProductAttributeToYes"> <argument name="option" value="Yes"/> </actionGroup> <magentoCLI command="indexer:reindex" stepKey="reindex1"/> @@ -110,17 +110,17 @@ <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> <!--SKU Product Attribute is disable for Promo Rule Conditions--> - <actionGroup ref="navigateToEditProductAttribute" stepKey="navigateToSkuProductAttribute"> + <actionGroup ref="NavigateToEditProductAttributeActionGroup" stepKey="navigateToSkuProductAttribute"> <argument name="ProductAttribute" value="sku"/> </actionGroup> - <actionGroup ref="changeUseForPromoRuleConditionsProductAttribute" stepKey="changeUseForPromoRuleConditionsProductAttributeToNo"> + <actionGroup ref="ChangeUseForPromoRuleConditionsProductAttributeActionGroup" stepKey="changeUseForPromoRuleConditionsProductAttributeToNo"> <argument name="option" value="No"/> </actionGroup> <actionGroup ref="logout" stepKey="logoutFromAdmin"/> </after> <!--Open category with products and Sort by price desc--> - <actionGroup ref="GoToStorefrontCategoryPageByParameters" stepKey="goToStorefrontCategoryPage"> + <actionGroup ref="GoToStorefrontCategoryPageByParametersActionGroup" stepKey="goToStorefrontCategoryPage"> <argument name="category" value="$$createCategory.custom_attributes[url_key]$$"/> <argument name="mode" value="grid"/> <argument name="numOfProductsPerPage" value="25"/> @@ -143,7 +143,7 @@ <magentoCLI command="cache:flush" stepKey="flushCache"/> <!--Reopen category with products and Sort by price desc--> - <actionGroup ref="GoToStorefrontCategoryPageByParameters" stepKey="goToStorefrontCategoryPage2"> + <actionGroup ref="GoToStorefrontCategoryPageByParametersActionGroup" stepKey="goToStorefrontCategoryPage2"> <argument name="category" value="$$createCategory.custom_attributes[url_key]$$"/> <argument name="mode" value="grid"/> <argument name="numOfProductsPerPage" value="9"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml index 182c8c069ab23..3ebd9d6ef5367 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml @@ -122,7 +122,7 @@ <!-- Open Product Index Page and Filter First Child product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageToLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct"> <argument name="product" value="ApiSimpleOne"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml index 749d1bee0661a..e3ab26fa2fff4 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml @@ -30,17 +30,17 @@ <after> <!--Delete created data--> <comment userInput="Delete created data" stepKey="commentDeleteCreatedData"/> - <actionGroup ref="deleteAllDuplicateProductUsingProductGrid" stepKey="deleteDuplicatedProduct"> + <actionGroup ref="DeleteAllDuplicateProductUsingProductGridActionGroup" stepKey="deleteDuplicatedProduct"> <argument name="product" value="$$createConfigProduct$$"/> </actionGroup> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetGridToDefaultKeywordSearch"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> <!--Delete product attributes--> <comment userInput="Delete product attributes" stepKey="deleteCommentAttributes"/> - <actionGroup ref="deleteProductAttributeByLabel" stepKey="deleteProductAttribute"> + <actionGroup ref="DeleteProductAttributeByLabelActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttribute" value="colorProductAttribute"/> </actionGroup> <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGridFirst"/> - <actionGroup ref="deleteProductAttributeByLabel" stepKey="deleteProductSecondAttribute"> + <actionGroup ref="DeleteProductAttributeByLabelActionGroup" stepKey="deleteProductSecondAttribute"> <argument name="ProductAttribute" value="productAttributeColor"/> </actionGroup> <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGridSecond"/> @@ -51,11 +51,11 @@ <comment userInput="Create attribute and options for product" stepKey="commentCreateAttributesAndOptions"/> <amOnPage url="{{AdminProductEditPage.url($$createConfigProduct.id$$)}}" stepKey="navigateToConfigProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> - <actionGroup ref="addProductImage" stepKey="addImageForProduct1"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct1"> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> - <actionGroup ref="AdminCreateAttributeFromProductPageWithScope" stepKey="createAttributeForProduct"> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> + <actionGroup ref="AdminCreateAttributeFromProductPageWithScopeActionGroup" stepKey="createAttributeForProduct"> <argument name="attributeName" value="{{colorProductAttribute.default_label}}"/> <argument name="attributeType" value="{{colorProductAttribute.input_type}}"/> <argument name="scope" value="Global"/> @@ -111,7 +111,7 @@ <waitForPageLoad stepKey="waitForSummaryPageLoad"/> <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButtonToGenerateConfigs"/> <waitForPageLoad stepKey="waitForConfigurableProductPageLoad"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Duplicate the product--> <comment userInput="Duplicate the product" stepKey="commentDuplicateProduct"/> <actionGroup ref="AdminFormSaveAndDuplicate" stepKey="saveAndDuplicateProductForm"/> @@ -120,8 +120,8 @@ <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="1" stepKey="selectInStock"/> <!--Change product image--> <comment userInput="Change product image" stepKey="commentChangeProductImage"/> - <actionGroup ref="removeProductImage" stepKey="removeProductImage"/> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="RemoveProductImageActionGroup" stepKey="removeProductImage"/> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="TestImageAdobe"/> </actionGroup> <!--Disable configurations--> @@ -132,10 +132,10 @@ <actionGroup ref="AdminConfigurableProductDisableConfigurationsActionGroup" stepKey="disableSecondConfig"> <argument name="productName" value="{{colorConfigurableProductAttribute2.name}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveDuplicatedProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveDuplicatedProductForm"/> <!--Create new configurations with another attribute--> <comment userInput="Create new configurations with another attribute" stepKey="commentCreateNewConfigurations"/> - <actionGroup ref="AdminCreateAttributeFromProductPageWithScope" stepKey="createAttributeForDuplicatedProduct"> + <actionGroup ref="AdminCreateAttributeFromProductPageWithScopeActionGroup" stepKey="createAttributeForDuplicatedProduct"> <argument name="attributeName" value="{{productAttributeColor.default_label}}"/> <argument name="attributeType" value="{{productAttributeColor.input_type}}"/> <argument name="scope" value="Global"/> @@ -187,7 +187,7 @@ <waitForPageLoad stepKey="waitForSummaryPageLoadForDuplicatedProduct"/> <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="generateConfigsForDuplicatedProduct"/> <waitForPageLoad stepKey="waitForDuplicatedProductPageLoad"/> - <actionGroup ref="saveProductForm" stepKey="saveDuplicatedProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveDuplicatedProduct"/> <magentoCLI command="indexer:reindex" stepKey="reindex"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> <!--Assert configurable product in category--> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml index 26fbfd394be68..feaef865a5e17 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml @@ -48,7 +48,7 @@ <actionGroup ref="StorefrontSwitchCurrency" stepKey="switchCurrency"> <argument name="currency" value="RUB"/> </actionGroup> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontNewProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontNewProductPage"> <argument name="productName" value="$$createNewProduct.name$$"/> </actionGroup> <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="guestGoToCheckoutNewProductFromMinicart" /> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayedInOneLineTest.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayedInOneLineTest.xml index dc6bdf3db542e..aa3c356d20a20 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayedInOneLineTest.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayedInOneLineTest.xml @@ -51,7 +51,7 @@ <!--Open created product on Storefront and place for order--> <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForProductPagePageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createProduct.name$$"/> </actionGroup> <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="guestGoToCheckoutFromMinicart" /> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminProductBackRedirectNavigateFromCustomerViewCartProduct.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminProductBackRedirectNavigateFromCustomerViewCartProduct.xml index b5db354d54371..18106836ce137 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminProductBackRedirectNavigateFromCustomerViewCartProduct.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminProductBackRedirectNavigateFromCustomerViewCartProduct.xml @@ -37,7 +37,7 @@ </actionGroup> <!-- Add product to cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml index f364d24806b9c..6d8f55daecc13 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml @@ -42,7 +42,7 @@ </after> <!-- Go to the created product page and add it to the cart--> - <actionGroup ref="AddSimpleProductToCart" stepKey="cartAddSimpleProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="cartAddSimpleProductToCart"> <argument name="product" value="$$product$$"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml index a7ce96ddf1fde..e801f890c34b9 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultImageDownloadableProductTest.xml @@ -23,7 +23,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove static.magento.com"/> @@ -33,15 +33,15 @@ <!-- Create product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="adminProductIndexPageAdd"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillMainProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> @@ -59,18 +59,18 @@ </actionGroup> <!--Save product--> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="assertProductImageAdminProductPage" stepKey="assertProductImageAdminProductPage"/> + <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <!-- Assert product image in storefront product page --> - <actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertProductImageStorefrontProductPage"> + <actionGroup ref="AssertProductImageStorefrontProductPageActionGroup" stepKey="assertProductImageStorefrontProductPage"> <argument name="product" value="DownloadableProduct"/> <argument name="image" value="MagentoLogo"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultVideoDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultVideoDownloadableProductTest.xml index d95ddaf12470d..4129fc50c4f7e 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultVideoDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultVideoDownloadableProductTest.xml @@ -26,10 +26,10 @@ </after> <!-- Create a downloadable product --> <!-- Replacing steps in base AdminAddDefaultVideoSimpleProductTest --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillMainProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -48,7 +48,7 @@ </actionGroup> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndEditDownloadableProductSettingsTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndEditDownloadableProductSettingsTest.xml index 2a7f5b437115b..ebd36dddc0b6c 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndEditDownloadableProductSettingsTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndEditDownloadableProductSettingsTest.xml @@ -24,7 +24,7 @@ </before> <after> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -33,12 +33,12 @@ </after> <!-- Create new downloadable product --> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createDownloadableProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createDownloadableProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill all main fields --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillMainProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -53,7 +53,7 @@ </actionGroup> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveButton"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveButton"/> <!-- Open product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> @@ -93,7 +93,7 @@ <actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="disableGiftMessageSettings"/> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveProduct"/> <!-- Verify Url Key after changing --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml index 55740af4d834f..d3933ae4fae7d 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml @@ -19,11 +19,11 @@ <group value="catalog"/> <group value="mtf_migrated"/> </annotations> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="openProductFillForm"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill form for Virtual Product Type --> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="_defaultProduct"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Type')}}" userInput="Simple Product" stepKey="seeProductTypeInGrid"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductAndAssignItToCustomStoreTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductAndAssignItToCustomStoreTest.xml index 4f07334640cf3..3ea48542ad96d 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductAndAssignItToCustomStoreTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductAndAssignItToCustomStoreTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -50,12 +50,12 @@ <!-- Create Downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -74,7 +74,7 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Switch default store view on store view created below --> <amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnStorefrontPage"/> @@ -84,7 +84,7 @@ </actionGroup> <!-- Assert product in custom store --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml index 54a2ff606f384..fce6568eacd6c 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithCustomOptionsTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -44,12 +44,12 @@ <!-- Create Downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -86,7 +86,7 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Go to storefront category page --> <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> @@ -98,7 +98,7 @@ </actionGroup> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml index 24741c281d7f6..cb8d36793c41e 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithDefaultSetLinksTest.xml @@ -35,7 +35,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -46,12 +46,12 @@ <!-- Create downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -75,14 +75,14 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <magentoCLI command="indexer:reindex" stepKey="reindex"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> <!-- Find downloadable product in grid --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedConfigurableProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedConfigurableProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProduct"/> @@ -103,7 +103,7 @@ </actionGroup> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithGroupPriceTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithGroupPriceTest.xml index 06cf31b763f1c..17d0e334eb7f3 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithGroupPriceTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithGroupPriceTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="ApiDownloadableProduct"/> </actionGroup> @@ -44,7 +44,7 @@ <!-- Create downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> @@ -55,7 +55,7 @@ </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="ApiDownloadableProduct"/> </actionGroup> @@ -79,12 +79,12 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Find downloadable product in grid --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedConfigurableProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedConfigurableProduct"> <argument name="product" value="ApiDownloadableProduct"/> </actionGroup> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProduct"/> @@ -96,7 +96,7 @@ <seeElement selector="{{AdminProductDownloadableSection.addLinkTitleInput('1')}}" stepKey="seeSecondLinkTitle"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="ApiDownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithInvalidDomainLinkUrlTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithInvalidDomainLinkUrlTest.xml index f2e4bdfb4890f..ae37d6f4d3bf1 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithInvalidDomainLinkUrlTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithInvalidDomainLinkUrlTest.xml @@ -25,10 +25,10 @@ <argument name="link" value="downloadableLink"/> <argument name="index" value="0"/> </actionGroup> - <actionGroup ref="SaveProductFormNoSuccessCheck" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormNoSuccessCheckActionGroup" stepKey="saveProduct"/> <see selector="{{AdminProductMessagesSection.errorMessage}}" userInput="Link URL's domain is not in list of downloadable_domains in env.php." stepKey="seeLinkUrlInvalidMessage" after="saveProduct" /> <magentoCLI stepKey="addDownloadableDomain2" command="downloadable:domains:add static.magento.com" after="seeLinkUrlInvalidMessage" /> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductFormAgain" after="addDownloadableDomain2"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductFormAgain" after="addDownloadableDomain2"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <checkOption selector="{{AdminProductDownloadableSection.isDownloadableProduct}}" stepKey="checkIsDownloadable" after="fillDownloadableProductFormAgain"/> @@ -37,7 +37,7 @@ <argument name="link" value="downloadableLink"/> <argument name="index" value="0"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProductAfterAddingDomainToWhitelist" after="addDownloadableProductLinkAgain" /> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductAfterAddingDomainToWhitelist" after="addDownloadableProductLinkAgain" /> <scrollTo selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLink.title)}}" stepKey="scrollToLinks"/> <click selector="{{StorefrontDownloadableProductSection.downloadableLinkByTitle(downloadableLink.title)}}" stepKey="selectProductLink"/> <see selector="{{CheckoutCartProductSection.ProductPriceByName(DownloadableProduct.name)}}" userInput="$52.99" stepKey="assertProductPriceInCart"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml index e43b8f94c7a3d..f604e710ce701 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithLinkTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -44,12 +44,12 @@ <!-- Create downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -68,7 +68,7 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product in storefront category page --> <amOnPage url="$$createCategory.name$$.html" stepKey="amOnCategoryPage"/> @@ -78,7 +78,7 @@ </actionGroup> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml index fb6a48254fa8d..732e347713dca 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -44,12 +44,12 @@ <!-- Create downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -86,12 +86,12 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Find downloadable product in grid --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedConfigurableProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedConfigurableProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProduct"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithOutOfStockStatusTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithOutOfStockStatusTest.xml index 5e3fe6836f7e9..2d3f8f88a8591 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithOutOfStockStatusTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithOutOfStockStatusTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProductOutOfStock"/> </actionGroup> @@ -44,12 +44,12 @@ <!-- Create Downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="DownloadableProductOutOfStock"/> </actionGroup> @@ -73,7 +73,7 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product is out of stock --> <amOnPage url="{{DownloadableProductOutOfStock.urlKey}}.html" stepKey="navigateToProductPage"/> @@ -83,7 +83,7 @@ <!-- Find downloadable product in grid --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedConfigurableProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedConfigurableProduct"> <argument name="product" value="DownloadableProductOutOfStock"/> </actionGroup> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProduct"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithSpecialPriceTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithSpecialPriceTest.xml index fb59d51831bae..5085c547517cd 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithSpecialPriceTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithSpecialPriceTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="ApiDownloadableProduct"/> </actionGroup> @@ -44,7 +44,7 @@ <!-- Create downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> @@ -54,7 +54,7 @@ </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="ApiDownloadableProduct"/> </actionGroup> @@ -78,12 +78,12 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Find downloadable product in grid --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedConfigurableProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedConfigurableProduct"> <argument name="product" value="ApiDownloadableProduct"/> </actionGroup> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProduct"/> @@ -95,7 +95,7 @@ <seeElement selector="{{AdminProductDownloadableSection.addLinkTitleInput('1')}}" stepKey="seeSecondLinkTitle"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="ApiDownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutFillingQuantityAndStockTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutFillingQuantityAndStockTest.xml index af9487e3e6a23..9f9e24b65b5a8 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutFillingQuantityAndStockTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutFillingQuantityAndStockTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -44,12 +44,12 @@ <!-- Create downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -75,12 +75,12 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Find downloadable product in grid --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedConfigurableProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedConfigurableProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProduct"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutTaxClassIdTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutTaxClassIdTest.xml index dd7e3331a0ed2..4c564c26b9cad 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutTaxClassIdTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithoutTaxClassIdTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -44,12 +44,12 @@ <!-- Create downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -76,12 +76,12 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Find downloadable product in grid --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedConfigurableProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedConfigurableProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProduct"/> @@ -93,7 +93,7 @@ <seeInField selector="{{AdminProductDownloadableSection.addLinkTitleInput('1')}}" userInput="{{downloadableLink.title}}" stepKey="seeSecondLinkTitle"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml index 07124ea4846be..0d93bac16569f 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml @@ -36,7 +36,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteDownloadableProductFilteredBySkuAndName"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteDownloadableProductFilteredBySkuAndName"> <argument name="product" value="$$createDownloadableProduct$$"/> </actionGroup> <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableProductSetEditContentTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableProductSetEditContentTest.xml index 72cdf589bec91..44c27c17adcd9 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableProductSetEditContentTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableProductSetEditContentTest.xml @@ -21,16 +21,16 @@ </annotations> <after> <!-- Delete downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> </after> <!-- Create product --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableSetEditRelatedProductsTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableSetEditRelatedProductsTest.xml index f70769cdfe834..a09076b7dc06e 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableSetEditRelatedProductsTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDownloadableSetEditRelatedProductsTest.xml @@ -21,16 +21,16 @@ <before></before> <after> <!-- Delete downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> </after> <!-- Create product --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml index 20c1acaf8d612..4a3f0d4ef9f83 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminProductTypeSwitchingOnEditingTest.xml @@ -23,7 +23,7 @@ <click selector="{{AdminProductDownloadableSection.sectionHeader}}" stepKey="openDownloadableSection" after="waitForSimpleProductPageLoad"/> <uncheckOption selector="{{AdminProductDownloadableSection.isDownloadableProduct}}" stepKey="checkOptionIsDownloadable" after="openDownloadableSection"/> <selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has weight" stepKey="selectWeightForProduct" after="checkOptionIsDownloadable"/> - <actionGroup ref="saveProductForm" stepKey="saveDownloadableProductForm" after="selectWeightForProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveDownloadableProductForm" after="selectWeightForProduct"/> </test> <test name="AdminSimpleProductTypeSwitchingToDownloadableProductTest"> <annotations> @@ -62,11 +62,11 @@ <actionGroup ref="addDownloadableProductLinkWithMaxDownloads" stepKey="addDownloadableProductLink"> <argument name="link" value="downloadableLinkWithMaxDownloads"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveDownloadableProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveDownloadableProductForm"/> <!--Assert downloadable product on Admin product page grid--> <comment userInput="Assert configurable product in Admin product page grid" stepKey="commentAssertDownloadableProductOnAdmin"/> <amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="goToCatalogProductPage"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterProductGridBySku"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterProductGridBySku"> <argument name="sku" value="$$createProduct.sku$$"/> </actionGroup> <see selector="{{AdminProductGridSection.productGridCell('1', 'Name')}}" userInput="$$createProduct.name$$" stepKey="seeDownloadableProductNameInGrid"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultImageDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultImageDownloadableProductTest.xml index 3597c12e82df0..6830ed9feb08f 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultImageDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultImageDownloadableProductTest.xml @@ -30,15 +30,15 @@ <!-- Create product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="adminProductIndexPageAdd"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillMainProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> @@ -56,22 +56,22 @@ </actionGroup> <!--Save product--> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Remove image from product --> - <actionGroup ref="removeProductImage" stepKey="removeProductImage"/> + <actionGroup ref="RemoveProductImageActionGroup" stepKey="removeProductImage"/> - <actionGroup ref="saveProductForm" stepKey="saveProductFormAfterRemove"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductFormAfterRemove"/> <!-- Assert product image not in admin product form --> - <actionGroup ref="assertProductImageNotInAdminProductPage" stepKey="assertProductImageNotInAdminProductPage"/> + <actionGroup ref="AssertProductImageNotInAdminProductPageActionGroup" stepKey="assertProductImageNotInAdminProductPage"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPageAfterRemove"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPageAfterRemove"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <!-- Assert product image not in storefront product page --> - <actionGroup ref="assertProductImageNotInStorefrontProductPage" stepKey="assertProductImageNotInStorefrontProductPage"> + <actionGroup ref="AssertProductImageNotInStorefrontProductPageActionGroup" stepKey="assertProductImageNotInStorefrontProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultVideoDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultVideoDownloadableProductTest.xml index 0d98862d9a5e7..ede4540050ecb 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultVideoDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultVideoDownloadableProductTest.xml @@ -27,10 +27,10 @@ <!-- Create a downloadable product --> <!-- Replacing steps in base AdminRemoveDefaultVideoSimpleProductTest --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillMainProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillMainProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -49,7 +49,7 @@ </actionGroup> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="DownloadableProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/EditDownloadableProductWithSeparateLinksFromCartTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/EditDownloadableProductWithSeparateLinksFromCartTest.xml index 274dd39468a2b..32dc52559b24b 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/EditDownloadableProductWithSeparateLinksFromCartTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/EditDownloadableProductWithSeparateLinksFromCartTest.xml @@ -30,12 +30,12 @@ <!-- Create downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -61,7 +61,7 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> </before> <after> <!-- Remove downloadable domains --> @@ -71,7 +71,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/EndToEndB2CAdminTest.xml index 75a66cec91692..3b9e359aeec34 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -11,7 +11,7 @@ <!--Create Downloadable Product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitProductPageDownloadable" after="seeSimpleProductInGrid"/> <waitForPageLoad stepKey="waitForProductPageLoadDownloadable" after="visitProductPageDownloadable"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateDownloadableProduct" after="waitForProductPageLoadDownloadable"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateDownloadableProduct" after="waitForProductPageLoadDownloadable"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <actionGroup ref="fillMainDownloadableProductForm" stepKey="fillMainProductFormDownloadable" after="goToCreateDownloadableProduct"> @@ -45,14 +45,14 @@ </actionGroup> <!--Save Product--> - <actionGroup ref="saveProductForm" stepKey="saveDownloadableProduct" after="addDownloadableSampleUrl"/> - <actionGroup ref="viewProductInAdminGrid" stepKey="viewDownloadableProductInGrid" after="saveDownloadableProduct"> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveDownloadableProduct" after="addDownloadableSampleUrl"/> + <actionGroup ref="ViewProductInAdminGridActionGroup" stepKey="viewDownloadableProductInGrid" after="saveDownloadableProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> <!--@TODO Move cleanup to "after" when MQE-830 is resolved--> <comment userInput="Clean up downloadable product" stepKey="cleanUpDownloadableProduct" after="deleteSimpleProduct"/> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteDownloadableProduct" after="cleanUpDownloadableProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteDownloadableProduct" after="cleanUpDownloadableProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/ManualSelectAllDownloadableLinksDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/ManualSelectAllDownloadableLinksDownloadableProductTest.xml index a86fd544d24d6..0b7f459f43427 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/ManualSelectAllDownloadableLinksDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/ManualSelectAllDownloadableLinksDownloadableProductTest.xml @@ -30,12 +30,12 @@ <!-- Create downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -61,7 +61,7 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> </before> <after> <!-- Remove downloadable domains --> @@ -71,7 +71,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/SelectAllDownloadableLinksDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/SelectAllDownloadableLinksDownloadableProductTest.xml index f9ca6fea09cf0..ea7074c70d3c3 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/SelectAllDownloadableLinksDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/SelectAllDownloadableLinksDownloadableProductTest.xml @@ -30,12 +30,12 @@ <!-- Create downloadable product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGridPageLoad"/> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createProduct"> <argument name="productType" value="downloadable"/> </actionGroup> <!-- Fill downloadable product values --> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillDownloadableProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillDownloadableProductForm"> <argument name="product" value="DownloadableProduct"/> </actionGroup> @@ -61,7 +61,7 @@ </actionGroup> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> </before> <after> <!-- Remove downloadable domains --> @@ -71,7 +71,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete created downloadable product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="DownloadableProduct"/> </actionGroup> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/VerifyDisableDownloadableProductSamplesAreNotAccessibleTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/VerifyDisableDownloadableProductSamplesAreNotAccessibleTest.xml index ba2e3453a6d99..b0f7edaeaa3a9 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/VerifyDisableDownloadableProductSamplesAreNotAccessibleTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/VerifyDisableDownloadableProductSamplesAreNotAccessibleTest.xml @@ -87,13 +87,13 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Open Downloadable product from precondition --> - <actionGroup ref="goToProductPageViaID" stepKey="openProductEditPage"> + <actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="openProductEditPage"> <argument name="productId" value="$createProduct.id$"/> </actionGroup> <!-- Change status of product to "Disable" and save it --> - <actionGroup ref="AdminSetProductDisabled" stepKey="disableProduct"/> - <actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/> + <actionGroup ref="AdminSetProductDisabledActionGroup" stepKey="disableProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveProduct"/> <!-- Assert product is disable on Storefront --> <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="openCategoryPage"> diff --git a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml index a144a4849db60..7c6ff7176ee8f 100644 --- a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml +++ b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml @@ -34,7 +34,7 @@ <magentoCLI command="config:set {{SetMinQueryLength3Config.path}} {{SetMinQueryLength3Config.value}}" stepKey="setMinQueryLengthPreviousState"/> <!--Delete created data--> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <actionGroup ref="deleteProductAttributeByAttributeCode" stepKey="deleteProductAttribute"> + <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttributeCode" value="{{textProductAttribute.attribute_code}}"/> </actionGroup> <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> @@ -42,35 +42,35 @@ <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid"/> <amOnPage url="{{ProductCatalogPage.url}}" stepKey="goToProductCatalog"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteProduct"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetFiltersIfExist"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteProduct"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetFiltersIfExist"/> <magentoCLI command="indexer:reindex catalogsearch_fulltext" stepKey="reindex"/> <magentoCLI command="cache:flush config" stepKey="flushCache"/> <actionGroup ref="logout" stepKey="logout"/> </after> <!--Create new searchable product attribute--> <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/> - <actionGroup ref="AdminCreateSearchableProductAttribute" stepKey="createAttribute"> + <actionGroup ref="AdminCreateSearchableProductAttributeActionGroup" stepKey="createAttribute"> <argument name="attribute" value="textProductAttribute"/> </actionGroup> <!--Assign attribute to the Default set--> <actionGroup ref="AdminOpenAttributeSetGridPageActionGroup" stepKey="openAttributeSetPage"/> <actionGroup ref="AdminOpenAttributeSetByNameActionGroup" stepKey="openDefaultAttributeSet"/> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="{{textProductAttribute.attribute_code}}"/> </actionGroup> - <actionGroup ref="SaveAttributeSet" stepKey="saveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/> <!--Create product and fill new attribute field--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillProductForm"> <argument name="product" value="ProductWithSpecialSymbols"/> </actionGroup> - <actionGroup ref="SetCategoryByName" stepKey="addCategoryToProduct"> + <actionGroup ref="SetCategoryByNameActionGroup" stepKey="addCategoryToProduct"> <argument name="categoryName" value="$$createCategory.name$$"/> </actionGroup> <fillField selector="{{AdminProductFormSection.attributeRequiredInput(textProductAttribute.attribute_code)}}" userInput="searchable" stepKey="fillTheAttributeRequiredInputField"/> diff --git a/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml b/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml index 91a76383babd4..c18364df3ca67 100644 --- a/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml +++ b/app/code/Magento/Fedex/Test/Mftf/Test/AdminCreatingShippingLabelTest.xml @@ -83,7 +83,7 @@ <actionGroup ref="AdminFillProductCountryOfManufactureActionGroup" stepKey="fillCountryOfManufacture"> <argument name="countryId" value="DE"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> <!--Place for order using FedEx shipping method--> <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="amOnStorefrontProductPage"/> <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/StorefrontAddGroupedProductWithTwoLinksToCartActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/StorefrontAddGroupedProductWithTwoLinksToCartActionGroup.xml index c1ba827f6ca8a..0a44aa6943862 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/StorefrontAddGroupedProductWithTwoLinksToCartActionGroup.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/StorefrontAddGroupedProductWithTwoLinksToCartActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="StorefrontAddGroupedProductWithTwoLinksToCartActionGroup" extends="AddSimpleProductToCart"> + <actionGroup name="StorefrontAddGroupedProductWithTwoLinksToCartActionGroup" extends="AddSimpleProductToCartActionGroup"> <annotations> <description>Adding to the Shopping Cart single Grouped product, with 2 associated from the Product page</description> </annotations> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml index f2cb2cc993a50..583406e898c39 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultImageGroupedProductTest.xml @@ -29,7 +29,7 @@ </createData> </before> <after> - <actionGroup ref="deleteProductBySku" stepKey="deleteGroupedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteGroupedProduct"> <argument name="sku" value="{{GroupedProduct.sku}}"/> </actionGroup> <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> @@ -41,8 +41,8 @@ <!-- Create product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> <actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm"> @@ -54,7 +54,7 @@ <click selector="body" stepKey="clickBodyToCorrectFocusGrouped"/> <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/> <waitForElementVisible selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="waitForGroupedProductModal"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterGroupedProducts"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterGroupedProducts"> <argument name="sku" value="api-simple-product"/> </actionGroup> <checkOption selector="{{AdminAddProductsToGroupPanel.nThCheckbox('0')}}" stepKey="checkFilterResult1"/> @@ -63,21 +63,21 @@ <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="clickAddSelectedGroupProducts"/> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert product image in admin product form --> - <actionGroup ref="assertProductImageAdminProductPage" stepKey="assertProductImageAdminProductPage"/> + <actionGroup ref="AssertProductImageAdminProductPageActionGroup" stepKey="assertProductImageAdminProductPage"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="GroupedProduct"/> </actionGroup> <!-- Assert product image in storefront product page --> - <actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertProductImageStorefrontProductPage"> + <actionGroup ref="AssertProductImageStorefrontProductPageActionGroup" stepKey="assertProductImageStorefrontProductPage"> <argument name="product" value="GroupedProduct"/> <argument name="image" value="MagentoLogo"/> </actionGroup> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultVideoGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultVideoGroupedProductTest.xml index c3a95bbef3aa3..b4d8b4c1825ad 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultVideoGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultVideoGroupedProductTest.xml @@ -29,7 +29,7 @@ <!-- Create a grouped product --> <!-- Replacing steps in base AdminAddDefaultVideoSimpleProductTest --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="GroupedProduct"/> </actionGroup> <actionGroup ref="fillGroupedProductForm" stepKey="fillMainProductForm"> @@ -41,18 +41,18 @@ <conditionalClick selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" dependentSelector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" visible="false" stepKey="openGroupedProductSection" after="scrollToSection"/> <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup" after="openGroupedProductSection"/> <waitForElementVisible selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="waitForFilter" after="clickAddProductsToGroup"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku1" after="waitForFilter"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku1" after="waitForFilter"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="checkOption1" after="filterProductGridBySku1"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku2" after="checkOption1"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku2" after="checkOption1"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="checkOption2" after="filterProductGridBySku2"/> <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="addSelectedProducts" before="saveProductForm"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="GroupedProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml index 3827666252478..41096c416d05e 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAssociateGroupedProductToWebsitesTest.xml @@ -69,14 +69,14 @@ <argument name="websiteName" value="{{secondCustomWebsite.name}}"/> </actionGroup> - <actionGroup ref="NavigateToAndResetProductGridToDefaultView" stepKey="resetProductGridFilter"/> + <actionGroup ref="NavigateToAndResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridFilter"/> <!-- Admin logout --> <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Open product page and assign grouped project to second website --> - <actionGroup ref="filterAndSelectProduct" stepKey="openAdminProductPage"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openAdminProductPage"> <argument name="productSku" value="$$createGroupedProduct.sku$$"/> </actionGroup> <actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="assignProductToSecondWebsite"> @@ -85,15 +85,15 @@ <actionGroup ref="AdminUnassignProductInWebsiteActionGroup" stepKey="unassignProductFromDefaultWebsite"> <argument name="website" value="{{_defaultWebsite.name}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveGroupedProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveGroupedProduct"/> <!-- Assert product is assigned to Second website --> - <actionGroup ref="AssertProductIsAssignedToWebsite" stepKey="seeCustomWebsiteIsChecked"> + <actionGroup ref="AssertProductIsAssignedToWebsiteActionGroup" stepKey="seeCustomWebsiteIsChecked"> <argument name="website" value="{{secondCustomWebsite.name}}"/> </actionGroup> <!-- Assert product is not assigned to Main website --> - <actionGroup ref="AssertProductIsNotAssignedToWebsite" stepKey="seeMainWebsiteIsNotChecked"> + <actionGroup ref="AssertProductIsNotAssignedToWebsiteActionGroup" stepKey="seeMainWebsiteIsNotChecked"> <argument name="website" value="{{_defaultWebsite.name}}"/> </actionGroup> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml index 62a685554f735..88f90e54784e8 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminCreateAndEditGroupedProductSettingsTest.xml @@ -30,7 +30,7 @@ </before> <after> <!-- Delete grouped product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> @@ -47,7 +47,7 @@ </after> <!-- Create new grouped product --> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="createGroupedProduct"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="createGroupedProduct"> <argument name="productType" value="grouped"/> </actionGroup> @@ -70,7 +70,7 @@ <actionGroup ref="AdminSetProductDesignSettingsActionGroup" stepKey="setProductDesignSettings"/> <!-- Save grouped product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveButton"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveButton"/> <!-- Open created simple product --> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct"> @@ -86,7 +86,7 @@ </actionGroup> <!-- Save simple product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveBtn"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveBtn"/> <!-- Open grouped product page --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage"> @@ -100,7 +100,7 @@ <fillField selector="{{StorefrontProductPageSection.qtyInput}}" userInput="{{ApiSimpleSingleQty.quantity}}" stepKey="fillFieldQtyInput"/> <!-- Assert Gift Option product settings is present --> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProductPage6"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage6"> <argument name="productName" value="GroupedProduct.name"/> </actionGroup> <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openShoppingCart"/> @@ -120,7 +120,7 @@ </actionGroup> <!-- Assert product is assigned to websites --> - <actionGroup ref="AssertProductIsAssignedToWebsite" stepKey="seeCustomWebsiteIsChecked"> + <actionGroup ref="AssertProductIsAssignedToWebsiteActionGroup" stepKey="seeCustomWebsiteIsChecked"> <argument name="website" value="$createWebsite.website[name]$"/> </actionGroup> @@ -135,7 +135,7 @@ </actionGroup> <!-- Save grouped product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveProduct"/> <!-- Open created simple product --> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForProduct"> @@ -149,7 +149,7 @@ <actionGroup ref="AdminSwitchProductGiftMessageStatusActionGroup" stepKey="disableGiftMessageSettings"/> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="clickSaveSimpleProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveSimpleProduct"/> <!-- Verify Url Key after changing --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminDeleteGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminDeleteGroupedProductTest.xml index 6768dd5a1a249..f7b9357f1b34a 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminDeleteGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminDeleteGroupedProductTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteGroupedProductFilteredBySkuAndName"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteGroupedProductFilteredBySkuAndName"> <argument name="product" value="$$createGroupedProduct$$"/> </actionGroup> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductSetEditContentTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductSetEditContentTest.xml index 3938d91c515f1..d9f9d8ecd9382 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductSetEditContentTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductSetEditContentTest.xml @@ -21,16 +21,16 @@ </annotations> <after> <!-- Delete grouped product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> </after> <!-- Create product --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="GroupedProduct"/> </actionGroup> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductsListTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductsListTest.xml index b59cf1e2175d8..431ca4449cbdb 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductsListTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedProductsListTest.xml @@ -39,7 +39,7 @@ <!-- Create product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="adminProductIndexPageAdd"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="GroupedProduct"/> </actionGroup> <actionGroup ref="fillGroupedProductForm" stepKey="fillMainProductForm"> @@ -50,11 +50,11 @@ <conditionalClick selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" dependentSelector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" visible="false" stepKey="openGroupedProductSection"/> <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/> <waitForElementVisible selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="waitForFilter"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku1"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku1"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="checkOption1"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="checkOption2"/> @@ -62,7 +62,7 @@ <waitForPageLoad stepKey="waitForPageLoad1"/> <!-- Save product --> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <waitForPageLoad stepKey="waitForPageLoad2"/> <scrollTo selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" x="0" y="-100" stepKey="scrollToProducts"/> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml index 8117d627a370c..9cdd24b41355a 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminGroupedSetEditRelatedProductsTest.xml @@ -21,13 +21,13 @@ <before></before> <after> <!-- Delete grouped product --> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> </after> <!-- Create product --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> <actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm"> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultImageGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultImageGroupedProductTest.xml index da7cfaeb71566..975498863d6da 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultImageGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultImageGroupedProductTest.xml @@ -38,8 +38,8 @@ <!-- Create product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> <actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm"> @@ -51,7 +51,7 @@ <click selector="body" stepKey="clickBodyToCorrectFocusGrouped"/> <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/> <waitForElementVisible selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="waitForGroupedProductModal"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterGroupedProducts"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterGroupedProducts"> <argument name="sku" value="api-simple-product"/> </actionGroup> <checkOption selector="{{AdminAddProductsToGroupPanel.nThCheckbox('0')}}" stepKey="checkFilterResult1"/> @@ -60,26 +60,26 @@ <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="clickAddSelectedGroupProducts"/> <!-- Add image to product --> - <actionGroup ref="addProductImage" stepKey="addImageForProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Remove image from product --> - <actionGroup ref="removeProductImage" stepKey="removeProductImage"/> + <actionGroup ref="RemoveProductImageActionGroup" stepKey="removeProductImage"/> - <actionGroup ref="saveProductForm" stepKey="saveProductFormAfterRemove"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductFormAfterRemove"/> <!-- Assert product image not in admin product form --> - <actionGroup ref="assertProductImageNotInAdminProductPage" stepKey="assertProductImageNotInAdminProductPage"/> + <actionGroup ref="AssertProductImageNotInAdminProductPageActionGroup" stepKey="assertProductImageNotInAdminProductPage"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPageAfterRemove"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPageAfterRemove"> <argument name="product" value="GroupedProduct"/> </actionGroup> <!-- Assert product image not in storefront product page --> - <actionGroup ref="assertProductImageNotInStorefrontProductPage" stepKey="assertProductImageNotInStorefrontProductPage"> + <actionGroup ref="AssertProductImageNotInStorefrontProductPageActionGroup" stepKey="assertProductImageNotInStorefrontProductPage"> <argument name="product" value="GroupedProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultVideoGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultVideoGroupedProductTest.xml index e322d4a1eb038..c24be0d9fdfb6 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultVideoGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultVideoGroupedProductTest.xml @@ -29,7 +29,7 @@ <!-- Create a grouped product --> <!-- Replacing steps in base AdminRemoveDefaultVideoSimpleProductTest --> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="GroupedProduct"/> </actionGroup> <actionGroup ref="fillGroupedProductForm" stepKey="fillMainProductForm"> @@ -41,18 +41,18 @@ <conditionalClick selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" dependentSelector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" visible="false" stepKey="openGroupedProductSection" after="scrollToSection"/> <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup" after="openGroupedProductSection"/> <waitForElementVisible selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="waitForFilter" after="clickAddProductsToGroup"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku1" after="waitForFilter"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku1" after="waitForFilter"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="checkOption1" after="filterProductGridBySku1"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku2" after="checkOption1"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku2" after="checkOption1"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> <checkOption selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="checkOption2" after="filterProductGridBySku2"/> <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="addSelectedProducts" before="saveProductForm"/> <!-- Assert product in storefront product page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="GroupedProduct"/> </actionGroup> </test> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminSortingAssociatedProductsTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminSortingAssociatedProductsTest.xml index ad5fbbb30edeb..f42c0bed70a17 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminSortingAssociatedProductsTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminSortingAssociatedProductsTest.xml @@ -94,7 +94,7 @@ </before> <after> <!--Delete created grouped product--> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" @@ -129,8 +129,8 @@ <!--Create grouped Product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> <actionGroup ref="fillGroupedProductForm" stepKey="fillProductForm"> @@ -142,7 +142,7 @@ <click selector="body" stepKey="clickBodyToCorrectFocusGrouped"/> <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/> <waitForElementVisible selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="waitForGroupedProductModal"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterGroupedProducts"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterGroupedProducts"> <argument name="sku" value="api-simple-product"/> </actionGroup> @@ -153,13 +153,13 @@ <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="clickAddSelectedGroupProducts"/> <waitForPageLoad stepKey="waitForProductsAdded"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Open created Product group--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetFiltersIfExist"/> - <actionGroup ref="searchProductGridByKeyword" stepKey="searchProductGridForm"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetFiltersIfExist"/> + <actionGroup ref="SearchProductGridByKeywordActionGroup" stepKey="searchProductGridForm"> <argument name="keyword" value="GroupedProduct.name"/> </actionGroup> <click selector="{{AdminProductGridSection.selectRowBasedOnName(GroupedProduct.name)}}" stepKey="openGroupedProduct"/> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml index dbe3dddfca81b..f5f7abc7075ab 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -11,7 +11,7 @@ <!--Create Grouped Product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageGrouped" after="seeSimpleProductInGrid"/> <waitForPageLoad stepKey="waitForProductPageLoadGrouped" after="visitAdminProductPageGrouped"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateGroupedProduct" after="waitForProductPageLoadGrouped"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateGroupedProduct" after="waitForProductPageLoadGrouped"> <argument name="product" value="GroupedProduct"/> </actionGroup> <actionGroup ref="checkRequiredFieldsInGroupedProductForm" stepKey="checkRequiredFieldsProductGrouped" after="goToCreateGroupedProduct"/> @@ -23,20 +23,20 @@ <click selector="body" stepKey="clickBodyToCorrectFocusGrouped" after="openGroupedProductsSection"/> <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup" after="clickBodyToCorrectFocusGrouped"/> <waitForElementVisible selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="waitForGroupedProductModal" after="clickAddProductsToGroup"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterGroupedProductOptions" after="waitForGroupedProductModal"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterGroupedProductOptions" after="waitForGroupedProductModal"> <argument name="product" value="SimpleProduct"/> </actionGroup> <checkOption selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="checkFilterResult" after="filterGroupedProductOptions"/> <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="clickAddSelectedGroupProducts" after="checkFilterResult"/> - <actionGroup ref="saveProductForm" stepKey="saveGroupedProduct" after="clickAddSelectedGroupProducts"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveGroupedProduct" after="clickAddSelectedGroupProducts"/> <actionGroup ref="viewGroupedProductInAdminGrid" stepKey="viewGroupedProductInGrid" after="saveGroupedProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> <!--@TODO Move cleanup to "after" when MQE-830 is resolved--> <comment userInput="Clean up grouped product" stepKey="cleanUpGroupedProduct" after="deleteSimpleProduct"/> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteGroupedProduct" after="cleanUpGroupedProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteGroupedProduct" after="cleanUpGroupedProduct"> <argument name="product" value="GroupedProduct"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/NewProductsListWidgetGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/NewProductsListWidgetGroupedProductTest.xml index a56512f84a9b8..d563796b21da9 100644 --- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/NewProductsListWidgetGroupedProductTest.xml +++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/NewProductsListWidgetGroupedProductTest.xml @@ -52,7 +52,7 @@ <scrollTo selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="scrollToAddProductsToGroup"/> <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/> <waitForElementVisible selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="waitForGroupedProductModal"/> - <actionGroup ref="filterProductGridBySku2" stepKey="filterGroupedProducts"> + <actionGroup ref="FilterProductGridBySku2ActionGroup" stepKey="filterGroupedProducts"> <argument name="sku" value="api-simple-product"/> </actionGroup> <checkOption selector="{{AdminAddProductsToGroupPanel.nThCheckbox('0')}}" stepKey="checkFilterResult1"/> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckDoubleImportOfProductsTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckDoubleImportOfProductsTest.xml index 909c6101fe53e..23ef749217ac6 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckDoubleImportOfProductsTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckDoubleImportOfProductsTest.xml @@ -37,7 +37,7 @@ <actionGroup ref="adminDataGridSelectPerPage" stepKey="selectNumberOfProductsPerPage"> <argument name="perPage" value="100"/> </actionGroup> - <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteAllProducts"/> <!-- Delete additional store views --> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteFirstStoreView"> @@ -48,7 +48,7 @@ </actionGroup> <!-- Delete category --> - <actionGroup ref="DeleteCategory" stepKey="deleteCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCategory"> <argument name="categoryEntity" value="Gear"/> </actionGroup> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckThatSomeAttributesChangedValueToEmptyAfterImportTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckThatSomeAttributesChangedValueToEmptyAfterImportTest.xml index 42516e5a5a363..6a2f6ca60acf4 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckThatSomeAttributesChangedValueToEmptyAfterImportTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminCheckThatSomeAttributesChangedValueToEmptyAfterImportTest.xml @@ -22,8 +22,8 @@ <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndexPage"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridToDefaultView"/> - <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridToDefaultView"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteAllProducts"/> <createData entity="productDropDownAttribute" stepKey="productAttribute"/> <createData entity="productAttributeOption2" stepKey="attributeOptionWithDefaultValue"> <requiredEntity createDataKey="productAttribute"/> @@ -44,22 +44,22 @@ <actionGroup ref="logout" stepKey="logoutFromAdmin"/> </after> <!--Create product--> - <actionGroup ref="GoToSpecifiedCreateProductPage" stepKey="openProductFillForm"/> - <actionGroup ref="fillMainProductForm" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="GoToSpecifiedCreateProductPageActionGroup" stepKey="openProductFillForm"/> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="product" value="simpleProductWithShortNameAndSku"/> </actionGroup> - <actionGroup ref="SetCategoryByName" stepKey="addCategoryToProduct"> + <actionGroup ref="SetCategoryByNameActionGroup" stepKey="addCategoryToProduct"> <argument name="categoryName" value="$$createCategory.name$$"/> </actionGroup> <!--Select created attribute--> - <actionGroup ref="addProductAttributeInProductModal" stepKey="addAttributeToProduct"> + <actionGroup ref="AddProductAttributeInProductModalActionGroup" stepKey="addAttributeToProduct"> <argument name="attributeCode" value="$$productAttribute.attribute_code$$"/> </actionGroup> <!--Check that attribute value is selected--> <scrollTo selector="{{AdminProductFormSection.attributeTab}}" stepKey="scrollToAttributeTitle1"/> <conditionalClick selector="{{AdminProductFormSection.attributeTab}}" dependentSelector="{{AdminProductAttributeSection.dropDownAttribute($$productAttribute.attribute_code$$)}}" visible="false" stepKey="expandAttributeTab1"/> <seeOptionIsSelected selector="{{AdminProductAttributeSection.dropDownAttribute($$productAttribute.attribute_code$$)}}" userInput="option2" stepKey="seeAttributeValueIsSelected1"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Import product with add/update behavior--> <actionGroup ref="AdminImportProductsActionGroup" stepKey="adminImportProductsFirstTime"> <argument name="behavior" value="Add/Update"/> @@ -67,7 +67,7 @@ <argument name="importNoticeMessage" value="Created: 0, Updated: 1, Deleted: 0"/> </actionGroup> <!--Check that attribute value is empty after import--> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct2"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheProduct2"> <argument name="productSku" value="{{simpleProductWithShortNameAndSku.sku}}"/> </actionGroup> <scrollTo selector="{{AdminProductFormSection.attributeTab}}" stepKey="scrollToAttributeTitle2"/> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportProductsWithErrorEntriesTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportProductsWithErrorEntriesTest.xml index 94840a4ea6142..e3065f005218b 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportProductsWithErrorEntriesTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportProductsWithErrorEntriesTest.xml @@ -25,7 +25,7 @@ <!--Clear products grid filters--> <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductsGridFilters"/> <!--Delete all imported products--> - <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteAllProducts"/> <!--Logout from Admin page--> <actionGroup ref="logout" stepKey="logoutFromAdminPage"/> </after> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductVisibilityDifferentStoreViewsAfterImportTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductVisibilityDifferentStoreViewsAfterImportTest.xml index 0a1423ece71e0..738acc873b9c8 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductVisibilityDifferentStoreViewsAfterImportTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminProductVisibilityDifferentStoreViewsAfterImportTest.xml @@ -38,7 +38,7 @@ <actionGroup ref="adminDataGridSelectPerPage" stepKey="selectNumberOfProductsPerPage"> <argument name="perPage" value="100"/> </actionGroup> - <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteAllProducts"/> <!--Delete store views--> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteEnglishStoreView"> <argument name="customStore" value="customStoreEN"/> @@ -55,17 +55,17 @@ <argument name="importNoticeMessage" value="Created: 2, Updated: 0, Deleted: 0"/> </actionGroup> <!--Open imported name4 product--> - <actionGroup ref="filterAndSelectProduct" stepKey="openName4Product"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="openName4Product"> <argument name="productSku" value="name4"/> </actionGroup> <!--Switch Chinese store view and assert visibility field--> <comment userInput="Switch Chinese store view and assert visibility field" stepKey="commentAssertVisibilityChineseView"/> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="switchToCustomStoreView"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="switchToCustomStoreView"> <argument name="storeViewName" value="{{storeViewChinese.name}}"/> </actionGroup> <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="Catalog" stepKey="seeVisibilityFieldForChineseStore"/> <!--Switch English store view and assert visibility field--> - <actionGroup ref="SwitchToTheNewStoreView" stepKey="switchToCustomEnglishView"> + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="switchToCustomEnglishView"> <argument name="storeViewName" value="{{customStoreEN.name}}"/> </actionGroup> <seeInField selector="{{AdminProductFormSection.visibility}}" userInput="Catalog" stepKey="seeVisibilityFieldForEnglishView"/> diff --git a/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobile.xml b/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobile.xml index 6d182d0b7a5e2..d2b462d0467a2 100644 --- a/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobile.xml +++ b/app/code/Magento/LayeredNavigation/Test/Mftf/Test/ShopByButtonInMobile.xml @@ -47,7 +47,7 @@ <comment userInput="Go to simple product edit page and set the product attribute to a value" stepKey="commentProductAttributeEdit" /> <amOnPage url="{{AdminProductEditPage.url($$simpleProduct1.id$$)}}" stepKey="goToEditPage"/> <selectOption selector="{{AdminProductFormSection.customSelectField($$attribute.attribute[attribute_code]$$)}}" userInput="option1" stepKey="selectAttribute"/> - <actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> <!-- Check storefront mobile view for shop by button is functioning as expected --> <comment userInput="Check storefront mobile view for shop by button is functioning as expected" stepKey="commentCheckShopByButton" /> <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToHomePage"/> diff --git a/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontProductWithMapAssignedConfigProductIsCorrectTest.xml b/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontProductWithMapAssignedConfigProductIsCorrectTest.xml index d1eb1339fe856..ccb724e8bf199 100644 --- a/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontProductWithMapAssignedConfigProductIsCorrectTest.xml +++ b/app/code/Magento/Msrp/Test/Mftf/Test/StorefrontProductWithMapAssignedConfigProductIsCorrectTest.xml @@ -114,7 +114,7 @@ <waitForElement selector="{{AdminProductFormAdvancedPricingSection.msrp}}" stepKey="waitForMsrp"/> <fillField selector="{{AdminProductFormAdvancedPricingSection.msrp}}" userInput="55" stepKey="setMsrpForFirstChildProduct"/> <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct1"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1"/> <amOnPage url="{{AdminProductEditPage.url($$createConfigChildProduct2.id$$)}}" stepKey="goToSecondChildProductEditPage"/> <waitForPageLoad stepKey="waitForProductPageLoad1"/> @@ -122,7 +122,7 @@ <waitForElement selector="{{AdminProductFormAdvancedPricingSection.msrp}}" stepKey="waitForMsrp1"/> <fillField selector="{{AdminProductFormAdvancedPricingSection.msrp}}" userInput="66" stepKey="setMsrpForSecondChildProduct"/> <click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton1"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Clear cache--> <magentoCLI command="cache:flush" stepKey="flushCache"/> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml index 3a58ead3b6dfa..cfec857329b3d 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithMultishipmentTest.xml @@ -38,11 +38,11 @@ </before> <amOnPage url="$$product1.name$$.html" stepKey="goToProduct1"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProduct1"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct1"> <argument name="productName" value="$$product1.name$$"/> </actionGroup> <amOnPage url="$$product2.name$$.html" stepKey="goToProduct2"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProduct2"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct2"> <argument name="productName" value="$$product2.name$$"/> </actionGroup> <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml index c9f1856249762..dcf0770e5421e 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontCheckingWithSingleShipmentTest.xml @@ -38,11 +38,11 @@ </before> <amOnPage url="$$product1.name$$.html" stepKey="goToProduct1"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProduct1"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct1"> <argument name="productName" value="$$product1.name$$"/> </actionGroup> <amOnPage url="$$product2.name$$.html" stepKey="goToProduct2"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProduct2"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct2"> <argument name="productName" value="$$product2.name$$"/> </actionGroup> <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml index c2fd978cf3137..e826d8e03ffbc 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMinicartWithMultishipmentTest.xml @@ -48,11 +48,11 @@ </after> <amOnPage url="$$product1.name$$.html" stepKey="goToProduct1"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProduct1"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct1"> <argument name="productName" value="$$product1.name$$"/> </actionGroup> <amOnPage url="$$product2.name$$.html" stepKey="goToProduct2"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartFromStorefrontProduct2"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProduct2"> <argument name="productName" value="$$product2.name$$"/> </actionGroup> <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMyAccountWithMultishipmentTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMyAccountWithMultishipmentTest.xml index eec8a40877bb3..52da343419a22 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMyAccountWithMultishipmentTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StoreFrontMyAccountWithMultishipmentTest.xml @@ -52,11 +52,11 @@ <actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearAllFilters"/> <actionGroup ref="logout" stepKey="logoutAdmin"/> </after> - <actionGroup ref="AddSimpleProductToCart" stepKey="addSimpleProduct1ToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProduct1ToCart"> <argument name="product" value="$$product1$$"/> </actionGroup> <waitForPageLoad stepKey="waitForSecondProductPageLoad"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="addSimpleProduct2ToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProduct2ToCart"> <argument name="product" value="$$product2$$"/> </actionGroup> <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCart"/> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutWithMultipleAddressesTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutWithMultipleAddressesTest.xml index 138ab5df26ab0..dc786f9cbc5db 100644 --- a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutWithMultipleAddressesTest.xml +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutWithMultipleAddressesTest.xml @@ -51,7 +51,7 @@ <argument name="productUrl" value="$$firstProduct.custom_attributes[url_key]$$"/> </actionGroup> <!-- Add the first product to the Shopping Cart --> - <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPage" stepKey="addFirstProductToCart"> + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addFirstProductToCart"> <argument name="productName" value="$$firstProduct.name$$"/> <argument name="productQty" value="1"/> </actionGroup> @@ -60,7 +60,7 @@ <argument name="productUrl" value="$$secondProduct.custom_attributes[url_key]$$"/> </actionGroup> <!-- Add the second product to the Shopping Cart --> - <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPage" stepKey="addSecondProductToCart"> + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addSecondProductToCart"> <argument name="productName" value="$$secondProduct.name$$"/> <argument name="productQty" value="1"/> </actionGroup> @@ -89,7 +89,7 @@ <argument name="productUrl" value="$$firstProduct.custom_attributes[url_key]$$"/> </actionGroup> <!-- Add three identical products to the Shopping Cart --> - <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPage" stepKey="addIdenticalProductsToCart"> + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPageActionGroup" stepKey="addIdenticalProductsToCart"> <argument name="productName" value="$$firstProduct.name$$"/> <argument name="productQty" value="3"/> </actionGroup> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/CheckShoppingCartBehaviorAfterSessionExpiredTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/CheckShoppingCartBehaviorAfterSessionExpiredTest.xml index c66a2979aa7f5..ff5713f445097 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/CheckShoppingCartBehaviorAfterSessionExpiredTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/CheckShoppingCartBehaviorAfterSessionExpiredTest.xml @@ -43,7 +43,7 @@ <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> </after> <!-- Add simple product to cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart1"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart1"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/GuestCheckoutWithEnabledPersistentTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/GuestCheckoutWithEnabledPersistentTest.xml index a383fd4505bd6..43390598f7cb3 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/GuestCheckoutWithEnabledPersistentTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/GuestCheckoutWithEnabledPersistentTest.xml @@ -31,7 +31,7 @@ <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> </after> <!-- Add simple product to cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart1"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart1"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <!-- Navigate to checkout --> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml index d508ebaa26885..2000617e79707 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml @@ -45,7 +45,7 @@ </actionGroup> <!--Step 2: Open the Product Page and add the product to shopping cart--> <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToProductPageAsLoggedUser"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToCartAsLoggedUser"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCartAsLoggedUser"> <argument name="productName" value="$$createProduct.name$$"/> </actionGroup> <!--Step 3: Log out, reset persistent cookie and go to homepage--> @@ -56,7 +56,7 @@ <waitForPageLoad stepKey="waitHomePageLoadAfterResetCookie"/> <!--Step 4: Add the product to shopping cart and open cart--> <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToProductPageAsGuestUser"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToCartAsGuestUser"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCartAsGuestUser"> <argument name="productName" value="$$createProduct.name$$"/> </actionGroup> <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartBeforeChangeShippingAndTaxSection"/> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml index e50fc4af83107..492e0a6f6b101 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyShoppingCartPersistenceUnderLongTermCookieTest.xml @@ -64,7 +64,7 @@ </actionGroup> <!-- 3. Put Simple Product 1 into Shopping Cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addSimple1ProductToCartForJohnSmithCustomer"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimple1ProductToCartForJohnSmithCustomer"> <argument name="product" value="$$createSimple1$$"/> </actionGroup> <actionGroup ref="assertOneProductNameInMiniCart" stepKey="checkSimple1InMiniCartForJohnSmithCustomer"> @@ -92,7 +92,7 @@ <argument name="customerFullName" value="{{Simple_Customer_Without_Address.fullname}}"/> </actionGroup> <!-- 6. Add Simple Product 1 to Shopping Cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addSimple1ProductToCartForJohnDoeCustomer"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimple1ProductToCartForJohnDoeCustomer"> <argument name="product" value="$$createSimple1$$"/> </actionGroup> <see selector="{{StorefrontMinicartSection.productCount}}" userInput="1" stepKey="miniCartContainsOneProductForJohnDoeCustomer"/> @@ -119,7 +119,7 @@ <see selector="{{CheckoutCartProductSection.productName}}" userInput="$$createSimple1.name$$" stepKey="checkSimple1InShoppingCart"/> <!-- 9. Add Simple Product 2 to Shopping Cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addSimple2ProductToCartForGuest"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimple2ProductToCartForGuest"> <argument name="product" value="$$createSimple2$$"/> </actionGroup> <actionGroup ref="assertOneProductNameInMiniCart" stepKey="checkSimple1InMiniCartForGuestCustomerSecondTime"> diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml index dc6f87bef0ba8..fd1396ce28d70 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/StorefrontVerifyThatInformationAboutViewingComparisonWishlistIsPersistedUnderLongTermCookieTest.xml @@ -70,10 +70,10 @@ <see userInput="Welcome, $$createCustomer.firstname$$ $$createCustomer.lastname$$!" selector="{{StorefrontPanelHeaderSection.WelcomeMessage}}" stepKey="checkWelcomeMessage"/> <!--Open the details page of Simple Product 1, Simple Product 2 and add to cart, get to the category--> - <actionGroup ref="AddSimpleProductToCart" stepKey="addSimpleProductProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductProductToCart"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> - <actionGroup ref="AddSimpleProductToCart" stepKey="addSecondSimpleProductProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSecondSimpleProductProductToCart"> <argument name="product" value="$$createSecondSimpleProduct$$"/> </actionGroup> <amOnPage url="{{StorefrontCategoryPage.url($$createCategory.custom_attributes[url_key]$$)}}" stepKey="openCategoryPageAfterAddedProductToCart"/> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminValidateUrlOnGetVideoInformationTest.xml b/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminValidateUrlOnGetVideoInformationTest.xml index 0db15276e8c67..03fb71ac039a7 100644 --- a/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminValidateUrlOnGetVideoInformationTest.xml +++ b/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminValidateUrlOnGetVideoInformationTest.xml @@ -25,7 +25,7 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndexPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="SimpleProduct"/> </actionGroup> <actionGroup ref="AdminOpenProductVideoModalActionGroup" stepKey="openAddProductVideoModal"/> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml b/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml index 7249a4223503e..57e63945865fa 100644 --- a/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml +++ b/app/code/Magento/ProductVideo/Test/Mftf/Test/YoutubeVideoWindowOnProductPageTest.xml @@ -35,11 +35,11 @@ <!--Open simple product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/> <waitForPageLoad stepKey="wait1"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku"> <argument name="product" value="$$createProduct$$"/> </actionGroup> - <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openFirstProductForEdit"/> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openFirstProductForEdit"/> <!-- Add product video --> <actionGroup ref="addProductVideo" stepKey="addProductVideo" after="openFirstProductForEdit"/> diff --git a/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml b/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml index f7a4fda4f67d8..6e31214b0dddf 100644 --- a/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml +++ b/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml @@ -86,11 +86,11 @@ <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/> <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductListing"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetGridToDefaultKeywordSearch"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> </after> <!-- Step 1: Add simple product to shopping cart --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.name$$)}}" stepKey="amOnSimpleProductPage"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="cartAddSimpleProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="cartAddSimpleProductToCart"> <argument name="product" value="$$createSimpleProduct$$"/> <argument name="productCount" value="1"/> </actionGroup> @@ -103,7 +103,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Find the first simple product that we just created using the product grid and go to its page--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct"> <argument name="product" value="$$createConfigChildProduct1$$"/> </actionGroup> <waitForPageLoad stepKey="waitForFiltersToBeApplied"/> @@ -111,7 +111,7 @@ <waitForPageLoad stepKey="waitForProductPageLoad"/> <!-- Disabled child configurable product --> <click selector="{{AdminProductFormSection.enableProductAttributeLabel}}" stepKey="clickDisableProduct"/> - <actionGroup ref="saveProductForm" stepKey="clickSaveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveProduct"/> <!-- Disabled simple product from grid --> <actionGroup ref="ChangeStatusProductUsingProductGridActionGroup" stepKey="disabledProductFromGrid"> <argument name="product" value="$$createSimpleProduct$$"/> @@ -126,7 +126,7 @@ <dontSeeElement selector="{{StorefrontMiniCartSection.quantity}}" stepKey="dontSeeCartItem"/> <!-- Add simple product to shopping cart --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct2.name$$)}}" stepKey="amOnSimpleProductPage2"/> - <actionGroup ref="AddSimpleProductToCart" stepKey="cartAddSimpleProductToCart2"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="cartAddSimpleProductToCart2"> <argument name="product" value="$$createSimpleProduct2$$"/> <argument name="productCount" value="1"/> </actionGroup> @@ -135,7 +135,7 @@ <openNewTab stepKey="openNewTab2"/> <!-- Find the first simple product that we just created using the product grid and go to its page --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage2"/> - <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct2"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="findCreatedProduct2"> <argument name="product" value="$$createSimpleProduct2$$"/> </actionGroup> <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProductPage2"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml index 116b8e7d6ca71..ed081d60074fc 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml @@ -152,7 +152,7 @@ <actionGroup ref="cancelPendingOrder" stepKey="cancelPendingOrder"/> <!-- Assert Simple Product Quantity in backend after order Canceled --> <comment userInput="Assert Simple Product Quantity in backend after order Canceled" stepKey="assertSimpleProductQuantityAfterOrderCanceledComment"/> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheProduct"> <argument name="productSku" value="$$simpleProduct.sku$$"/> </actionGroup> <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad"/> @@ -167,7 +167,7 @@ </actionGroup> <!-- Assert Virtual Product Quantity in backend after order canceled --> <comment userInput="Assert Virtual Product Quantity in backend after order canceled" stepKey="assertVirtualProductQuantityAfterOrderCanceledComment"/> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheVirtualProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheVirtualProduct"> <argument name="productSku" value="$$virtualProduct.sku$$"/> </actionGroup> <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad1"/> @@ -182,7 +182,7 @@ </actionGroup> <!-- Assert Bundle Product Quantity in backend after order canceled --> <comment userInput="Assert Bundle Product Quantity in backend after order canceled" stepKey="assertBundleProductQuantityAfterOrderCanceledComment"/> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheBundleProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheBundleProduct"> <argument name="productSku" value="$$simpleProduct1.sku$$"/> </actionGroup> <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad2"/> @@ -197,7 +197,7 @@ </actionGroup> <!-- Assert Configurable Product Quantity in backend after order canceled --> <comment userInput="Assert Configurable Product quantity in backend after order canceled" stepKey="assertConfigurableProductQuantityAfterOrderCanceledComment"/> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheConfigProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheConfigProduct"> <argument name="productSku" value="$$createConfigChildProduct1.sku$$"/> </actionGroup> <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad3"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithProductQtyWithoutStockDecreaseTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithProductQtyWithoutStockDecreaseTest.xml index 4300f22c3fb3a..28aa3fab7b9a7 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithProductQtyWithoutStockDecreaseTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithProductQtyWithoutStockDecreaseTest.xml @@ -67,7 +67,7 @@ <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> <!-- Assert Simple Product Quantity in backend after order --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheProduct"> <argument name="productSku" value="$$simpleProduct.sku$$"/> </actionGroup> <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad"/> @@ -89,7 +89,7 @@ <actionGroup ref="cancelPendingOrder" stepKey="cancelPendingOrder"/> <!-- Assert Simple Product Quantity in backend after Cancelling the order --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct1"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheProduct1"> <argument name="productSku" value="$$simpleProduct.sku$$"/> </actionGroup> <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad1"/> @@ -114,7 +114,7 @@ <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder1"/> <!-- Assert Simple Product Quantity in backend after Reorder --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct2"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterAndSelectTheProduct2"> <argument name="productSku" value="$$simpleProduct.sku$$"/> </actionGroup> <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad2"/> @@ -122,4 +122,4 @@ <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="10" stepKey="seeProductQuantityAfterReorder"/> <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="In Stock" stepKey="seeProductStockStatusAfterReorder"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml index 4310d412d1c98..75f3640b16405 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCorrectnessInvoicedItemInBundleProductTest.xml @@ -53,7 +53,7 @@ <!--Complete Bundle product creation--> <amOnPage url="{{AdminProductEditPage.url($$createBundleProduct.id$$)}}" stepKey="goToProductEditPage"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Run re-index task--> <magentoCLI command="indexer:reindex" stepKey="reindex"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml index a90fe5c49f032..b0868a408498f 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateInvoiceTest.xml @@ -84,7 +84,7 @@ <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Processing" stepKey="seeOrderStatus"/> <amOnPage url="{{AdminInvoicesPage.url}}" stepKey="goToInvoices"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask6" /> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetGridInitial"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridInitial"/> <click selector="{{AdminInvoicesGridSection.filter}}" stepKey="clickFilters"/> <fillField selector="{{AdminInvoicesFiltersSection.orderNum}}" userInput="{$grabOrderNumber}" stepKey="searchOrderNum2"/> <click selector="{{AdminInvoicesFiltersSection.applyFilters}}" stepKey="clickApplyFilters"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml index b40e9d041a10e..2b7b8bac2038b 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminProductInTheShoppingCartCouldBeReachedByAdminDuringOrderCreationWithMultiWebsiteConfigTest.xml @@ -37,10 +37,10 @@ <argument name="StoreGroup" value="customStoreGroup"/> <argument name="customStore" value="customStore"/> </actionGroup> - <actionGroup ref="goToProductPageViaID" stepKey="goToProductEditPage"> + <actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="goToProductEditPage"> <argument name="productId" value="$$createProduct.id$$"/> </actionGroup> - <actionGroup ref="ProductSetWebsite" stepKey="assignProductToSecondWebsite"> + <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="assignProductToSecondWebsite"> <argument name="website" value="{{customWebsite.name}}"/> </actionGroup> </before> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml index 0bd8ab4855e97..aa506ead65974 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml @@ -36,7 +36,7 @@ </createData> <!-- Check Links can be purchased separately for Downloadable Product --> - <actionGroup ref="navigateToCreatedProductEditPage" stepKey="goToDownloadableProduct"> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToDownloadableProduct"> <argument name="product" value="$$downloadableProduct$$"/> </actionGroup> <waitForPageLoad stepKey="waitForPageLoad"/> @@ -112,7 +112,7 @@ </createData> <!-- Grab attribute name for Configurable Product --> - <actionGroup ref="navigateToCreatedProductEditPage" stepKey="goToConfigurableProduct"> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToConfigurableProduct"> <argument name="product" value="$$createConfigProduct$$"/> </actionGroup> <grabTextFrom selector="{{AdminConfigurableProductFormSection.currentAttribute}}" stepKey="grabAttribute"/> @@ -145,7 +145,7 @@ </createData> <!-- Grab bundle option name for Bundle Product --> - <actionGroup ref="navigateToCreatedProductEditPage" stepKey="goToBundleProduct"> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToBundleProduct"> <argument name="product" value="$$createBundleProduct$$"/> </actionGroup> <grabTextFrom selector="{{AdminProductFormBundleSection.currentBundleOption}}" stepKey="grabBundleOption"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml index ab085dc5ae137..675a5857f3959 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml @@ -36,7 +36,7 @@ <deleteData createDataKey="defaultCategory" stepKey="deleteCategory"/> <deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteBundleProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteBundleProduct"> <argument name="sku" value="{{BundleProduct.sku}}"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFilters"/> @@ -52,10 +52,10 @@ <!--Start creating a bundle product--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductList"/> <waitForPageLoad stepKey="waitForProductList"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> - <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillNameAndSku"> + <actionGroup ref="FillProductNameAndSkuInProductFormActionGroup" stepKey="fillNameAndSku"> <argument name="product" value="BundleProduct"/> </actionGroup> <pressKey selector="{{AdminProductFormSection.productSku}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::ENTER]" stepKey="enter"/> @@ -83,7 +83,7 @@ </actionGroup> <selectOption selector="{{AdminProductFormBundleSection.bundlePriceType}}" userInput="Fixed" stepKey="selectPriceType"/> <fillField selector="{{AdminProductFormBundleSection.bundlePriceValue}}" userInput="200" stepKey="fillPriceValue"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Create cart price rule--> <actionGroup ref="AdminCreateCartPriceRuleWithConditions" stepKey="createRule"> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml index 02078ff15ecc2..625e174ae9c8e 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateBuyXGetYFreeTest.xml @@ -50,7 +50,7 @@ <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> <!-- Create a product to check the storefront --> - <actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="_defaultProduct"/> </actionGroup> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionAndFreeShippingIsAppliedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionAndFreeShippingIsAppliedTest.xml index b51027d51fd53..d2efdfb6ec084 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionAndFreeShippingIsAppliedTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionAndFreeShippingIsAppliedTest.xml @@ -74,7 +74,7 @@ <seeInField selector="{{AdminCartPriceRulesFormSection.defaultStoreView}}" userInput="{{CartPriceRuleConditionAndFreeShippingApplied.defaultStoreView}}" stepKey="seeDefaultStoreView"/> <!--Go to storefront page and verify created product--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> <!--Click on Add To Cart button--> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionIsNotAppliedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionIsNotAppliedTest.xml index 8969e9d9d4ceb..dcd813bb30b35 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionIsNotAppliedTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleAndVerifyRuleConditionIsNotAppliedTest.xml @@ -85,7 +85,7 @@ <seeInField selector="{{AdminCartPriceRulesFormSection.defaultStoreView}}" userInput="{{CartPriceRuleConditionNotApplied.defaultStoreView}}" stepKey="seeDefaultStoreView"/> <!--Go to storefront page and verify created product--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> <fillField selector="{{StorefrontProductInfoMainSection.qty}}" userInput="2" stepKey="fillProductQuantity"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml index 712475186d5bf..6242c1f3d1baf 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml @@ -67,7 +67,7 @@ <seeInField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="5" stepKey="seeDiscountAmount"/> <!-- Create a product to check the storefront --> - <actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="_defaultProduct"/> </actionGroup> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml index d719bb90efd59..78943a0648b51 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml @@ -69,7 +69,7 @@ <grabTextFrom selector="{{AdminCartPriceRulesFormSection.generatedCouponByIndex('1')}}" stepKey="grabCouponCode"/> <!-- Create a product to check the storefront --> - <actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="_defaultProduct"/> </actionGroup> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForMatchingSubtotalAndVerifyRuleConditionIsAppliedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForMatchingSubtotalAndVerifyRuleConditionIsAppliedTest.xml index ab62e51414e85..7ecf869ec1c7e 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForMatchingSubtotalAndVerifyRuleConditionIsAppliedTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForMatchingSubtotalAndVerifyRuleConditionIsAppliedTest.xml @@ -84,7 +84,7 @@ <seeInField selector="{{AdminCartPriceRulesFormSection.defaultStoreView}}" userInput="{{CartPriceRuleConditionAppliedForSubtotal.defaultStoreView}}" stepKey="seeDefaultStoreView"/> <!--Go to storefront page and verify created product--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> <!--Click on Add To Cart button--> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml index 00f104885e0f0..eeccdef78c554 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingCategoryAndVerifyRuleConditionIsAppliedTest.xml @@ -21,14 +21,14 @@ <before> <actionGroup ref = "LoginAsAdmin" stepKey="loginAsAdmin"/> <createData entity="_defaultCategory" stepKey="createCategory"/> - <actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createCategory$$"/> <argument name="simpleProduct" value="_defaultProduct"/> </actionGroup> </before> <after> <deleteData createDataKey="createCategory" stepKey="deletePreReqCategory"/> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteSimpleProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteSimpleProduct"> <argument name="product" value="_defaultProduct"/> </actionGroup> <actionGroup ref="DeleteCartPriceRuleByName" stepKey="deleteCreatedCartPriceRule"> @@ -94,7 +94,7 @@ <!--Go to storefront page and verify created product--> <amOnPage url="{{StorefrontProductPage.url(_defaultProduct.urlKey)}}" stepKey="onCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="productName" value="_defaultProduct.name"/> </actionGroup> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingTotalWeightAndVerifyRuleConditionIsAppliedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingTotalWeightAndVerifyRuleConditionIsAppliedTest.xml index 43b92ee938978..9157de478efec 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingTotalWeightAndVerifyRuleConditionIsAppliedTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleWithMatchingTotalWeightAndVerifyRuleConditionIsAppliedTest.xml @@ -81,7 +81,7 @@ <seeInField selector="{{AdminCartPriceRulesFormSection.defaultStoreView}}" userInput="{{CartPriceRuleConditionAppliedForWeight.defaultStoreView}}" stepKey="seeDefaultStoreView"/> <!--Go to storefront page and verify created product--> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> <!--Click on Add To Cart button--> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml index 1681d910ccdb0..44c89d022edb3 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountDiscountTest.xml @@ -49,7 +49,7 @@ <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> <!-- Create a product to check the storefront --> - <actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="_defaultProduct"/> </actionGroup> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml index 69918bda8c426..b92efd6f83651 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateFixedAmountWholeCartDiscountTest.xml @@ -49,7 +49,7 @@ <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> <!-- Create a product to check the storefront --> - <actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="_defaultProduct"/> </actionGroup> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml index 898e5a07304b6..5fd7c7241130f 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreatePercentOfProductPriceTest.xml @@ -49,7 +49,7 @@ <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> <!-- Create a product to check the storefront --> - <actionGroup ref="FillAdminSimpleProductForm" stepKey="fillProductFieldsInAdmin"> + <actionGroup ref="FillAdminSimpleProductFormActionGroup" stepKey="fillProductFieldsInAdmin"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="_defaultProduct"/> </actionGroup> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteInactiveSalesRuleAndVerifyDeleteMessageTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteInactiveSalesRuleAndVerifyDeleteMessageTest.xml index 1570bfbdb7a23..39a5d0f6a7131 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteInactiveSalesRuleAndVerifyDeleteMessageTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminDeleteInactiveSalesRuleAndVerifyDeleteMessageTest.xml @@ -44,7 +44,7 @@ </actionGroup> <!--Verify customer don't see updated virtual product link on category page --> - <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct"> <argument name="product" value="$$initialSimpleProduct$$"/> </actionGroup> @@ -62,4 +62,4 @@ <argument name="qty" value="1"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml index d8c5b42dbaaaf..a14ccc2ad879f 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml @@ -31,28 +31,28 @@ </actionGroup> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Assign config1 and the associated child products to CAT1 --> - <actionGroup ref="AdminAssignProductToCategory" stepKey="assignConfigurableProduct1ToCategory"> + <actionGroup ref="AdminAssignProductToCategoryActionGroup" stepKey="assignConfigurableProduct1ToCategory"> <argument name="productId" value="$$createConfigProductCreateConfigurableProduct1.id$$"/> <argument name="categoryName" value="$$createCategory.name$$"/> </actionGroup> - <actionGroup ref="AdminAssignProductToCategory" stepKey="assignConfig1ChildProduct1ToCategory"> + <actionGroup ref="AdminAssignProductToCategoryActionGroup" stepKey="assignConfig1ChildProduct1ToCategory"> <argument name="productId" value="$$createConfigChildProduct1CreateConfigurableProduct1.id$$"/> <argument name="categoryName" value="$$createCategory.name$$"/> </actionGroup> - <actionGroup ref="AdminAssignProductToCategory" stepKey="assignConfig1ChildProduct2ToCategory"> + <actionGroup ref="AdminAssignProductToCategoryActionGroup" stepKey="assignConfig1ChildProduct2ToCategory"> <argument name="productId" value="$$createConfigChildProduct2CreateConfigurableProduct1.id$$"/> <argument name="categoryName" value="$$createCategory.name$$"/> </actionGroup> <!-- Assign config12 and the associated child products to CAT2 --> - <actionGroup ref="AdminAssignProductToCategory" stepKey="assignConfigurableProduct2ToCategory2"> + <actionGroup ref="AdminAssignProductToCategoryActionGroup" stepKey="assignConfigurableProduct2ToCategory2"> <argument name="productId" value="$$createConfigProductCreateConfigurableProduct2.id$$"/> <argument name="categoryName" value="$$createCategory2.name$$"/> </actionGroup> - <actionGroup ref="AdminAssignProductToCategory" stepKey="assignConfig2ChildProduct1ToCategory2"> + <actionGroup ref="AdminAssignProductToCategoryActionGroup" stepKey="assignConfig2ChildProduct1ToCategory2"> <argument name="productId" value="$$createConfigChildProduct1CreateConfigurableProduct2.id$$"/> <argument name="categoryName" value="$$createCategory2.name$$"/> </actionGroup> - <actionGroup ref="AdminAssignProductToCategory" stepKey="assignConfig2ChildProduct2ToCategory2"> + <actionGroup ref="AdminAssignProductToCategoryActionGroup" stepKey="assignConfig2ChildProduct2ToCategory2"> <argument name="productId" value="$$createConfigChildProduct2CreateConfigurableProduct2.id$$"/> <argument name="categoryName" value="$$createCategory2.name$$"/> </actionGroup> diff --git a/app/code/Magento/Search/Test/Mftf/Test/AdminGlobalSearchOnProductPageTest.xml b/app/code/Magento/Search/Test/Mftf/Test/AdminGlobalSearchOnProductPageTest.xml index 45a5f53c3e448..725f45c0bc6e3 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/AdminGlobalSearchOnProductPageTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/AdminGlobalSearchOnProductPageTest.xml @@ -24,12 +24,12 @@ </before> <after> <!-- Delete product --> - <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{SimpleProduct.sku}}"/> </actionGroup> <!-- Delete category --> - <actionGroup ref="DeleteCategory" stepKey="deleteCreatedNewRootCategory"> + <actionGroup ref="DeleteCategoryActionGroup" stepKey="deleteCreatedNewRootCategory"> <argument name="categoryEntity" value="_defaultCategory"/> </actionGroup> @@ -40,20 +40,20 @@ <!-- Create Simple Product --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="adminProductIndexPageAdd"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="SimpleProduct"/> </actionGroup> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="SimpleProduct"/> </actionGroup> <!-- Create new category for product --> - <actionGroup ref="FillNewProductCategory" stepKey="FillNewProductCategory"> + <actionGroup ref="FillNewProductCategoryActionGroup" stepKey="FillNewProductCategory"> <argument name="categoryName" value="{{_defaultCategory.name}}"/> </actionGroup> <!-- Save product form --> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <!-- Click on the magnifying glass to start searching --> <click selector="{{AdminGlobalSearchSection.globalSearch}}" stepKey="clickSearchBtn"/> diff --git a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml index c5124ac9c74a1..9e5001591bb91 100644 --- a/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml +++ b/app/code/Magento/Search/Test/Mftf/Test/StorefrontVerifySearchSuggestionByProductDescriptionTest.xml @@ -28,7 +28,7 @@ <!-- Delete all search terms --> <comment userInput="Delete all search terms" stepKey="deleteAllSearchTermsComment"/> <actionGroup ref="DeleteAllSearchTerms" stepKey="deleteAllSearchTerms"/> - <actionGroup ref="deleteAllProductsUsingProductGrid" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/> <!-- Create product with description --> <comment userInput="Create product with description" stepKey="createProductWithDescriptionComment"/> <createData entity="SimpleProductWithDescription" stepKey="simpleProduct"/> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml index b2e3e2516a5c3..9602bfdde5e75 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/AdminCreateOrderCustomStoreShippingMethodTableRatesTest.xml @@ -78,13 +78,13 @@ <!--Assign product to custom website--> <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="goToProductEditPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> - <actionGroup ref="unassignWebsiteFromProductActionGroup" stepKey="unassignWebsiteInProduct"> + <actionGroup ref="UnassignWebsiteFromProductActionGroup" stepKey="unassignWebsiteInProduct"> <argument name="website" value="{{_defaultWebsite.name}}"/> </actionGroup> <actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectWebsiteInProduct"> <argument name="website" value="{{customWebsite.name}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!--Create order--> <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$createCustomer$$"/> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/StorefrontDisplayTableRatesShippingMethodForAETest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/StorefrontDisplayTableRatesShippingMethodForAETest.xml index bb29a4a28bcf6..81fe492ffc005 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Test/StorefrontDisplayTableRatesShippingMethodForAETest.xml +++ b/app/code/Magento/Shipping/Test/Mftf/Test/StorefrontDisplayTableRatesShippingMethodForAETest.xml @@ -54,7 +54,7 @@ <argument name="Customer" value="$$createCustomer$$"/> </actionGroup> <!--Add the created product to the shopping cart--> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <!--Proceed to Checkout from the mini cart--> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateImageSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateImageSwatchTest.xml index 0e294153e881e..aac765b4926af 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateImageSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateImageSwatchTest.xml @@ -98,10 +98,10 @@ <!-- Create a configurable product to verify the storefront with --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad time="30" stepKey="waitForProductGrid"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateConfigurableProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateTextSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateTextSwatchTest.xml index 87d3f0bb5bcb9..4685670fbfdd2 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateTextSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateTextSwatchTest.xml @@ -54,12 +54,12 @@ <!-- Create a configurable product to verify the storefront with --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad time="30" stepKey="waitForProductGrid"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateConfigurableProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> <fillField userInput="{{_defaultProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchWithNonValidOptionsTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchWithNonValidOptionsTest.xml index b03f771875957..5b11cf5942cde 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchWithNonValidOptionsTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminCreateVisualSwatchWithNonValidOptionsTest.xml @@ -21,7 +21,7 @@ </before> <after> <!-- Remove attribute --> - <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteAttribute"> <argument name="ProductAttribute" value="visualSwatchAttribute"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> @@ -103,10 +103,10 @@ <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> - <actionGroup ref="navigateToCreatedProductAttribute" stepKey="navigateToAttribute"> + <actionGroup ref="NavigateToCreatedProductAttributeActionGroup" stepKey="navigateToAttribute"> <argument name="ProductAttribute" value="visualSwatchAttribute"/> </actionGroup> <!-- Check attribute data --> <seeCheckboxIsChecked selector="{{AdminManageSwatchSection.nthIsDefault('2')}}" stepKey="CheckDefaultOption"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml index f94314fe94806..43205375a6330 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml @@ -59,7 +59,7 @@ </before> <after> <!-- Delete product attribute and clear grid filter --> - <actionGroup ref="deleteProductAttributeByAttributeCode" stepKey="deleteProductAttribute"> + <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttributeCode" value="{{VisualSwatchProductAttribute.attribute_code}}"/> </actionGroup> <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearAttributesGridFilter"/> @@ -73,19 +73,19 @@ <!-- Add created product attribute to the Default set --> <actionGroup ref="AdminOpenAttributeSetGridPageActionGroup" stepKey="openAttributeSetPage"/> <actionGroup ref="AdminOpenAttributeSetByNameActionGroup" stepKey="openDefaultAttributeSet"/> - <actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> + <actionGroup ref="AssignAttributeToGroupActionGroup" stepKey="assignAttributeToGroup"> <argument name="group" value="Product Details"/> <argument name="attribute" value="{{VisualSwatchProductAttribute.attribute_code}}"/> </actionGroup> - <actionGroup ref="SaveAttributeSet" stepKey="saveAttributeSet"/> + <actionGroup ref="SaveAttributeSetActionGroup" stepKey="saveAttributeSet"/> <!-- Create configurable product --> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Fill all the necessary information such as weight, name, SKU etc --> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Click "Create Configurations" button, select created product attribute using the same Quantity for all products. Click "Generate products" button --> @@ -100,10 +100,10 @@ <attachFile selector="{{AdminDataGridTableSection.rowTemplate({$attributeCodeAdobeSmall})}}{{AdminProductFormConfigurationsSection.fileUploaderInput}}" userInput="{{TestImageAdobe.file}}" stepKey="uploadImageForSecondProduct"/> <!-- Click "Save" button --> - <actionGroup ref="saveProductForm" stepKey="clickSaveButton"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="clickSaveButton"/> <!-- Delete all created product --> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProducts"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProducts"> <argument name="sku" value="{{ApiConfigurableProduct.sku}}"/> </actionGroup> </test> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml index 0a98e7a721c17..af3e2f49c9e79 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest.xml @@ -26,17 +26,17 @@ </before> <after> <!-- Delete configurable product and all child products --> - <actionGroup ref="deleteProductsByKeyword" stepKey="deleteProductsByKeyword"> + <actionGroup ref="DeleteProductsByKeywordActionGroup" stepKey="deleteProductsByKeyword"> <argument name="keyword" value="{{_defaultProduct.sku}}"/> </actionGroup> <!-- Delete category --> <deleteData createDataKey="createCategory" stepKey="deleteCategoryAttribute"/> <!-- Delete color attribute --> - <actionGroup ref="deleteProductAttribute" stepKey="deleteColorAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteColorAttribute"> <argument name="ProductAttribute" value="ProductColorAttribute"/> </actionGroup> <!-- Delete size attribute --> - <actionGroup ref="deleteProductAttribute" stepKey="deleteSizeAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteSizeAttribute"> <argument name="ProductAttribute" value="ProductSizeAttribute"/> </actionGroup> <!-- Logout --> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontDisplayAllCharactersOnTextSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontDisplayAllCharactersOnTextSwatchTest.xml index 1bcdd6fcf9a3a..0999b43c48820 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontDisplayAllCharactersOnTextSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontDisplayAllCharactersOnTextSwatchTest.xml @@ -63,7 +63,7 @@ <click selector="{{StorefrontCategorySidebarSection.attributeNthOption(ProductAttributeFrontendLabel.label, '4')}}" stepKey="filterBySwatch4"/> <!-- Deletes the created configurable product--> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteConfigurableProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteConfigurableProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml index c9602ddcd127c..b23e94ae41d6b 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByImageSwatchTest.xml @@ -81,18 +81,18 @@ <!-- Create a configurable product to verify the storefront with --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad time="30" stepKey="waitForProductGrid"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateConfigurableProduct"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Add image to configurable product --> - <actionGroup ref="addProductImage" stepKey="addFirstImageForProductConfigurable"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addFirstImageForProductConfigurable"> <argument name="image" value="MagentoLogo"/> </actionGroup> <!-- Add image to configurable product --> - <actionGroup ref="addProductImage" stepKey="addSecondImageForProductConfigurable"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addSecondImageForProductConfigurable"> <argument name="image" value="TestImageNew"/> </actionGroup> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/> @@ -130,18 +130,18 @@ <dontSee selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" userInput="$$createSimpleProduct.name$$" stepKey="dontSeeSimpleProduct"/> <!-- Assert configurable product in storefront product page --> - <actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage"> + <actionGroup ref="AssertProductInStorefrontProductPageActionGroup" stepKey="AssertProductInStorefrontProductPage"> <argument name="product" value="ApiConfigurableProduct"/> </actionGroup> <!-- Assert configurable product image in storefront product page --> - <actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertProductImageStorefrontProductPage"> + <actionGroup ref="AssertProductImageStorefrontProductPageActionGroup" stepKey="assertProductImageStorefrontProductPage"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="image" value="MagentoLogo"/> </actionGroup> <!-- Assert configurable product image in storefront product page --> - <actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertProductSecondImageStorefrontProductPage"> + <actionGroup ref="AssertProductImageStorefrontProductPageActionGroup" stepKey="assertProductSecondImageStorefrontProductPage"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="image" value="TestImageNew"/> </actionGroup> @@ -150,7 +150,7 @@ <click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('adobe-thumb')}}" stepKey="clickSwatchOption"/> <!-- Assert swatch option image for configurable product image in storefront product page --> - <actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertSwatchImageStorefrontProductPage"> + <actionGroup ref="AssertProductImageStorefrontProductPageActionGroup" stepKey="assertSwatchImageStorefrontProductPage"> <argument name="product" value="ApiConfigurableProduct"/> <argument name="image" value="TestImageAdobe"/> </actionGroup> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml index 7bf63d25417e3..c065cb450d3e3 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByTextSwatchTest.xml @@ -69,10 +69,10 @@ <!-- Create a configurable product to verify the storefront with --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad stepKey="waitForProductGrid"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateConfigurableProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml index fd38c48919416..de12e326ebcef 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontFilterByVisualSwatchTest.xml @@ -81,10 +81,10 @@ <!-- Create a configurable product to verify the storefront with --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> <waitForPageLoad time="30" stepKey="waitForProductGrid"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateConfigurableProduct"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateConfigurableProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="fillCategory"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml index 2928011662864..64283accb9c13 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontImageColorWhenFilterByColorFilterTest.xml @@ -30,7 +30,7 @@ <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> - <actionGroup ref="deleteProductAttributeByLabel" stepKey="deleteAttribute"> + <actionGroup ref="DeleteProductAttributeByLabelActionGroup" stepKey="deleteAttribute"> <argument name="ProductAttribute" value="visualSwatchAttribute"/> </actionGroup> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> @@ -38,7 +38,7 @@ <actionGroup ref="adminDataGridSelectPerPage" stepKey="selectNumberOfProductsPerPage"> <argument name="perPage" value="100"/> </actionGroup> - <actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/> + <actionGroup ref="DeleteProductsIfTheyExistActionGroup" stepKey="deleteAllProducts"/> <actionGroup ref="logout" stepKey="logout"/> </after> <amOnPage url="{{AdminProductEditPage.url($$createConfigProduct.id$$)}}" stepKey="navigateToConfigProductPage"/> @@ -66,7 +66,7 @@ </actionGroup> <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/> <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnGenerateProductsButton"/> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> <!-- Perform reindex and flush cache --> <magentoCLI command="indexer:reindex" stepKey="reindex"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml index 1717b424e4597..34f95d7f2284b 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSeeProductImagesMatchingProductSwatchesTest.xml @@ -26,11 +26,11 @@ <after> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> - <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteAttribute"> <argument name="ProductAttribute" value="VisualSwatchProductAttribute"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductAttributeGridFilter"/> - <actionGroup ref="deleteAllDuplicateProductUsingProductGrid" stepKey="deleteAllChildrenProducts"> + <actionGroup ref="DeleteAllDuplicateProductUsingProductGridActionGroup" stepKey="deleteAllChildrenProducts"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductGridFilter"/> @@ -63,15 +63,15 @@ </actionGroup> <!-- Edit configurable product --> - <actionGroup ref="goToProductPageViaID" stepKey="openProductEditPage"> + <actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="openProductEditPage"> <argument name="productId" value="$$createSimpleProduct.id$$"/> </actionGroup> <!-- Add images to configurable product --> - <actionGroup ref="addProductImage" stepKey="addFirstImageForProductConfigurable"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addFirstImageForProductConfigurable"> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="addProductImage" stepKey="addSecondImageForProductConfigurable"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addSecondImageForProductConfigurable"> <argument name="image" value="TestImageNew"/> </actionGroup> @@ -97,15 +97,15 @@ <!-- Go to the category page --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage"/> - <actionGroup ref="StorefrontAssertActiveProductImage" stepKey="StorefrontAssertActiveProductImage"/> + <actionGroup ref="StorefrontAssertActiveProductImageActionGroup" stepKey="StorefrontAssertActiveProductImage"/> <!--Click a swatch and expect to see the image from the swatch from the configurable product --> <actionGroup ref="StorefrontSelectSwatchOptionOnProductPageAndCheckImage" stepKey="clickSwatchOption"> <argument name="optionName" value="{{visualSwatchOption1.default_label}}"/> <argument name="fileName" value="{{TestImageAdobe.filename}}"/> </actionGroup> - <actionGroup ref="StorefrontAssertFotoramaImageAvailablity" stepKey="seeFirstImageBaseProductInSwatchOption"/> - <actionGroup ref="StorefrontAssertFotoramaImageAvailablity" stepKey="seeSecondImageBaseProductInSwatchOption"> + <actionGroup ref="StorefrontAssertFotoramaImageAvailabilityActionGroup" stepKey="seeFirstImageBaseProductInSwatchOption"/> + <actionGroup ref="StorefrontAssertFotoramaImageAvailabilityActionGroup" stepKey="seeSecondImageBaseProductInSwatchOption"> <argument name="fileName" value="{{TestImageNew.filename}}"/> </actionGroup> @@ -113,8 +113,8 @@ <argument name="optionName" value="{{visualSwatchOption2.default_label}}"/> <argument name="fileName" value="{{ImageUpload3.filename}}"/> </actionGroup> - <actionGroup ref="StorefrontAssertFotoramaImageAvailablity" stepKey="seeFirstImageBaseProductInSwatchOption2"/> - <actionGroup ref="StorefrontAssertFotoramaImageAvailablity" stepKey="seeSecondImageBaseProductInSwatchOption2"> + <actionGroup ref="StorefrontAssertFotoramaImageAvailabilityActionGroup" stepKey="seeFirstImageBaseProductInSwatchOption2"/> + <actionGroup ref="StorefrontAssertFotoramaImageAvailabilityActionGroup" stepKey="seeSecondImageBaseProductInSwatchOption2"> <argument name="fileName" value="{{TestImageNew.filename}}"/> </actionGroup> </test> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml index 323b10507fe28..119a645252685 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml @@ -30,13 +30,13 @@ <after> <!--delete created configurable product--> - <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> <waitForPageLoad stepKey="waitForAdminProductGridLoad"/> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <actionGroup ref="deleteProductAttributeByLabel" stepKey="deleteAttribute"> + <actionGroup ref="DeleteProductAttributeByLabelActionGroup" stepKey="deleteAttribute"> <argument name="ProductAttribute" value="visualSwatchAttribute"/> </actionGroup> <!--delete root category--> @@ -58,10 +58,10 @@ <!--Create a configurable swatch product via the UI --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/> <waitForPageLoad stepKey="waitForProductPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createRootCategory.name$$]" stepKey="searchAndSelectCategory"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchProductWithFileCustomOptionTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchProductWithFileCustomOptionTest.xml index 5e712ebc38292..99b38bd3b34d6 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchProductWithFileCustomOptionTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchProductWithFileCustomOptionTest.xml @@ -34,19 +34,19 @@ <!-- Create a configurable swatch product via the UI --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/> <waitForPageLoad stepKey="waitForProductPage"/> - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> + <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateProductPage"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> - <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillProductForm"> <argument name="product" value="BaseConfigurableProduct"/> </actionGroup> <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[$$createCategory.name$$]" stepKey="searchAndSelectCategory"/> <!--Add swatch attribute to configurable product--> <actionGroup ref="AddVisualSwatchToProductActionGroup" stepKey="addSwatchToProduct"/> <!--Add custom option to configurable product--> - <actionGroup ref="AddProductCustomOptionFile" stepKey="addCustomOptionToProduct"/> + <actionGroup ref="AddProductCustomOptionFileActionGroup" stepKey="addCustomOptionToProduct"/> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/> - + <!--Go to storefront--> <amOnPage url="" stepKey="goToHomePage"/> <waitForPageLoad stepKey="waitForHomePageLoad"/> @@ -85,7 +85,7 @@ <click selector="{{CheckoutCartProductSection.RemoveItem}}" stepKey="deleteCartItem"/> <!--Delete product--> - <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct"> <argument name="sku" value="{{BaseConfigurableProduct.sku}}"/> </actionGroup> </test> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml index 628d189823a52..814ac1aee1603 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminTaxReportGridTest.xml @@ -72,11 +72,11 @@ <!--Open Created products. In Tax Class select new created Product Tax classes.--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/> <waitForPageLoad stepKey="wait1"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGrid"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProductGridBySku"> <argument name="product" value="$$firstProduct$$"/> </actionGroup> - <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openFirstProductForEdit"/> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openFirstProductForEdit"/> <selectOption selector="{{AdminProductFormSection.productTaxClass}}" stepKey="selectTexClassForFirstProduct" userInput="TaxClasses1"/> <!-- Save the second product --> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveFirstProduct"/> @@ -84,11 +84,11 @@ <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="againGoToProductIndex"/> <waitForPageLoad stepKey="wait2"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetSecondProductGrid"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterSecondProductGridBySku"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetSecondProductGrid"/> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterSecondProductGridBySku"> <argument name="product" value="$$secondProduct$$"/> </actionGroup> - <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openSecondProductForEdit"/> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openSecondProductForEdit"/> <selectOption selector="{{AdminProductFormSection.productTaxClass}}" stepKey="selectTexClassForSecondProduct" userInput="TaxClasses2"/> <!-- Save the second product --> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveSecondProduct"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml index aa44593400a89..5032ca693ceaa 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForCustomerPhysicalQuoteTest.xml @@ -57,10 +57,10 @@ <argument name="stateForFPT" value="New York"/> <argument name="valueForFPT" value="20"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetGridToDefaultKeywordSearch"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> </before> <after> <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml index bce9d895e311e..7ac66498b3c6d 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxInformationInShoppingCartForGuestPhysicalQuoteTest.xml @@ -55,10 +55,10 @@ <argument name="stateForFPT" value="New York"/> <argument name="valueForFPT" value="20"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetGridToDefaultKeywordSearch"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> </before> <after> <deleteData createDataKey="createTaxRule" stepKey="deleteTaxRule"/> diff --git a/app/code/Magento/Theme/Test/Mftf/Test/AdminDesignConfigMediaGalleryImageUploadTest.xml b/app/code/Magento/Theme/Test/Mftf/Test/AdminDesignConfigMediaGalleryImageUploadTest.xml index f46328ac151b1..8939bf6744042 100644 --- a/app/code/Magento/Theme/Test/Mftf/Test/AdminDesignConfigMediaGalleryImageUploadTest.xml +++ b/app/code/Magento/Theme/Test/Mftf/Test/AdminDesignConfigMediaGalleryImageUploadTest.xml @@ -61,7 +61,7 @@ <waitForPageLoad stepKey="waitForPageloadSuccess2"/> <!--Delete Image: will be in both root and favicon--> <comment userInput="Delete Image" stepKey="deleteImageComment"/> - <actionGroup ref="navigateToMediaGallery" stepKey="navigateToMediaGallery"/> + <actionGroup ref="NavigateToMediaGalleryActionGroup" stepKey="navigateToMediaGallery"/> <actionGroup ref="NavigateToMediaFolderActionGroup" stepKey="navigateToFolder2"> <argument name="FolderName" value="Storage Root"/> </actionGroup> diff --git a/app/code/Magento/Translation/Test/Mftf/Test/AdminInlineTranslationOnCheckoutTest.xml b/app/code/Magento/Translation/Test/Mftf/Test/AdminInlineTranslationOnCheckoutTest.xml index 2b86a8ac07e77..08448f7735f7c 100644 --- a/app/code/Magento/Translation/Test/Mftf/Test/AdminInlineTranslationOnCheckoutTest.xml +++ b/app/code/Magento/Translation/Test/Mftf/Test/AdminInlineTranslationOnCheckoutTest.xml @@ -56,7 +56,7 @@ <argument name="Customer" value="$$createCustomer$$"/> </actionGroup> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProduct"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProduct"> <argument name="product" value="$$createProduct$$"/> </actionGroup> @@ -333,7 +333,7 @@ <argument name="Customer" value="$$createCustomer2$$"/> </actionGroup> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <click selector="{{StorefrontMiniCartSection.show}}" stepKey="showCart"/> @@ -427,7 +427,7 @@ <argument name="Customer" value="$$createCustomer3$$"/> </actionGroup> - <actionGroup ref="AddSimpleProductToCart" stepKey="addOneProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addOneProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Translation/Test/Mftf/Test/StorefrontButtonsInlineTranslationTest.xml b/app/code/Magento/Translation/Test/Mftf/Test/StorefrontButtonsInlineTranslationTest.xml index 155e174310ea9..d87d3635fa07c 100644 --- a/app/code/Magento/Translation/Test/Mftf/Test/StorefrontButtonsInlineTranslationTest.xml +++ b/app/code/Magento/Translation/Test/Mftf/Test/StorefrontButtonsInlineTranslationTest.xml @@ -45,7 +45,7 @@ </after> <!-- Add product to cart on storefront --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createProduct$$"/> </actionGroup> diff --git a/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterDeleteAndVerifyErrorMessageTest.xml b/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterDeleteAndVerifyErrorMessageTest.xml index e2c3b157c1059..1a4b3b76eebe8 100644 --- a/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterDeleteAndVerifyErrorMessageTest.xml +++ b/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterDeleteAndVerifyErrorMessageTest.xml @@ -53,7 +53,7 @@ <!--Filter created simple product in grid and add category and website created in create data--> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="openProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowOfCreatedSimpleProduct"/> @@ -78,4 +78,4 @@ <argument name="errorMessage" value="Something went wrong with processing the default view and we have restored the filter to its original state."/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml index 52d313b21f3e1..5d2bc8a923237 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminAutoUpdateURLRewriteWhenCategoryIsDeletedTest.xml @@ -46,7 +46,7 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!--Filter Product in product page and get the Product ID --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterProduct"> <argument name="productSku" value="$$createSimpleProduct.sku$$"/> </actionGroup> <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> @@ -70,4 +70,4 @@ <argument name="requestPath" value="$$createCategory.name$$.html"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest.xml index 121fd7c736dcc..dc26b8c97c64e 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesCorrectlyGeneratedForMultipleStoreviewsDuringProductImportTest.xml @@ -46,31 +46,31 @@ <argument name="storeViewName" value="{{customStoreNLNotUnique.name}}"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearStoreFilters"/> - <actionGroup ref="deleteProductByName" stepKey="deleteImportedProduct"> + <actionGroup ref="DeleteProductByNameActionGroup" stepKey="deleteImportedProduct"> <argument name="sku" value="productformagetwo68980"/> <argument name="name" value="productformagetwo68980"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFiltersIfSet"/> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="switchCategoryStoreView" stepKey="switchToStoreViewEn"> + <actionGroup ref="SwitchCategoryStoreViewActionGroup" stepKey="switchToStoreViewEn"> <argument name="Store" value="customStoreENNotUnique.name"/> <argument name="CatName" value="$$createCategory.name$$"/> </actionGroup> <uncheckOption selector="{{AdminCategoryBasicFieldSection.categoryNameUseDefault}}" stepKey="uncheckUseDefaultValueENStoreView"/> <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="category-english" stepKey="changeNameField"/> <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="clickOnSectionHeader"/> - <actionGroup ref="ChangeSeoUrlKeyForSubCategory" stepKey="changeSeoUrlKeyENStoreView"> + <actionGroup ref="ChangeSeoUrlKeyForSubCategoryActionGroup" stepKey="changeSeoUrlKeyENStoreView"> <argument name="value" value="category-english"/> </actionGroup> - <actionGroup ref="switchCategoryStoreView" stepKey="switchToStoreViewNl"> + <actionGroup ref="SwitchCategoryStoreViewActionGroup" stepKey="switchToStoreViewNl"> <argument name="Store" value="customStoreNLNotUnique.name"/> <argument name="CatName" value="$$createCategory.name$$"/> </actionGroup> <uncheckOption selector="{{AdminCategoryBasicFieldSection.categoryNameUseDefault}}" stepKey="uncheckUseDefaultValue1"/> <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="category-dutch" stepKey="changeNameFieldNLStoreView"/> <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="clickOnSectionHeader2"/> - <actionGroup ref="ChangeSeoUrlKeyForSubCategory" stepKey="changeSeoUrlKeyNLStoreView"> + <actionGroup ref="ChangeSeoUrlKeyForSubCategoryActionGroup" stepKey="changeSeoUrlKeyNLStoreView"> <argument name="value" value="category-dutch"/> </actionGroup> <amOnPage url="{{AdminImportIndexPage.url}}" stepKey="navigateToSystemImport"/> @@ -170,7 +170,7 @@ <argument name="storeViewName" value="{{customStoreNLNotUnique.name}}"/> </actionGroup> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearStoreGridFilters"/> - <actionGroup ref="deleteProductByName" stepKey="deleteImportedProduct"> + <actionGroup ref="DeleteProductByNameActionGroup" stepKey="deleteImportedProduct"> <argument name="sku" value="productformagetwo68980"/> <argument name="name" value="productformagetwo68980"/> </actionGroup> @@ -180,24 +180,24 @@ <!--Flush cache--> <magentoCLI command="cache:flush" stepKey="cleanCache2"/> </after> - <actionGroup ref="switchCategoryStoreView" stepKey="switchToStoreViewEn"> + <actionGroup ref="SwitchCategoryStoreViewActionGroup" stepKey="switchToStoreViewEn"> <argument name="Store" value="customStoreENNotUnique.name"/> <argument name="CatName" value="$$createCategory.name$$"/> </actionGroup> <uncheckOption selector="{{AdminCategoryBasicFieldSection.categoryNameUseDefault}}" stepKey="uncheckUseDefaultValueENStoreView"/> <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="category-english" stepKey="changeNameField"/> <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="clickOnSectionHeader"/> - <actionGroup ref="ChangeSeoUrlKeyForSubCategory" stepKey="changeSeoUrlKeyENStoreView"> + <actionGroup ref="ChangeSeoUrlKeyForSubCategoryActionGroup" stepKey="changeSeoUrlKeyENStoreView"> <argument name="value" value="category-english"/> </actionGroup> - <actionGroup ref="switchCategoryStoreView" stepKey="switchToStoreViewNl"> + <actionGroup ref="SwitchCategoryStoreViewActionGroup" stepKey="switchToStoreViewNl"> <argument name="Store" value="customStoreNLNotUnique.name"/> <argument name="CatName" value="$$createCategory.name$$"/> </actionGroup> <uncheckOption selector="{{AdminCategoryBasicFieldSection.categoryNameUseDefault}}" stepKey="uncheckUseDefaultValue1"/> <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="category-dutch" stepKey="changeNameFieldNLStoreView"/> <click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="clickOnSectionHeader2"/> - <actionGroup ref="ChangeSeoUrlKeyForSubCategory" stepKey="changeSeoUrlKeyNLStoreView"> + <actionGroup ref="ChangeSeoUrlKeyForSubCategoryActionGroup" stepKey="changeSeoUrlKeyNLStoreView"> <argument name="value" value="category-dutch"/> </actionGroup> <amOnPage url="{{AdminImportIndexPage.url}}" stepKey="navigateToSystemImport"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml index 52dce4d67f698..828a661e385c9 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml @@ -45,18 +45,18 @@ </after> <!-- On the categories editing page change store view to created additional view --> - <actionGroup ref="switchCategoryStoreView" stepKey="switchStoreView"> + <actionGroup ref="SwitchCategoryStoreViewActionGroup" stepKey="switchStoreView"> <argument name="Store" value="customStore.name"/> <argument name="CatName" value="$$createFirstCategory.name$$"/> </actionGroup> <!-- Change url key for category for first category; save --> - <actionGroup ref="ChangeSeoUrlKeyForSubCategory" stepKey="changeUrlKey"> + <actionGroup ref="ChangeSeoUrlKeyForSubCategoryActionGroup" stepKey="changeUrlKey"> <argument name="value" value="{{SimpleRootSubCategory.url_key}}"/> </actionGroup> <!-- Change store view to "All store views" for first category --> - <actionGroup ref="switchCategoryToAllStoreView" stepKey="switchToAllStoreViewProduct"> + <actionGroup ref="SwitchCategoryToAllStoreViewActionGroup" stepKey="switchToAllStoreViewProduct"> <argument name="CatName" value="$$createFirstCategory.name$$"/> </actionGroup> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml index 85e9d7847d5ea..e4047ca625618 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml @@ -37,7 +37,7 @@ </actionGroup> <!-- Get Category ID --> - <actionGroup ref="OpenCategoryFromCategoryTree" stepKey="getCategoryId"> + <actionGroup ref="OpenCategoryFromCategoryTreeActionGroup" stepKey="getCategoryId"> <argument name="category" value="$$category.name$$"/> </actionGroup> <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml index b123bc14cb1ed..552853943db25 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml @@ -30,7 +30,7 @@ </after> <!-- Open Category Page and Get Category ID --> - <actionGroup ref="OpenCategoryFromCategoryTree" stepKey="getCategoryId"> + <actionGroup ref="OpenCategoryFromCategoryTreeActionGroup" stepKey="getCategoryId"> <argument name="category" value="$$category.name$$"/> </actionGroup> <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml index 711d5389b013b..2a225123a3409 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml @@ -30,7 +30,7 @@ </after> <!--Filter Product in product page and get the Product ID --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterProduct"> <argument name="productSku" value="$$createProduct.sku$$"/> </actionGroup> <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteAndAddNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteAndAddNoRedirectTest.xml index f8d297c92a176..4aef4aec3deed 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteAndAddNoRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteAndAddNoRedirectTest.xml @@ -40,7 +40,7 @@ </actionGroup> <!--Filter Product in product page and get the Product ID --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterProduct"> <argument name="productSku" value="$$createSimpleProduct.sku$$"/> </actionGroup> <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> @@ -59,4 +59,4 @@ <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml index ae18ab33ba6ce..e91446f43fec0 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductURLRewriteWithCategoryAndAddTemporaryRedirectTest.xml @@ -51,7 +51,7 @@ </actionGroup> <!--Filter Product in product page and get the Product ID --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterProduct"> <argument name="productSku" value="$$createSimpleProduct.sku$$"/> </actionGroup> <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> @@ -64,7 +64,7 @@ </actionGroup> <!-- Open Category Page and Get Category ID --> - <actionGroup ref="OpenCategoryFromCategoryTree" stepKey="getCategoryId"> + <actionGroup ref="OpenCategoryFromCategoryTreeActionGroup" stepKey="getCategoryId"> <argument name="category" value="$$createCategory.name$$"/> </actionGroup> <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> @@ -76,4 +76,4 @@ <argument name="targetPath" value="catalog/category/view/id/{$categoryId}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddPermanentRedirectTest.xml index 66c586d4fe891..82e6b269c7b30 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddPermanentRedirectTest.xml @@ -39,7 +39,7 @@ </actionGroup> <!--Filter Product in product page and get the Product ID --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterProduct"> <argument name="productSku" value="$$createSimpleProduct.sku$$"/> </actionGroup> <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> @@ -59,4 +59,4 @@ <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddTemporaryRedirectTest.xml index 2d797a12bedf5..1133119202226 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductUrLRewriteAndAddTemporaryRedirectTest.xml @@ -40,7 +40,7 @@ </actionGroup> <!--Filter Product in product page and get the Product ID --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterProduct"> <argument name="productSku" value="$$createSimpleProduct.sku$$"/> </actionGroup> <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> @@ -59,4 +59,4 @@ <argument name="targetPath" value="catalog/product/view/id/{$productId}"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml index 4dc5c85830076..1dafe371f0d2a 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateProductWithSeveralWebsitesAndCheckURLRewritesTest.xml @@ -65,7 +65,7 @@ <!-- Create simple product with categories created in create data --> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="openProductCatalogPage"/> <waitForPageLoad stepKey="waitForProductCatalogPage"/> - <actionGroup ref="filterProductGridBySku" stepKey="filterProduct"> + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterProduct"> <argument name="product" value="$$createProduct$$"/> </actionGroup> <click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="clickFirstRowOfCreatedSimpleProduct"/> @@ -85,7 +85,7 @@ <see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/> <!-- Grab category Id --> - <actionGroup ref="OpenCategoryFromCategoryTree" stepKey="grabCategoryId"> + <actionGroup ref="OpenCategoryFromCategoryTreeActionGroup" stepKey="grabCategoryId"> <argument name="category" value="$$category.name$$"/> </actionGroup> <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> @@ -99,7 +99,7 @@ <see selector="{{AdminUrlRewriteIndexSection.storeView('1')}}" userInput="{{customStoreEN.name}}" stepKey="seeStoreViewValueForCategoryId"/> <!-- Grab product Id --> - <actionGroup ref="filterAndSelectProduct" stepKey="grabProductId"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="grabProductId"> <argument name="productSku" value="$$createProduct.sku$$"/> </actionGroup> <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> @@ -112,4 +112,4 @@ <see selector="{{AdminUrlRewriteIndexSection.storeView('1')}}" userInput="{{customStore.name}}" stepKey="seeStoreValueForProductId"/> <see selector="{{AdminUrlRewriteIndexSection.storeView('1')}}" userInput="{{storeViewData.name}}" stepKey="seeStoreViewValueForProductId"/> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml index c6ee1a7da9602..151211bac67e0 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminProductCreateUrlRewriteForCustomStoreViewTest.xml @@ -44,7 +44,7 @@ <actionGroup ref="logout" stepKey="logoutFromAdmin"/> </after> <!--Step 1. Navigate as Admin on Product Page for edit product`s Url Key--> - <actionGroup ref="navigateToCreatedProductEditPage" stepKey="goToProductForUrlRewrite"> + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="goToProductForUrlRewrite"> <argument name="product" value="$$createProductForUrlRewrite$$"/> </actionGroup> <!--Step 2. As Admin switch on Custom Store View from Precondition --> @@ -55,12 +55,12 @@ <actionGroup ref="AdminProductFormUpdateUrlKeyActionGroup" stepKey="updateUrlKeyForProduct"> <argument name="newUrlKey" value="U2"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProductWithNewUrl"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductWithNewUrl"/> <!--Step 4. Set URL Key for created category --> - <actionGroup ref="navigateToCreatedCategory" stepKey="navigateToCreatedSubCategory"> + <actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="navigateToCreatedSubCategory"> <argument name="Category" value="$$createCategory$$"/> </actionGroup> - <actionGroup ref="ChangeSeoUrlKey" stepKey="updateUrlKeyForCategory"> + <actionGroup ref="ChangeSeoUrlKeyActionGroup" stepKey="updateUrlKeyForCategory"> <argument name="value" value="U1"/> </actionGroup> <!--Step 5. On Storefront Assert what URL Key for Category is changed and is correct as for Default Store View --> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddAspxRequestPathTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddAspxRequestPathTest.xml index 072753505223d..33f8ab5d8a98d 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddAspxRequestPathTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddAspxRequestPathTest.xml @@ -40,7 +40,7 @@ </actionGroup> <!-- Open Category Page and Get Category ID --> - <actionGroup ref="OpenCategoryFromCategoryTree" stepKey="getCategoryId"> + <actionGroup ref="OpenCategoryFromCategoryTreeActionGroup" stepKey="getCategoryId"> <argument name="category" value="$$category.name$$"/> </actionGroup> <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddNoRedirectTest.xml index 80b9dbe41bf59..9859d1a792679 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddNoRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddNoRedirectTest.xml @@ -40,7 +40,7 @@ </actionGroup> <!-- Open Category Page and Get Category ID --> - <actionGroup ref="OpenCategoryFromCategoryTree" stepKey="getCategoryId"> + <actionGroup ref="OpenCategoryFromCategoryTreeActionGroup" stepKey="getCategoryId"> <argument name="category" value="$$category.name$$"/> </actionGroup> <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddPermanentRedirectTest.xml index be9fd1d83c8f1..65fd4f2df25bd 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddPermanentRedirectTest.xml @@ -40,7 +40,7 @@ </actionGroup> <!-- Open Category Page and Get Category ID --> - <actionGroup ref="OpenCategoryFromCategoryTree" stepKey="getCategoryId"> + <actionGroup ref="OpenCategoryFromCategoryTreeActionGroup" stepKey="getCategoryId"> <argument name="category" value="$$category.name$$"/> </actionGroup> <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml index 7e1b9acbc47ab..42b3032592897 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml @@ -40,7 +40,7 @@ </actionGroup> <!-- Open Category Page and Get Category ID --> - <actionGroup ref="OpenCategoryFromCategoryTree" stepKey="getCategoryId"> + <actionGroup ref="OpenCategoryFromCategoryTreeActionGroup" stepKey="getCategoryId"> <argument name="category" value="$$category.name$$"/> </actionGroup> <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesTemporaryTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesTemporaryTest.xml index 07d578cbbeca4..059f6bdce71f2 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesTemporaryTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCustomURLRewritesTemporaryTest.xml @@ -32,7 +32,7 @@ </after> <!--Filter Product in product page and get the Product ID --> - <actionGroup ref="filterAndSelectProduct" stepKey="filterProduct"> + <actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterProduct"> <argument name="productSku" value="$$createProduct.sku$$"/> </actionGroup> <grabFromCurrentUrl stepKey="productId" regex="#\/([0-9]*)?\/$#"/> @@ -65,4 +65,4 @@ <argument name="productRequestPath" value="$$createProduct.name$$.html"/> </actionGroup> </test> -</tests> \ No newline at end of file +</tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest.xml index b708b63599173..dc82a3e4ab24f 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest.xml @@ -54,7 +54,7 @@ <seeElement selector="{{AdminUrlRewriteIndexSection.requestPathColumnValue($simpleSubCategory1.custom_attributes[url_key]$/$simpleSubCategory2.custom_attributes[url_key]$/$simpleSubCategory3.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeValue4"/> <!-- 3. Edit Category 1 for DEFAULT Store View: --> - <actionGroup ref="switchCategoryStoreView" stepKey="switchStoreView"> + <actionGroup ref="SwitchCategoryStoreViewActionGroup" stepKey="switchStoreView"> <argument name="Store" value="_defaultStore.name"/> <argument name="CatName" value="$$simpleSubCategory1.name$$"/> </actionGroup> @@ -137,7 +137,7 @@ <dontSeeElement selector="{{AdminUrlRewriteIndexSection.requestPathColumnValue($simpleSubCategory1.custom_attributes[url_key]$/$simpleSubCategory2.custom_attributes[url_key]$/$simpleSubCategory3.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeValue4"/> <!-- 3. Edit Category 1 for DEFAULT Store View: --> - <actionGroup ref="switchCategoryStoreView" stepKey="switchStoreView"> + <actionGroup ref="SwitchCategoryStoreViewActionGroup" stepKey="switchStoreView"> <argument name="Store" value="_defaultStore.name"/> <argument name="CatName" value="$$simpleSubCategory1.name$$"/> </actionGroup> @@ -200,7 +200,7 @@ </before> <remove keyForRemoval="switchStoreView"/> <!-- 3. Edit Category 1 for All store view: --> - <actionGroup ref="navigateToCreatedCategory" stepKey="goToCategoryPage" after="seeValue4"> + <actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="goToCategoryPage" after="seeValue4"> <argument name="Category" value="$$simpleSubCategory1$$"/> </actionGroup> <remove keyForRemoval="uncheckRedirect2"/> @@ -227,7 +227,7 @@ </before> <remove keyForRemoval="switchStoreView"/> <!-- 3. Edit Category 1 for All store view: --> - <actionGroup ref="navigateToCreatedCategory" stepKey="goToCategoryPage" after="seeValue4"> + <actionGroup ref="NavigateToCreatedCategoryActionGroup" stepKey="goToCategoryPage" after="seeValue4"> <argument name="Category" value="$$simpleSubCategory1$$"/> </actionGroup> <remove keyForRemoval="uncheckRedirect2"/> diff --git a/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml index aeb8537313fae..6cbdbe0db267d 100644 --- a/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml +++ b/app/code/Magento/Weee/Test/Mftf/Test/AdminFixedTaxValSavedForSpecificWebsiteTest.xml @@ -75,7 +75,7 @@ <actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectWebsiteInProduct"> <argument name="website" value="{{NewWebSiteData.name}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProductFirstTime"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductFirstTime"/> <!-- Add Fixed Product Tax attribute --> <comment userInput="Add Fixed Product Tax attribute" stepKey="addFixedProdTaxAttr"/> <actionGroup ref="AdminProductAddFPTValueActionGroup" stepKey="addFixedProductTaxAttr"> @@ -83,7 +83,7 @@ <argument name="stateForFPT" value="California"/> <argument name="valueForFPT" value="10"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProductSecondTime"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductSecondTime"/> <!-- Check if created tax attribute is saved --> <comment userInput="Check if created tax attribute is saved" stepKey="checkThatTaxAttributeIsSaved"/> <seeElement selector="{{AdminProductAddFPTValueSection.setTaxValueForFPT($$createProductFPTAttribute.attribute_code$$)}}" stepKey="checkIfTaxAttributeSaved"/> @@ -104,10 +104,10 @@ <seeElement selector="{{AdminProductAddFPTValueSection.setWebSiteForFPTOption($$createProductFPTAttribute.attribute_code$$, 'All Websites')}}" stepKey="checkAllWebsitesInDropDown"/> <seeElement selector="{{AdminProductAddFPTValueSection.setWebSiteForFPTOption($$createProductFPTAttribute.attribute_code$$, 'Main Website')}}" stepKey="checkMainWebsiteInDropDown"/> <seeElement selector="{{AdminProductAddFPTValueSection.setWebSiteForFPTOption($$createProductFPTAttribute.attribute_code$$, NewWebSiteData.name)}}" stepKey="checkSecondWebsitesInDropDown"/> - <actionGroup ref="unassignWebsiteFromProductActionGroup" stepKey="unassignWebsiteInProduct"> + <actionGroup ref="UnassignWebsiteFromProductActionGroup" stepKey="unassignWebsiteInProduct"> <argument name="website" value="{{_defaultWebsite.name}}"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProductThirdTime"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductThirdTime"/> <waitForPageLoad stepKey="waitForSavedProductLoad"/> <seeElement selector="{{AdminProductAddFPTValueSection.setWebSiteForFPTOption($$createProductFPTAttribute.attribute_code$$, 'All Websites')}}" stepKey="checkAllWebsitesInDropDownSecondTime"/> <dontSeeElement selector="{{AdminProductAddFPTValueSection.setWebSiteForFPTOption($$createProductFPTAttribute.attribute_code$$, 'Main Website')}}" stepKey="checkNoMainWebsiteInDropDown"/> diff --git a/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml index 3aeed3095dc45..6164f037048ba 100644 --- a/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml +++ b/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml @@ -35,12 +35,12 @@ <argument name="stateForFPT" value="California"/> <argument name="valueForFPT" value="10"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProductInitial"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductInitial"/> </before> <after> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductListing"/> <waitForPageLoad stepKey="waitForProductListingPageLoad"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetGridToDefaultKeywordSearch"/> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/> <actionGroup ref="logout" stepKey="logout"/> <deleteData createDataKey="createProductFPTAttribute" stepKey="deleteProductFPTAttribute"/> <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> @@ -56,7 +56,7 @@ </actionGroup> <!-- Step 2: Remove weee attribute options --> <click selector="{{AdminProductAddFPTValueSection.removeRowByIndex('$$createProductFPTAttribute.attribute_code$$','1')}}" stepKey="removeAttributeOption"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Assert weee attribute options are empty --> <dontSeeElement selector="{{AdminProductAddFPTValueSection.removeRowByIndex('$$createProductFPTAttribute.attribute_code$$','1')}}" stepKey="dontSeeOptions"/> </test> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml index 4e6a062c7993d..75f5a0e192080 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml @@ -33,7 +33,7 @@ <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete the first simple product --> - <actionGroup stepKey="deleteProduct1" ref="deleteProductBySku"> + <actionGroup stepKey="deleteProduct1" ref="DeleteProductBySkuActionGroup"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml index 0489ec750b7e0..3d2d229c6077a 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml @@ -36,24 +36,24 @@ </after> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad"/> - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetFiltersIfPresent"/> - <actionGroup ref="searchProductGridByKeyword" stepKey="searchProductGrid"> + <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetFiltersIfPresent"/> + <actionGroup ref="SearchProductGridByKeywordActionGroup" stepKey="searchProductGrid"> <argument name="keyword" value="_defaultProduct.name"/> </actionGroup> <click selector="{{AdminProductGridSection.selectRowBasedOnName(_defaultProduct.name)}}" stepKey="selectProductToAddImage"/> <waitForPageLoad stepKey="waitForProductEditPageLoad"/> - <actionGroup ref="addProductImage" stepKey="addImageForParentProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForParentProduct"> <argument name="image" value="MagentoLogo"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex1"/> <waitForPageLoad stepKey="waitForProductIndexPageLoad1"/> <click selector="{{AdminProductGridSection.selectRowBasedOnName(colorProductAttribute1.name)}}" stepKey="selectProductToAddImage1"/> <waitForPageLoad stepKey="waitForProductEditPageLoad1"/> - <actionGroup ref="addProductImage" stepKey="addImageForChildProduct"> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForChildProduct"> <argument name="image" value="TestImageNew"/> </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> <!--Sign in as customer --> <amOnPage url="{{StorefrontCustomerSignInPage.url}}" stepKey="amOnSignInPage"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddProductsToCartFromWishlistUsingSidebarTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddProductsToCartFromWishlistUsingSidebarTest.xml index 82c53bc343e51..432ab2b41cdf6 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddProductsToCartFromWishlistUsingSidebarTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddProductsToCartFromWishlistUsingSidebarTest.xml @@ -44,7 +44,7 @@ </actionGroup> <!-- Add product from first category to the wishlist --> <amOnPage url="{{StorefrontCategoryPage.url($$categoryFirst.name$$)}}" stepKey="navigateToCategoryFirstPage"/> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct1"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct1"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <actionGroup ref="StorefrontCustomerAddCategoryProductToWishlistActionGroup" stepKey="addSimpleProduct1ToWishlist"> @@ -52,7 +52,7 @@ </actionGroup> <!--Add product to the cart from the Wishlist using the sidebar from the second category page--> <amOnPage url="{{StorefrontCategoryPage.url($$categorySecond.name$$)}}" stepKey="navigateToCategorySecondPage"/> - <actionGroup ref="StorefrontSwitchCategoryViewToListMode" stepKey="switchCategoryViewToListMode"/> + <actionGroup ref="StorefrontSwitchCategoryViewToListModeActionGroup" stepKey="switchCategoryViewToListMode"/> <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebar" stepKey="checkSimpleProduct1InWishlistSidebar"> <argument name="productVar" value="$$simpleProduct1$$"/> </actionGroup> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleDynamicProductFromWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleDynamicProductFromWishlistTest.xml index ae65a4171d883..c2a0f2b20a028 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleDynamicProductFromWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontDeleteBundleDynamicProductFromWishlistTest.xml @@ -48,12 +48,12 @@ </createData> <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> - <actionGroup ref="goToProductPageViaID" stepKey="goToProduct"> + <actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="goToProduct"> <argument name="productId" value="$$createBundleProduct.id$$"/> </actionGroup> <scrollTo selector="{{AdminProductFormBundleSection.contentDropDown}}" stepKey="scrollToBundleSection"/> <selectOption userInput="Separately" selector="{{AdminProductFormBundleSection.shipmentType}}" stepKey="selectSeparately"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> </before> <after> <!-- Delete data --> @@ -74,7 +74,7 @@ <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductFromCategory"> <argument name="productUrlKey" value="$$createBundleProduct.custom_attributes[url_key]$$"/> </actionGroup> - + <!-- Add created product to Wishlist according to dataset and assert add product to wishlist success message --> <actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addProductToWishlist"> <argument name="productVar" value="$$createBundleProduct$$"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontRemoveProductsFromWishlistUsingSidebarTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontRemoveProductsFromWishlistUsingSidebarTest.xml index 6c73cb6708ae4..37adb23f513ab 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontRemoveProductsFromWishlistUsingSidebarTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontRemoveProductsFromWishlistUsingSidebarTest.xml @@ -45,7 +45,7 @@ </actionGroup> <!-- Add product from first category to the wishlist --> <amOnPage url="{{StorefrontCategoryPage.url($$categoryFirst.name$$)}}" stepKey="navigateToCategoryFirstPage"/> - <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct1"> + <actionGroup ref="StorefrontCheckCategorySimpleProductActionGroup" stepKey="browseAssertCategoryProduct1"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> <actionGroup ref="StorefrontCustomerAddCategoryProductToWishlistActionGroup" stepKey="addSimpleProduct1ToWishlist"> @@ -53,7 +53,7 @@ </actionGroup> <!--Remove product from the Wishlist using the sidebar from the second category page--> <amOnPage url="{{StorefrontCategoryPage.url($$categorySecond.name$$)}}" stepKey="navigateToCategorySecondPage"/> - <actionGroup ref="StorefrontSwitchCategoryViewToListMode" stepKey="switchCategoryViewToListMode"/> + <actionGroup ref="StorefrontSwitchCategoryViewToListModeActionGroup" stepKey="switchCategoryViewToListMode"/> <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebar" stepKey="checkSimpleProduct1InWishlistSidebar"> <argument name="productVar" value="$$simpleProduct1$$"/> </actionGroup> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml index af216c139e7fe..488490c2b612e 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/WishListWithDisabledProductTest.xml @@ -41,8 +41,8 @@ <openNewTab stepKey="openNewTab"/> <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminArea"/> <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="goToProductEditPage"/> - <actionGroup ref="AdminSetProductDisabled" stepKey="disableProduct"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="AdminSetProductDisabledActionGroup" stepKey="disableProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <closeTab stepKey="closeSecondTab"/> <reloadPage stepKey="refreshPage"/> <actionGroup ref="StorefrontAssertCustomerWishlistIsEmpty" stepKey="checkProductIsAbsentInWishlistIsEmpty"/> From bb860cce82ba7b720832d386047c687d6ddbc33b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Fri, 29 Nov 2019 21:19:30 +0100 Subject: [PATCH 353/595] FIX: Extract Assertion to separate file, append existing tests with assertion --- ...ductAttributeRemovedSuccessfullyActionGroup.xml | 14 ++++++++++++++ ...eProductAttributeByAttributeCodeActionGroup.xml | 1 - ...ropdownProductAttributeFromAttributeSetTest.xml | 1 + .../Mftf/Test/AdminDeleteProductAttributeTest.xml | 1 + ...xtFieldProductAttributeFromAttributeSetTest.xml | 1 + ...AdminCheckResultsOfColorAndOtherFiltersTest.xml | 1 + ...refrontElasticsearch6SearchInvalidValueTest.xml | 1 + ...eProductWithAttributesImagesAndSwatchesTest.xml | 1 + 8 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductAttributeRemovedSuccessfullyActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductAttributeRemovedSuccessfullyActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductAttributeRemovedSuccessfullyActionGroup.xml new file mode 100644 index 0000000000000..60f1e59f9871a --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertProductAttributeRemovedSuccessfullyActionGroup.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="AssertProductAttributeRemovedSuccessfullyActionGroup"> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml index 7fbf6a9b2a178..c40a0f6d31dc0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml @@ -25,6 +25,5 @@ <click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="deleteAttribute"/> <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOnDeleteButton"/> <waitForPageLoad stepKey="waitForPageLoad"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml index 84a116fb4bcd6..bded224a86563 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml @@ -52,6 +52,7 @@ <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttributeCode" value="$$attribute.attribute_code$$"/> </actionGroup> + <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <!--Confirm Attribute is not present in Product Attribute Grid --> <actionGroup ref="FilterProductAttributeByAttributeCodeActionGroup" stepKey="filterAttribute"> <argument name="ProductAttributeCode" value="$$attribute.attribute_code$$"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml index cc3242310ca11..f81b05c61a669 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml @@ -27,6 +27,7 @@ <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttributeCode" value="$$createProductAttribute.attribute_code$$"/> </actionGroup> + <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <!-- Assert the product attribute is not in the grid by Attribute code --> <actionGroup ref="FilterProductAttributeByAttributeCodeActionGroup" stepKey="filterByAttributeCode"> <argument name="ProductAttributeCode" value="$$createProductAttribute.attribute_code$$"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml index 4b97fb38e994f..f5fc104fa2b8d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml @@ -58,6 +58,7 @@ <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttributeCode" value="$$attribute.attribute_code$$"/> </actionGroup> + <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <!-- Confirm attribute is not present in product attribute grid --> <actionGroup ref="FilterProductAttributeByAttributeCodeActionGroup" stepKey="filterAttribute"> <argument name="ProductAttributeCode" value="$$attribute.attribute_code$$"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml index 84fbab5fb4f02..7324008879eda 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml @@ -104,6 +104,7 @@ <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteSecondProductAttributeByAttributeCode"> <argument name="ProductAttributeCode" value="$$createConfigProductAttribute2.attribute_code$$"/> </actionGroup> + <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <!-- Clear filters --> <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductAttributesFilter"/> <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductsGridFilter"/> diff --git a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml index 7c6ff7176ee8f..9da343b40a283 100644 --- a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml +++ b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml @@ -37,6 +37,7 @@ <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttributeCode" value="{{textProductAttribute.attribute_code}}"/> </actionGroup> + <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> <waitForPageLoad stepKey="waitForAttributePageLoad"/> <click selector="{{AdminProductAttributeGridSection.ResetFilter}}" stepKey="resetFiltersOnGrid"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml index 43205375a6330..e7fc490bbcb97 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml @@ -62,6 +62,7 @@ <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> <argument name="ProductAttributeCode" value="{{VisualSwatchProductAttribute.attribute_code}}"/> </actionGroup> + <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearAttributesGridFilter"/> <!--Clear products grid filter--> <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPage"/> From bd425997542a3a02888f243c040bd58abdbe5e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Sat, 30 Nov 2019 11:09:44 +0100 Subject: [PATCH 354/595] Refactor: Remove redundant section to avoid confusion --- .../Test/Mftf/Section/StorefrontSwitchCurrencyRatesSection.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Section/StorefrontSwitchCurrencyRatesSection.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Section/StorefrontSwitchCurrencyRatesSection.xml index ff922421e5db7..43512796a134d 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Section/StorefrontSwitchCurrencyRatesSection.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Section/StorefrontSwitchCurrencyRatesSection.xml @@ -10,7 +10,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="StorefrontSwitchCurrencyRatesSection"> <element name="currencyToggle" type="select" selector="#switcher-currency-trigger" timeout="30"/> - <element name="currencyTrigger" type="select" selector="#switcher-currency-trigger" timeout="30"/> <element name="currency" type="button" selector="//div[@id='switcher-currency-trigger']/following-sibling::ul//a[contains(text(), '{{currency}}')]" parameterized="true" timeout="10"/> <element name="selectedCurrency" type="text" selector="#switcher-currency-trigger span"/> </section> From da0de42e50758ce52f66f32867e53ec6cccb61c8 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sun, 1 Dec 2019 23:36:13 +0700 Subject: [PATCH 355/595] Cover Change Encryption key By MFTF Test. --- ...nEncryptionKeyChangeKeyAutoActionGroup.xml | 25 ++++++++++++++ ...ncryptionKeyChangeKeyManualActionGroup.xml | 26 ++++++++++++++ ...tionKeyNavigateToChangePageActionGroup.xml | 18 ++++++++++ .../Test/Mftf/Data/AdminEncryptionKeyData.xml | 18 ++++++++++ .../Page/AdminEncryptionKeyChangeFormPage.xml | 12 +++++++ .../AdminEncryptionKeyChangeFormSection.xml | 16 +++++++++ .../AdminEncryptionKeyAutoGenerateKeyTest.xml | 34 +++++++++++++++++++ ...dminEncryptionKeyManualGenerateKeyTest.xml | 34 +++++++++++++++++++ 8 files changed, 183 insertions(+) create mode 100644 app/code/Magento/EncryptionKey/Test/Mftf/ActionGroup/AdminEncryptionKeyChangeKeyAutoActionGroup.xml create mode 100644 app/code/Magento/EncryptionKey/Test/Mftf/ActionGroup/AdminEncryptionKeyChangeKeyManualActionGroup.xml create mode 100644 app/code/Magento/EncryptionKey/Test/Mftf/ActionGroup/AdminEncryptionKeyNavigateToChangePageActionGroup.xml create mode 100644 app/code/Magento/EncryptionKey/Test/Mftf/Data/AdminEncryptionKeyData.xml create mode 100644 app/code/Magento/EncryptionKey/Test/Mftf/Page/AdminEncryptionKeyChangeFormPage.xml create mode 100644 app/code/Magento/EncryptionKey/Test/Mftf/Section/AdminEncryptionKeyChangeFormSection.xml create mode 100644 app/code/Magento/EncryptionKey/Test/Mftf/Test/AdminEncryptionKeyAutoGenerateKeyTest.xml create mode 100644 app/code/Magento/EncryptionKey/Test/Mftf/Test/AdminEncryptionKeyManualGenerateKeyTest.xml diff --git a/app/code/Magento/EncryptionKey/Test/Mftf/ActionGroup/AdminEncryptionKeyChangeKeyAutoActionGroup.xml b/app/code/Magento/EncryptionKey/Test/Mftf/ActionGroup/AdminEncryptionKeyChangeKeyAutoActionGroup.xml new file mode 100644 index 0000000000000..62568ebb551e1 --- /dev/null +++ b/app/code/Magento/EncryptionKey/Test/Mftf/ActionGroup/AdminEncryptionKeyChangeKeyAutoActionGroup.xml @@ -0,0 +1,25 @@ +<?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="AdminEncryptionKeyChangeKeyAutoActionGroup"> + <annotations> + <description>Change Encryption Key Auto Generate Action Group.</description> + </annotations> + <arguments> + <argument name="encryptionKeyData" defaultValue="AdminEncryptionKeyAutoGenerate"/> + </arguments> + + <selectOption selector="{{AdminEncryptionKeyChangeFormSection.autoGenerate}}" userInput="{{encryptionKeyData.autoGenerate}}" stepKey="selectGenerateMode"/> + <click selector="{{AdminEncryptionKeyChangeFormSection.changeEncryptionKey}}" stepKey="clickChangeButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="The encryption key has been changed." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/EncryptionKey/Test/Mftf/ActionGroup/AdminEncryptionKeyChangeKeyManualActionGroup.xml b/app/code/Magento/EncryptionKey/Test/Mftf/ActionGroup/AdminEncryptionKeyChangeKeyManualActionGroup.xml new file mode 100644 index 0000000000000..0880bd07a0739 --- /dev/null +++ b/app/code/Magento/EncryptionKey/Test/Mftf/ActionGroup/AdminEncryptionKeyChangeKeyManualActionGroup.xml @@ -0,0 +1,26 @@ +<?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="AdminEncryptionKeyChangeKeyManualActionGroup"> + <annotations> + <description>Change Encryption Key - No-Auto Generate Action Group.</description> + </annotations> + <arguments> + <argument name="encryptionKeyData" defaultValue="AdminEncryptionKeyManualGenerate"/> + </arguments> + + <selectOption selector="{{AdminEncryptionKeyChangeFormSection.autoGenerate}}" userInput="{{encryptionKeyData.autoGenerate}}" stepKey="selectGenerateMode"/> + <fillField selector="{{AdminEncryptionKeyChangeFormSection.cryptKey}}" userInput="{{encryptionKeyData.cryptKey}}" stepKey="fillCryptKey"/> + <click selector="{{AdminEncryptionKeyChangeFormSection.changeEncryptionKey}}" stepKey="clickChangeButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="The encryption key has been changed." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/EncryptionKey/Test/Mftf/ActionGroup/AdminEncryptionKeyNavigateToChangePageActionGroup.xml b/app/code/Magento/EncryptionKey/Test/Mftf/ActionGroup/AdminEncryptionKeyNavigateToChangePageActionGroup.xml new file mode 100644 index 0000000000000..69847526a15a0 --- /dev/null +++ b/app/code/Magento/EncryptionKey/Test/Mftf/ActionGroup/AdminEncryptionKeyNavigateToChangePageActionGroup.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="AdminEncryptionKeyNavigateToChangePageActionGroup"> + <annotations> + <description>Navigate to change encryption key page.</description> + </annotations> + <amOnPage url="{{AdminEncryptionKeyChangeFormPage.url}}" stepKey="navigateToChangeEncryptionPage" /> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/EncryptionKey/Test/Mftf/Data/AdminEncryptionKeyData.xml b/app/code/Magento/EncryptionKey/Test/Mftf/Data/AdminEncryptionKeyData.xml new file mode 100644 index 0000000000000..ff1fe3fd2e10c --- /dev/null +++ b/app/code/Magento/EncryptionKey/Test/Mftf/Data/AdminEncryptionKeyData.xml @@ -0,0 +1,18 @@ +<?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="AdminEncryptionKeyAutoGenerate"> + <data key="autoGenerate">Yes</data> + </entity> + <entity name="AdminEncryptionKeyManualGenerate"> + <data key="autoGenerate">No</data> + <data key="cryptKey">9d469ae32ec27dfec0206cb5d63f135d</data> + </entity> +</entities> diff --git a/app/code/Magento/EncryptionKey/Test/Mftf/Page/AdminEncryptionKeyChangeFormPage.xml b/app/code/Magento/EncryptionKey/Test/Mftf/Page/AdminEncryptionKeyChangeFormPage.xml new file mode 100644 index 0000000000000..b3b8b33fc0364 --- /dev/null +++ b/app/code/Magento/EncryptionKey/Test/Mftf/Page/AdminEncryptionKeyChangeFormPage.xml @@ -0,0 +1,12 @@ +<?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="AdminEncryptionKeyChangeFormPage" url="admin/crypt_key/index" area="admin" module="Magento_EncryptionKey"> + <section name="AdminCustomerConfigSection"/> + </page> +</pages> diff --git a/app/code/Magento/EncryptionKey/Test/Mftf/Section/AdminEncryptionKeyChangeFormSection.xml b/app/code/Magento/EncryptionKey/Test/Mftf/Section/AdminEncryptionKeyChangeFormSection.xml new file mode 100644 index 0000000000000..7ce37af60fd7f --- /dev/null +++ b/app/code/Magento/EncryptionKey/Test/Mftf/Section/AdminEncryptionKeyChangeFormSection.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="AdminEncryptionKeyChangeFormSection"> + <element name="autoGenerate" type="select" selector="#generate_random"/> + <element name="cryptKey" type="input" selector="#crypt_key"/> + <element name="changeEncryptionKey" type="button" selector=".page-actions-buttons #save" timeout="10"/> + </section> +</sections> diff --git a/app/code/Magento/EncryptionKey/Test/Mftf/Test/AdminEncryptionKeyAutoGenerateKeyTest.xml b/app/code/Magento/EncryptionKey/Test/Mftf/Test/AdminEncryptionKeyAutoGenerateKeyTest.xml new file mode 100644 index 0000000000000..ded57f4aad019 --- /dev/null +++ b/app/code/Magento/EncryptionKey/Test/Mftf/Test/AdminEncryptionKeyAutoGenerateKeyTest.xml @@ -0,0 +1,34 @@ +<?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="AdminEncryptionKeyAutoGenerateKeyTest"> + <annotations> + <features value="Encryption Key"/> + <stories value="Change Encryption Key"/> + <title value="Change Encryption Key by Auto Generate Key"/> + <description value="Change Encryption Key by Auto Generate Key"/> + <severity value="CRITICAL"/> + <group value="encryption_key"/> + </annotations> + + <before> + <!--Login to Admin Area--> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminArea"/> + </before> + + <after> + <!--Logout from Admin Area--> + <actionGroup ref="logout" stepKey="logoutOfAdmin"/> + </after> + + <actionGroup ref="AdminEncryptionKeyNavigateToChangePageActionGroup" stepKey="navigateToPage"/> + <actionGroup ref="AdminEncryptionKeyChangeKeyAutoActionGroup" stepKey="changeKeyAutoGenerate"/> + </test> +</tests> diff --git a/app/code/Magento/EncryptionKey/Test/Mftf/Test/AdminEncryptionKeyManualGenerateKeyTest.xml b/app/code/Magento/EncryptionKey/Test/Mftf/Test/AdminEncryptionKeyManualGenerateKeyTest.xml new file mode 100644 index 0000000000000..f3a9849969263 --- /dev/null +++ b/app/code/Magento/EncryptionKey/Test/Mftf/Test/AdminEncryptionKeyManualGenerateKeyTest.xml @@ -0,0 +1,34 @@ +<?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="AdminEncryptionKeyManualGenerateKeyTest"> + <annotations> + <features value="Encryption Key"/> + <stories value="Change Encryption Key"/> + <title value="Change Encryption Key by Manual Key"/> + <description value="Change Encryption Key by Manual Key"/> + <severity value="CRITICAL"/> + <group value="encryption_key"/> + </annotations> + + <before> + <!--Login to Admin Area--> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminArea"/> + </before> + + <after> + <!--Logout from Admin Area--> + <actionGroup ref="logout" stepKey="logoutOfAdmin"/> + </after> + + <actionGroup ref="AdminEncryptionKeyNavigateToChangePageActionGroup" stepKey="navigateToPage"/> + <actionGroup ref="AdminEncryptionKeyChangeKeyManualActionGroup" stepKey="changeKeyManualGenerate"/> + </test> +</tests> From 23f0ced28aa4c065a771bcb0ec6368b8e85059aa Mon Sep 17 00:00:00 2001 From: Mateusz Krzeszowiak <mateusz.krzeszowiak@creativestyle.pl> Date: Sun, 1 Dec 2019 20:25:48 +0100 Subject: [PATCH 356/595] Prevent RequireJS from adding .min.js suffix to external files Fixes #25690 --- .../Magento/Framework/RequireJs/Config.php | 37 +++++++++++++------ .../RequireJs/Test/Unit/ConfigTest.php | 15 +++++--- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/lib/internal/Magento/Framework/RequireJs/Config.php b/lib/internal/Magento/Framework/RequireJs/Config.php index ae45e29f38911..f158aa8b1ebce 100644 --- a/lib/internal/Magento/Framework/RequireJs/Config.php +++ b/lib/internal/Magento/Framework/RequireJs/Config.php @@ -196,11 +196,14 @@ public function getConfigFileRelativePath() */ public function getMixinsFileRelativePath() { - $map = $this->getRepositoryFilesMap(Config::MIXINS_FILE_NAME, [ - 'area' => $this->staticContext->getAreaCode(), - 'theme' => $this->staticContext->getThemePath(), - 'locale' => $this->staticContext->getLocale(), - ]); + $map = $this->getRepositoryFilesMap( + Config::MIXINS_FILE_NAME, + [ + 'area' => $this->staticContext->getAreaCode(), + 'theme' => $this->staticContext->getThemePath(), + 'locale' => $this->staticContext->getLocale(), + ] + ); if ($map) { $relativePath = implode('/', $map) . '/' . Config::MIXINS_FILE_NAME; } else { @@ -254,11 +257,14 @@ public function getMinResolverRelativePath() */ public function getUrlResolverFileRelativePath() { - $map = $this->getRepositoryFilesMap(Config::URL_RESOLVER_FILE_NAME, [ - 'area' => $this->staticContext->getAreaCode(), - 'theme' => $this->staticContext->getThemePath(), - 'locale' => $this->staticContext->getLocale(), - ]); + $map = $this->getRepositoryFilesMap( + Config::URL_RESOLVER_FILE_NAME, + [ + 'area' => $this->staticContext->getAreaCode(), + 'theme' => $this->staticContext->getThemePath(), + 'locale' => $this->staticContext->getLocale(), + ] + ); if ($map) { $relativePath = implode('/', $map) . '/' . Config::URL_RESOLVER_FILE_NAME; } else { @@ -278,6 +284,8 @@ public function getMapFileRelativePath() } /** + * Get path to configuration file + * * @return string */ protected function getConfigFileName() @@ -286,11 +294,13 @@ protected function getConfigFileName() } /** + * Get resolver code which RequireJS fetch minified files instead + * * @return string */ public function getMinResolverCode() { - $excludes = []; + $excludes = ['url.indexOf(baseUrl) === 0']; foreach ($this->minification->getExcludes('js') as $expression) { $excludes[] = '!url.match(/' . str_replace('/', '\/', $expression) . '/)'; } @@ -298,7 +308,8 @@ public function getMinResolverCode() $result = <<<code var ctx = require.s.contexts._, - origNameToUrl = ctx.nameToUrl; + origNameToUrl = ctx.nameToUrl, + baseUrl = ctx.config.baseUrl; ctx.nameToUrl = function() { var url = origNameToUrl.apply(ctx, arguments); @@ -317,6 +328,8 @@ public function getMinResolverCode() } /** + * Get map for given file. + * * @param string $fileId * @param array $params * @return array diff --git a/lib/internal/Magento/Framework/RequireJs/Test/Unit/ConfigTest.php b/lib/internal/Magento/Framework/RequireJs/Test/Unit/ConfigTest.php index 369449d1f046a..05f040e8f406d 100644 --- a/lib/internal/Magento/Framework/RequireJs/Test/Unit/ConfigTest.php +++ b/lib/internal/Magento/Framework/RequireJs/Test/Unit/ConfigTest.php @@ -101,9 +101,13 @@ public function testGetConfig() { $this->fileReader->expects($this->any()) ->method('readAll') - ->will($this->returnCallback(function ($file) { - return $file . ' content'; - })); + ->will( + $this->returnCallback( + function ($file) { + return $file . ' content'; + } + ) + ); $fileOne = $this->createMock(\Magento\Framework\View\File::class); $fileOne->expects($this->once()) ->method('getFilename') @@ -180,11 +184,12 @@ public function testGetMinResolverCode() $expected = <<<code var ctx = require.s.contexts._, - origNameToUrl = ctx.nameToUrl; + origNameToUrl = ctx.nameToUrl, + baseUrl = ctx.config.baseUrl; ctx.nameToUrl = function() { var url = origNameToUrl.apply(ctx, arguments); - if (!url.match(/\.min\./)) { + if (url.indexOf(baseUrl) === 0&&!url.match(/\.min\./)) { url = url.replace(/(\.min)?\.js$/, '.min.js'); } return url; From db5332e5d95a12c9b32ed0e3523655c8e24d7b1f Mon Sep 17 00:00:00 2001 From: Ashna-Jahan <32352950+Ashna-Jahan@users.noreply.github.com> Date: Mon, 2 Dec 2019 14:01:23 +0530 Subject: [PATCH 357/595] Fixed issue. --- .../backend/web/css/source/forms/fields/_control-table.less | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less index b304ae1de4c5a..f8e50db60281c 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less @@ -239,11 +239,10 @@ } .product_form_product_form_advanced_pricing_modal .admin__fieldset > .admin__field > .admin__field-control { - min-width: 682px; + width: calc(~"(100%) * 0.57 - 30px"); } -.admin__control-table-wrapper { - max-width: 100%; +.product_form_product_form_advanced_pricing_modal .admin__control-table-wrapper { overflow-x: visible; overflow-y: visible; } From 666cca825d83d82ad85e44b003df56eb92c2393f Mon Sep 17 00:00:00 2001 From: Mateusz Krzeszowiak <mateusz.krzeszowiak@creativestyle.pl> Date: Tue, 26 Nov 2019 21:33:30 +0100 Subject: [PATCH 358/595] Removes hardcoded references to country selector component --- .../view/frontend/web/js/view/shipping.js | 9 +- .../base/web/js/form/element/post-code.js | 25 ++-- .../view/base/web/js/form/element/region.js | 73 +++------- .../frontend/js/view/shipping.test.js | 24 ++-- .../Ui/base/js/form/element/post-code.test.js | 75 ++++++++-- .../Ui/base/js/form/element/region.test.js | 131 ++++++++++++++++-- 6 files changed, 237 insertions(+), 100 deletions(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/shipping.js b/app/code/Magento/Checkout/view/frontend/web/js/view/shipping.js index 1c3f38a37c7f9..fe8d7782e5eae 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/shipping.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/shipping.js @@ -60,7 +60,10 @@ define([ template: 'Magento_Checkout/shipping', shippingFormTemplate: 'Magento_Checkout/shipping-address/form', shippingMethodListTemplate: 'Magento_Checkout/shipping-address/shipping-method-list', - shippingMethodItemTemplate: 'Magento_Checkout/shipping-address/shipping-method-item' + shippingMethodItemTemplate: 'Magento_Checkout/shipping-address/shipping-method-item', + imports: { + countryOptions: '${ $.parentName }.shippingAddress.shipping-address-fieldset.country_id:indexedOptions' + } }, visible: ko.observable(!quote.isVirtual()), errorValidationMessage: ko.observable(false), @@ -276,9 +279,7 @@ define([ loginFormSelector = 'form[data-role=email-with-possible-login]', emailValidationResult = customer.isLoggedIn(), field, - country = registry.get(this.parentName + '.shippingAddress.shipping-address-fieldset.country_id'), - countryIndexedOptions = country.indexedOptions, - option = countryIndexedOptions[quote.shippingAddress().countryId], + option = _.isObject(this.countryOptions) && this.countryOptions[quote.shippingAddress().countryId], messageContainer = registry.get('checkout.errors').messageContainer; if (!quote.shippingMethod()) { diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js b/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js index 0eaacdc32567b..72c352f353239 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js @@ -8,14 +8,14 @@ */ define([ 'underscore', - 'uiRegistry', './abstract' -], function (_, registry, Abstract) { +], function (_, Abstract) { 'use strict'; return Abstract.extend({ defaults: { imports: { + countryOptions: '${ $.parentName }.country_id:indexedOptions', update: '${ $.parentName }.country_id:value' } }, @@ -41,31 +41,32 @@ define([ }, /** - * @param {String} value + * Method called every time country selector's value gets changed. + * Updates all validations and requirements for certain country. + * @param {String} value - Selected country ID. */ update: function (value) { - var country = registry.get(this.parentName + '.' + 'country_id'), - options = country.indexedOptions, - option = null; + var isZipCodeOptional, + option; if (!value) { return; } - option = options[value]; + option = _.isObject(this.countryOptions) && this.countryOptions[value]; if (!option) { return; } - if (option['is_zipcode_optional']) { + isZipCodeOptional = !!option['is_zipcode_optional']; + + if (isZipCodeOptional) { this.error(false); - this.validation = _.omit(this.validation, 'required-entry'); - } else { - this.validation['required-entry'] = true; } - this.required(!option['is_zipcode_optional']); + this.validation['required-entry'] = !isZipCodeOptional; + this.required(!isZipCodeOptional); } }); }); diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/region.js b/app/code/Magento/Ui/view/base/web/js/form/element/region.js index f6eafcf49284d..cd9c2aee85dc6 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/region.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/region.js @@ -18,81 +18,54 @@ define([ defaults: { skipValidation: false, imports: { + countryOptions: '${ $.parentName }.country_id:indexedOptions', update: '${ $.parentName }.country_id:value' } }, /** - * @param {String} value + * Method called every time country selector's value gets changed. + * Updates all validations and requirements for certain country. + * @param {String} value - Selected country ID. */ update: function (value) { - var country = registry.get(this.parentName + '.' + 'country_id'), - options = country.indexedOptions, - isRegionRequired, + var isRegionRequired, option; if (!value) { return; } - option = options[value]; - if (typeof option === 'undefined') { + option = _.isObject(this.countryOptions) && this.countryOptions[value]; + + if (!option) { return; } defaultPostCodeResolver.setUseDefaultPostCode(!option['is_zipcode_optional']); - if (this.skipValidation) { - this.validation['required-entry'] = false; - this.required(false); - } else { - if (option && !option['is_region_required']) { - this.error(false); - this.validation = _.omit(this.validation, 'required-entry'); - registry.get(this.customName, function (input) { - input.validation['required-entry'] = false; - input.required(false); - }); - } else { - this.validation['required-entry'] = true; - } + if (option['is_region_visible'] === false) { + // Hide select and corresponding text input field if region must not be shown for selected country. + this.setVisible(false); - if (option && !this.options().length) { - registry.get(this.customName, function (input) { - isRegionRequired = !!option['is_region_required']; - input.validation['required-entry'] = isRegionRequired; - input.validation['validate-not-number-first'] = true; - input.required(isRegionRequired); - }); + if (this.customEntry) { // eslint-disable-line max-depth + this.toggleInput(false); } - - this.required(!!option['is_region_required']); } - }, - /** - * Filters 'initialOptions' property by 'field' and 'value' passed, - * calls 'setOptions' passing the result to it - * - * @param {*} value - * @param {String} field - */ - filter: function (value, field) { - var superFn = this._super; - - registry.get(this.parentName + '.' + 'country_id', function (country) { - var option = country.indexedOptions[value]; + isRegionRequired = !this.skipValidation && !!option['is_region_required']; - superFn.call(this, value, field); + if (!isRegionRequired) { + this.error(false); + } - if (option && option['is_region_visible'] === false) { - // hide select and corresponding text input field if region must not be shown for selected country - this.setVisible(false); + this.required(isRegionRequired); + this.validation['required-entry'] = isRegionRequired; - if (this.customEntry) {// eslint-disable-line max-depth - this.toggleInput(false); - } - } + registry.get(this.customName, function (input) { + input.required(isRegionRequired); + input.validation['required-entry'] = isRegionRequired; + input.validation['validate-not-number-first'] = !this.options().length; }.bind(this)); } }); diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/view/shipping.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/view/shipping.test.js index 9b9b1ce5b1614..46d9e1974bdb7 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/view/shipping.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/view/shipping.test.js @@ -174,16 +174,13 @@ define(['squire', 'ko', 'jquery', 'uiRegistry', 'jquery/validate'], function (Sq describe('"validateShippingInformation" method', function () { it('Check method call on negative cases.', function () { + /* jscs:disable */ var country = { - 'indexedOptions': { - 'AD': - { - label: 'Andorra', - labeltitle: 'Andorra', - value: 'AD' - } - } + on: function () {}, + get: function () {}, + set: function () {} }; + /* jscs:enable */ registry.set('test.shippingAddress.shipping-address-fieldset.country_id', country); registry.set('checkout.errors', {}); @@ -202,9 +199,20 @@ define(['squire', 'ko', 'jquery', 'uiRegistry', 'jquery/validate'], function (Sq expect(obj.validateShippingInformation()).toBeFalsy(); }); it('Check method call on positive case.', function () { + /* jscs:disable */ + var country = { + on: function () {}, + get: function () {}, + set: function () {} + }; + /* jscs:enable */ + $('body').append('<form data-role="email-with-possible-login">' + '<input type="text" name="username" />' + '</form>'); + + registry.set('test.shippingAddress.shipping-address-fieldset.country_id', country); + registry.set('checkout.errors', {}); obj.source = { get: jasmine.createSpy().and.returnValue(true), set: jasmine.createSpy(), diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/post-code.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/post-code.test.js index 96bca1bbd8c6b..d369d66a92225 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/post-code.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/post-code.test.js @@ -47,22 +47,71 @@ define([ }); describe('update method', function () { - it('check for default', function () { - var value = 'Value', - country = { - indexedOptions: { - 'Value': { - 'is_zipcode_optional': true - } - } - }; - - spyOn(mocks['Magento_Ui/js/lib/registry/registry'], 'get').and.returnValue(country); + it('makes field optional when there is no corresponding country', function () { + var value = 'Value'; + + model.countryOptions = {}; + + model.update(value); + + expect(model.required()).toEqual(false); + }); + + it('makes field optional when post code is optional for certain country', function () { + var value = 'Value'; + + model.countryOptions = { + 'Value': { + 'is_zipcode_optional': true + } + }; + model.update(value); - expect(mocks['Magento_Ui/js/lib/registry/registry'].get).toHaveBeenCalled(); - expect(model.error()).toEqual(false); + expect(model.required()).toEqual(false); }); + + it('removes field required validation when post code is optional for certain country', function () { + var value = 'Value'; + + model.countryOptions = { + 'Value': { + 'is_zipcode_optional': true + } + }; + + model.update(value); + + expect(model.validation['required-entry']).toBeFalsy(); + }); + + it('makes field required when post code is required for certain country', function () { + var value = 'Value'; + + model.countryOptions = { + 'Value': { + 'is_zipcode_optional': false + } + }; + + model.update(value); + + expect(model.required()).toEqual(true); + }); + + it('sets field required validation when post code is required for certain country', function () { + var value = 'Value'; + + model.countryOptions = { + 'Value': { + 'is_zipcode_optional': false + } + }; + + model.update(value); + + expect(model.validation['required-entry']).toEqual(true); + }); }); }); }); diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/region.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/region.test.js index a36d3b0b7fefa..a957db5d1c119 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/region.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/element/region.test.js @@ -48,22 +48,127 @@ define([ }); describe('update method', function () { - it('check for default', function () { - var value = 'Value', - country = { - indexedOptions: { - 'Value': { - 'is_zipcode_optional': true - } - } - }; - - spyOn(mocks['Magento_Ui/js/lib/registry/registry'], 'get').and.returnValue(country); + it('makes field optional when there is no corresponding country', function () { + var value = 'Value'; + + model.countryOptions = {}; + + model.update(value); + + expect(model.required()).toEqual(false); + }); + + it('makes field optional when region is optional for certain country', function () { + var value = 'Value'; + + model.countryOptions = { + 'Value': { + 'is_region_required': false + } + }; + model.update(value); - expect(mocks['Magento_Ui/js/lib/registry/registry'].get).toHaveBeenCalled(); - expect(model.error()).toEqual(false); + expect(model.required()).toEqual(false); }); + + it('removes field required validation when region is optional for certain country', function () { + var value = 'Value'; + + model.countryOptions = { + 'Value': { + 'is_region_required': false + } + }; + + model.update(value); + + expect(model.validation['required-entry']).toBeFalsy(); + }); + + it('makes field required when region is required for certain country', function () { + var value = 'Value'; + + model.countryOptions = { + 'Value': { + 'is_region_required': true + } + }; + + model.update(value); + + expect(model.required()).toEqual(true); + }); + + it('sets field required validation when region is required for certain country', function () { + var value = 'Value'; + + model.countryOptions = { + 'Value': { + 'is_region_required': true + } + }; + + model.update(value); + + expect(model.validation['required-entry']).toEqual(true); + }); + + it('keeps region visible by default', function () { + var value = 'Value'; + + model.countryOptions = { + 'Value': {} + }; + + model.update(value); + + expect(model.visible()).toEqual(true); + }); + + it('hides region field when it should be hidden for certain country', function () { + var value = 'Value'; + + model.countryOptions = { + 'Value': { + 'is_region_visible': false + } + }; + + model.update(value); + + expect(model.visible()).toEqual(false); + }); + + it('makes field optional when validation should be skipped', function () { + var value = 'Value'; + + model.countryOptions = { + 'Value': { + 'is_region_required': true + } + }; + + model.skipValidation = true; + model.update(value); + + expect(model.required()).toEqual(false); + }); + + it('removes field validation when validation should be skipped', function () { + var value = 'Value'; + + model.countryOptions = { + 'Value': { + 'is_region_required': true + } + }; + + model.skipValidation = true; + model.update(value); + + expect(model.validation['required-entry']).toBeFalsy(); + }); }); }); }); From 7c9ca2f038d3fa8a12a496fa0b63c1c43e405cb3 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Mon, 2 Dec 2019 22:46:52 +0700 Subject: [PATCH 359/595] [Captcha] Cover Model Config by Unit Test --- .../Test/Unit/Model/Config/FontTest.php | 100 ++++++++++++++++++ .../Unit/Model/Config/Form/BackendTest.php | 100 ++++++++++++++++++ .../Unit/Model/Config/Form/FrontendTest.php | 99 +++++++++++++++++ 3 files changed, 299 insertions(+) create mode 100644 app/code/Magento/Captcha/Test/Unit/Model/Config/FontTest.php create mode 100644 app/code/Magento/Captcha/Test/Unit/Model/Config/Form/BackendTest.php create mode 100644 app/code/Magento/Captcha/Test/Unit/Model/Config/Form/FrontendTest.php diff --git a/app/code/Magento/Captcha/Test/Unit/Model/Config/FontTest.php b/app/code/Magento/Captcha/Test/Unit/Model/Config/FontTest.php new file mode 100644 index 0000000000000..fd6b59a6ad388 --- /dev/null +++ b/app/code/Magento/Captcha/Test/Unit/Model/Config/FontTest.php @@ -0,0 +1,100 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Captcha\Test\Unit\Model\Config; +use PHPUnit\Framework\TestCase; +use Magento\Captcha\Helper\Data as HelperData; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Captcha\Model\Config\Font; + +class FontTest extends TestCase +{ + /** + * @var ObjectManagerHelper + */ + private $objectManagerHelper; + + /** + * @var Font + */ + private $model; + + /** + * @var HelperData|\PHPUnit_Framework_MockObject_MockObject + */ + private $helperDataMock; + + /** + * Setup Environment For Testing + */ + protected function setUp() + { + $this->helperDataMock = $this->createMock(HelperData::class); + + $this->objectManagerHelper = new ObjectManagerHelper($this); + + $this->model = $this->objectManagerHelper->getObject( + Font::class, + [ + 'captchaData' => $this->helperDataMock + ] + ); + } + + /** + * Test toOptionArray() with data provider below + * + * @param array $fonts + * @param array $expectedResult + * @dataProvider toOptionArrayDataProvider + */ + public function testToOptionArray($fonts, $expectedResult) + { + $this->helperDataMock->expects($this->any())->method('getFonts') + ->willReturn($fonts); + + $this->assertEquals($expectedResult, $this->model->toOptionArray()); + } + + /** + * Data Provider for testing toOptionArray() + * + * @return array + */ + public function toOptionArrayDataProvider() + { + return [ + 'Empty get font' => [ + [], + [] + ], + 'Get font result' => [ + [ + 'arial' => [ + 'label' => 'Arial', + 'path' => '/www/magento/fonts/arial.ttf' + ], + 'verdana' => [ + 'label' => 'Verdana', + 'path' => '/www/magento/fonts/verdana.ttf' + ] + ], + [ + [ + 'label' => 'Arial', + 'value' => 'arial' + ], + [ + 'label' => 'Verdana', + 'value' => 'verdana' + ] + ] + ] + ]; + } +} diff --git a/app/code/Magento/Captcha/Test/Unit/Model/Config/Form/BackendTest.php b/app/code/Magento/Captcha/Test/Unit/Model/Config/Form/BackendTest.php new file mode 100644 index 0000000000000..054cc71af61bc --- /dev/null +++ b/app/code/Magento/Captcha/Test/Unit/Model/Config/Form/BackendTest.php @@ -0,0 +1,100 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Captcha\Test\Unit\Model\Config\Form; + +use Magento\Captcha\Model\Config\Form\Backend; +use PHPUnit\Framework\TestCase; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; + +class BackendTest extends TestCase +{ + /** + * @var ObjectManagerHelper + */ + private $objectManagerHelper; + + /** + * @var Backend + */ + private $model; + + /** + * @var ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $configMock; + + /** + * Setup Environment For Testing + */ + protected function setUp() + { + $this->configMock = $this->createMock(ScopeConfigInterface::class); + + $this->objectManagerHelper = new ObjectManagerHelper($this); + + $this->model = $this->objectManagerHelper->getObject( + Backend::class, + [ + 'config' => $this->configMock + ] + ); + } + + /** + * Test toOptionArray() with data provider below + * + * @param string|array $config + * @param array $expectedResult + * @dataProvider toOptionArrayDataProvider + */ + public function testToOptionArray($config, $expectedResult) + { + $this->configMock->expects($this->any())->method('getValue') + ->with('captcha/backend/areas', 'default') + ->willReturn($config); + + $this->assertEquals($expectedResult, $this->model->toOptionArray()); + } + + /** + * Data Provider for testing toOptionArray() + * + * @return array + */ + public function toOptionArrayDataProvider() + { + return [ + 'Empty captcha backend areas' => [ + '', + [] + ], + 'With two captcha backend area' => [ + [ + 'backend_login' => [ + 'label' => 'Admin Login' + ], + 'backend_forgotpassword' => [ + 'label' => 'Admin Forgot Password' + ] + ], + [ + [ + 'label' => 'Admin Login', + 'value' => 'backend_login' + ], + [ + 'label' => 'Admin Forgot Password', + 'value' => 'backend_forgotpassword' + ] + ] + ] + ]; + } +} diff --git a/app/code/Magento/Captcha/Test/Unit/Model/Config/Form/FrontendTest.php b/app/code/Magento/Captcha/Test/Unit/Model/Config/Form/FrontendTest.php new file mode 100644 index 0000000000000..25681ac975cef --- /dev/null +++ b/app/code/Magento/Captcha/Test/Unit/Model/Config/Form/FrontendTest.php @@ -0,0 +1,99 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Captcha\Test\Unit\Model\Config\Form; +use Magento\Captcha\Model\Config\Form\Frontend; +use PHPUnit\Framework\TestCase; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; + +class FrontendTest extends TestCase +{ + /** + * @var ObjectManagerHelper + */ + private $objectManagerHelper; + + /** + * @var Frontend + */ + private $model; + + /** + * @var ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $configMock; + + /** + * Setup Environment For Testing + */ + protected function setUp() + { + $this->configMock = $this->createMock(ScopeConfigInterface::class); + + $this->objectManagerHelper = new ObjectManagerHelper($this); + + $this->model = $this->objectManagerHelper->getObject( + Frontend::class, + [ + 'config' => $this->configMock + ] + ); + } + + /** + * Test toOptionArray() with data provider below + * + * @param string|array $config + * @param array $expectedResult + * @dataProvider toOptionArrayDataProvider + */ + public function testToOptionArray($config, $expectedResult) + { + $this->configMock->expects($this->any())->method('getValue') + ->with('captcha/frontend/areas', 'default') + ->willReturn($config); + + $this->assertEquals($expectedResult, $this->model->toOptionArray()); + } + + /** + * Data Provider for testing toOptionArray() + * + * @return array + */ + public function toOptionArrayDataProvider() + { + return [ + 'Empty captcha frontend areas' => [ + '', + [] + ], + 'With two captcha frontend area' => [ + [ + 'product_sendtofriend_form' => [ + 'label' => 'Send To Friend Form' + ], + 'sales_rule_coupon_request' => [ + 'label' => 'Applying coupon code' + ] + ], + [ + [ + 'label' => 'Send To Friend Form', + 'value' => 'product_sendtofriend_form' + ], + [ + 'label' => 'Applying coupon code', + 'value' => 'sales_rule_coupon_request' + ] + ] + ] + ]; + } +} From 3b27be628e5d1b94a83bcfba1d84e7e172360d43 Mon Sep 17 00:00:00 2001 From: Roman Hanin <rganin@adobe.com> Date: Mon, 2 Dec 2019 11:57:24 -0600 Subject: [PATCH 360/595] B2B-271: Remove Ship To field from Order Search --- .../Magento/Sales/view/frontend/templates/order/history.phtml | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/code/Magento/Sales/view/frontend/templates/order/history.phtml b/app/code/Magento/Sales/view/frontend/templates/order/history.phtml index ef56ad69dcb1b..746d02a668a87 100644 --- a/app/code/Magento/Sales/view/frontend/templates/order/history.phtml +++ b/app/code/Magento/Sales/view/frontend/templates/order/history.phtml @@ -19,7 +19,6 @@ <th scope="col" class="col id"><?= $block->escapeHtml(__('Order #')) ?></th> <th scope="col" class="col date"><?= $block->escapeHtml(__('Date')) ?></th> <?= $block->getChildHtml('extra.column.header') ?> - <th scope="col" class="col shipping"><?= $block->escapeHtml(__('Ship To')) ?></th> <th scope="col" class="col total"><?= $block->escapeHtml(__('Order Total')) ?></th> <th scope="col" class="col status"><?= $block->escapeHtml(__('Status')) ?></th> <th scope="col" class="col actions"><?= $block->escapeHtml(__('Action')) ?></th> @@ -35,7 +34,6 @@ <?php $extra->setOrder($_order); ?> <?= $extra->getChildHtml() ?> <?php endif; ?> - <td data-th="<?= $block->escapeHtml(__('Ship To')) ?>" class="col shipping"><?= $_order->getShippingAddress() ? $block->escapeHtml($_order->getShippingAddress()->getName()) : ' ' ?></td> <td data-th="<?= $block->escapeHtml(__('Order Total')) ?>" class="col total"><?= /* @noEscape */ $_order->formatPrice($_order->getGrandTotal()) ?></td> <td data-th="<?= $block->escapeHtml(__('Status')) ?>" class="col status"><?= $block->escapeHtml($_order->getStatusLabel()) ?></td> <td data-th="<?= $block->escapeHtml(__('Actions')) ?>" class="col actions"> From 28542922e9914d169ddb41ce1f83ce44cc063982 Mon Sep 17 00:00:00 2001 From: Dmytro Voskoboinikov <voskoboi@adobe.com> Date: Mon, 2 Dec 2019 15:06:05 -0600 Subject: [PATCH 361/595] MC-23177: Update of Moment.js library --- lib/web/moment.js | 557 +--------------------------------------------- 1 file changed, 6 insertions(+), 551 deletions(-) diff --git a/lib/web/moment.js b/lib/web/moment.js index d34d1c6329e59..ee598a90a83f0 100644 --- a/lib/web/moment.js +++ b/lib/web/moment.js @@ -1,551 +1,6 @@ -//! moment.js -//! version : 2.17.1 -//! authors : Tim Wood, Iskren Chernev, Moment.js contributors -//! license : MIT -//! momentjs.com -!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return od.apply(null,arguments)} -// This is done to register the method called with moment() -// without creating circular dependencies. - function b(a){od=a}function c(a){return a instanceof Array||"[object Array]"===Object.prototype.toString.call(a)}function d(a){ -// IE8 will treat undefined and null as object if it wasn't for -// input != null - return null!=a&&"[object Object]"===Object.prototype.toString.call(a)}function e(a){var b;for(b in a) -// even if its not own property I'd still call it non-empty - return!1;return!0}function f(a){return"number"==typeof a||"[object Number]"===Object.prototype.toString.call(a)}function g(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function h(a,b){var c,d=[];for(c=0;c<a.length;++c)d.push(b(a[c],c));return d}function i(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function j(a,b){for(var c in b)i(b,c)&&(a[c]=b[c]);return i(b,"toString")&&(a.toString=b.toString),i(b,"valueOf")&&(a.valueOf=b.valueOf),a}function k(a,b,c,d){return rb(a,b,c,d,!0).utc()}function l(){ -// We need to deep clone this object. - return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null}}function m(a){return null==a._pf&&(a._pf=l()),a._pf}function n(a){if(null==a._isValid){var b=m(a),c=qd.call(b.parsedDateParts,function(a){return null!=a}),d=!isNaN(a._d.getTime())&&b.overflow<0&&!b.empty&&!b.invalidMonth&&!b.invalidWeekday&&!b.nullInput&&!b.invalidFormat&&!b.userInvalidated&&(!b.meridiem||b.meridiem&&c);if(a._strict&&(d=d&&0===b.charsLeftOver&&0===b.unusedTokens.length&&void 0===b.bigHour),null!=Object.isFrozen&&Object.isFrozen(a))return d;a._isValid=d}return a._isValid}function o(a){var b=k(NaN);return null!=a?j(m(b),a):m(b).userInvalidated=!0,b}function p(a){return void 0===a}function q(a,b){var c,d,e;if(p(b._isAMomentObject)||(a._isAMomentObject=b._isAMomentObject),p(b._i)||(a._i=b._i),p(b._f)||(a._f=b._f),p(b._l)||(a._l=b._l),p(b._strict)||(a._strict=b._strict),p(b._tzm)||(a._tzm=b._tzm),p(b._isUTC)||(a._isUTC=b._isUTC),p(b._offset)||(a._offset=b._offset),p(b._pf)||(a._pf=m(b)),p(b._locale)||(a._locale=b._locale),rd.length>0)for(c in rd)d=rd[c],e=b[d],p(e)||(a[d]=e);return a} -// Moment prototype object - function r(b){q(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)), -// Prevent infinite loop in case updateOffset creates new moment -// objects. - sd===!1&&(sd=!0,a.updateOffset(this),sd=!1)}function s(a){return a instanceof r||null!=a&&null!=a._isAMomentObject}function t(a){return a<0?Math.ceil(a)||0:Math.floor(a)}function u(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=t(b)),c} -// compare two arrays, return the number of differences - function v(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;d<e;d++)(c&&a[d]!==b[d]||!c&&u(a[d])!==u(b[d]))&&g++;return g+f}function w(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function x(b,c){var d=!0;return j(function(){if(null!=a.deprecationHandler&&a.deprecationHandler(null,b),d){for(var e,f=[],g=0;g<arguments.length;g++){if(e="","object"==typeof arguments[g]){e+="\n["+g+"] ";for(var h in arguments[0])e+=h+": "+arguments[0][h]+", ";e=e.slice(0,-2)}else e=arguments[g];f.push(e)}w(b+"\nArguments: "+Array.prototype.slice.call(f).join("")+"\n"+(new Error).stack),d=!1}return c.apply(this,arguments)},c)}function y(b,c){null!=a.deprecationHandler&&a.deprecationHandler(b,c),td[b]||(w(c),td[b]=!0)}function z(a){return a instanceof Function||"[object Function]"===Object.prototype.toString.call(a)}function A(a){var b,c;for(c in a)b=a[c],z(b)?this[c]=b:this["_"+c]=b;this._config=a, -// Lenient ordinal parsing accepts just a number in addition to -// number + (possibly) stuff coming from _ordinalParseLenient. - this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function B(a,b){var c,e=j({},a);for(c in b)i(b,c)&&(d(a[c])&&d(b[c])?(e[c]={},j(e[c],a[c]),j(e[c],b[c])):null!=b[c]?e[c]=b[c]:delete e[c]);for(c in a)i(a,c)&&!i(b,c)&&d(a[c])&&( -// make sure changes to properties don't modify parent config - e[c]=j({},e[c]));return e}function C(a){null!=a&&this.set(a)}function D(a,b,c){var d=this._calendar[a]||this._calendar.sameElse;return z(d)?d.call(b,c):d}function E(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function F(){return this._invalidDate}function G(a){return this._ordinal.replace("%d",a)}function H(a,b,c,d){var e=this._relativeTime[c];return z(e)?e(a,b,c,d):e.replace(/%d/i,a)}function I(a,b){var c=this._relativeTime[a>0?"future":"past"];return z(c)?c(b):c.replace(/%s/i,b)}function J(a,b){var c=a.toLowerCase();Dd[c]=Dd[c+"s"]=Dd[b]=a}function K(a){return"string"==typeof a?Dd[a]||Dd[a.toLowerCase()]:void 0}function L(a){var b,c,d={};for(c in a)i(a,c)&&(b=K(c),b&&(d[b]=a[c]));return d}function M(a,b){Ed[a]=b}function N(a){var b=[];for(var c in a)b.push({unit:c,priority:Ed[c]});return b.sort(function(a,b){return a.priority-b.priority}),b}function O(b,c){return function(d){return null!=d?(Q(this,b,d),a.updateOffset(this,c),this):P(this,b)}}function P(a,b){return a.isValid()?a._d["get"+(a._isUTC?"UTC":"")+b]():NaN}function Q(a,b,c){a.isValid()&&a._d["set"+(a._isUTC?"UTC":"")+b](c)} -// MOMENTS - function R(a){return a=K(a),z(this[a])?this[a]():this}function S(a,b){if("object"==typeof a){a=L(a);for(var c=N(a),d=0;d<c.length;d++)this[c[d].unit](a[c[d].unit])}else if(a=K(a),z(this[a]))return this[a](b);return this}function T(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d} -// token: 'M' -// padded: ['MM', 2] -// ordinal: 'Mo' -// callback: function () { this.month() + 1 } - function U(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(Id[a]=e),b&&(Id[b[0]]=function(){return T(e.apply(this,arguments),b[1],b[2])}),c&&(Id[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function V(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function W(a){var b,c,d=a.match(Fd);for(b=0,c=d.length;b<c;b++)Id[d[b]]?d[b]=Id[d[b]]:d[b]=V(d[b]);return function(b){var e,f="";for(e=0;e<c;e++)f+=d[e]instanceof Function?d[e].call(b,a):d[e];return f}} -// format date using native date object - function X(a,b){return a.isValid()?(b=Y(b,a.localeData()),Hd[b]=Hd[b]||W(b),Hd[b](a)):a.localeData().invalidDate()}function Y(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Gd.lastIndex=0;d>=0&&Gd.test(a);)a=a.replace(Gd,c),Gd.lastIndex=0,d-=1;return a}function Z(a,b,c){$d[a]=z(b)?b:function(a,d){return a&&c?c:b}}function $(a,b){return i($d,a)?$d[a](b._strict,b._locale):new RegExp(_(a))} -// Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript - function _(a){return aa(a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}))}function aa(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function ba(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),f(b)&&(d=function(a,c){c[b]=u(a)}),c=0;c<a.length;c++)_d[a[c]]=d}function ca(a,b){ba(a,function(a,c,d,e){d._w=d._w||{},b(a,d._w,d,e)})}function da(a,b,c){null!=b&&i(_d,a)&&_d[a](b,c._a,c,a)}function ea(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function fa(a,b){return a?c(this._months)?this._months[a.month()]:this._months[(this._months.isFormat||ke).test(b)?"format":"standalone"][a.month()]:this._months}function ga(a,b){return a?c(this._monthsShort)?this._monthsShort[a.month()]:this._monthsShort[ke.test(b)?"format":"standalone"][a.month()]:this._monthsShort}function ha(a,b,c){var d,e,f,g=a.toLocaleLowerCase();if(!this._monthsParse)for( -// this is not used - this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],d=0;d<12;++d)f=k([2e3,d]),this._shortMonthsParse[d]=this.monthsShort(f,"").toLocaleLowerCase(),this._longMonthsParse[d]=this.months(f,"").toLocaleLowerCase();return c?"MMM"===b?(e=je.call(this._shortMonthsParse,g),e!==-1?e:null):(e=je.call(this._longMonthsParse,g),e!==-1?e:null):"MMM"===b?(e=je.call(this._shortMonthsParse,g),e!==-1?e:(e=je.call(this._longMonthsParse,g),e!==-1?e:null)):(e=je.call(this._longMonthsParse,g),e!==-1?e:(e=je.call(this._shortMonthsParse,g),e!==-1?e:null))}function ia(a,b,c){var d,e,f;if(this._monthsParseExact)return ha.call(this,a,b,c); -// TODO: add sorting -// Sorting makes sure if one month (or abbr) is a prefix of another -// see sorting in computeMonthsParse - for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),d=0;d<12;d++){ -// test the regex - if( -// make the regex if we don't have it already - e=k([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}} -// MOMENTS - function ja(a,b){var c;if(!a.isValid()) -// No op - return a;if("string"==typeof b)if(/^\d+$/.test(b))b=u(b);else -// TODO: Another silent failure? - if(b=a.localeData().monthsParse(b),!f(b))return a;return c=Math.min(a.date(),ea(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a}function ka(b){return null!=b?(ja(this,b),a.updateOffset(this,!0),this):P(this,"Month")}function la(){return ea(this.year(),this.month())}function ma(a){return this._monthsParseExact?(i(this,"_monthsRegex")||oa.call(this),a?this._monthsShortStrictRegex:this._monthsShortRegex):(i(this,"_monthsShortRegex")||(this._monthsShortRegex=ne),this._monthsShortStrictRegex&&a?this._monthsShortStrictRegex:this._monthsShortRegex)}function na(a){return this._monthsParseExact?(i(this,"_monthsRegex")||oa.call(this),a?this._monthsStrictRegex:this._monthsRegex):(i(this,"_monthsRegex")||(this._monthsRegex=oe),this._monthsStrictRegex&&a?this._monthsStrictRegex:this._monthsRegex)}function oa(){function a(a,b){return b.length-a.length}var b,c,d=[],e=[],f=[];for(b=0;b<12;b++) -// make the regex if we don't have it already - c=k([2e3,b]),d.push(this.monthsShort(c,"")),e.push(this.months(c,"")),f.push(this.months(c,"")),f.push(this.monthsShort(c,""));for( -// Sorting makes sure if one month (or abbr) is a prefix of another it -// will match the longer piece. - d.sort(a),e.sort(a),f.sort(a),b=0;b<12;b++)d[b]=aa(d[b]),e[b]=aa(e[b]);for(b=0;b<24;b++)f[b]=aa(f[b]);this._monthsRegex=new RegExp("^("+f.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+d.join("|")+")","i")} -// HELPERS - function pa(a){return qa(a)?366:365}function qa(a){return a%4===0&&a%100!==0||a%400===0}function ra(){return qa(this.year())}function sa(a,b,c,d,e,f,g){ -//can't just apply() to create a date: -//http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply - var h=new Date(a,b,c,d,e,f,g); -//the date constructor remaps years 0-99 to 1900-1999 - return a<100&&a>=0&&isFinite(h.getFullYear())&&h.setFullYear(a),h}function ta(a){var b=new Date(Date.UTC.apply(null,arguments)); -//the Date.UTC function remaps years 0-99 to 1900-1999 - return a<100&&a>=0&&isFinite(b.getUTCFullYear())&&b.setUTCFullYear(a),b} -// start-of-first-week - start-of-year - function ua(a,b,c){var// first-week day -- which january is always in the first week (4 for iso, 1 for other) - d=7+b-c, -// first-week day local weekday -- which local weekday is fwd - e=(7+ta(a,0,d).getUTCDay()-b)%7;return-e+d-1} -//http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday - function va(a,b,c,d,e){var f,g,h=(7+c-d)%7,i=ua(a,d,e),j=1+7*(b-1)+h+i;return j<=0?(f=a-1,g=pa(f)+j):j>pa(a)?(f=a+1,g=j-pa(a)):(f=a,g=j),{year:f,dayOfYear:g}}function wa(a,b,c){var d,e,f=ua(a.year(),b,c),g=Math.floor((a.dayOfYear()-f-1)/7)+1;return g<1?(e=a.year()-1,d=g+xa(e,b,c)):g>xa(a.year(),b,c)?(d=g-xa(a.year(),b,c),e=a.year()+1):(e=a.year(),d=g),{week:d,year:e}}function xa(a,b,c){var d=ua(a,b,c),e=ua(a+1,b,c);return(pa(a)-d+e)/7} -// HELPERS -// LOCALES - function ya(a){return wa(a,this._week.dow,this._week.doy).week}function za(){return this._week.dow}function Aa(){return this._week.doy} -// MOMENTS - function Ba(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function Ca(a){var b=wa(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")} -// HELPERS - function Da(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function Ea(a,b){return"string"==typeof a?b.weekdaysParse(a)%7||7:isNaN(a)?null:a}function Fa(a,b){return a?c(this._weekdays)?this._weekdays[a.day()]:this._weekdays[this._weekdays.isFormat.test(b)?"format":"standalone"][a.day()]:this._weekdays}function Ga(a){return a?this._weekdaysShort[a.day()]:this._weekdaysShort}function Ha(a){return a?this._weekdaysMin[a.day()]:this._weekdaysMin}function Ia(a,b,c){var d,e,f,g=a.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],d=0;d<7;++d)f=k([2e3,1]).day(d),this._minWeekdaysParse[d]=this.weekdaysMin(f,"").toLocaleLowerCase(),this._shortWeekdaysParse[d]=this.weekdaysShort(f,"").toLocaleLowerCase(),this._weekdaysParse[d]=this.weekdays(f,"").toLocaleLowerCase();return c?"dddd"===b?(e=je.call(this._weekdaysParse,g),e!==-1?e:null):"ddd"===b?(e=je.call(this._shortWeekdaysParse,g),e!==-1?e:null):(e=je.call(this._minWeekdaysParse,g),e!==-1?e:null):"dddd"===b?(e=je.call(this._weekdaysParse,g),e!==-1?e:(e=je.call(this._shortWeekdaysParse,g),e!==-1?e:(e=je.call(this._minWeekdaysParse,g),e!==-1?e:null))):"ddd"===b?(e=je.call(this._shortWeekdaysParse,g),e!==-1?e:(e=je.call(this._weekdaysParse,g),e!==-1?e:(e=je.call(this._minWeekdaysParse,g),e!==-1?e:null))):(e=je.call(this._minWeekdaysParse,g),e!==-1?e:(e=je.call(this._weekdaysParse,g),e!==-1?e:(e=je.call(this._shortWeekdaysParse,g),e!==-1?e:null)))}function Ja(a,b,c){var d,e,f;if(this._weekdaysParseExact)return Ia.call(this,a,b,c);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;d<7;d++){ -// test the regex - if( -// make the regex if we don't have it already - e=k([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(e,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(e,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(e,"").replace(".",".?")+"$","i")),this._weekdaysParse[d]||(f="^"+this.weekdays(e,"")+"|^"+this.weekdaysShort(e,"")+"|^"+this.weekdaysMin(e,""),this._weekdaysParse[d]=new RegExp(f.replace(".",""),"i")),c&&"dddd"===b&&this._fullWeekdaysParse[d].test(a))return d;if(c&&"ddd"===b&&this._shortWeekdaysParse[d].test(a))return d;if(c&&"dd"===b&&this._minWeekdaysParse[d].test(a))return d;if(!c&&this._weekdaysParse[d].test(a))return d}} -// MOMENTS - function Ka(a){if(!this.isValid())return null!=a?this:NaN;var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Da(a,this.localeData()),this.add(a-b,"d")):b}function La(a){if(!this.isValid())return null!=a?this:NaN;var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function Ma(a){if(!this.isValid())return null!=a?this:NaN; -// behaves the same as moment#day except -// as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) -// as a setter, sunday should belong to the previous week. - if(null!=a){var b=Ea(a,this.localeData());return this.day(this.day()%7?b:b-7)}return this.day()||7}function Na(a){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||Qa.call(this),a?this._weekdaysStrictRegex:this._weekdaysRegex):(i(this,"_weekdaysRegex")||(this._weekdaysRegex=ue),this._weekdaysStrictRegex&&a?this._weekdaysStrictRegex:this._weekdaysRegex)}function Oa(a){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||Qa.call(this),a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(i(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ve),this._weekdaysShortStrictRegex&&a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Pa(a){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||Qa.call(this),a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(i(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=we),this._weekdaysMinStrictRegex&&a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Qa(){function a(a,b){return b.length-a.length}var b,c,d,e,f,g=[],h=[],i=[],j=[];for(b=0;b<7;b++) -// make the regex if we don't have it already - c=k([2e3,1]).day(b),d=this.weekdaysMin(c,""),e=this.weekdaysShort(c,""),f=this.weekdays(c,""),g.push(d),h.push(e),i.push(f),j.push(d),j.push(e),j.push(f);for( -// Sorting makes sure if one weekday (or abbr) is a prefix of another it -// will match the longer piece. - g.sort(a),h.sort(a),i.sort(a),j.sort(a),b=0;b<7;b++)h[b]=aa(h[b]),i[b]=aa(i[b]),j[b]=aa(j[b]);this._weekdaysRegex=new RegExp("^("+j.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+g.join("|")+")","i")} -// FORMATTING - function Ra(){return this.hours()%12||12}function Sa(){return this.hours()||24}function Ta(a,b){U(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})} -// PARSING - function Ua(a,b){return b._meridiemParse} -// LOCALES - function Va(a){ -// IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays -// Using charAt should be more compatible. - return"p"===(a+"").toLowerCase().charAt(0)}function Wa(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function Xa(a){return a?a.toLowerCase().replace("_","-"):a} -// pick the locale from the array -// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each -// substring from most specific to least, but move to the next array item if it's a more specific variant than the current root - function Ya(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Xa(a[f]).split("-"),b=e.length,c=Xa(a[f+1]),c=c?c.split("-"):null;b>0;){if(d=Za(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&v(e,c,!0)>=b-1) -//the next array item is better than a shallower substring of this one - break;b--}f++}return null}function Za(a){var b=null; -// TODO: Find a better way to register and load all the locales in Node - if(!Be[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=xe._abbr,require("./locale/"+a), -// because defineLocale currently also sets the global locale, we -// want to undo that for lazy loaded locales - $a(b)}catch(a){}return Be[a]} -// This function will load locale and then set the global locale. If -// no arguments are passed in, it will simply return the current global -// locale key. - function $a(a,b){var c; -// moment.duration._locale = moment._locale = data; - return a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}function _a(a,b){if(null!==b){var c=Ae;if(b.abbr=a,null!=Be[a])y("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),c=Be[a]._config;else if(null!=b.parentLocale){if(null==Be[b.parentLocale])return Ce[b.parentLocale]||(Ce[b.parentLocale]=[]),Ce[b.parentLocale].push({name:a,config:b}),null;c=Be[b.parentLocale]._config} -// backwards compat for now: also set the locale -// make sure we set the locale AFTER all child locales have been -// created, so we won't end up with the child locale set. - return Be[a]=new C(B(c,b)),Ce[a]&&Ce[a].forEach(function(a){_a(a.name,a.config)}),$a(a),Be[a]} -// useful for testing - return delete Be[a],null}function ab(a,b){if(null!=b){var c,d=Ae; -// MERGE - null!=Be[a]&&(d=Be[a]._config),b=B(d,b),c=new C(b),c.parentLocale=Be[a],Be[a]=c, -// backwards compat for now: also set the locale - $a(a)}else -// pass null for config to unupdate, useful for tests - null!=Be[a]&&(null!=Be[a].parentLocale?Be[a]=Be[a].parentLocale:null!=Be[a]&&delete Be[a]);return Be[a]} -// returns locale data - function bb(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return xe;if(!c(a)){if( -//short-circuit everything else - b=Za(a))return b;a=[a]}return Ya(a)}function cb(){return wd(Be)}function db(a){var b,c=a._a;return c&&m(a).overflow===-2&&(b=c[be]<0||c[be]>11?be:c[ce]<1||c[ce]>ea(c[ae],c[be])?ce:c[de]<0||c[de]>24||24===c[de]&&(0!==c[ee]||0!==c[fe]||0!==c[ge])?de:c[ee]<0||c[ee]>59?ee:c[fe]<0||c[fe]>59?fe:c[ge]<0||c[ge]>999?ge:-1,m(a)._overflowDayOfYear&&(b<ae||b>ce)&&(b=ce),m(a)._overflowWeeks&&b===-1&&(b=he),m(a)._overflowWeekday&&b===-1&&(b=ie),m(a).overflow=b),a} -// date from iso format - function eb(a){var b,c,d,e,f,g,h=a._i,i=De.exec(h)||Ee.exec(h);if(i){for(m(a).iso=!0,b=0,c=Ge.length;b<c;b++)if(Ge[b][1].exec(i[1])){e=Ge[b][0],d=Ge[b][2]!==!1;break}if(null==e)return void(a._isValid=!1);if(i[3]){for(b=0,c=He.length;b<c;b++)if(He[b][1].exec(i[3])){ -// match[2] should be 'T' or space - f=(i[2]||" ")+He[b][0];break}if(null==f)return void(a._isValid=!1)}if(!d&&null!=f)return void(a._isValid=!1);if(i[4]){if(!Fe.exec(i[4]))return void(a._isValid=!1);g="Z"}a._f=e+(f||"")+(g||""),kb(a)}else a._isValid=!1} -// date from iso format or fallback - function fb(b){var c=Ie.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))} -// Pick the first defined of two or three arguments. - function gb(a,b,c){return null!=a?a:null!=b?b:c}function hb(b){ -// hooks is actually the exported moment object - var c=new Date(a.now());return b._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()]} -// convert an array to a date. -// the array should mirror the parameters below -// note: all values past the year are optional and will default to the lowest possible value. -// [year, month, day , hour, minute, second, millisecond] - function ib(a){var b,c,d,e,f=[];if(!a._d){ -// Default to current date. -// * if no year, month, day of month are given, default to today -// * if day of month is given, default month and year -// * if month is given, default only year -// * if year is given, don't default anything - for(d=hb(a), -//compute day of the year from weeks and weekdays - a._w&&null==a._a[ce]&&null==a._a[be]&&jb(a), -//if the day of the year is set, figure out what it is - a._dayOfYear&&(e=gb(a._a[ae],d[ae]),a._dayOfYear>pa(e)&&(m(a)._overflowDayOfYear=!0),c=ta(e,0,a._dayOfYear),a._a[be]=c.getUTCMonth(),a._a[ce]=c.getUTCDate()),b=0;b<3&&null==a._a[b];++b)a._a[b]=f[b]=d[b]; -// Zero out whatever was not defaulted, including time - for(;b<7;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b]; -// Check for 24:00:00.000 - 24===a._a[de]&&0===a._a[ee]&&0===a._a[fe]&&0===a._a[ge]&&(a._nextDay=!0,a._a[de]=0),a._d=(a._useUTC?ta:sa).apply(null,f), -// Apply timezone offset from input. The actual utcOffset can be changed -// with parseZone. - null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[de]=24)}}function jb(a){var b,c,d,e,f,g,h,i;if(b=a._w,null!=b.GG||null!=b.W||null!=b.E)f=1,g=4, -// TODO: We need to take the current isoWeekYear, but that depends on -// how we interpret now (local, utc, fixed offset). So create -// a now version of current config (take local/utc/offset flags, and -// create now). - c=gb(b.GG,a._a[ae],wa(sb(),1,4).year),d=gb(b.W,1),e=gb(b.E,1),(e<1||e>7)&&(i=!0);else{f=a._locale._week.dow,g=a._locale._week.doy;var j=wa(sb(),f,g);c=gb(b.gg,a._a[ae],j.year), -// Default to current week. - d=gb(b.w,j.week),null!=b.d?( -// weekday -- low day numbers are considered next week - e=b.d,(e<0||e>6)&&(i=!0)):null!=b.e?( -// local weekday -- counting starts from begining of week - e=b.e+f,(b.e<0||b.e>6)&&(i=!0)): -// default to begining of week - e=f}d<1||d>xa(c,f,g)?m(a)._overflowWeeks=!0:null!=i?m(a)._overflowWeekday=!0:(h=va(c,d,e,f,g),a._a[ae]=h.year,a._dayOfYear=h.dayOfYear)} -// date from string and format string - function kb(b){ -// TODO: Move this to another part of the creation flow to prevent circular deps - if(b._f===a.ISO_8601)return void eb(b);b._a=[],m(b).empty=!0; -// This array is used to make a Date, either with `new Date` or `Date.UTC` - var c,d,e,f,g,h=""+b._i,i=h.length,j=0;for(e=Y(b._f,b._locale).match(Fd)||[],c=0;c<e.length;c++)f=e[c],d=(h.match($(f,b))||[])[0], -// console.log('token', token, 'parsedInput', parsedInput, -// 'regex', getParseRegexForToken(token, config)); - d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&m(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),j+=d.length), -// don't parse if it's not a known token - Id[f]?(d?m(b).empty=!1:m(b).unusedTokens.push(f),da(f,d,b)):b._strict&&!d&&m(b).unusedTokens.push(f); -// add remaining unparsed input length to the string - m(b).charsLeftOver=i-j,h.length>0&&m(b).unusedInput.push(h), -// clear _12h flag if hour is <= 12 - b._a[de]<=12&&m(b).bigHour===!0&&b._a[de]>0&&(m(b).bigHour=void 0),m(b).parsedDateParts=b._a.slice(0),m(b).meridiem=b._meridiem, -// handle meridiem - b._a[de]=lb(b._locale,b._a[de],b._meridiem),ib(b),db(b)}function lb(a,b,c){var d; -// Fallback - return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&b<12&&(b+=12),d||12!==b||(b=0),b):b} -// date from string and array of format strings - function mb(a){var b,c,d,e,f;if(0===a._f.length)return m(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;e<a._f.length;e++)f=0,b=q({},a),null!=a._useUTC&&(b._useUTC=a._useUTC),b._f=a._f[e],kb(b),n(b)&&( -// if there is any input that was not parsed add a penalty for that format - f+=m(b).charsLeftOver, -//or tokens - f+=10*m(b).unusedTokens.length,m(b).score=f,(null==d||f<d)&&(d=f,c=b));j(a,c||b)}function nb(a){if(!a._d){var b=L(a._i);a._a=h([b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],function(a){return a&&parseInt(a,10)}),ib(a)}}function ob(a){var b=new r(db(pb(a))); -// Adding is smart enough around DST - return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function pb(a){var b=a._i,d=a._f;return a._locale=a._locale||bb(a._l),null===b||void 0===d&&""===b?o({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),s(b)?new r(db(b)):(g(b)?a._d=b:c(d)?mb(a):d?kb(a):qb(a),n(a)||(a._d=null),a))}function qb(b){var d=b._i;void 0===d?b._d=new Date(a.now()):g(d)?b._d=new Date(d.valueOf()):"string"==typeof d?fb(b):c(d)?(b._a=h(d.slice(0),function(a){return parseInt(a,10)}),ib(b)):"object"==typeof d?nb(b):f(d)? -// from milliseconds - b._d=new Date(d):a.createFromInputFallback(b)}function rb(a,b,f,g,h){var i={}; -// object construction must be done this way. -// https://github.com/moment/moment/issues/1423 - return f!==!0&&f!==!1||(g=f,f=void 0),(d(a)&&e(a)||c(a)&&0===a.length)&&(a=void 0),i._isAMomentObject=!0,i._useUTC=i._isUTC=h,i._l=f,i._i=a,i._f=b,i._strict=g,ob(i)}function sb(a,b,c,d){return rb(a,b,c,d,!1)} -// Pick a moment m from moments so that m[fn](other) is true for all -// other. This relies on the function fn to be transitive. -// -// moments should either be an array of moment objects or an array, whose -// first element is an array of moment objects. - function tb(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return sb();for(d=b[0],e=1;e<b.length;++e)b[e].isValid()&&!b[e][a](d)||(d=b[e]);return d} -// TODO: Use [].sort instead? - function ub(){var a=[].slice.call(arguments,0);return tb("isBefore",a)}function vb(){var a=[].slice.call(arguments,0);return tb("isAfter",a)}function wb(a){var b=L(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0; -// representation for dateAddRemove - this._milliseconds=+k+1e3*j+// 1000 - 6e4*i+// 1000 * 60 - 1e3*h*60*60,//using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978 -// Because of dateAddRemove treats 24 hours as different from a -// day when working around DST, we need to store them separately - this._days=+g+7*f, -// It is impossible translate months into days without knowing -// which months you are are talking about, so we have to store -// it separately. - this._months=+e+3*d+12*c,this._data={},this._locale=bb(),this._bubble()}function xb(a){return a instanceof wb}function yb(a){return a<0?Math.round(-1*a)*-1:Math.round(a)} -// FORMATTING - function zb(a,b){U(a,0,0,function(){var a=this.utcOffset(),c="+";return a<0&&(a=-a,c="-"),c+T(~~(a/60),2)+b+T(~~a%60,2)})}function Ab(a,b){var c=(b||"").match(a);if(null===c)return null;var d=c[c.length-1]||[],e=(d+"").match(Me)||["-",0,0],f=+(60*e[1])+u(e[2]);return 0===f?0:"+"===e[0]?f:-f} -// Return a moment from input, that is local/utc/zone equivalent to model. - function Bb(b,c){var d,e; -// Use low-level api, because this fn is low-level api. - return c._isUTC?(d=c.clone(),e=(s(b)||g(b)?b.valueOf():sb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):sb(b).local()}function Cb(a){ -// On Firefox.24 Date#getTimezoneOffset returns a floating point. -// https://github.com/moment/moment/pull/1871 - return 15*-Math.round(a._d.getTimezoneOffset()/15)} -// MOMENTS -// keepLocalTime = true means only change the timezone, without -// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> -// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset -// +0200, so we adjust the time as needed, to be valid. -// -// Keeping the time actually adds/subtracts (one hour) -// from the actual represented time. That is why we call updateOffset -// a second time. In case it wants us to change the offset again -// _changeInProgress == true case, then we have to adjust, because -// there is no such time in the given timezone. - function Db(b,c){var d,e=this._offset||0;if(!this.isValid())return null!=b?this:NaN;if(null!=b){if("string"==typeof b){if(b=Ab(Xd,b),null===b)return this}else Math.abs(b)<16&&(b=60*b);return!this._isUTC&&c&&(d=Cb(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?Tb(this,Ob(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?e:Cb(this)}function Eb(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Fb(a){return this.utcOffset(0,a)}function Gb(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Cb(this),"m")),this}function Hb(){if(null!=this._tzm)this.utcOffset(this._tzm);else if("string"==typeof this._i){var a=Ab(Wd,this._i);null!=a?this.utcOffset(a):this.utcOffset(0,!0)}return this}function Ib(a){return!!this.isValid()&&(a=a?sb(a).utcOffset():0,(this.utcOffset()-a)%60===0)}function Jb(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Kb(){if(!p(this._isDSTShifted))return this._isDSTShifted;var a={};if(q(a,this),a=pb(a),a._a){var b=a._isUTC?k(a._a):sb(a._a);this._isDSTShifted=this.isValid()&&v(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Lb(){return!!this.isValid()&&!this._isUTC}function Mb(){return!!this.isValid()&&this._isUTC}function Nb(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Ob(a,b){var c,d,e,g=a, -// matching against regexp is expensive, do it on demand - h=null;// checks for null or undefined - return xb(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:f(a)?(g={},b?g[b]=a:g.milliseconds=a):(h=Ne.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:u(h[ce])*c,h:u(h[de])*c,m:u(h[ee])*c,s:u(h[fe])*c,ms:u(yb(1e3*h[ge]))*c}):(h=Oe.exec(a))?(c="-"===h[1]?-1:1,g={y:Pb(h[2],c),M:Pb(h[3],c),w:Pb(h[4],c),d:Pb(h[5],c),h:Pb(h[6],c),m:Pb(h[7],c),s:Pb(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=Rb(sb(g.from),sb(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new wb(g),xb(a)&&i(a,"_locale")&&(d._locale=a._locale),d}function Pb(a,b){ -// We'd normally use ~~inp for this, but unfortunately it also -// converts floats to ints. -// inp may be undefined, so careful calling replace on it. - var c=a&&parseFloat(a.replace(",",".")); -// apply sign while we're at it - return(isNaN(c)?0:c)*b}function Qb(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function Rb(a,b){var c;return a.isValid()&&b.isValid()?(b=Bb(b,a),a.isBefore(b)?c=Qb(a,b):(c=Qb(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}} -// TODO: remove 'name' arg after deprecation is removed - function Sb(a,b){return function(c,d){var e,f; -//invert the arguments, but complain about it - return null===d||isNaN(+d)||(y(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}function Tb(b,c,d,e){var f=c._milliseconds,g=yb(c._days),h=yb(c._months);b.isValid()&&(e=null==e||e,f&&b._d.setTime(b._d.valueOf()+f*d),g&&Q(b,"Date",P(b,"Date")+g*d),h&&ja(b,P(b,"Month")+h*d),e&&a.updateOffset(b,g||h))}function Ub(a,b){var c=a.diff(b,"days",!0);return c<-6?"sameElse":c<-1?"lastWeek":c<0?"lastDay":c<1?"sameDay":c<2?"nextDay":c<7?"nextWeek":"sameElse"}function Vb(b,c){ -// We want to compare the start of today, vs this. -// Getting start-of-today depends on whether we're local/utc/offset or not. - var d=b||sb(),e=Bb(d,this).startOf("day"),f=a.calendarFormat(this,e)||"sameElse",g=c&&(z(c[f])?c[f].call(this,d):c[f]);return this.format(g||this.localeData().calendar(f,this,sb(d)))}function Wb(){return new r(this)}function Xb(a,b){var c=s(a)?a:sb(a);return!(!this.isValid()||!c.isValid())&&(b=K(p(b)?"millisecond":b),"millisecond"===b?this.valueOf()>c.valueOf():c.valueOf()<this.clone().startOf(b).valueOf())}function Yb(a,b){var c=s(a)?a:sb(a);return!(!this.isValid()||!c.isValid())&&(b=K(p(b)?"millisecond":b),"millisecond"===b?this.valueOf()<c.valueOf():this.clone().endOf(b).valueOf()<c.valueOf())}function Zb(a,b,c,d){return d=d||"()",("("===d[0]?this.isAfter(a,c):!this.isBefore(a,c))&&(")"===d[1]?this.isBefore(b,c):!this.isAfter(b,c))}function $b(a,b){var c,d=s(a)?a:sb(a);return!(!this.isValid()||!d.isValid())&&(b=K(b||"millisecond"),"millisecond"===b?this.valueOf()===d.valueOf():(c=d.valueOf(),this.clone().startOf(b).valueOf()<=c&&c<=this.clone().endOf(b).valueOf()))}function _b(a,b){return this.isSame(a,b)||this.isAfter(a,b)}function ac(a,b){return this.isSame(a,b)||this.isBefore(a,b)}function bc(a,b,c){var d,e,f,g;// 1000 -// 1000 * 60 -// 1000 * 60 * 60 -// 1000 * 60 * 60 * 24, negate dst -// 1000 * 60 * 60 * 24 * 7, negate dst - return this.isValid()?(d=Bb(a,this),d.isValid()?(e=6e4*(d.utcOffset()-this.utcOffset()),b=K(b),"year"===b||"month"===b||"quarter"===b?(g=cc(this,d),"quarter"===b?g/=3:"year"===b&&(g/=12)):(f=this-d,g="second"===b?f/1e3:"minute"===b?f/6e4:"hour"===b?f/36e5:"day"===b?(f-e)/864e5:"week"===b?(f-e)/6048e5:f),c?g:t(g)):NaN):NaN}function cc(a,b){ -// difference in months - var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()), -// b is in (anchor - 1 month, anchor + 1 month) - f=a.clone().add(e,"months"); -//check for negative zero, return zero if negative zero -// linear across the month -// linear across the month - return b-f<0?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)||0}function dc(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ec(){var a=this.clone().utc();return 0<a.year()&&a.year()<=9999?z(Date.prototype.toISOString)?this.toDate().toISOString():X(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):X(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}/** - * Return a human readable representation of a moment that can - * also be evaluated to get a new moment which is the same - * - * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects - */ - function fc(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var a="moment",b="";this.isLocal()||(a=0===this.utcOffset()?"moment.utc":"moment.parseZone",b="Z");var c="["+a+'("]',d=0<this.year()&&this.year()<=9999?"YYYY":"YYYYYY",e="-MM-DD[T]HH:mm:ss.SSS",f=b+'[")]';return this.format(c+d+e+f)}function gc(b){b||(b=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var c=X(this,b);return this.localeData().postformat(c)}function hc(a,b){return this.isValid()&&(s(a)&&a.isValid()||sb(a).isValid())?Ob({to:this,from:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function ic(a){return this.from(sb(),a)}function jc(a,b){return this.isValid()&&(s(a)&&a.isValid()||sb(a).isValid())?Ob({from:this,to:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function kc(a){return this.to(sb(),a)} -// If passed a locale key, it will set the locale for this -// instance. Otherwise, it will return the locale configuration -// variables for this instance. - function lc(a){var b;return void 0===a?this._locale._abbr:(b=bb(a),null!=b&&(this._locale=b),this)}function mc(){return this._locale}function nc(a){ -// the following switch intentionally omits break keywords -// to utilize falling through the cases. - switch(a=K(a)){case"year":this.month(0);/* falls through */ - case"quarter":case"month":this.date(1);/* falls through */ - case"week":case"isoWeek":case"day":case"date":this.hours(0);/* falls through */ - case"hour":this.minutes(0);/* falls through */ - case"minute":this.seconds(0);/* falls through */ - case"second":this.milliseconds(0)} -// weeks are a special case -// quarters are also special - return"week"===a&&this.weekday(0),"isoWeek"===a&&this.isoWeekday(1),"quarter"===a&&this.month(3*Math.floor(this.month()/3)),this}function oc(a){ -// 'date' is an alias for 'day', so it should be considered as such. - return a=K(a),void 0===a||"millisecond"===a?this:("date"===a&&(a="day"),this.startOf(a).add(1,"isoWeek"===a?"week":a).subtract(1,"ms"))}function pc(){return this._d.valueOf()-6e4*(this._offset||0)}function qc(){return Math.floor(this.valueOf()/1e3)}function rc(){return new Date(this.valueOf())}function sc(){var a=this;return[a.year(),a.month(),a.date(),a.hour(),a.minute(),a.second(),a.millisecond()]}function tc(){var a=this;return{years:a.year(),months:a.month(),date:a.date(),hours:a.hours(),minutes:a.minutes(),seconds:a.seconds(),milliseconds:a.milliseconds()}}function uc(){ -// new Date(NaN).toJSON() === null - return this.isValid()?this.toISOString():null}function vc(){return n(this)}function wc(){return j({},m(this))}function xc(){return m(this).overflow}function yc(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function zc(a,b){U(0,[a,a.length],0,b)} -// MOMENTS - function Ac(a){return Ec.call(this,a,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Bc(a){return Ec.call(this,a,this.isoWeek(),this.isoWeekday(),1,4)}function Cc(){return xa(this.year(),1,4)}function Dc(){var a=this.localeData()._week;return xa(this.year(),a.dow,a.doy)}function Ec(a,b,c,d,e){var f;return null==a?wa(this,d,e).year:(f=xa(a,d,e),b>f&&(b=f),Fc.call(this,a,b,c,d,e))}function Fc(a,b,c,d,e){var f=va(a,b,c,d,e),g=ta(f.year,0,f.dayOfYear);return this.year(g.getUTCFullYear()),this.month(g.getUTCMonth()),this.date(g.getUTCDate()),this} -// MOMENTS - function Gc(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)} -// HELPERS -// MOMENTS - function Hc(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function Ic(a,b){b[ge]=u(1e3*("0."+a))} -// MOMENTS - function Jc(){return this._isUTC?"UTC":""}function Kc(){return this._isUTC?"Coordinated Universal Time":""}function Lc(a){return sb(1e3*a)}function Mc(){return sb.apply(null,arguments).parseZone()}function Nc(a){return a}function Oc(a,b,c,d){var e=bb(),f=k().set(d,b);return e[c](f,a)}function Pc(a,b,c){if(f(a)&&(b=a,a=void 0),a=a||"",null!=b)return Oc(a,b,c,"month");var d,e=[];for(d=0;d<12;d++)e[d]=Oc(a,d,c,"month");return e} -// () -// (5) -// (fmt, 5) -// (fmt) -// (true) -// (true, 5) -// (true, fmt, 5) -// (true, fmt) - function Qc(a,b,c,d){"boolean"==typeof a?(f(b)&&(c=b,b=void 0),b=b||""):(b=a,c=b,a=!1,f(b)&&(c=b,b=void 0),b=b||"");var e=bb(),g=a?e._week.dow:0;if(null!=c)return Oc(b,(c+g)%7,d,"day");var h,i=[];for(h=0;h<7;h++)i[h]=Oc(b,(h+g)%7,d,"day");return i}function Rc(a,b){return Pc(a,b,"months")}function Sc(a,b){return Pc(a,b,"monthsShort")}function Tc(a,b,c){return Qc(a,b,c,"weekdays")}function Uc(a,b,c){return Qc(a,b,c,"weekdaysShort")}function Vc(a,b,c){return Qc(a,b,c,"weekdaysMin")}function Wc(){var a=this._data;return this._milliseconds=Ze(this._milliseconds),this._days=Ze(this._days),this._months=Ze(this._months),a.milliseconds=Ze(a.milliseconds),a.seconds=Ze(a.seconds),a.minutes=Ze(a.minutes),a.hours=Ze(a.hours),a.months=Ze(a.months),a.years=Ze(a.years),this}function Xc(a,b,c,d){var e=Ob(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()} -// supports only 2.0-style add(1, 's') or add(duration) - function Yc(a,b){return Xc(this,a,b,1)} -// supports only 2.0-style subtract(1, 's') or subtract(duration) - function Zc(a,b){return Xc(this,a,b,-1)}function $c(a){return a<0?Math.floor(a):Math.ceil(a)}function _c(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data; -// if we have a mix of positive and negative values, bubble down first -// check: https://github.com/moment/moment/issues/2166 -// The following code bubbles up values, see the tests for -// examples of what that means. -// convert days to months -// 12 months -> 1 year - return f>=0&&g>=0&&h>=0||f<=0&&g<=0&&h<=0||(f+=864e5*$c(bd(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=t(f/1e3),i.seconds=a%60,b=t(a/60),i.minutes=b%60,c=t(b/60),i.hours=c%24,g+=t(c/24),e=t(ad(g)),h+=e,g-=$c(bd(e)),d=t(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function ad(a){ -// 400 years have 146097 days (taking into account leap year rules) -// 400 years have 12 months === 4800 - return 4800*a/146097}function bd(a){ -// the reverse of daysToMonths - return 146097*a/4800}function cd(a){var b,c,d=this._milliseconds;if(a=K(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+ad(b),"month"===a?c:c/12;switch( -// handle milliseconds separately because of floating point math errors (issue #1867) - b=this._days+Math.round(bd(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3; -// Math.floor prevents floating point math errors here - case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}} -// TODO: Use this.as('ms')? - function dd(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*u(this._months/12)}function ed(a){return function(){return this.as(a)}}function fd(a){return a=K(a),this[a+"s"]()}function gd(a){return function(){return this._data[a]}}function hd(){return t(this.days()/7)} -// helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize - function id(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function jd(a,b,c){var d=Ob(a).abs(),e=of(d.as("s")),f=of(d.as("m")),g=of(d.as("h")),h=of(d.as("d")),i=of(d.as("M")),j=of(d.as("y")),k=e<pf.s&&["s",e]||f<=1&&["m"]||f<pf.m&&["mm",f]||g<=1&&["h"]||g<pf.h&&["hh",g]||h<=1&&["d"]||h<pf.d&&["dd",h]||i<=1&&["M"]||i<pf.M&&["MM",i]||j<=1&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,id.apply(null,k)} -// This function allows you to set the rounding function for relative time strings - function kd(a){return void 0===a?of:"function"==typeof a&&(of=a,!0)} -// This function allows you to set a threshold for relative time strings - function ld(a,b){return void 0!==pf[a]&&(void 0===b?pf[a]:(pf[a]=b,!0))}function md(a){var b=this.localeData(),c=jd(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function nd(){ -// for ISO strings we do not use the normal bubbling rules: -// * milliseconds bubble up until they become hours -// * days do not bubble at all -// * months bubble up until they become years -// This is because there is no context-free conversion between hours and days -// (think of clock changes) -// and also not between days and months (28-31 days per month) - var a,b,c,d=qf(this._milliseconds)/1e3,e=qf(this._days),f=qf(this._months); -// 3600 seconds -> 60 minutes -> 1 hour - a=t(d/60),b=t(a/60),d%=60,a%=60, -// 12 months -> 1 year - c=t(f/12),f%=12; -// inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js - var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(m<0?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}var od,pd;pd=Array.prototype.some?Array.prototype.some:function(a){for(var b=Object(this),c=b.length>>>0,d=0;d<c;d++)if(d in b&&a.call(this,b[d],d,b))return!0;return!1};var qd=pd,rd=a.momentProperties=[],sd=!1,td={};a.suppressDeprecationWarnings=!1,a.deprecationHandler=null;var ud;ud=Object.keys?Object.keys:function(a){var b,c=[];for(b in a)i(a,b)&&c.push(b);return c};var vd,wd=ud,xd={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},yd={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},zd="Invalid date",Ad="%d",Bd=/\d{1,2}/,Cd={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Dd={},Ed={},Fd=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Gd=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Hd={},Id={},Jd=/\d/,Kd=/\d\d/,Ld=/\d{3}/,Md=/\d{4}/,Nd=/[+-]?\d{6}/,Od=/\d\d?/,Pd=/\d\d\d\d?/,Qd=/\d\d\d\d\d\d?/,Rd=/\d{1,3}/,Sd=/\d{1,4}/,Td=/[+-]?\d{1,6}/,Ud=/\d+/,Vd=/[+-]?\d+/,Wd=/Z|[+-]\d\d:?\d\d/gi,Xd=/Z|[+-]\d\d(?::?\d\d)?/gi,Yd=/[+-]?\d+(\.\d{1,3})?/,Zd=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,$d={},_d={},ae=0,be=1,ce=2,de=3,ee=4,fe=5,ge=6,he=7,ie=8;vd=Array.prototype.indexOf?Array.prototype.indexOf:function(a){ -// I know - var b;for(b=0;b<this.length;++b)if(this[b]===a)return b;return-1};var je=vd; -// FORMATTING - U("M",["MM",2],"Mo",function(){return this.month()+1}),U("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),U("MMMM",0,0,function(a){return this.localeData().months(this,a)}), -// ALIASES - J("month","M"), -// PRIORITY - M("month",8), -// PARSING - Z("M",Od),Z("MM",Od,Kd),Z("MMM",function(a,b){return b.monthsShortRegex(a)}),Z("MMMM",function(a,b){return b.monthsRegex(a)}),ba(["M","MM"],function(a,b){b[be]=u(a)-1}),ba(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict); -// if we didn't find a month name, mark the date as invalid. - null!=e?b[be]=e:m(c).invalidMonth=a}); -// LOCALES - var ke=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,le="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),me="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),ne=Zd,oe=Zd; -// FORMATTING - U("Y",0,0,function(){var a=this.year();return a<=9999?""+a:"+"+a}),U(0,["YY",2],0,function(){return this.year()%100}),U(0,["YYYY",4],0,"year"),U(0,["YYYYY",5],0,"year"),U(0,["YYYYYY",6,!0],0,"year"), -// ALIASES - J("year","y"), -// PRIORITIES - M("year",1), -// PARSING - Z("Y",Vd),Z("YY",Od,Kd),Z("YYYY",Sd,Md),Z("YYYYY",Td,Nd),Z("YYYYYY",Td,Nd),ba(["YYYYY","YYYYYY"],ae),ba("YYYY",function(b,c){c[ae]=2===b.length?a.parseTwoDigitYear(b):u(b)}),ba("YY",function(b,c){c[ae]=a.parseTwoDigitYear(b)}),ba("Y",function(a,b){b[ae]=parseInt(a,10)}), -// HOOKS - a.parseTwoDigitYear=function(a){return u(a)+(u(a)>68?1900:2e3)}; -// MOMENTS - var pe=O("FullYear",!0); -// FORMATTING - U("w",["ww",2],"wo","week"),U("W",["WW",2],"Wo","isoWeek"), -// ALIASES - J("week","w"),J("isoWeek","W"), -// PRIORITIES - M("week",5),M("isoWeek",5), -// PARSING - Z("w",Od),Z("ww",Od,Kd),Z("W",Od),Z("WW",Od,Kd),ca(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=u(a)});var qe={dow:0,// Sunday is the first day of the week. - doy:6}; -// FORMATTING - U("d",0,"do","day"),U("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),U("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),U("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),U("e",0,0,"weekday"),U("E",0,0,"isoWeekday"), -// ALIASES - J("day","d"),J("weekday","e"),J("isoWeekday","E"), -// PRIORITY - M("day",11),M("weekday",11),M("isoWeekday",11), -// PARSING - Z("d",Od),Z("e",Od),Z("E",Od),Z("dd",function(a,b){return b.weekdaysMinRegex(a)}),Z("ddd",function(a,b){return b.weekdaysShortRegex(a)}),Z("dddd",function(a,b){return b.weekdaysRegex(a)}),ca(["dd","ddd","dddd"],function(a,b,c,d){var e=c._locale.weekdaysParse(a,d,c._strict); -// if we didn't get a weekday name, mark the date as invalid - null!=e?b.d=e:m(c).invalidWeekday=a}),ca(["d","e","E"],function(a,b,c,d){b[d]=u(a)}); -// LOCALES - var re="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),se="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),te="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ue=Zd,ve=Zd,we=Zd;U("H",["HH",2],0,"hour"),U("h",["hh",2],0,Ra),U("k",["kk",2],0,Sa),U("hmm",0,0,function(){return""+Ra.apply(this)+T(this.minutes(),2)}),U("hmmss",0,0,function(){return""+Ra.apply(this)+T(this.minutes(),2)+T(this.seconds(),2)}),U("Hmm",0,0,function(){return""+this.hours()+T(this.minutes(),2)}),U("Hmmss",0,0,function(){return""+this.hours()+T(this.minutes(),2)+T(this.seconds(),2)}),Ta("a",!0),Ta("A",!1), -// ALIASES - J("hour","h"), -// PRIORITY - M("hour",13),Z("a",Ua),Z("A",Ua),Z("H",Od),Z("h",Od),Z("HH",Od,Kd),Z("hh",Od,Kd),Z("hmm",Pd),Z("hmmss",Qd),Z("Hmm",Pd),Z("Hmmss",Qd),ba(["H","HH"],de),ba(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),ba(["h","hh"],function(a,b,c){b[de]=u(a),m(c).bigHour=!0}),ba("hmm",function(a,b,c){var d=a.length-2;b[de]=u(a.substr(0,d)),b[ee]=u(a.substr(d)),m(c).bigHour=!0}),ba("hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[de]=u(a.substr(0,d)),b[ee]=u(a.substr(d,2)),b[fe]=u(a.substr(e)),m(c).bigHour=!0}),ba("Hmm",function(a,b,c){var d=a.length-2;b[de]=u(a.substr(0,d)),b[ee]=u(a.substr(d))}),ba("Hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[de]=u(a.substr(0,d)),b[ee]=u(a.substr(d,2)),b[fe]=u(a.substr(e))});var xe,ye=/[ap]\.?m?\.?/i,ze=O("Hours",!0),Ae={calendar:xd,longDateFormat:yd,invalidDate:zd,ordinal:Ad,ordinalParse:Bd,relativeTime:Cd,months:le,monthsShort:me,week:qe,weekdays:re,weekdaysMin:te,weekdaysShort:se,meridiemParse:ye},Be={},Ce={},De=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ee=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Fe=/Z|[+-]\d\d(?::?\d\d)?/,Ge=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/], -// YYYYMM is NOT allowed by the standard - ["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],He=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Ie=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=x("value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}), -// constant that refers to the ISO standard - a.ISO_8601=function(){};var Je=x("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var a=sb.apply(null,arguments);return this.isValid()&&a.isValid()?a<this?this:a:o()}),Ke=x("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var a=sb.apply(null,arguments);return this.isValid()&&a.isValid()?a>this?this:a:o()}),Le=function(){return Date.now?Date.now():+new Date};zb("Z",":"),zb("ZZ",""), -// PARSING - Z("Z",Xd),Z("ZZ",Xd),ba(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=Ab(Xd,a)}); -// HELPERS -// timezone chunker -// '+10:00' > ['10', '00'] -// '-1530' > ['-15', '30'] - var Me=/([\+\-]|\d\d)/gi; -// HOOKS -// This function will be called whenever a moment is mutated. -// It is intended to keep the offset in sync with the timezone. - a.updateOffset=function(){}; -// ASP.NET json date format regex - var Ne=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Oe=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;Ob.fn=wb.prototype;var Pe=Sb(1,"add"),Qe=Sb(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",a.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Re=x("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)}); -// FORMATTING - U(0,["gg",2],0,function(){return this.weekYear()%100}),U(0,["GG",2],0,function(){return this.isoWeekYear()%100}),zc("gggg","weekYear"),zc("ggggg","weekYear"),zc("GGGG","isoWeekYear"),zc("GGGGG","isoWeekYear"), -// ALIASES - J("weekYear","gg"),J("isoWeekYear","GG"), -// PRIORITY - M("weekYear",1),M("isoWeekYear",1), -// PARSING - Z("G",Vd),Z("g",Vd),Z("GG",Od,Kd),Z("gg",Od,Kd),Z("GGGG",Sd,Md),Z("gggg",Sd,Md),Z("GGGGG",Td,Nd),Z("ggggg",Td,Nd),ca(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=u(a)}),ca(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}), -// FORMATTING - U("Q",0,"Qo","quarter"), -// ALIASES - J("quarter","Q"), -// PRIORITY - M("quarter",7), -// PARSING - Z("Q",Jd),ba("Q",function(a,b){b[be]=3*(u(a)-1)}), -// FORMATTING - U("D",["DD",2],"Do","date"), -// ALIASES - J("date","D"), -// PRIOROITY - M("date",9), -// PARSING - Z("D",Od),Z("DD",Od,Kd),Z("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),ba(["D","DD"],ce),ba("Do",function(a,b){b[ce]=u(a.match(Od)[0],10)}); -// MOMENTS - var Se=O("Date",!0); -// FORMATTING - U("DDD",["DDDD",3],"DDDo","dayOfYear"), -// ALIASES - J("dayOfYear","DDD"), -// PRIORITY - M("dayOfYear",4), -// PARSING - Z("DDD",Rd),Z("DDDD",Ld),ba(["DDD","DDDD"],function(a,b,c){c._dayOfYear=u(a)}), -// FORMATTING - U("m",["mm",2],0,"minute"), -// ALIASES - J("minute","m"), -// PRIORITY - M("minute",14), -// PARSING - Z("m",Od),Z("mm",Od,Kd),ba(["m","mm"],ee); -// MOMENTS - var Te=O("Minutes",!1); -// FORMATTING - U("s",["ss",2],0,"second"), -// ALIASES - J("second","s"), -// PRIORITY - M("second",15), -// PARSING - Z("s",Od),Z("ss",Od,Kd),ba(["s","ss"],fe); -// MOMENTS - var Ue=O("Seconds",!1); -// FORMATTING - U("S",0,0,function(){return~~(this.millisecond()/100)}),U(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),U(0,["SSS",3],0,"millisecond"),U(0,["SSSS",4],0,function(){return 10*this.millisecond()}),U(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),U(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),U(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),U(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),U(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}), -// ALIASES - J("millisecond","ms"), -// PRIORITY - M("millisecond",16), -// PARSING - Z("S",Rd,Jd),Z("SS",Rd,Kd),Z("SSS",Rd,Ld);var Ve;for(Ve="SSSS";Ve.length<=9;Ve+="S")Z(Ve,Ud);for(Ve="S";Ve.length<=9;Ve+="S")ba(Ve,Ic); -// MOMENTS - var We=O("Milliseconds",!1); -// FORMATTING - U("z",0,0,"zoneAbbr"),U("zz",0,0,"zoneName");var Xe=r.prototype;Xe.add=Pe,Xe.calendar=Vb,Xe.clone=Wb,Xe.diff=bc,Xe.endOf=oc,Xe.format=gc,Xe.from=hc,Xe.fromNow=ic,Xe.to=jc,Xe.toNow=kc,Xe.get=R,Xe.invalidAt=xc,Xe.isAfter=Xb,Xe.isBefore=Yb,Xe.isBetween=Zb,Xe.isSame=$b,Xe.isSameOrAfter=_b,Xe.isSameOrBefore=ac,Xe.isValid=vc,Xe.lang=Re,Xe.locale=lc,Xe.localeData=mc,Xe.max=Ke,Xe.min=Je,Xe.parsingFlags=wc,Xe.set=S,Xe.startOf=nc,Xe.subtract=Qe,Xe.toArray=sc,Xe.toObject=tc,Xe.toDate=rc,Xe.toISOString=ec,Xe.inspect=fc,Xe.toJSON=uc,Xe.toString=dc,Xe.unix=qc,Xe.valueOf=pc,Xe.creationData=yc, -// Year - Xe.year=pe,Xe.isLeapYear=ra, -// Week Year - Xe.weekYear=Ac,Xe.isoWeekYear=Bc, -// Quarter - Xe.quarter=Xe.quarters=Gc, -// Month - Xe.month=ka,Xe.daysInMonth=la, -// Week - Xe.week=Xe.weeks=Ba,Xe.isoWeek=Xe.isoWeeks=Ca,Xe.weeksInYear=Dc,Xe.isoWeeksInYear=Cc, -// Day - Xe.date=Se,Xe.day=Xe.days=Ka,Xe.weekday=La,Xe.isoWeekday=Ma,Xe.dayOfYear=Hc, -// Hour - Xe.hour=Xe.hours=ze, -// Minute - Xe.minute=Xe.minutes=Te, -// Second - Xe.second=Xe.seconds=Ue, -// Millisecond - Xe.millisecond=Xe.milliseconds=We, -// Offset - Xe.utcOffset=Db,Xe.utc=Fb,Xe.local=Gb,Xe.parseZone=Hb,Xe.hasAlignedHourOffset=Ib,Xe.isDST=Jb,Xe.isLocal=Lb,Xe.isUtcOffset=Mb,Xe.isUtc=Nb,Xe.isUTC=Nb, -// Timezone - Xe.zoneAbbr=Jc,Xe.zoneName=Kc, -// Deprecations - Xe.dates=x("dates accessor is deprecated. Use date instead.",Se),Xe.months=x("months accessor is deprecated. Use month instead",ka),Xe.years=x("years accessor is deprecated. Use year instead",pe),Xe.zone=x("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Eb),Xe.isDSTShifted=x("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Kb);var Ye=C.prototype;Ye.calendar=D,Ye.longDateFormat=E,Ye.invalidDate=F,Ye.ordinal=G,Ye.preparse=Nc,Ye.postformat=Nc,Ye.relativeTime=H,Ye.pastFuture=I,Ye.set=A, -// Month - Ye.months=fa,Ye.monthsShort=ga,Ye.monthsParse=ia,Ye.monthsRegex=na,Ye.monthsShortRegex=ma, -// Week - Ye.week=ya,Ye.firstDayOfYear=Aa,Ye.firstDayOfWeek=za, -// Day of Week - Ye.weekdays=Fa,Ye.weekdaysMin=Ha,Ye.weekdaysShort=Ga,Ye.weekdaysParse=Ja,Ye.weekdaysRegex=Na,Ye.weekdaysShortRegex=Oa,Ye.weekdaysMinRegex=Pa, -// Hours - Ye.isPM=Va,Ye.meridiem=Wa,$a("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===u(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}), -// Side effect imports - a.lang=x("moment.lang is deprecated. Use moment.locale instead.",$a),a.langData=x("moment.langData is deprecated. Use moment.localeData instead.",bb);var Ze=Math.abs,$e=ed("ms"),_e=ed("s"),af=ed("m"),bf=ed("h"),cf=ed("d"),df=ed("w"),ef=ed("M"),ff=ed("y"),gf=gd("milliseconds"),hf=gd("seconds"),jf=gd("minutes"),kf=gd("hours"),lf=gd("days"),mf=gd("months"),nf=gd("years"),of=Math.round,pf={s:45,// seconds to minute - m:45,// minutes to hour - h:22,// hours to day - d:26,// days to month - M:11},qf=Math.abs,rf=wb.prototype; -// Deprecations -// Side effect imports -// FORMATTING -// PARSING -// Side effect imports - return rf.abs=Wc,rf.add=Yc,rf.subtract=Zc,rf.as=cd,rf.asMilliseconds=$e,rf.asSeconds=_e,rf.asMinutes=af,rf.asHours=bf,rf.asDays=cf,rf.asWeeks=df,rf.asMonths=ef,rf.asYears=ff,rf.valueOf=dd,rf._bubble=_c,rf.get=fd,rf.milliseconds=gf,rf.seconds=hf,rf.minutes=jf,rf.hours=kf,rf.days=lf,rf.weeks=hd,rf.months=mf,rf.years=nf,rf.humanize=md,rf.toISOString=nd,rf.toString=nd,rf.toJSON=nd,rf.locale=lc,rf.localeData=mc,rf.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",nd),rf.lang=Re,U("X",0,0,"unix"),U("x",0,0,"valueOf"),Z("x",Vd),Z("X",Yd),ba("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),ba("x",function(a,b,c){c._d=new Date(u(a))}),a.version="2.17.1",b(sb),a.fn=Xe,a.min=ub,a.max=vb,a.now=Le,a.utc=k,a.unix=Lc,a.months=Rc,a.isDate=g,a.locale=$a,a.invalid=o,a.duration=Ob,a.isMoment=s,a.weekdays=Tc,a.parseZone=Mc,a.localeData=bb,a.isDuration=xb,a.monthsShort=Sc,a.weekdaysMin=Vc,a.defineLocale=_a,a.updateLocale=ab,a.locales=cb,a.weekdaysShort=Uc,a.normalizeUnits=K,a.relativeTimeRounding=kd,a.relativeTimeThreshold=ld,a.calendarFormat=Ub,a.prototype=Xe,a}); \ No newline at end of file +/** + * Moment.js + * + * Version: 2.24.0 + */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var e,i;function c(){return e.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function u(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function l(e){return void 0===e}function h(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function d(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var n,s=[];for(n=0;n<e.length;++n)s.push(t(e[n],n));return s}function m(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _(e,t){for(var n in t)m(t,n)&&(e[n]=t[n]);return m(t,"toString")&&(e.toString=t.toString),m(t,"valueOf")&&(e.valueOf=t.valueOf),e}function y(e,t,n,s){return Tt(e,t,n,s,!0).utc()}function g(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function v(e){if(null==e._isValid){var t=g(e),n=i.call(t.parsedDateParts,function(e){return null!=e}),s=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return s;e._isValid=s}return e._isValid}function p(e){var t=y(NaN);return null!=e?_(g(t),e):g(t).userInvalidated=!0,t}i=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1};var r=c.momentProperties=[];function w(e,t){var n,s,i;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=g(t)),l(t._locale)||(e._locale=t._locale),0<r.length)for(n=0;n<r.length;n++)l(i=t[s=r[n]])||(e[s]=i);return e}var t=!1;function M(e){w(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===t&&(t=!0,c.updateOffset(this),t=!1)}function k(e){return e instanceof M||null!=e&&null!=e._isAMomentObject}function S(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function D(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=S(t)),n}function a(e,t,n){var s,i=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),a=0;for(s=0;s<i;s++)(n&&e[s]!==t[s]||!n&&D(e[s])!==D(t[s]))&&a++;return a+r}function Y(e){!1===c.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function n(i,r){var a=!0;return _(function(){if(null!=c.deprecationHandler&&c.deprecationHandler(null,i),a){for(var e,t=[],n=0;n<arguments.length;n++){if(e="","object"==typeof arguments[n]){for(var s in e+="\n["+n+"] ",arguments[0])e+=s+": "+arguments[0][s]+", ";e=e.slice(0,-2)}else e=arguments[n];t.push(e)}Y(i+"\nArguments: "+Array.prototype.slice.call(t).join("")+"\n"+(new Error).stack),a=!1}return r.apply(this,arguments)},r)}var s,O={};function T(e,t){null!=c.deprecationHandler&&c.deprecationHandler(e,t),O[e]||(Y(t),O[e]=!0)}function b(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function x(e,t){var n,s=_({},e);for(n in t)m(t,n)&&(u(e[n])&&u(t[n])?(s[n]={},_(s[n],e[n]),_(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)m(e,n)&&!m(t,n)&&u(e[n])&&(s[n]=_({},s[n]));return s}function P(e){null!=e&&this.set(e)}c.suppressDeprecationWarnings=!1,c.deprecationHandler=null,s=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)m(e,t)&&n.push(t);return n};var W={};function C(e,t){var n=e.toLowerCase();W[n]=W[n+"s"]=W[t]=e}function H(e){return"string"==typeof e?W[e]||W[e.toLowerCase()]:void 0}function R(e){var t,n,s={};for(n in e)m(e,n)&&(t=H(n))&&(s[t]=e[n]);return s}var U={};function F(e,t){U[e]=t}function L(e,t,n){var s=""+Math.abs(e),i=t-s.length;return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}var N=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,G=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,V={},E={};function I(e,t,n,s){var i=s;"string"==typeof s&&(i=function(){return this[s]()}),e&&(E[e]=i),t&&(E[t[0]]=function(){return L(i.apply(this,arguments),t[1],t[2])}),n&&(E[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function A(e,t){return e.isValid()?(t=j(t,e.localeData()),V[t]=V[t]||function(s){var e,i,t,r=s.match(N);for(e=0,i=r.length;e<i;e++)E[r[e]]?r[e]=E[r[e]]:r[e]=(t=r[e]).match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"");return function(e){var t,n="";for(t=0;t<i;t++)n+=b(r[t])?r[t].call(e,s):r[t];return n}}(t),V[t](e)):e.localeData().invalidDate()}function j(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(G.lastIndex=0;0<=n&&G.test(e);)e=e.replace(G,s),G.lastIndex=0,n-=1;return e}var Z=/\d/,z=/\d\d/,$=/\d{3}/,q=/\d{4}/,J=/[+-]?\d{6}/,B=/\d\d?/,Q=/\d\d\d\d?/,X=/\d\d\d\d\d\d?/,K=/\d{1,3}/,ee=/\d{1,4}/,te=/[+-]?\d{1,6}/,ne=/\d+/,se=/[+-]?\d+/,ie=/Z|[+-]\d\d:?\d\d/gi,re=/Z|[+-]\d\d(?::?\d\d)?/gi,ae=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,oe={};function ue(e,n,s){oe[e]=b(n)?n:function(e,t){return e&&s?s:n}}function le(e,t){return m(oe,e)?oe[e](t._strict,t._locale):new RegExp(he(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i})))}function he(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var de={};function ce(e,n){var t,s=n;for("string"==typeof e&&(e=[e]),h(n)&&(s=function(e,t){t[n]=D(e)}),t=0;t<e.length;t++)de[e[t]]=s}function fe(e,i){ce(e,function(e,t,n,s){n._w=n._w||{},i(e,n._w,n,s)})}var me=0,_e=1,ye=2,ge=3,ve=4,pe=5,we=6,Me=7,ke=8;function Se(e){return De(e)?366:365}function De(e){return e%4==0&&e%100!=0||e%400==0}I("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),I(0,["YY",2],0,function(){return this.year()%100}),I(0,["YYYY",4],0,"year"),I(0,["YYYYY",5],0,"year"),I(0,["YYYYYY",6,!0],0,"year"),C("year","y"),F("year",1),ue("Y",se),ue("YY",B,z),ue("YYYY",ee,q),ue("YYYYY",te,J),ue("YYYYYY",te,J),ce(["YYYYY","YYYYYY"],me),ce("YYYY",function(e,t){t[me]=2===e.length?c.parseTwoDigitYear(e):D(e)}),ce("YY",function(e,t){t[me]=c.parseTwoDigitYear(e)}),ce("Y",function(e,t){t[me]=parseInt(e,10)}),c.parseTwoDigitYear=function(e){return D(e)+(68<D(e)?1900:2e3)};var Ye,Oe=Te("FullYear",!0);function Te(t,n){return function(e){return null!=e?(xe(this,t,e),c.updateOffset(this,n),this):be(this,t)}}function be(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function xe(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&De(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Pe(n,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function Pe(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,s=(t%(n=12)+n)%n;return e+=(t-s)/12,1===s?De(e)?29:28:31-s%7%2}Ye=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},I("M",["MM",2],"Mo",function(){return this.month()+1}),I("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),I("MMMM",0,0,function(e){return this.localeData().months(this,e)}),C("month","M"),F("month",8),ue("M",B),ue("MM",B,z),ue("MMM",function(e,t){return t.monthsShortRegex(e)}),ue("MMMM",function(e,t){return t.monthsRegex(e)}),ce(["M","MM"],function(e,t){t[_e]=D(e)-1}),ce(["MMM","MMMM"],function(e,t,n,s){var i=n._locale.monthsParse(e,s,n._strict);null!=i?t[_e]=i:g(n).invalidMonth=e});var We=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Ce="January_February_March_April_May_June_July_August_September_October_November_December".split("_");var He="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Re(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=D(t);else if(!h(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),Pe(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Ue(e){return null!=e?(Re(this,e),c.updateOffset(this,!0),this):be(this,"Month")}var Fe=ae;var Le=ae;function Ne(){function e(e,t){return t.length-e.length}var t,n,s=[],i=[],r=[];for(t=0;t<12;t++)n=y([2e3,t]),s.push(this.monthsShort(n,"")),i.push(this.months(n,"")),r.push(this.months(n,"")),r.push(this.monthsShort(n,""));for(s.sort(e),i.sort(e),r.sort(e),t=0;t<12;t++)s[t]=he(s[t]),i[t]=he(i[t]);for(t=0;t<24;t++)r[t]=he(r[t]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Ge(e){var t;if(e<100&&0<=e){var n=Array.prototype.slice.call(arguments);n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)}else t=new Date(Date.UTC.apply(null,arguments));return t}function Ve(e,t,n){var s=7+t-n;return-((7+Ge(e,0,s).getUTCDay()-t)%7)+s-1}function Ee(e,t,n,s,i){var r,a,o=1+7*(t-1)+(7+n-s)%7+Ve(e,s,i);return a=o<=0?Se(r=e-1)+o:o>Se(e)?(r=e+1,o-Se(e)):(r=e,o),{year:r,dayOfYear:a}}function Ie(e,t,n){var s,i,r=Ve(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+Ae(i=e.year()-1,t,n):a>Ae(e.year(),t,n)?(s=a-Ae(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function Ae(e,t,n){var s=Ve(e,t,n),i=Ve(e+1,t,n);return(Se(e)-s+i)/7}I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),C("week","w"),C("isoWeek","W"),F("week",5),F("isoWeek",5),ue("w",B),ue("ww",B,z),ue("W",B),ue("WW",B,z),fe(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=D(e)});function je(e,t){return e.slice(t,7).concat(e.slice(0,t))}I("d",0,"do","day"),I("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),I("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),I("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),C("day","d"),C("weekday","e"),C("isoWeekday","E"),F("day",11),F("weekday",11),F("isoWeekday",11),ue("d",B),ue("e",B),ue("E",B),ue("dd",function(e,t){return t.weekdaysMinRegex(e)}),ue("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ue("dddd",function(e,t){return t.weekdaysRegex(e)}),fe(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:g(n).invalidWeekday=e}),fe(["d","e","E"],function(e,t,n,s){t[s]=D(e)});var Ze="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var ze="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var $e="Su_Mo_Tu_We_Th_Fr_Sa".split("_");var qe=ae;var Je=ae;var Be=ae;function Qe(){function e(e,t){return t.length-e.length}var t,n,s,i,r,a=[],o=[],u=[],l=[];for(t=0;t<7;t++)n=y([2e3,1]).day(t),s=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),r=this.weekdays(n,""),a.push(s),o.push(i),u.push(r),l.push(s),l.push(i),l.push(r);for(a.sort(e),o.sort(e),u.sort(e),l.sort(e),t=0;t<7;t++)o[t]=he(o[t]),u[t]=he(u[t]),l[t]=he(l[t]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Xe(){return this.hours()%12||12}function Ke(e,t){I(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function et(e,t){return t._meridiemParse}I("H",["HH",2],0,"hour"),I("h",["hh",2],0,Xe),I("k",["kk",2],0,function(){return this.hours()||24}),I("hmm",0,0,function(){return""+Xe.apply(this)+L(this.minutes(),2)}),I("hmmss",0,0,function(){return""+Xe.apply(this)+L(this.minutes(),2)+L(this.seconds(),2)}),I("Hmm",0,0,function(){return""+this.hours()+L(this.minutes(),2)}),I("Hmmss",0,0,function(){return""+this.hours()+L(this.minutes(),2)+L(this.seconds(),2)}),Ke("a",!0),Ke("A",!1),C("hour","h"),F("hour",13),ue("a",et),ue("A",et),ue("H",B),ue("h",B),ue("k",B),ue("HH",B,z),ue("hh",B,z),ue("kk",B,z),ue("hmm",Q),ue("hmmss",X),ue("Hmm",Q),ue("Hmmss",X),ce(["H","HH"],ge),ce(["k","kk"],function(e,t,n){var s=D(e);t[ge]=24===s?0:s}),ce(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ce(["h","hh"],function(e,t,n){t[ge]=D(e),g(n).bigHour=!0}),ce("hmm",function(e,t,n){var s=e.length-2;t[ge]=D(e.substr(0,s)),t[ve]=D(e.substr(s)),g(n).bigHour=!0}),ce("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=D(e.substr(0,s)),t[ve]=D(e.substr(s,2)),t[pe]=D(e.substr(i)),g(n).bigHour=!0}),ce("Hmm",function(e,t,n){var s=e.length-2;t[ge]=D(e.substr(0,s)),t[ve]=D(e.substr(s))}),ce("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=D(e.substr(0,s)),t[ve]=D(e.substr(s,2)),t[pe]=D(e.substr(i))});var tt,nt=Te("Hours",!0),st={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Ce,monthsShort:He,week:{dow:0,doy:6},weekdays:Ze,weekdaysMin:$e,weekdaysShort:ze,meridiemParse:/[ap]\.?m?\.?/i},it={},rt={};function at(e){return e?e.toLowerCase().replace("_","-"):e}function ot(e){var t=null;if(!it[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=tt._abbr,require("./locale/"+e),ut(t)}catch(e){}return it[e]}function ut(e,t){var n;return e&&((n=l(t)?ht(e):lt(e,t))?tt=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),tt._abbr}function lt(e,t){if(null===t)return delete it[e],null;var n,s=st;if(t.abbr=e,null!=it[e])T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=it[e]._config;else if(null!=t.parentLocale)if(null!=it[t.parentLocale])s=it[t.parentLocale]._config;else{if(null==(n=ot(t.parentLocale)))return rt[t.parentLocale]||(rt[t.parentLocale]=[]),rt[t.parentLocale].push({name:e,config:t}),null;s=n._config}return it[e]=new P(x(s,t)),rt[e]&&rt[e].forEach(function(e){lt(e.name,e.config)}),ut(e),it[e]}function ht(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return tt;if(!o(e)){if(t=ot(e))return t;e=[e]}return function(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=at(e[r]).split("-")).length,n=(n=at(e[r+1]))?n.split("-"):null;0<t;){if(s=ot(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&a(i,n,!0)>=t-1)break;t--}r++}return tt}(e)}function dt(e){var t,n=e._a;return n&&-2===g(e).overflow&&(t=n[_e]<0||11<n[_e]?_e:n[ye]<1||n[ye]>Pe(n[me],n[_e])?ye:n[ge]<0||24<n[ge]||24===n[ge]&&(0!==n[ve]||0!==n[pe]||0!==n[we])?ge:n[ve]<0||59<n[ve]?ve:n[pe]<0||59<n[pe]?pe:n[we]<0||999<n[we]?we:-1,g(e)._overflowDayOfYear&&(t<me||ye<t)&&(t=ye),g(e)._overflowWeeks&&-1===t&&(t=Me),g(e)._overflowWeekday&&-1===t&&(t=ke),g(e).overflow=t),e}function ct(e,t,n){return null!=e?e:null!=t?t:n}function ft(e){var t,n,s,i,r,a=[];if(!e._d){var o,u;for(o=e,u=new Date(c.now()),s=o._useUTC?[u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()]:[u.getFullYear(),u.getMonth(),u.getDate()],e._w&&null==e._a[ye]&&null==e._a[_e]&&function(e){var t,n,s,i,r,a,o,u;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)r=1,a=4,n=ct(t.GG,e._a[me],Ie(bt(),1,4).year),s=ct(t.W,1),((i=ct(t.E,1))<1||7<i)&&(u=!0);else{r=e._locale._week.dow,a=e._locale._week.doy;var l=Ie(bt(),r,a);n=ct(t.gg,e._a[me],l.year),s=ct(t.w,l.week),null!=t.d?((i=t.d)<0||6<i)&&(u=!0):null!=t.e?(i=t.e+r,(t.e<0||6<t.e)&&(u=!0)):i=r}s<1||s>Ae(n,r,a)?g(e)._overflowWeeks=!0:null!=u?g(e)._overflowWeekday=!0:(o=Ee(n,s,i,r,a),e._a[me]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(r=ct(e._a[me],s[me]),(e._dayOfYear>Se(r)||0===e._dayOfYear)&&(g(e)._overflowDayOfYear=!0),n=Ge(r,0,e._dayOfYear),e._a[_e]=n.getUTCMonth(),e._a[ye]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=s[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ge]&&0===e._a[ve]&&0===e._a[pe]&&0===e._a[we]&&(e._nextDay=!0,e._a[ge]=0),e._d=(e._useUTC?Ge:function(e,t,n,s,i,r,a){var o;return e<100&&0<=e?(o=new Date(e+400,t,n,s,i,r,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,n,s,i,r,a),o}).apply(null,a),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ge]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(g(e).weekdayMismatch=!0)}}var mt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_t=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,yt=/Z|[+-]\d\d(?::?\d\d)?/,gt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],vt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],pt=/^\/?Date\((\-?\d+)/i;function wt(e){var t,n,s,i,r,a,o=e._i,u=mt.exec(o)||_t.exec(o);if(u){for(g(e).iso=!0,t=0,n=gt.length;t<n;t++)if(gt[t][1].exec(u[1])){i=gt[t][0],s=!1!==gt[t][2];break}if(null==i)return void(e._isValid=!1);if(u[3]){for(t=0,n=vt.length;t<n;t++)if(vt[t][1].exec(u[3])){r=(u[2]||" ")+vt[t][0];break}if(null==r)return void(e._isValid=!1)}if(!s&&null!=r)return void(e._isValid=!1);if(u[4]){if(!yt.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),Yt(e)}else e._isValid=!1}var Mt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;function kt(e,t,n,s,i,r){var a=[function(e){var t=parseInt(e,10);{if(t<=49)return 2e3+t;if(t<=999)return 1900+t}return t}(e),He.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(i,10)];return r&&a.push(parseInt(r,10)),a}var St={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Dt(e){var t,n,s,i=Mt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(i){var r=kt(i[4],i[3],i[2],i[5],i[6],i[7]);if(t=i[1],n=r,s=e,t&&ze.indexOf(t)!==new Date(n[0],n[1],n[2]).getDay()&&(g(s).weekdayMismatch=!0,!(s._isValid=!1)))return;e._a=r,e._tzm=function(e,t,n){if(e)return St[e];if(t)return 0;var s=parseInt(n,10),i=s%100;return(s-i)/100*60+i}(i[8],i[9],i[10]),e._d=Ge.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),g(e).rfc2822=!0}else e._isValid=!1}function Yt(e){if(e._f!==c.ISO_8601)if(e._f!==c.RFC_2822){e._a=[],g(e).empty=!0;var t,n,s,i,r,a,o,u,l=""+e._i,h=l.length,d=0;for(s=j(e._f,e._locale).match(N)||[],t=0;t<s.length;t++)i=s[t],(n=(l.match(le(i,e))||[])[0])&&(0<(r=l.substr(0,l.indexOf(n))).length&&g(e).unusedInput.push(r),l=l.slice(l.indexOf(n)+n.length),d+=n.length),E[i]?(n?g(e).empty=!1:g(e).unusedTokens.push(i),a=i,u=e,null!=(o=n)&&m(de,a)&&de[a](o,u._a,u,a)):e._strict&&!n&&g(e).unusedTokens.push(i);g(e).charsLeftOver=h-d,0<l.length&&g(e).unusedInput.push(l),e._a[ge]<=12&&!0===g(e).bigHour&&0<e._a[ge]&&(g(e).bigHour=void 0),g(e).parsedDateParts=e._a.slice(0),g(e).meridiem=e._meridiem,e._a[ge]=function(e,t,n){var s;if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):(null!=e.isPM&&((s=e.isPM(n))&&t<12&&(t+=12),s||12!==t||(t=0)),t)}(e._locale,e._a[ge],e._meridiem),ft(e),dt(e)}else Dt(e);else wt(e)}function Ot(e){var t,n,s,i,r=e._i,a=e._f;return e._locale=e._locale||ht(e._l),null===r||void 0===a&&""===r?p({nullInput:!0}):("string"==typeof r&&(e._i=r=e._locale.preparse(r)),k(r)?new M(dt(r)):(d(r)?e._d=r:o(a)?function(e){var t,n,s,i,r;if(0===e._f.length)return g(e).invalidFormat=!0,e._d=new Date(NaN);for(i=0;i<e._f.length;i++)r=0,t=w({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],Yt(t),v(t)&&(r+=g(t).charsLeftOver,r+=10*g(t).unusedTokens.length,g(t).score=r,(null==s||r<s)&&(s=r,n=t));_(e,n||t)}(e):a?Yt(e):l(n=(t=e)._i)?t._d=new Date(c.now()):d(n)?t._d=new Date(n.valueOf()):"string"==typeof n?(s=t,null===(i=pt.exec(s._i))?(wt(s),!1===s._isValid&&(delete s._isValid,Dt(s),!1===s._isValid&&(delete s._isValid,c.createFromInputFallback(s)))):s._d=new Date(+i[1])):o(n)?(t._a=f(n.slice(0),function(e){return parseInt(e,10)}),ft(t)):u(n)?function(e){if(!e._d){var t=R(e._i);e._a=f([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),ft(e)}}(t):h(n)?t._d=new Date(n):c.createFromInputFallback(t),v(e)||(e._d=null),e))}function Tt(e,t,n,s,i){var r,a={};return!0!==n&&!1!==n||(s=n,n=void 0),(u(e)&&function(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}(e)||o(e)&&0===e.length)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=e,a._f=t,a._strict=s,(r=new M(dt(Ot(a))))._nextDay&&(r.add(1,"d"),r._nextDay=void 0),r}function bt(e,t,n,s){return Tt(e,t,n,s,!1)}c.createFromInputFallback=n("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),c.ISO_8601=function(){},c.RFC_2822=function(){};var xt=n("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=bt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:p()}),Pt=n("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=bt.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:p()});function Wt(e,t){var n,s;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return bt();for(n=t[0],s=1;s<t.length;++s)t[s].isValid()&&!t[s][e](n)||(n=t[s]);return n}var Ct=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ht(e){var t=R(e),n=t.year||0,s=t.quarter||0,i=t.month||0,r=t.week||t.isoWeek||0,a=t.day||0,o=t.hour||0,u=t.minute||0,l=t.second||0,h=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===Ye.call(Ct,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var n=!1,s=0;s<Ct.length;++s)if(e[Ct[s]]){if(n)return!1;parseFloat(e[Ct[s]])!==D(e[Ct[s]])&&(n=!0)}return!0}(t),this._milliseconds=+h+1e3*l+6e4*u+1e3*o*60*60,this._days=+a+7*r,this._months=+i+3*s+12*n,this._data={},this._locale=ht(),this._bubble()}function Rt(e){return e instanceof Ht}function Ut(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ft(e,n){I(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+L(~~(e/60),2)+n+L(~~e%60,2)})}Ft("Z",":"),Ft("ZZ",""),ue("Z",re),ue("ZZ",re),ce(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Nt(re,e)});var Lt=/([\+\-]|\d\d)/gi;function Nt(e,t){var n=(t||"").match(e);if(null===n)return null;var s=((n[n.length-1]||[])+"").match(Lt)||["-",0,0],i=60*s[1]+D(s[2]);return 0===i?0:"+"===s[0]?i:-i}function Gt(e,t){var n,s;return t._isUTC?(n=t.clone(),s=(k(e)||d(e)?e.valueOf():bt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),c.updateOffset(n,!1),n):bt(e).local()}function Vt(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Et(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}c.updateOffset=function(){};var It=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,At=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function jt(e,t){var n,s,i,r=e,a=null;return Rt(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:h(e)?(r={},t?r[t]=e:r.milliseconds=e):(a=It.exec(e))?(n="-"===a[1]?-1:1,r={y:0,d:D(a[ye])*n,h:D(a[ge])*n,m:D(a[ve])*n,s:D(a[pe])*n,ms:D(Ut(1e3*a[we]))*n}):(a=At.exec(e))?(n="-"===a[1]?-1:1,r={y:Zt(a[2],n),M:Zt(a[3],n),w:Zt(a[4],n),d:Zt(a[5],n),h:Zt(a[6],n),m:Zt(a[7],n),s:Zt(a[8],n)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(i=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Gt(t,e),e.isBefore(t)?n=zt(e,t):((n=zt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(bt(r.from),bt(r.to)),(r={}).ms=i.milliseconds,r.M=i.months),s=new Ht(r),Rt(e)&&m(e,"_locale")&&(s._locale=e._locale),s}function Zt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function zt(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function $t(s,i){return function(e,t){var n;return null===t||isNaN(+t)||(T(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=e,e=t,t=n),qt(this,jt(e="string"==typeof e?+e:e,t),s),this}}function qt(e,t,n,s){var i=t._milliseconds,r=Ut(t._days),a=Ut(t._months);e.isValid()&&(s=null==s||s,a&&Re(e,be(e,"Month")+a*n),r&&xe(e,"Date",be(e,"Date")+r*n),i&&e._d.setTime(e._d.valueOf()+i*n),s&&c.updateOffset(e,r||a))}jt.fn=Ht.prototype,jt.invalid=function(){return jt(NaN)};var Jt=$t(1,"add"),Bt=$t(-1,"subtract");function Qt(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(n,"months");return-(n+(t-s<0?(t-s)/(s-e.clone().add(n-1,"months")):(t-s)/(e.clone().add(n+1,"months")-s)))||0}function Xt(e){var t;return void 0===e?this._locale._abbr:(null!=(t=ht(e))&&(this._locale=t),this)}c.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",c.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Kt=n("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function en(){return this._locale}var tn=126227808e5;function nn(e,t){return(e%t+t)%t}function sn(e,t,n){return e<100&&0<=e?new Date(e+400,t,n)-tn:new Date(e,t,n).valueOf()}function rn(e,t,n){return e<100&&0<=e?Date.UTC(e+400,t,n)-tn:Date.UTC(e,t,n)}function an(e,t){I(0,[e,e.length],0,t)}function on(e,t,n,s,i){var r;return null==e?Ie(this,s,i).year:((r=Ae(e,s,i))<t&&(t=r),function(e,t,n,s,i){var r=Ee(e,t,n,s,i),a=Ge(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}.call(this,e,t,n,s,i))}I(0,["gg",2],0,function(){return this.weekYear()%100}),I(0,["GG",2],0,function(){return this.isoWeekYear()%100}),an("gggg","weekYear"),an("ggggg","weekYear"),an("GGGG","isoWeekYear"),an("GGGGG","isoWeekYear"),C("weekYear","gg"),C("isoWeekYear","GG"),F("weekYear",1),F("isoWeekYear",1),ue("G",se),ue("g",se),ue("GG",B,z),ue("gg",B,z),ue("GGGG",ee,q),ue("gggg",ee,q),ue("GGGGG",te,J),ue("ggggg",te,J),fe(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=D(e)}),fe(["gg","GG"],function(e,t,n,s){t[s]=c.parseTwoDigitYear(e)}),I("Q",0,"Qo","quarter"),C("quarter","Q"),F("quarter",7),ue("Q",Z),ce("Q",function(e,t){t[_e]=3*(D(e)-1)}),I("D",["DD",2],"Do","date"),C("date","D"),F("date",9),ue("D",B),ue("DD",B,z),ue("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ce(["D","DD"],ye),ce("Do",function(e,t){t[ye]=D(e.match(B)[0])});var un=Te("Date",!0);I("DDD",["DDDD",3],"DDDo","dayOfYear"),C("dayOfYear","DDD"),F("dayOfYear",4),ue("DDD",K),ue("DDDD",$),ce(["DDD","DDDD"],function(e,t,n){n._dayOfYear=D(e)}),I("m",["mm",2],0,"minute"),C("minute","m"),F("minute",14),ue("m",B),ue("mm",B,z),ce(["m","mm"],ve);var ln=Te("Minutes",!1);I("s",["ss",2],0,"second"),C("second","s"),F("second",15),ue("s",B),ue("ss",B,z),ce(["s","ss"],pe);var hn,dn=Te("Seconds",!1);for(I("S",0,0,function(){return~~(this.millisecond()/100)}),I(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),I(0,["SSS",3],0,"millisecond"),I(0,["SSSS",4],0,function(){return 10*this.millisecond()}),I(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),I(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),I(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),I(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),I(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),C("millisecond","ms"),F("millisecond",16),ue("S",K,Z),ue("SS",K,z),ue("SSS",K,$),hn="SSSS";hn.length<=9;hn+="S")ue(hn,ne);function cn(e,t){t[we]=D(1e3*("0."+e))}for(hn="S";hn.length<=9;hn+="S")ce(hn,cn);var fn=Te("Milliseconds",!1);I("z",0,0,"zoneAbbr"),I("zz",0,0,"zoneName");var mn=M.prototype;function _n(e){return e}mn.add=Jt,mn.calendar=function(e,t){var n=e||bt(),s=Gt(n,this).startOf("day"),i=c.calendarFormat(this,s)||"sameElse",r=t&&(b(t[i])?t[i].call(this,n):t[i]);return this.format(r||this.localeData().calendar(i,this,bt(n)))},mn.clone=function(){return new M(this)},mn.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Gt(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=H(t)){case"year":r=Qt(this,s)/12;break;case"month":r=Qt(this,s);break;case"quarter":r=Qt(this,s)/3;break;case"second":r=(this-s)/1e3;break;case"minute":r=(this-s)/6e4;break;case"hour":r=(this-s)/36e5;break;case"day":r=(this-s-i)/864e5;break;case"week":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:S(r)},mn.endOf=function(e){var t;if(void 0===(e=H(e))||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?rn:sn;switch(e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-nn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-nn(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-nn(t,1e3)-1;break}return this._d.setTime(t),c.updateOffset(this,!0),this},mn.format=function(e){e||(e=this.isUtc()?c.defaultFormatUtc:c.defaultFormat);var t=A(this,e);return this.localeData().postformat(t)},mn.from=function(e,t){return this.isValid()&&(k(e)&&e.isValid()||bt(e).isValid())?jt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},mn.fromNow=function(e){return this.from(bt(),e)},mn.to=function(e,t){return this.isValid()&&(k(e)&&e.isValid()||bt(e).isValid())?jt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},mn.toNow=function(e){return this.to(bt(),e)},mn.get=function(e){return b(this[e=H(e)])?this[e]():this},mn.invalidAt=function(){return g(this).overflow},mn.isAfter=function(e,t){var n=k(e)?e:bt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=H(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},mn.isBefore=function(e,t){var n=k(e)?e:bt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=H(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},mn.isBetween=function(e,t,n,s){var i=k(e)?e:bt(e),r=k(t)?t:bt(t);return!!(this.isValid()&&i.isValid()&&r.isValid())&&("("===(s=s||"()")[0]?this.isAfter(i,n):!this.isBefore(i,n))&&(")"===s[1]?this.isBefore(r,n):!this.isAfter(r,n))},mn.isSame=function(e,t){var n,s=k(e)?e:bt(e);return!(!this.isValid()||!s.isValid())&&("millisecond"===(t=H(t)||"millisecond")?this.valueOf()===s.valueOf():(n=s.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},mn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},mn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},mn.isValid=function(){return v(this)},mn.lang=Kt,mn.locale=Xt,mn.localeData=en,mn.max=Pt,mn.min=xt,mn.parsingFlags=function(){return _({},g(this))},mn.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t=[];for(var n in e)t.push({unit:n,priority:U[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}(e=R(e)),s=0;s<n.length;s++)this[n[s].unit](e[n[s].unit]);else if(b(this[e=H(e)]))return this[e](t);return this},mn.startOf=function(e){var t;if(void 0===(e=H(e))||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?rn:sn;switch(e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=nn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":t=this._d.valueOf(),t-=nn(t,6e4);break;case"second":t=this._d.valueOf(),t-=nn(t,1e3);break}return this._d.setTime(t),c.updateOffset(this,!0),this},mn.subtract=Bt,mn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},mn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},mn.toDate=function(){return new Date(this.valueOf())},mn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||9999<n.year()?A(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):b(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",A(n,"Z")):A(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},mn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var n="["+e+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i=t+'[")]';return this.format(n+s+"-MM-DD[T]HH:mm:ss.SSS"+i)},mn.toJSON=function(){return this.isValid()?this.toISOString():null},mn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},mn.unix=function(){return Math.floor(this.valueOf()/1e3)},mn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},mn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},mn.year=Oe,mn.isLeapYear=function(){return De(this.year())},mn.weekYear=function(e){return on.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},mn.isoWeekYear=function(e){return on.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},mn.quarter=mn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},mn.month=Ue,mn.daysInMonth=function(){return Pe(this.year(),this.month())},mn.week=mn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},mn.isoWeek=mn.isoWeeks=function(e){var t=Ie(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},mn.weeksInYear=function(){var e=this.localeData()._week;return Ae(this.year(),e.dow,e.doy)},mn.isoWeeksInYear=function(){return Ae(this.year(),1,4)},mn.date=un,mn.day=mn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t,n,s=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(t=e,n=this.localeData(),e="string"!=typeof t?t:isNaN(t)?"number"==typeof(t=n.weekdaysParse(t))?t:null:parseInt(t,10),this.add(e-s,"d")):s},mn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},mn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null==e)return this.day()||7;var t,n,s=(t=e,n=this.localeData(),"string"==typeof t?n.weekdaysParse(t)%7||7:isNaN(t)?null:t);return this.day(this.day()%7?s:s-7)},mn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},mn.hour=mn.hours=nt,mn.minute=mn.minutes=ln,mn.second=mn.seconds=dn,mn.millisecond=mn.milliseconds=fn,mn.utcOffset=function(e,t,n){var s,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null==e)return this._isUTC?i:Vt(this);if("string"==typeof e){if(null===(e=Nt(re,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(s=Vt(this)),this._offset=e,this._isUTC=!0,null!=s&&this.add(s,"m"),i!==e&&(!t||this._changeInProgress?qt(this,jt(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,c.updateOffset(this,!0),this._changeInProgress=null)),this},mn.utc=function(e){return this.utcOffset(0,e)},mn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Vt(this),"m")),this},mn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Nt(ie,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},mn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?bt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},mn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},mn.isLocal=function(){return!!this.isValid()&&!this._isUTC},mn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},mn.isUtc=Et,mn.isUTC=Et,mn.zoneAbbr=function(){return this._isUTC?"UTC":""},mn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},mn.dates=n("dates accessor is deprecated. Use date instead.",un),mn.months=n("months accessor is deprecated. Use month instead",Ue),mn.years=n("years accessor is deprecated. Use year instead",Oe),mn.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),mn.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e={};if(w(e,this),(e=Ot(e))._a){var t=e._isUTC?y(e._a):bt(e._a);this._isDSTShifted=this.isValid()&&0<a(e._a,t.toArray())}else this._isDSTShifted=!1;return this._isDSTShifted});var yn=P.prototype;function gn(e,t,n,s){var i=ht(),r=y().set(s,t);return i[n](r,e)}function vn(e,t,n){if(h(e)&&(t=e,e=void 0),e=e||"",null!=t)return gn(e,t,n,"month");var s,i=[];for(s=0;s<12;s++)i[s]=gn(e,s,n,"month");return i}function pn(e,t,n,s){t=("boolean"==typeof e?h(t)&&(n=t,t=void 0):(t=e,e=!1,h(n=t)&&(n=t,t=void 0)),t||"");var i,r=ht(),a=e?r._week.dow:0;if(null!=n)return gn(t,(n+a)%7,s,"day");var o=[];for(i=0;i<7;i++)o[i]=gn(t,(i+a)%7,s,"day");return o}yn.calendar=function(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return b(s)?s.call(t,n):s},yn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])},yn.invalidDate=function(){return this._invalidDate},yn.ordinal=function(e){return this._ordinal.replace("%d",e)},yn.preparse=_n,yn.postformat=_n,yn.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return b(i)?i(e,t,n,s):i.replace(/%d/i,e)},yn.pastFuture=function(e,t){var n=this._relativeTime[0<e?"future":"past"];return b(n)?n(t):n.replace(/%s/i,t)},yn.set=function(e){var t,n;for(n in e)b(t=e[n])?this[n]=t:this["_"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},yn.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||We).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},yn.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[We.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},yn.monthsParse=function(e,t,n){var s,i,r;if(this._monthsParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=y([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=Ye.call(this._shortMonthsParse,a))?i:null:-1!==(i=Ye.call(this._longMonthsParse,a))?i:null:"MMM"===t?-1!==(i=Ye.call(this._shortMonthsParse,a))?i:-1!==(i=Ye.call(this._longMonthsParse,a))?i:null:-1!==(i=Ye.call(this._longMonthsParse,a))?i:-1!==(i=Ye.call(this._shortMonthsParse,a))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=y([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},yn.monthsRegex=function(e){return this._monthsParseExact?(m(this,"_monthsRegex")||Ne.call(this),e?this._monthsStrictRegex:this._monthsRegex):(m(this,"_monthsRegex")||(this._monthsRegex=Le),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},yn.monthsShortRegex=function(e){return this._monthsParseExact?(m(this,"_monthsRegex")||Ne.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(m(this,"_monthsShortRegex")||(this._monthsShortRegex=Fe),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},yn.week=function(e){return Ie(e,this._week.dow,this._week.doy).week},yn.firstDayOfYear=function(){return this._week.doy},yn.firstDayOfWeek=function(){return this._week.dow},yn.weekdays=function(e,t){var n=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?je(n,this._week.dow):e?n[e.day()]:n},yn.weekdaysMin=function(e){return!0===e?je(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},yn.weekdaysShort=function(e){return!0===e?je(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},yn.weekdaysParse=function(e,t,n){var s,i,r;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=y([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=y([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},yn.weekdaysRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Qe.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(m(this,"_weekdaysRegex")||(this._weekdaysRegex=qe),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},yn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Qe.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(m(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Je),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},yn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Qe.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(m(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Be),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},yn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},yn.meridiem=function(e,t,n){return 11<e?n?"pm":"PM":n?"am":"AM"},ut("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===D(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),c.lang=n("moment.lang is deprecated. Use moment.locale instead.",ut),c.langData=n("moment.langData is deprecated. Use moment.localeData instead.",ht);var wn=Math.abs;function Mn(e,t,n,s){var i=jt(t,n);return e._milliseconds+=s*i._milliseconds,e._days+=s*i._days,e._months+=s*i._months,e._bubble()}function kn(e){return e<0?Math.floor(e):Math.ceil(e)}function Sn(e){return 4800*e/146097}function Dn(e){return 146097*e/4800}function Yn(e){return function(){return this.as(e)}}var On=Yn("ms"),Tn=Yn("s"),bn=Yn("m"),xn=Yn("h"),Pn=Yn("d"),Wn=Yn("w"),Cn=Yn("M"),Hn=Yn("Q"),Rn=Yn("y");function Un(e){return function(){return this.isValid()?this._data[e]:NaN}}var Fn=Un("milliseconds"),Ln=Un("seconds"),Nn=Un("minutes"),Gn=Un("hours"),Vn=Un("days"),En=Un("months"),In=Un("years");var An=Math.round,jn={ss:44,s:45,m:45,h:22,d:26,M:11};var Zn=Math.abs;function zn(e){return(0<e)-(e<0)||+e}function $n(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=Zn(this._milliseconds)/1e3,s=Zn(this._days),i=Zn(this._months);t=S((e=S(n/60))/60),n%=60,e%=60;var r=S(i/12),a=i%=12,o=s,u=t,l=e,h=n?n.toFixed(3).replace(/\.?0+$/,""):"",d=this.asSeconds();if(!d)return"P0D";var c=d<0?"-":"",f=zn(this._months)!==zn(d)?"-":"",m=zn(this._days)!==zn(d)?"-":"",_=zn(this._milliseconds)!==zn(d)?"-":"";return c+"P"+(r?f+r+"Y":"")+(a?f+a+"M":"")+(o?m+o+"D":"")+(u||l||h?"T":"")+(u?_+u+"H":"")+(l?_+l+"M":"")+(h?_+h+"S":"")}var qn=Ht.prototype;return qn.isValid=function(){return this._isValid},qn.abs=function(){var e=this._data;return this._milliseconds=wn(this._milliseconds),this._days=wn(this._days),this._months=wn(this._months),e.milliseconds=wn(e.milliseconds),e.seconds=wn(e.seconds),e.minutes=wn(e.minutes),e.hours=wn(e.hours),e.months=wn(e.months),e.years=wn(e.years),this},qn.add=function(e,t){return Mn(this,e,t,1)},qn.subtract=function(e,t){return Mn(this,e,t,-1)},qn.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if("month"===(e=H(e))||"quarter"===e||"year"===e)switch(t=this._days+s/864e5,n=this._months+Sn(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Dn(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},qn.asMilliseconds=On,qn.asSeconds=Tn,qn.asMinutes=bn,qn.asHours=xn,qn.asDays=Pn,qn.asWeeks=Wn,qn.asMonths=Cn,qn.asQuarters=Hn,qn.asYears=Rn,qn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*D(this._months/12):NaN},qn._bubble=function(){var e,t,n,s,i,r=this._milliseconds,a=this._days,o=this._months,u=this._data;return 0<=r&&0<=a&&0<=o||r<=0&&a<=0&&o<=0||(r+=864e5*kn(Dn(o)+a),o=a=0),u.milliseconds=r%1e3,e=S(r/1e3),u.seconds=e%60,t=S(e/60),u.minutes=t%60,n=S(t/60),u.hours=n%24,o+=i=S(Sn(a+=S(n/24))),a-=kn(Dn(i)),s=S(o/12),o%=12,u.days=a,u.months=o,u.years=s,this},qn.clone=function(){return jt(this)},qn.get=function(e){return e=H(e),this.isValid()?this[e+"s"]():NaN},qn.milliseconds=Fn,qn.seconds=Ln,qn.minutes=Nn,qn.hours=Gn,qn.days=Vn,qn.weeks=function(){return S(this.days()/7)},qn.months=En,qn.years=In,qn.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t,n,s,i,r,a,o,u,l,h,d,c=this.localeData(),f=(n=!e,s=c,i=jt(t=this).abs(),r=An(i.as("s")),a=An(i.as("m")),o=An(i.as("h")),u=An(i.as("d")),l=An(i.as("M")),h=An(i.as("y")),(d=r<=jn.ss&&["s",r]||r<jn.s&&["ss",r]||a<=1&&["m"]||a<jn.m&&["mm",a]||o<=1&&["h"]||o<jn.h&&["hh",o]||u<=1&&["d"]||u<jn.d&&["dd",u]||l<=1&&["M"]||l<jn.M&&["MM",l]||h<=1&&["y"]||["yy",h])[2]=n,d[3]=0<+t,d[4]=s,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,d));return e&&(f=c.pastFuture(+this,f)),c.postformat(f)},qn.toISOString=$n,qn.toString=$n,qn.toJSON=$n,qn.locale=Xt,qn.localeData=en,qn.toIsoString=n("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",$n),qn.lang=Kt,I("X",0,0,"unix"),I("x",0,0,"valueOf"),ue("x",se),ue("X",/[+-]?\d+(\.\d{1,3})?/),ce("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),ce("x",function(e,t,n){n._d=new Date(D(e))}),c.version="2.24.0",e=bt,c.fn=mn,c.min=function(){return Wt("isBefore",[].slice.call(arguments,0))},c.max=function(){return Wt("isAfter",[].slice.call(arguments,0))},c.now=function(){return Date.now?Date.now():+new Date},c.utc=y,c.unix=function(e){return bt(1e3*e)},c.months=function(e,t){return vn(e,t,"months")},c.isDate=d,c.locale=ut,c.invalid=p,c.duration=jt,c.isMoment=k,c.weekdays=function(e,t,n){return pn(e,t,n,"weekdays")},c.parseZone=function(){return bt.apply(null,arguments).parseZone()},c.localeData=ht,c.isDuration=Rt,c.monthsShort=function(e,t){return vn(e,t,"monthsShort")},c.weekdaysMin=function(e,t,n){return pn(e,t,n,"weekdaysMin")},c.defineLocale=lt,c.updateLocale=function(e,t){if(null!=t){var n,s,i=st;null!=(s=ot(e))&&(i=s._config),(n=new P(t=x(i,t))).parentLocale=it[e],it[e]=n,ut(e)}else null!=it[e]&&(null!=it[e].parentLocale?it[e]=it[e].parentLocale:null!=it[e]&&delete it[e]);return it[e]},c.locales=function(){return s(it)},c.weekdaysShort=function(e,t,n){return pn(e,t,n,"weekdaysShort")},c.normalizeUnits=H,c.relativeTimeRounding=function(e){return void 0===e?An:"function"==typeof e&&(An=e,!0)},c.relativeTimeThreshold=function(e,t){return void 0!==jn[e]&&(void 0===t?jn[e]:(jn[e]=t,"s"===e&&(jn.ss=t-1),!0))},c.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},c.prototype=mn,c.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},c}); \ No newline at end of file From e4598ebffd58f0318708a4432ea364b934ab2e04 Mon Sep 17 00:00:00 2001 From: Dmytro Cheshun <d.cheshun@atwix.com> Date: Tue, 3 Dec 2019 00:00:06 +0200 Subject: [PATCH 362/595] Minor code style fix --- app/code/Magento/Captcha/Test/Unit/Model/Config/FontTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Captcha/Test/Unit/Model/Config/FontTest.php b/app/code/Magento/Captcha/Test/Unit/Model/Config/FontTest.php index fd6b59a6ad388..42ab3146f1321 100644 --- a/app/code/Magento/Captcha/Test/Unit/Model/Config/FontTest.php +++ b/app/code/Magento/Captcha/Test/Unit/Model/Config/FontTest.php @@ -7,6 +7,7 @@ declare(strict_types=1); namespace Magento\Captcha\Test\Unit\Model\Config; + use PHPUnit\Framework\TestCase; use Magento\Captcha\Helper\Data as HelperData; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; From e2cecfbfe5ae9ed86212af1fdc8afb791320645a Mon Sep 17 00:00:00 2001 From: Dmytro Cheshun <d.cheshun@atwix.com> Date: Tue, 3 Dec 2019 00:00:28 +0200 Subject: [PATCH 363/595] Minor code style fix --- .../Magento/Captcha/Test/Unit/Model/Config/Form/FrontendTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Captcha/Test/Unit/Model/Config/Form/FrontendTest.php b/app/code/Magento/Captcha/Test/Unit/Model/Config/Form/FrontendTest.php index 25681ac975cef..d3f40f5872a7d 100644 --- a/app/code/Magento/Captcha/Test/Unit/Model/Config/Form/FrontendTest.php +++ b/app/code/Magento/Captcha/Test/Unit/Model/Config/Form/FrontendTest.php @@ -7,6 +7,7 @@ declare(strict_types=1); namespace Magento\Captcha\Test\Unit\Model\Config\Form; + use Magento\Captcha\Model\Config\Form\Frontend; use PHPUnit\Framework\TestCase; use Magento\Framework\App\Config\ScopeConfigInterface; From ff92deb93ecd30669ba17e0ad58f3fc64a68e2fe Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Tue, 3 Dec 2019 10:26:00 +0200 Subject: [PATCH 364/595] Fixing static tests --- .../Config/Model/Config/Structure/Element/Dependency/Field.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php b/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php index 8f4d82eed51c5..28e1ba505a2ce 100644 --- a/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php +++ b/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php @@ -6,6 +6,8 @@ namespace Magento\Config\Model\Config\Structure\Element\Dependency; /** + * Field + * * @api * @since 100.0.2 */ From f64cd491cd0a4574b572de10e609870a746e3e48 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Tue, 3 Dec 2019 10:27:55 +0200 Subject: [PATCH 365/595] Revert "Fixing static tests" This reverts commit ff92deb93ecd30669ba17e0ad58f3fc64a68e2fe. --- .../Config/Model/Config/Structure/Element/Dependency/Field.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php b/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php index 28e1ba505a2ce..8f4d82eed51c5 100644 --- a/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php +++ b/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php @@ -6,8 +6,6 @@ namespace Magento\Config\Model\Config\Structure\Element\Dependency; /** - * Field - * * @api * @since 100.0.2 */ From 37fc4e501eda2536fa244765fb44fc1204e16cf4 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Tue, 3 Dec 2019 10:28:56 +0200 Subject: [PATCH 366/595] Fixing static tests --- .../Config/Model/Config/Structure/Element/Dependency/Field.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php b/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php index 6ed9be0d10e11..6171bdfca5584 100644 --- a/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php +++ b/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php @@ -6,6 +6,8 @@ namespace Magento\Config\Model\Config\Structure\Element\Dependency; /** + * Field + * * @api * @since 100.0.2 */ From f42641c9280d0415895ad6571da582f1e8d66704 Mon Sep 17 00:00:00 2001 From: Ajith <ajithkumar.maragathavel@ziffity.com> Date: Tue, 3 Dec 2019 20:04:50 +0530 Subject: [PATCH 367/595] Unit test case added --- .../Controller/Adminhtml/Block/SaveTest.php | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Block/SaveTest.php b/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Block/SaveTest.php index 0d44f66048ba3..41e74416d3b1d 100644 --- a/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Block/SaveTest.php +++ b/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Block/SaveTest.php @@ -373,6 +373,58 @@ public function testSaveAndClose() $this->assertSame($this->resultRedirect, $this->saveController->execute()); } + public function testSaveActionWithMarginalSpace() + { + $postData = [ + 'title' => '"><img src=y onerror=prompt(document.domain)>;', + 'identifier' => ' unique_title_123', + 'stores' => ['0'], + 'is_active' => true, + 'content' => '"><script>alert("cookie: "+document.cookie)</script>', + 'back' => 'continue' + ]; + + $this->requestMock->expects($this->any())->method('getPostValue')->willReturn($postData); + $this->requestMock->expects($this->atLeastOnce()) + ->method('getParam') + ->willReturnMap( + [ + ['block_id', null, 1], + ['back', null, true], + ] + ); + + $this->blockFactory->expects($this->atLeastOnce()) + ->method('create') + ->willReturn($this->blockMock); + + $this->blockRepository->expects($this->once()) + ->method('getById') + ->with($this->blockId) + ->willReturn($this->blockMock); + + $this->blockMock->expects($this->once())->method('setData'); + $this->blockRepository->expects($this->once())->method('save') + ->with($this->blockMock) + ->willThrowException(new \Exception('No marginal white space please.')); + + $this->messageManagerMock->expects($this->never()) + ->method('addSuccessMessage'); + $this->messageManagerMock->expects($this->once()) + ->method('addExceptionMessage'); + + $this->dataPersistorMock->expects($this->any()) + ->method('set') + ->with('cms_block', array_merge($postData, ['block_id' => null])); + + $this->resultRedirect->expects($this->atLeastOnce()) + ->method('setPath') + ->with('*/*/edit', ['block_id' => $this->blockId]) + ->willReturnSelf(); + + $this->assertSame($this->resultRedirect, $this->saveController->execute()); + } + public function testSaveActionThrowsException() { $postData = [ From f3f2b02c1b9bf2edf278260a334d023c97e9c170 Mon Sep 17 00:00:00 2001 From: Ajith <ajithkumar.maragathavel@ziffity.com> Date: Tue, 3 Dec 2019 21:45:33 +0530 Subject: [PATCH 368/595] Unit test case postData modified --- .../Cms/Test/Unit/Controller/Adminhtml/Block/SaveTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Block/SaveTest.php b/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Block/SaveTest.php index 41e74416d3b1d..c5bb26d04c734 100644 --- a/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Block/SaveTest.php +++ b/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Block/SaveTest.php @@ -376,11 +376,11 @@ public function testSaveAndClose() public function testSaveActionWithMarginalSpace() { $postData = [ - 'title' => '"><img src=y onerror=prompt(document.domain)>;', + 'title' => 'unique_title_123', 'identifier' => ' unique_title_123', 'stores' => ['0'], 'is_active' => true, - 'content' => '"><script>alert("cookie: "+document.cookie)</script>', + 'content' => '', 'back' => 'continue' ]; From d904436ab74f88afb6102aff022fc206e7abd199 Mon Sep 17 00:00:00 2001 From: Ashna-Jahan <32352950+Ashna-Jahan@users.noreply.github.com> Date: Wed, 4 Dec 2019 13:39:27 +0530 Subject: [PATCH 369/595] Fixed the issue. --- .../css/source/forms/fields/_control-table.less | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less index f8e50db60281c..22957cb86cb55 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less @@ -238,12 +238,20 @@ } } -.product_form_product_form_advanced_pricing_modal .admin__fieldset > .admin__field > .admin__field-control { - width: calc(~"(100%) * 0.57 - 30px"); +.product_form_product_form_advanced_pricing_modal .admin__fieldset > .admin__field > .admin__field-label, .product_form_product_form_advanced_pricing_modal [class*='admin__control-grouped'] > .admin__field:first-child > .admin__field-label { + margin-left: 0; +} + +.product_form_product_form_advanced_pricing_modal .admin__control-table td, +.product_form_product_form_advanced_pricing_modal .admin__control-table th { + padding: 1.3rem 0.7rem 1.3rem 0.3; + overflow-y: visible; +} +.product_form_product_form_advanced_pricing_modal .admin__fieldset { + margin: -40px; } .product_form_product_form_advanced_pricing_modal .admin__control-table-wrapper { overflow-x: visible; overflow-y: visible; } - From a4d57b99f4163ca929433f20d56630e99f234a54 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Wed, 4 Dec 2019 22:50:34 +0700 Subject: [PATCH 370/595] Resolve issue 25896: Cannot create folder using only letters --- .../Magento/Cms/Model/Wysiwyg/Images/Storage.php | 2 +- .../Unit/Model/Wysiwyg/Images/StorageTest.php | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php index e02d2b461a94e..21f3b232e783c 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php @@ -416,7 +416,7 @@ public function createDirectory($name, $path) { if (!preg_match(self::DIRECTORY_NAME_REGEXP, $name)) { throw new \Magento\Framework\Exception\LocalizedException( - __('Please rename the folder using only letters, numbers, underscores and dashes.') + __('Please rename the folder using only Latin letters, numbers, underscores and dashes.') ); } diff --git a/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php b/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php index 662aee671dd24..9a9c63195051c 100644 --- a/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php +++ b/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php @@ -7,6 +7,7 @@ use Magento\Cms\Model\Wysiwyg\Images\Storage\Collection as StorageCollection; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Exception\LocalizedException; /** * @SuppressWarnings(PHPMD.LongVariable) @@ -539,4 +540,18 @@ public function testUploadFile() $this->assertEquals($result, $this->imagesStorage->uploadFile($targetPath, $type)); } + + /** + * Test create directory with invalid name + */ + public function testCreateDirectoryWithInvalidName() + { + $name = 'папка'; + $path = '/tmp/path'; + $this->expectException(LocalizedException::class); + $this->expectExceptionMessage( + (string)__('Please rename the folder using only Latin letters, numbers, underscores and dashes.') + ); + $this->imagesStorage->createDirectory($name, $path); + } } From 8a2ce159b3b0c980cc556f788aaee9ad0243edd8 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Wed, 4 Dec 2019 23:22:08 +0700 Subject: [PATCH 371/595] [Checkout] Cover DirectoryData by Unit Test --- .../Unit/CustomerData/DirectoryDataTest.php | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 app/code/Magento/Checkout/Test/Unit/CustomerData/DirectoryDataTest.php diff --git a/app/code/Magento/Checkout/Test/Unit/CustomerData/DirectoryDataTest.php b/app/code/Magento/Checkout/Test/Unit/CustomerData/DirectoryDataTest.php new file mode 100644 index 0000000000000..3c0bae31c9c0d --- /dev/null +++ b/app/code/Magento/Checkout/Test/Unit/CustomerData/DirectoryDataTest.php @@ -0,0 +1,96 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Checkout\Test\Unit\CustomerData; + +use Magento\Checkout\CustomerData\DirectoryData; +use Magento\Directory\Helper\Data as HelperData; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Directory\Model\Country; +use PHPUnit\Framework\TestCase; + +class DirectoryDataTest extends TestCase +{ + /** + * @var DirectoryData + */ + private $model; + + /** + * @var HelperData|\PHPUnit_Framework_MockObject_MockObject + */ + private $directoryHelperMock; + + /** + * @var ObjectManagerHelper + */ + private $objectManager; + + /** + * Setup environment for testing + */ + protected function setUp() + { + $this->objectManager = new ObjectManagerHelper($this); + $this->directoryHelperMock = $this->createMock(HelperData::class); + + $this->model = $this->objectManager->getObject( + DirectoryData::class, + [ + 'directoryHelper' => $this->directoryHelperMock + ] + ); + } + + /** + * Test getSectionData() function + */ + public function testGetSectionData() + { + $regions = [ + 'US' => [ + 'TX' => [ + 'code' => 'TX', + 'name' => 'Texas' + ] + ] + ]; + + $testCountryInfo = $this->objectManager->getObject(Country::class); + $testCountryInfo->setData('country_id', 'US'); + $testCountryInfo->setData('iso2_code', 'US'); + $testCountryInfo->setData('iso3_code', 'USA'); + $testCountryInfo->setData('name_default', 'United States of America'); + $testCountryInfo->setData('name_en_US', 'United States of America'); + $countries = ['US' => $testCountryInfo]; + + $this->directoryHelperMock->expects($this->any()) + ->method('getRegionData') + ->willReturn($regions); + + $this->directoryHelperMock->expects($this->any()) + ->method('getCountryCollection') + ->willReturn($countries); + + /* Assert result */ + $this->assertEquals( + [ + 'US' => [ + 'name' => 'United States of America', + 'regions' => [ + 'TX' => [ + 'code' => 'TX', + 'name' => 'Texas' + ] + ] + ] + ], + $this->model->getSectionData() + ); + } +} From 9f14f895ac616d8a9c4aa5ed1cf2a657eff24814 Mon Sep 17 00:00:00 2001 From: Lena Orobei <oorobei@magento.com> Date: Wed, 4 Dec 2019 13:06:04 -0600 Subject: [PATCH 372/595] Merge branch '2.3-develop' of github.com:magento-engcom/magento2ee into coding-standard-update # Conflicts: # composer.lock --- .../Magento/BundleGraphQl/etc/schema.graphqls | 2 - composer.lock | 160 +++++++++--------- 2 files changed, 81 insertions(+), 81 deletions(-) diff --git a/app/code/Magento/BundleGraphQl/etc/schema.graphqls b/app/code/Magento/BundleGraphQl/etc/schema.graphqls index 914e405ba2695..0eff0e086180e 100644 --- a/app/code/Magento/BundleGraphQl/etc/schema.graphqls +++ b/app/code/Magento/BundleGraphQl/etc/schema.graphqls @@ -86,5 +86,3 @@ enum ShipBundleItemsEnum @doc(description: "This enumeration defines whether bun TOGETHER SEPARATELY } - -type invalidCamelCaseType {} #test static check diff --git a/composer.lock b/composer.lock index d6cd5368fd72a..ba126b3eabefc 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0e6d1fc607befd753c33181c6bcfd1b4", + "content-hash": "e3ad90186a7742707e4c12cda2580b35", "packages": [ { "name": "braintree/braintree_php", @@ -1112,16 +1112,16 @@ }, { "name": "monolog/monolog", - "version": "1.25.1", + "version": "1.25.2", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "70e65a5470a42cfec1a7da00d30edb6e617e8dcf" + "reference": "d5e2fb341cb44f7e2ab639d12a1e5901091ec287" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/70e65a5470a42cfec1a7da00d30edb6e617e8dcf", - "reference": "70e65a5470a42cfec1a7da00d30edb6e617e8dcf", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/d5e2fb341cb44f7e2ab639d12a1e5901091ec287", + "reference": "d5e2fb341cb44f7e2ab639d12a1e5901091ec287", "shasum": "" }, "require": { @@ -1186,7 +1186,7 @@ "logging", "psr-3" ], - "time": "2019-09-06T13:49:17+00:00" + "time": "2019-11-13T10:00:05+00:00" }, { "name": "paragonie/random_compat", @@ -1391,39 +1391,36 @@ }, { "name": "php-amqplib/php-amqplib", - "version": "v2.7.3", + "version": "v2.10.1", "source": { "type": "git", "url": "https://github.com/php-amqplib/php-amqplib.git", - "reference": "a8ba54bd35b973fc6861e4c2e105f71e9e95f43f" + "reference": "6e2b2501e021e994fb64429e5a78118f83b5c200" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-amqplib/php-amqplib/zipball/a8ba54bd35b973fc6861e4c2e105f71e9e95f43f", - "reference": "a8ba54bd35b973fc6861e4c2e105f71e9e95f43f", + "url": "https://api.github.com/repos/php-amqplib/php-amqplib/zipball/6e2b2501e021e994fb64429e5a78118f83b5c200", + "reference": "6e2b2501e021e994fb64429e5a78118f83b5c200", "shasum": "" }, "require": { "ext-bcmath": "*", - "ext-mbstring": "*", - "php": ">=5.3.0" + "ext-sockets": "*", + "php": ">=5.6" }, "replace": { "videlalvaro/php-amqplib": "self.version" }, "require-dev": { - "phpdocumentor/phpdocumentor": "^2.9", - "phpunit/phpunit": "^4.8", - "scrutinizer/ocular": "^1.1", + "ext-curl": "*", + "nategood/httpful": "^0.2.20", + "phpunit/phpunit": "^5.7|^6.5|^7.0", "squizlabs/php_codesniffer": "^2.5" }, - "suggest": { - "ext-sockets": "Use AMQPSocketConnection" - }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.10-dev" } }, "autoload": { @@ -1449,6 +1446,11 @@ "name": "Raúl Araya", "email": "nubeiro@gmail.com", "role": "Maintainer" + }, + { + "name": "Luke Bakken", + "email": "luke@bakken.io", + "role": "Maintainer" } ], "description": "Formerly videlalvaro/php-amqplib. This library is a pure PHP implementation of the AMQP protocol. It's been tested against RabbitMQ.", @@ -1458,7 +1460,7 @@ "queue", "rabbitmq" ], - "time": "2018-04-30T03:54:54+00:00" + "time": "2019-10-10T13:23:40+00:00" }, { "name": "phpseclib/mcrypt_compat", @@ -2081,7 +2083,7 @@ }, { "name": "symfony/css-selector", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -2134,7 +2136,7 @@ }, { "name": "symfony/event-dispatcher", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -2262,7 +2264,7 @@ }, { "name": "symfony/filesystem", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -2312,7 +2314,7 @@ }, { "name": "symfony/finder", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -2478,7 +2480,7 @@ }, { "name": "symfony/process", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", @@ -2724,23 +2726,23 @@ }, { "name": "wikimedia/less.php", - "version": "1.8.1", + "version": "1.8.2", "source": { "type": "git", "url": "https://github.com/wikimedia/less.php.git", - "reference": "f0f7768f6fa8a9d2ac6a0274f6f477c72159bf9b" + "reference": "e238ad228d74b6ffd38209c799b34e9826909266" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/less.php/zipball/f0f7768f6fa8a9d2ac6a0274f6f477c72159bf9b", - "reference": "f0f7768f6fa8a9d2ac6a0274f6f477c72159bf9b", + "url": "https://api.github.com/repos/wikimedia/less.php/zipball/e238ad228d74b6ffd38209c799b34e9826909266", + "reference": "e238ad228d74b6ffd38209c799b34e9826909266", "shasum": "" }, "require": { - "php": ">=5.3" + "php": ">=7.2.9" }, "require-dev": { - "phpunit/phpunit": "~4.8.24" + "phpunit/phpunit": "7.5.14" }, "bin": [ "bin/lessc" @@ -2759,6 +2761,10 @@ "Apache-2.0" ], "authors": [ + { + "name": "Josh Schmidt", + "homepage": "https://github.com/oyejorge" + }, { "name": "Matt Agar", "homepage": "https://github.com/agar" @@ -2766,10 +2772,6 @@ { "name": "Martin Jantošovič", "homepage": "https://github.com/Mordred" - }, - { - "name": "Josh Schmidt", - "homepage": "https://github.com/oyejorge" } ], "description": "PHP port of the Javascript version of LESS http://lesscss.org (Originally maintained by Josh Schmidt)", @@ -2781,7 +2783,7 @@ "php", "stylesheet" ], - "time": "2019-01-19T01:01:33+00:00" + "time": "2019-11-06T18:30:11+00:00" }, { "name": "zendframework/zend-captcha", @@ -6160,16 +6162,16 @@ }, { "name": "doctrine/cache", - "version": "1.9.0", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "c15dcd24b756f9e52ea7c3ae8227354f3628f11a" + "reference": "89a5c76c39c292f7798f964ab3c836c3f8192a55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/c15dcd24b756f9e52ea7c3ae8227354f3628f11a", - "reference": "c15dcd24b756f9e52ea7c3ae8227354f3628f11a", + "url": "https://api.github.com/repos/doctrine/cache/zipball/89a5c76c39c292f7798f964ab3c836c3f8192a55", + "reference": "89a5c76c39c292f7798f964ab3c836c3f8192a55", "shasum": "" }, "require": { @@ -6239,7 +6241,7 @@ "riak", "xcache" ], - "time": "2019-11-11T10:31:52+00:00" + "time": "2019-11-15T14:31:57+00:00" }, { "name": "doctrine/inflector", @@ -6366,28 +6368,30 @@ }, { "name": "doctrine/lexer", - "version": "1.0.2", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8" + "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/1febd6c3ef84253d7c815bed85fc622ad207a9f8", - "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", + "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^7.2" }, "require-dev": { - "phpunit/phpunit": "^4.5" + "doctrine/coding-standard": "^6.0", + "phpstan/phpstan": "^0.11.8", + "phpunit/phpunit": "^8.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -6400,14 +6404,14 @@ "MIT" ], "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, { "name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com" }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com" @@ -6422,7 +6426,7 @@ "parser", "php" ], - "time": "2019-06-08T11:03:04+00:00" + "time": "2019-10-30T14:39:59+00:00" }, { "name": "facebook/webdriver", @@ -6616,16 +6620,16 @@ }, { "name": "fzaninotto/faker", - "version": "v1.8.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/fzaninotto/Faker.git", - "reference": "f72816b43e74063c8b10357394b6bba8cb1c10de" + "reference": "27a216cbe72327b2d6369fab721a5843be71e57d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/f72816b43e74063c8b10357394b6bba8cb1c10de", - "reference": "f72816b43e74063c8b10357394b6bba8cb1c10de", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/27a216cbe72327b2d6369fab721a5843be71e57d", + "reference": "27a216cbe72327b2d6369fab721a5843be71e57d", "shasum": "" }, "require": { @@ -6634,13 +6638,11 @@ "require-dev": { "ext-intl": "*", "phpunit/phpunit": "^4.8.35 || ^5.7", - "squizlabs/php_codesniffer": "^1.5" + "squizlabs/php_codesniffer": "^2.9.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.8-dev" - } + "branch-alias": [] }, "autoload": { "psr-4": { @@ -6662,7 +6664,7 @@ "faker", "fixtures" ], - "time": "2018-07-12T10:23:15+00:00" + "time": "2019-11-14T13:13:06+00:00" }, { "name": "grasmash/expander", @@ -7677,16 +7679,16 @@ }, { "name": "phpcompatibility/php-compatibility", - "version": "9.3.3", + "version": "9.3.4", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "1af08ca3861048a8bfb39d0405d0ac3e50ba2696" + "reference": "1f37659196e4f3113ea506a7efba201c52303bf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/1af08ca3861048a8bfb39d0405d0ac3e50ba2696", - "reference": "1af08ca3861048a8bfb39d0405d0ac3e50ba2696", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/1f37659196e4f3113ea506a7efba201c52303bf1", + "reference": "1f37659196e4f3113ea506a7efba201c52303bf1", "shasum": "" }, "require": { @@ -7731,7 +7733,7 @@ "phpcs", "standards" ], - "time": "2019-11-11T03:25:23+00:00" + "time": "2019-11-15T04:12:02+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -9252,7 +9254,7 @@ }, { "name": "symfony/browser-kit", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", @@ -9311,7 +9313,7 @@ }, { "name": "symfony/config", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/config.git", @@ -9375,7 +9377,7 @@ }, { "name": "symfony/dependency-injection", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", @@ -9448,7 +9450,7 @@ }, { "name": "symfony/dom-crawler", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", @@ -9509,16 +9511,16 @@ }, { "name": "symfony/http-foundation", - "version": "v2.8.50", + "version": "v2.8.52", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "746f8d3638bf46ee8b202e62f2b214c3d61fb06a" + "reference": "3929d9fe8148d17819ad0178c748b8d339420709" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/746f8d3638bf46ee8b202e62f2b214c3d61fb06a", - "reference": "746f8d3638bf46ee8b202e62f2b214c3d61fb06a", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/3929d9fe8148d17819ad0178c748b8d339420709", + "reference": "3929d9fe8148d17819ad0178c748b8d339420709", "shasum": "" }, "require": { @@ -9560,11 +9562,11 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2019-04-16T10:00:53+00:00" + "time": "2019-11-12T12:34:41+00:00" }, { "name": "symfony/options-resolver", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", @@ -9904,7 +9906,7 @@ }, { "name": "symfony/stopwatch", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", @@ -9954,7 +9956,7 @@ }, { "name": "symfony/yaml", - "version": "v4.3.7", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", From 4584cabf5f11cb422f9735f12f552e471e69644d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 21:34:39 +0100 Subject: [PATCH 373/595] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 app/code/Magento/Backup/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Backup/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Backup/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..84c6812ddf183 --- /dev/null +++ b/app/code/Magento/Backup/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="createSystemBackup"> + <annotations> + <description>Creates a System Backup using provided Backup Entity.</description> + </annotations> + <arguments> + <argument name="backup" defaultValue="SystemBackup"/> + </arguments> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateSystemBackupActionGroup` instead --> + <click selector="{{AdminMainActionsSection.systemBackup}}" stepKey="clickCreateBackupButton"/> + <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> + <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> + <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> + <waitForElementNotVisible selector=".loading-mask" time="300" stepKey="waitForBackupProcess"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You created the system backup." stepKey="seeSuccessMessage"/> + <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> + <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> + </actionGroup> + + <actionGroup name="createMediaBackup"> + <annotations> + <description>Creates a Media Backup using provided Backup Entity.</description> + </annotations> + <arguments> + <argument name="backup" defaultValue="MediaBackup"/> + </arguments> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateMediaBackupActionGroup` instead --> + <click selector="{{AdminMainActionsSection.mediaBackup}}" stepKey="clickCreateBackupButton"/> + <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> + <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> + <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> + <waitForPageLoad time="120" stepKey="waitForBackupProcess"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You created the database and media backup." stepKey="seeSuccessMessage"/> + <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> + <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> + </actionGroup> + + <actionGroup name="createDatabaseBackup"> + <annotations> + <description>Creates a Database Backup using provided Backup Entity.</description> + </annotations> + <arguments> + <argument name="backup" defaultValue="DatabaseBackup"/> + </arguments> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateDatabaseBackupActionGroup` instead --> + <click selector="{{AdminMainActionsSection.databaseBackup}}" stepKey="clickCreateBackupButton"/> + <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> + <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> + <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> + <waitForPageLoad time="120" stepKey="waitForBackupProcess"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You created the database backup." stepKey="seeSuccessMessage"/> + <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> + <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> + </actionGroup> +</actionGroups> From 54f094a82ef60da66e0f84fa213be3ef5cb74ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 21:44:58 +0100 Subject: [PATCH 374/595] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../_Deprecated_ActionGroup.xml .xml | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 app/code/Magento/Braintree/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml .xml diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml .xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml .xml new file mode 100644 index 0000000000000..5bfd2d15de72a --- /dev/null +++ b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml .xml @@ -0,0 +1,139 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="GoToAllUsers"> + <annotations> + <description>Navigate to the Users page via Backend Admin Side Menu. PLEASE NOTE: Use the amOnPage action instead.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GoToAllUsersActionGroup` instead --> + <click selector="{{AdminCreateUserSection.system}}" stepKey="clickOnSystemIcon"/> + <waitForPageLoad stepKey="waitForSystemsPageToOpen"/> + <click selector="{{AdminCreateUserSection.allUsers}}" stepKey="clickToSelectUserRoles"/> + <waitForPageLoad stepKey="waitForUserRolesPageToOpen"/> + </actionGroup> + + <actionGroup name="GoToUserRoles"> + <annotations> + <description>Navigate to the User Roles page via Backend Admin Side Menu. PLEASE NOTE: Use the amOnPage action instead.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GoToUserRolesActionGroup` instead --> + <click selector="#menu-magento-backend-system" stepKey="clickOnSystemIcon"/> + <waitForPageLoad stepKey="waitForSystemsPageToOpen"/> + <click selector="//span[contains(text(), 'User Roles')]" stepKey="clickToSelectUserRoles"/> + <waitForPageLoad stepKey="waitForUserRolesPageToOpen"/> + </actionGroup> + + <actionGroup name="AdminCreateNewRole"> + <annotations> + <description>Creates a User Role using the provided Data.</description> + </annotations> + <arguments> + <argument name="role" type="string" defaultValue=""/> + <argument name="resource" type="string" defaultValue="All"/> + <argument name="scope" type="string" defaultValue="Custom"/> + <argument name="websites" type="string" defaultValue="Main Website"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateNewRoleActionGroup` instead --> + <click selector="{{AdminCreateRoleSection.create}}" stepKey="clickToAddNewRole"/> + <fillField selector="{{AdminCreateRoleSection.name}}" userInput="{{role.name}}" stepKey="setRoleName"/> + <fillField stepKey="setPassword" selector="{{AdminCreateRoleSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> + <click selector="{{AdminCreateRoleSection.roleResources}}" stepKey="clickToOpenRoleResources"/> + <waitForPageLoad stepKey="waitForRoleResourcePage" time="5"/> + <click stepKey="checkSales" selector="//a[text()='Sales']"/> + <click selector="{{AdminCreateRoleSection.save}}" stepKey="clickToSaveRole"/> + <waitForPageLoad stepKey="waitForPageLoad" time="10"/> + <see userInput="You saved the role." stepKey="seeSuccessMessage"/> + </actionGroup> + + <actionGroup name="AdminCreateUserAction"> + <annotations> + <description>Creates a User using the NewAdmin User Entity and User Role Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateUserActionGroup` instead --> + <click selector="{{AdminCreateUserSection.create}}" stepKey="clickToCreateNewUser"/> + <waitForPageLoad stepKey="waitForNewUserPageLoad" time="10"/> + <fillField selector="{{AdminCreateUserSection.usernameTextField}}" userInput="{{NewAdmin.username}}" stepKey="enterUserName"/> + <fillField selector="{{AdminCreateUserSection.firstNameTextField}}" userInput="{{NewAdmin.firstName}}" stepKey="enterFirstName"/> + <fillField selector="{{AdminCreateUserSection.lastNameTextField}}" userInput="{{NewAdmin.lastName}}" stepKey="enterLastName"/> + <fillField selector="{{AdminCreateUserSection.emailTextField}}" userInput="{{NewAdmin.email}}" stepKey="enterEmail"/> + <fillField selector="{{AdminCreateUserSection.passwordTextField}}" userInput="{{NewAdmin.password}}" stepKey="enterPassword"/> + <fillField selector="{{AdminCreateUserSection.pwConfirmationTextField}}" userInput="{{NewAdmin.password}}" stepKey="confirmPassword"/> + <fillField selector="{{AdminCreateUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword"/> + <scrollToTopOfPage stepKey="scrollToTopOfPage"/> + <click selector="{{AdminCreateUserSection.userRoleTab}}" stepKey="clickUserRole"/> + <waitForAjaxLoad stepKey="waitForRoles" time="5"/> + <fillField selector="{{AdminCreateRoleSection.roleNameFilterTextField}}" userInput="{{role.name}}" stepKey="filterRole"/> + <click selector="{{AdminCreateRoleSection.searchButton}}" stepKey="clickSearch"/> + <waitForPageLoad stepKey="waitForSearch" time="10"/> + <click selector="{{AdminCreateRoleSection.searchResultFirstRow}}" stepKey="selectRole"/> + <click selector="{{AdminCreateUserSection.saveButton}}" stepKey="clickSaveUser"/> + <waitForPageLoad stepKey="waitForSaveUser" time="10"/> + <see userInput="You saved the user." stepKey="seeSuccessMessage"/> + </actionGroup> + + <actionGroup name="ConfigureBraintree"> + <annotations> + <description>Sets up the Braintree configuration setting using the BraintreeConfigurationSection Data Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ConfigureBraintreeActionGroup` instead --> + <click stepKey="clickOnSTORES" selector="{{AdminMenuSection.stores}}"/> + <waitForPageLoad stepKey="waitForConfiguration" time="2"/> + <click stepKey="clickOnConfigurations" selector="{{AdminMenuSection.configuration}}"/> + <waitForPageLoad stepKey="waitForSales" time="2"/> + <click stepKey="clickOnSales" selector="{{ConfigurationListSection.sales}}"/> + <waitForPageLoad stepKey="waitForPaymentMethods" time="2"/> + <click stepKey="clickOnPaymentMethods" selector="{{ConfigurationListSection.salesPaymentMethods}}"/> + <waitForPageLoad stepKey="waitForConfigureButton" time="2"/> + <click stepKey="clickOnConfigureButtonForBraintree" selector="{{ConfigurationPaymentSection.configureButton}}"/> + <waitForPageLoad stepKey="BraintreeSettings" time="2"/> + + <fillField stepKey="fillTitleForBraintreeSettings" selector="{{BraintreeConfiguraionSection.titleForBraintreeSettings}}" userInput="{{BraintreeConfigurationData.title}}"/> + <click stepKey="openEnvironmentSelect" selector="{{BraintreeConfiguraionSection.environment}}"/> + <click stepKey="chooseEnvironment" selector="{{BraintreeConfiguraionSection.sandbox}}"/> + <click stepKey="openPaymentActionSelect" selector="{{BraintreeConfiguraionSection.paymentActionSelect}}"/> + <click stepKey="choosePaymentAction" selector="{{BraintreeConfiguraionSection.paymentAction}}"/> + <fillField stepKey="fillMerchantID" selector="{{BraintreeConfiguraionSection.merchantID}}" userInput="{{BraintreeConfigurationData.merchantID}}"/> + <fillField stepKey="fillPublicKey" selector="{{BraintreeConfiguraionSection.publicKey}}" userInput="{{BraintreeConfigurationData.publicKey}}"/> + <fillField stepKey="fillPrivateKey" selector="{{BraintreeConfiguraionSection.privateKey}}" userInput="{{BraintreeConfigurationData.privateKey}}"/> + <click stepKey="expandEnableThisSolution" selector="{{BraintreeConfiguraionSection.enableThisSolution}}"/> + <click stepKey="chooseYesForEnableThisSolution" selector="{{BraintreeConfiguraionSection.yesForEnable}}"/> + <click stepKey="expandEnablePayPalThroughBraintree" selector="{{BraintreeConfiguraionSection.payPalThroughBraintree}}"/> + <click stepKey="chooseYesForEnablePayPalThroughBraintree" selector="{{BraintreeConfiguraionSection.yesForPayPalThroughBraintree}}"/> + <click stepKey="expandAdvancedBraintreeSettings" selector="{{BraintreeConfiguraionSection.advancedBraintreeSettings}}"/> + <fillField stepKey="fillMerchantAccountID" selector="{{BraintreeConfiguraionSection.merchantAccountID}}" userInput="{{BraintreeConfigurationData.merchantAccountID}}"/> + <click stepKey="expandCVVVerification" selector="{{BraintreeConfiguraionSection.CVVVerification}}"/> + <click stepKey="chooseYes" selector="{{BraintreeConfiguraionSection.yesForCVV}}"/> + <click stepKey="expandPayPalThroughBraintree" selector="{{BraintreeConfiguraionSection.payPalThroughBraintreeSelector}}"/> + <fillField stepKey="fillTitleForPayPalThroughBraintree" selector="{{BraintreeConfiguraionSection.titleForPayPalThroughBraintree}}" userInput="{{BraintreeConfigurationData.titleForPayPalThroughBraintree}}"/> + <click stepKey="expandPaymentAction" selector="{{BraintreeConfiguraionSection.paymentActionInPayPal}}"/> + <click stepKey="chooseAuthorize" selector="{{BraintreeConfiguraionSection.actionAuthorize}}"/> + <click stepKey="save" selector="{{BraintreeConfiguraionSection.save}}"/> + <waitForElementVisible selector="{{BraintreeConfiguraionSection.successfulMessage}}" stepKey="waitForSuccessfullyConfigured" time="10"/> + </actionGroup> + + <actionGroup name="DisableBrainTree"> + <annotations> + <description>Disables the Braintree and BraintreePaypal configuration settings via the CLI.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DisableBraintreeActionGroup` instead --> + <magentoCLI stepKey="disableBrainTree" command="config:set payment/braintree/active 0"/> + <magentoCLI stepKey="disableBrainTreePaypal" command="config:set payment/braintree_paypal/active 0"/> + </actionGroup> +</actionGroups> From df44eebd4b9eefa1027f5d5fa67687a30d30e8e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 21:56:55 +0100 Subject: [PATCH 375/595] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- ...iewBundleProductInAdminGridActionGroup.xml | 2 +- .../ActionGroup/_Deprecated_ActionGroup.xml | 263 ++++++++++++++++++ 2 files changed, 264 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/ViewBundleProductInAdminGridActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/ViewBundleProductInAdminGridActionGroup.xml index 96179b49206c8..bd0d08e4c0924 100644 --- a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/ViewBundleProductInAdminGridActionGroup.xml +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/ViewBundleProductInAdminGridActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="viewBundleProductInAdminGrid"> + <actionGroup name="ViewBundleProductInAdminGridActionGroup"> <annotations> <description>Clears the Grid Filters on the Catalog Grid page and applies Filter by Name and Sku. Then checks to see if the Product exists in the 1st row. Then clears the Grid Filters again for future Tests.</description> </annotations> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..d5413d2269a5b --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,263 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AncillaryPrepBundleProduct"> + <annotations> + <description>Requires Navigation to the Product Creation page. Fills out Name, Sku, and SEO information using the BundleProduct Data Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AncillaryPrepBundleProductActionGroup` instead --> + <fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/> + <fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/> + + <scrollTo selector="{{AdminProductFormBundleSection.seoDropdown}}" stepKey="moveToSEOSection"/> + <conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.urlKey}}" visible="false" stepKey="openDropDownIfClosed"/> + <waitForPageLoad stepKey="WaitForDropDownSEO"/> + + <fillField userInput="{{BundleProduct.urlKey}}" selector="{{AdminProductFormBundleSection.urlKey}}" stepKey="FillsinSEOlinkExtension"/> + </actionGroup> + + <actionGroup name="FindProductToEdit"> + <annotations> + <description>Clears the Backend Admin Grid Filters on the Backend Admin Product Grid page. Searches for the BundleProduct Data Entity. Then clicks on the first item in the Admin Grid. PLEASE NOTE: The Action Group values are Hardcoded.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FindProductToEditActionGroup` instead --> + <amOnPage url="{{ProductCatalogPage.url}}" stepKey="GoToProductCatalog"/> + <waitForPageLoad stepKey="WaitForCatalogProductPageToLoad"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <fillField userInput="{{BundleProduct.name}}" selector="#fulltext" stepKey="EnterProductNameInSearch"/> + <click stepKey="ClickSearch" selector="{{AdminProductFormBundleSection.searchButton}}"/> + <click stepKey="ClickOnProduct" selector="{{AdminProductFormBundleSection.firstCatalogProduct}}"/> + <waitForPageLoad stepKey="WaitForProductEditPageToLoad"/> + </actionGroup> + + <actionGroup name="CreateBasicBundleProduct"> + <annotations> + <description>Requires Navigation to the Product Creation page. Fills out Name, Sku, and SEO information using the BundleProduct Data Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateBasicBundleProductActionGroup` instead --> + <fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/> + <fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/> + + <scrollTo selector="{{AdminProductFormBundleSection.seoDropdown}}" stepKey="scrollToSeoDropDown"/> + <conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.urlKey}}" visible="false" stepKey="openDropDownIfClosed"/> + <waitForPageLoad stepKey="waitForDropDownSEO"/> + + <fillField userInput="{{BundleProduct.urlKey}}" selector="{{AdminProductFormBundleSection.urlKey}}" stepKey="fillsInSeoLinkExtension"/> + </actionGroup> + + <actionGroup name="addBundleOptionWithTwoProducts"> + <annotations> + <description>Requires Navigation to the Product Creation page. Adds Bundle Option with Two Products using the provided arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleOptionWithTwoProductsActionGroup` instead --> + <arguments> + <argument name="x" type="string"/> + <argument name="n" type="string"/> + <argument name="prodOneSku" type="string"/> + <argument name="prodTwoSku" type="string"/> + <argument name="optionTitle" type="string"/> + <argument name="inputType" type="string"/> + </arguments> + + <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> + <scrollTo selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" stepKey="scrollUpABit"/> + <click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption"/> + <waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle(x)}}" stepKey="waitForOptions"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle(x)}}" userInput="{{optionTitle}}" stepKey="fillTitle"/> + <selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType(x)}}" userInput="{{inputType}}" stepKey="selectType"/> + <waitForElementVisible selector="{{AdminProductFormBundleSection.nthAddProductsToOption(n)}}" stepKey="waitForAddBtn"/> + <click selector="{{AdminProductFormBundleSection.nthAddProductsToOption(n)}}" stepKey="clickAdd"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters1"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters1"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodOneSku}}" stepKey="fillProductSkuFilter1"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters1"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad1" time="30"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct1"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters2"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters2"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTwoSku}}" stepKey="fillProductSkuFilter2"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters2"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad2" time="30"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct2"/> + <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddButton1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="50" stepKey="fillQuantity1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="50" stepKey="fillQuantity2"/> + </actionGroup> + + <actionGroup name="addBundleOptionWithOneProduct" extends="addBundleOptionWithTwoProducts"> + <annotations> + <description>Requires Navigation to the Product Creation page. Adds Bundle Option with One Product as specified in arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleOptionWithOneProductActionGroup` instead --> + <remove keyForRemoval="openProductFilters2"/> + <remove keyForRemoval="fillProductSkuFilter2"/> + <remove keyForRemoval="clickApplyFilters2"/> + <remove keyForRemoval="waitForFilteredGridLoad2"/> + <remove keyForRemoval="selectProduct2"/> + <remove keyForRemoval="selectProduct2"/> + <remove keyForRemoval="fillQuantity1"/> + <remove keyForRemoval="fillQuantity2"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity" after="clickAddButton1"/> + </actionGroup> + + <actionGroup name="addBundleOptionWithTreeProducts" extends="addBundleOptionWithTwoProducts"> + <annotations> + <description>Requires Navigation to the Product Creation page. Adds Bundle Option with Three Products using the provided arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> + </annotations> + <arguments> + <argument name="prodTreeSku" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleOptionWithThreeProductsActionGroup` instead --> + <remove keyForRemoval="fillQuantity1"/> + <remove keyForRemoval="fillQuantity2"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity1" after="clickAddButton1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="1" stepKey="fillQuantity2" after="fillQuantity1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="1" stepKey="fillQuantity3" after="fillQuantity2"/> + </actionGroup> + + <actionGroup name="addBundleOptionWithSixProducts" extends="addBundleOptionWithTwoProducts"> + <annotations> + <description>Requires Navigation to Product Creation page. Adds Bundle Option with Six Products as specified in arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> + </annotations> + <arguments> + <argument name="prodTreeSku" type="string"/> + <argument name="prodFourSku" type="string"/> + <argument name="prodFiveSku" type="string"/> + <argument name="prodSixSku" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleOptionWithSixProductsActionGroup` instead --> + <remove keyForRemoval="fillQuantity1"/> + <remove keyForRemoval="fillQuantity2"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters4" after="selectProduct3"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters4" after="clickClearFilters4"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFourSku}}" stepKey="fillProductSkuFilter4" after="openProductFilters4"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters4" after="fillProductSkuFilter4"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad4" time="30" after="clickApplyFilters4"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct4" after="clickApplyFilters4"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters5" after="selectProduct4"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters5" after="clickClearFilters5"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFiveSku}}" stepKey="fillProductSkuFilter5" after="openProductFilters5"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters5" after="fillProductSkuFilter5"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad5" time="30" after="clickApplyFilters5"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct5" after="waitForFilteredGridLoad5"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters6" after="selectProduct5"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters6" after="clickClearFilters6"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodSixSku}}" stepKey="fillProductSkuFilter6" after="openProductFilters6"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters6" after="fillProductSkuFilter6"/> + <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad6" time="30" after="clickApplyFilters6"/> + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct6" after="waitForFilteredGridLoad6"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="2" stepKey="fillQuantity1" after="clickAddButton1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="2" stepKey="fillQuantity2" after="fillQuantity1"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="2" stepKey="fillQuantity3" after="fillQuantity2"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '3')}}" userInput="2" stepKey="fillQuantity4" after="fillQuantity3"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '4')}}" userInput="2" stepKey="fillQuantity5" after="fillQuantity4"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '5')}}" userInput="2" stepKey="fillQuantity6" after="fillQuantity5"/> + </actionGroup> + + <actionGroup name="deleteBundleOptionByIndex"> + <annotations> + <description>Requires Navigation to Product Creation page. Removes any Bundle Option by index specified in arguments. 'deleteIndex' refers to Bundle option number.</description> + </annotations> + <arguments> + <argument name="deleteIndex" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DeleteBundleOptionByIndexActionGroup` instead --> + <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> + <scrollTo selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" stepKey="scrollUpABit"/> + <click selector="{{AdminProductFormBundleSection.deleteOption(deleteIndex)}}" stepKey="clickDeleteOption"/> + </actionGroup> + + <actionGroup name="StorefrontAddBundleProductFromProductToCartWithMultiOption" extends="StorefrontAddBundleProductFromProductToCartActionGroup"> + <annotations> + <description>Selects a Bundled Product option on the Bundled Product page. PLEASE NOTE: The Quantity selection is not available in the Action Group.</description> + </annotations> + <arguments> + <argument name="optionName" type="string"/> + <argument name="value" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontAddBundleProductFromProductToCartWithMultiOptionActionGroup` instead --> + <selectOption selector="{{StorefrontBundledSection.multiselectOptionFourProducts(optionName)}}" userInput="{{value}}" stepKey="selectValue" before="clickAddBundleProductToCart"/> + </actionGroup> + + <actionGroup name="fillMainBundleProductForm"> + <annotations> + <description>Fills the Name, SKU and Stock Status fields.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="BundleProduct"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillMainBundleProductFormActionGroup` instead --> + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> + <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="selectStockStatus"/> + </actionGroup> + + <actionGroup name="checkRequiredFieldsInBundleProductForm"> + <annotations> + <description>Clears the Name and SKU fields when adding a Product and then verifies that they are required after attempting to Save.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CheckRequiredFieldsInBundleProductFormActionGroup` instead --> + <clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductSku"/> + <clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductName"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/> + <see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/> + <see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/> + </actionGroup> + + <actionGroup name="viewBundleProductInAdminGrid"> + <annotations> + <description>Clears the Grid Filters on the Catalog Grid page and applies Filter by Name and Sku. Then checks to see if the Product exists in the 1st row. Then clears the Grid Filters again for future Tests.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="BundleProduct"/> + <argument name="thumbnail" defaultValue="ProductPlaceholderImage"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ViewBundleProductInAdminGridActionGroup` instead --> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <waitForPageLoad stepKey="waitForPageLoadInitial"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> + <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionProductType"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeProductNameInGrid"/> + <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> + </actionGroup> +</actionGroups> From 24637fc96cb65ebf61f198c6279c0d6b208acc90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 22:03:21 +0100 Subject: [PATCH 376/595] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..ca17b0275ed5b --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + + <actionGroup name="StorefrontCustomerCheckProductInWishlist"> + <annotations> + <description>Validates that the provided Product details (Price and Name) are present in the Storefront Customer Dashboard Wish List.</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCustomerCheckProductInWishlistActionGroup` instead --> + <waitForElement selector="{{StorefrontCustomerWishlistProductSection.ProductTitleByName(productVar.name)}}" time="30" stepKey="assertWishlistProductName"/> + <see userInput="${{productVar.price}}.00" selector="{{StorefrontCustomerWishlistProductSection.ProductPriceByName(productVar.name)}}" stepKey="AssertWishlistProductPrice"/> + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(productVar.name)}}" stepKey="wishlistMoveMouseOverProduct"/> + <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductAddToCartByName(productVar.name)}}" stepKey="AssertWishlistAddToCart"/> + <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductImageByName(productVar.name)}}" stepKey="AssertWishlistProductImage"/> + </actionGroup> + + <actionGroup name="StorefrontCustomerCheckProductInWishlistSidebar"> + <annotations> + <description>Validates that the provided Product details (Name) are present in the Wish List side bar menu.</description> + </annotations> + <arguments> + <argument name="productVar"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCustomerCheckProductInWishlistSidebarActionGroup` instead --> + <waitForElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductTitleByName(productVar.name)}}" time="30" stepKey="assertWishlistSidebarProductName"/> + <see userInput="${{productVar.price}}.00" selector="{{StorefrontCustomerWishlistSidebarSection.ProductPriceByName(productVar.name)}}" stepKey="AssertWishlistSidebarProductPrice"/> + <seeElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductAddToCartByName(productVar.name)}}" stepKey="AssertWishlistSidebarAddToCart"/> + <seeElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductImageByName(productVar.name)}}" stepKey="AssertWishlistSidebarProductImage"/> + </actionGroup> + + <actionGroup name="StorefrontCustomerRemoveProductFromWishlistUsingSidebar"> + <annotations> + <description>Removes the provided Product from the Wish List side bar menu. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCustomerRemoveProductFromWishlistUsingSidebarActionGroup` instead --> + <click selector="{{StorefrontCustomerWishlistSidebarSection.ProductRemoveByName(product.name)}}" stepKey="RemoveProductFromWishlistUsingSidebarClickRemoveItemFromWishlist"/> + <waitForElement selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="RemoveProductFromWishlistUsingSidebarWaitForSuccessMessage"/> + <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="{{product.name}} has been removed from your Wish List." stepKey="RemoveProductFromWishlistUsingSidebarSeeProductNameRemovedFromWishlist"/> + </actionGroup> + + <actionGroup name="StorefrontCustomerAddProductToCartFromWishlistUsingSidebar"> + <annotations> + <description>Add the provided Product to the Cart from the Wish List side bar menu. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCustomerAddProductToCartFromWishlistUsingSidebarActionGroup` instead --> + <click selector="{{StorefrontCustomerWishlistSidebarSection.ProductAddToCartByName(product.name)}}" stepKey="AddProductToCartFromWishlistUsingSidebarClickAddToCartFromWishlist"/> + <waitForElement selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="AddProductToCartFromWishlistUsingSidebarWaitForSuccessMessage"/> + <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added {{product.name}} to your shopping cart." stepKey="AddProductToCartFromWishlistUsingSidebarSeeProductNameAddedToCartFromWishlist"/> + </actionGroup> + + <actionGroup name="StorefrontCustomerEditProductInWishlist"> + <annotations> + <description>Edits the provided Product on the Storefront Wish List page. Fills in the provided Description and Quantity. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="description" type="string"/> + <argument name="quantity" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCustomerEditProductInWishlistActionGroup` instead --> + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(product.name)}}" stepKey="mouseOverOnProduct"/> + <fillField selector="{{StorefrontCustomerWishlistProductSection.ProductDescription(product.name)}}" userInput="{{description}}" stepKey="fillDescription"/> + <fillField selector="{{StorefrontCustomerWishlistProductSection.ProductQuantity(product.name)}}" userInput="{{quantity}}" stepKey="fillQuantity"/> + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductAddAllToCart}}" stepKey="mouseOver"/> + <click selector="{{StorefrontCustomerWishlistProductSection.ProductUpdateWishList}}" stepKey="submitUpdateWishlist"/> + <see selector="{{StorefrontCustomerWishlistProductSection.ProductSuccessUpdateMessage}}" userInput="{{product.name}} has been updated in your Wish List." stepKey="successMessage"/> + </actionGroup> + + <actionGroup name="StorefrontAssertCustomerWishlistIsEmpty"> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontAssertCustomerWishlistIsEmptyActionGroup` instead --> + <dontSeeElement selector="{{StorefrontCustomerWishlistProductSection.pager}}" stepKey="checkThatPagerIsAbsent"/> + <see selector="{{StorefrontCustomerWishlistProductSection.wishlistEmpty}}" userInput="You have no items in your wish list." stepKey="checkNoItemsMessage"/> + </actionGroup> +</actionGroups> From 8519c5d8da998647f7d052493114fb9e893714a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 22:12:56 +0100 Subject: [PATCH 377/595] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..0230f5b1c8e3e --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + + + <actionGroup name="AdminAddNewUserRoleWithCustomRoleScopes" extends="AdminAddNewUserRoleActionGroup"> + <arguments> + <argument name="customWebsiteName" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddNewUserRoleWithCustomRoleScopesActionGroup` instead --> + <checkOption selector="{{AdminCreateRoleSection.selectWebsite(customWebsiteName)}}" stepKey="checkWebsite" after="selectRoleResources"/> + </actionGroup> + <actionGroup name="AdminFillUserRoleRequiredData" extends="AdminCreateRoleActionGroup"> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminFillUserRoleRequiredDataActionGroup` instead --> + <remove keyForRemoval="clickRoleResourcesTab"/> + <remove keyForRemoval="waitForScopeSelection"/> + <remove keyForRemoval="selectResourceAccessCustom"/> + <remove keyForRemoval="waitForElementVisible"/> + <remove keyForRemoval="clickContentBlockCheckbox"/> + <remove keyForRemoval="clickSaveRoleButton"/> + <remove keyForRemoval="waitForPageLoad2"/> + </actionGroup> + <actionGroup name="AdminAddRestrictedRole" extends="AdminCreateRoleActionGroup"> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddRestrictedRoleActionGroup` instead --> + <remove keyForRemoval="navigateToNewRole"/> + <remove keyForRemoval="waitForPageLoad1"/> + <remove keyForRemoval="fillRoleName"/> + <remove keyForRemoval="enterPassword"/> + <remove keyForRemoval="clickRoleResourcesTab"/> + <remove keyForRemoval="waitForScopeSelection"/> + <remove keyForRemoval="clickSaveRoleButton"/> + <remove keyForRemoval="waitForPageLoad2"/> + <scrollTo selector="{{AdminEditRoleInfoSection.blockName('restrictedRole')}}" x="0" y="-100" stepKey="scrollToResourceElement" after="selectResourceAccessCustom"/> + </actionGroup> + <actionGroup name="AdminCreateRole"> + <annotations> + <description>Clicks on 'Add New Role'. Fills in the provided details (Role, Resource, Scope and Websites). Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="role" type="string" defaultValue=""/> + <argument name="resource" type="string" defaultValue="All"/> + <argument name="scope" type="string" defaultValue="Custom"/> + <argument name="websites" type="string" defaultValue="Main Website"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateRoleActionGroup` instead --> + <click selector="{{AdminCreateRoleSection.create}}" stepKey="clickToAddNewRole"/> + <fillField selector="{{AdminCreateRoleSection.name}}" userInput="{{role.name}}" stepKey="setRoleName"/> + <fillField stepKey="setPassword" selector="{{AdminCreateRoleSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> + <click selector="{{AdminCreateRoleSection.roleResources}}" stepKey="clickToOpenRoleResources"/> + <waitForPageLoad stepKey="waitForRoleResourcePage" time="5"/> + <click stepKey="checkSales" selector="//a[text()='Sales']"/> + <click selector="{{AdminCreateRoleSection.save}}" stepKey="clickToSaveRole"/> + <waitForPageLoad stepKey="waitForPageLoad" time="10"/> + <see userInput="You saved the role." stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> From bb7eca034eac3fa1514bd78df347f0e9f46bd06b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 22:19:45 +0100 Subject: [PATCH 378/595] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- ....xml => AdminAddUrlRewriteActionGroup.xml} | 0 .../ActionGroup/_Deprecated_ActionGroup.xml | 296 ++++++++++++++++++ 2 files changed, 296 insertions(+) rename app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/{AdminUrlRewriteActionGroup.xml => AdminAddUrlRewriteActionGroup.xml} (100%) create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteActionGroup.xml similarity index 100% rename from app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteActionGroup.xml rename to app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminAddUrlRewriteActionGroup.xml diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..c990db8cc3cf8 --- /dev/null +++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,296 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAddUrlRewrite"> + <annotations> + <description>Goes to the Admin Add URL Rewrite edit page. Fills in the provided URL details. Clicks on Save. Validates that the Success Message is present.</description> + </annotations> + <arguments> + <argument name="category" type="string"/> + <argument name="customUrlRewriteValue" type="string"/> + <argument name="storeValue" type="string"/> + <argument name="requestPath" type="string"/> + <argument name="redirectTypeValue" type="string"/> + <argument name="description" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddUrlRewriteActionGroup` instead --> + <amOnPage url="{{AdminUrlRewriteEditPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForElementVisible selector="{{AdminUrlRewriteEditSection.createCustomUrlRewrite}}" stepKey="waitForCreateUrlRewriteVisible"/> + <selectOption selector="{{AdminUrlRewriteEditSection.createCustomUrlRewrite}}" userInput="{{customUrlRewriteValue}}" stepKey="selectUrlRewriteTypeOption"/> + <waitForElementVisible selector="{{AdminUrlRewriteEditSection.categoryInTree(category)}}" stepKey="waitForCategoryInTreeVisible"/> + <click selector="{{AdminUrlRewriteEditSection.categoryInTree(category)}}" stepKey="clickOnCategoryInTree"/> + <waitForElementVisible selector="{{AdminUrlRewriteEditSection.store}}" stepKey="waitForStoreSelectVisible"/> + <selectOption selector="{{AdminUrlRewriteEditSection.store}}" userInput="{{storeValue}}" stepKey="selectStoreOption"/> + <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPathField"/> + <selectOption selector="{{AdminUrlRewriteEditSection.redirectType}}" userInput="{{redirectTypeValue}}" stepKey="selectRedirectType"/> + <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescriptionField"/> + <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveButton"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="The URL Rewrite has been saved." stepKey="seeSuccessMessage"/> + </actionGroup> + + <actionGroup name="AdminAddUrlRewriteForProduct"> + <annotations> + <description>Adds the provided URL Rewrite details for a Product.</description> + </annotations> + <arguments> + <argument name="storeValue" type="string"/> + <argument name="requestPath" type="string"/> + <argument name="redirectTypeValue" type="string"/> + <argument name="description" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddUrlRewriteForProductActionGroup` instead --> + <waitForElementVisible selector="{{AdminUrlRewriteProductSection.skipCategoryButton}}" stepKey="waitForSkipCategoryButton"/> + <click selector="{{AdminUrlRewriteProductSection.skipCategoryButton}}" stepKey="clickOnSkipCategoryButton"/> + <waitForPageLoad stepKey="waitForProductPageToLoad"/> + <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> + <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> + <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> + <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue('redirectTypeValue')}}" stepKey="clickOnRedirectTypeValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> + <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> + <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> + </actionGroup> + + <actionGroup name="AdminAddCustomUrlRewrite"> + <annotations> + <description>Goes to the Admin URL Rewrite edit page. Adds the provided Custom URL Rewrite details. Clicks on Save. Validates that the Success Message is present.</description> + </annotations> + <arguments> + <argument name="customUrlRewriteValue" type="string"/> + <argument name="storeValue" type="string"/> + <argument name="requestPath" type="string"/> + <argument name="targetPath" type="string"/> + <argument name="redirectTypeValue" type="string"/> + <argument name="description" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddCustomUrlRewriteActionGroup` instead --> + <amOnPage url="{{AdminUrlRewriteEditPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad" after="openUrlRewriteEditPage"/> + <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewrite}}" stepKey="clickOnCustonUrlRewrite"/> + <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewriteValue('customUrlRewriteValue')}}" stepKey="selectCustom"/> + <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> + <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> + <fillField selector="{{AdminUrlRewriteEditSection.targetPath}}" userInput="{{targetPath}}" stepKey="fillTargetPath"/> + <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> + <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue('redirectTypeValue')}}" stepKey="selectRedirectTypeValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> + <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> + <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> + </actionGroup> + + <actionGroup name="AdminUpdateUrlRewrite"> + <annotations> + <description>Updates the URL Rewrite fields with the provided details.</description> + </annotations> + <arguments> + <argument name="storeValue" type="string"/> + <argument name="requestPath" type="string"/> + <argument name="redirectTypeValue" type="string"/> + <argument name="description" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminUpdateUrlRewriteActionGroup` instead --> + <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> + <click selector="{{AdminUrlRewriteEditSection.storeValue(storeValue)}}" stepKey="clickOnStoreValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> + <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> + <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue(redirectTypeValue)}}" stepKey="selectRedirectTypeValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> + <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> + <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> + </actionGroup> + + <actionGroup name="AdminUpdateCustomUrlRewrite"> + <annotations> + <description>Updates the Custom URL Rewrite fields with the provided details.</description> + </annotations> + <arguments> + <argument name="storeValue" type="string"/> + <argument name="requestPath" type="string"/> + <argument name="targetPath" type="string"/> + <argument name="redirectTypeValue" type="string"/> + <argument name="description" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminUpdateCustomUrlRewriteActionGroup` instead --> + <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> + <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> + <fillField selector="{{AdminUrlRewriteEditSection.targetPath}}" userInput="{{targetPath}}" stepKey="fillTargetPath"/> + <selectOption selector="{{AdminUrlRewriteEditSection.redirectType}}" userInput="{{redirectTypeValue}}" stepKey="selectRedirectTypeValue"/> + <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> + <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> + <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> + </actionGroup> + <actionGroup name="AdminSearchByRequestPath"> + <annotations> + <description>Goes to the Admin URL Rewrite grid page. Searches the grid based on the provided Redirect Path. Validates that the provided Redirect Path, Type and Target Path are present and correct in the grid.</description> + </annotations> + <arguments> + <argument name="redirectPath" type="string"/> + <argument name="redirectType" type="string"/> + <argument name="targetPath" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminSearchByRequestPathActionGroup` instead --> + <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> + <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{redirectPath}}" stepKey="fillRedirectPathFilter"/> + <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + <see selector="{{AdminUrlRewriteIndexSection.requestPathColumn('1')}}" userInput="{{redirectPath}}" stepKey="seeTheRedirectPathForOldUrl"/> + <see selector="{{AdminUrlRewriteIndexSection.targetPathColumn('1')}}" userInput="{{targetPath}}" stepKey="seeTheTargetPath"/> + <see selector="{{AdminUrlRewriteIndexSection.redirectTypeColumn('1')}}" userInput="{{redirectType}}" stepKey="seeTheRedirectTypeForOldUrl"/> + </actionGroup> + + <actionGroup name="AdminSearchUrlRewriteProductBySku"> + <annotations> + <description>Goes to the Admin URL Rewrite grid page. Searches the grid based on the provided Product SKU. Clicks on the 1st row in the grid.</description> + </annotations> + <arguments> + <argument name="productSku" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminSearchUrlRewriteProductBySkuActionGroup` instead --> + <amOnPage url="{{AdminUrlRewriteProductPage.url}}" stepKey="openUrlRewriteProductPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteProductPageToLoad"/> + <click selector="{{AdminUrlRewriteProductSection.resetFilter}}" stepKey="clickOnResetFilter"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminUrlRewriteProductSection.skuFilter}}" userInput="{{productSku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminUrlRewriteProductSection.searchFilter}}" stepKey="clickOnSearchFilter"/> + <waitForPageLoad stepKey="waitForProductToLoad"/> + <click selector="{{AdminUrlRewriteProductSection.productRow}}" stepKey="clickOnFirstRow"/> + <waitForPageLoad stepKey="waitForProductCategoryPageToLoad"/> + </actionGroup> + + <actionGroup name="AdminSearchDeletedUrlRewrite"> + <annotations> + <description>Goes to the Admin URL Rewrite grid page. Searches the grid for the provided Request Path. Validates that it does NOT appear in the grid.</description> + </annotations> + <arguments> + <argument name="requestPath" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminSearchDeletedUrlRewriteActionGroup` instead --> + <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> + <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> + <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + <see selector="{{AdminUrlRewriteIndexSection.emptyRecords}}" userInput="We couldn't find any records." stepKey="seeEmptyRecordMessage"/> + </actionGroup> + + <actionGroup name="AdminDeleteUrlRewrite"> + <annotations> + <description>Goes to the Admin URL Rewrite grid page. Deletes the provided Request Path. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="requestPath" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDeleteUrlRewriteActionGroup` instead --> + <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> + <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> + <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + <click selector="{{AdminUrlRewriteIndexSection.editButton('1')}}" stepKey="clickOnEditButton"/> + <waitForPageLoad stepKey="waitForEditPageToLoad"/> + <click selector="{{AdminUrlRewriteEditSection.deleteButton}}" stepKey="clickOnDeleteButton"/> + <waitForPageLoad stepKey="waitForPageToLoad2"/> + <waitForElementVisible selector="{{AdminUrlRewriteEditSection.okButton}}" stepKey="waitForOkButtonToVisible"/> + <click selector="{{AdminUrlRewriteEditSection.okButton}}" stepKey="clickOnOkButton"/> + <waitForPageLoad stepKey="waitForPageToLoad3"/> + <see selector="{{AdminUrlRewriteIndexSection.successMessage}}" userInput="You deleted the URL rewrite." stepKey="seeSuccessMessage"/> + </actionGroup> + + <actionGroup name="AssertPageByUrlRewriteIsNotFound"> + <annotations> + <description>Validates that the provided Request Path does NOT exist on the Storefront. Validates that the 'Whoops' message is present and correct.</description> + </annotations> + <arguments> + <argument name="requestPath" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertPageByUrlRewriteIsNotFoundActionGroup` instead --> + <amOnPage url="{{requestPath}}" stepKey="amOnPage"/> + <waitForPageLoad stepKey="waitForStorefrontPageLoad"/> + <see userInput="Whoops, our bad..." stepKey="seeWhoops"/> + </actionGroup> + + <actionGroup name="AdminSearchAndSelectUrlRewriteInGrid"> + <annotations> + <description>Goes to the Admin URL Rewrite grid page. Searches the grid for the provided Request Path. Clicks on Edit.</description> + </annotations> + <arguments> + <argument name="requestPath" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminSearchAndSelectUrlRewriteInGridActionGroup` instead --> + <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> + <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> + <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> + <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + <click selector="{{AdminUrlRewriteIndexSection.editButton('1')}}" stepKey="clickOnEditButton"/> + <waitForPageLoad stepKey="waitForEditPageToLoad"/> + </actionGroup> + + <actionGroup name="AssertStorefrontUrlRewriteRedirect"> + <annotations> + <description>Goes to the provided New URL. Validates that the redirect works and the provided Category is present.</description> + </annotations> + <arguments> + <argument name="category" type="string"/> + <argument name="newRequestPath" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStorefrontUrlRewriteRedirectActionGroup` instead --> + <amOnPage url="{{newRequestPath}}" stepKey="openCategoryInStorefront"/> + <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> + <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(category)}}" stepKey="seeCategoryOnStoreNavigationBar"/> + <seeElement selector="{{StorefrontCategoryMainSection.CategoryTitle(category)}}" stepKey="seeCategoryInTitle"/> + </actionGroup> + + <actionGroup name="AssertStorefrontProductRedirect"> + <annotations> + <description>Goes to the provided New Product URL. Validates that the redirect works and the provided Product is present and correct.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="productSku" type="string"/> + <argument name="productRequestPath" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStorefrontProductRedirectActionGroup` instead --> + <amOnPage url="{{productRequestPath}}" stepKey="openCategoryInStorefront"/> + <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{productName}}" stepKey="seeProductNameInStoreFrontPage"/> + <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{productSku}}" stepKey="seeProductSkuInStoreFrontPage"/> + </actionGroup> +</actionGroups> From 64936e3174869374bb767b820ce2fc3eb52ab864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 22:23:24 +0100 Subject: [PATCH 379/595] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 app/code/Magento/Ui/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..48d6b90ddb8dc --- /dev/null +++ b/app/code/Magento/Ui/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="searchAdminDataGridByKeyword"> + <annotations> + <description>Fills 'Search by keyword' on an Admin Grid page. Clicks on Submit Search.</description> + </annotations> + <arguments> + <argument name="keyword"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SearchAdminDataGridByKeywordActionGroup` instead --> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <fillField selector="{{AdminDataGridHeaderSection.search}}" userInput="{{keyword}}" stepKey="fillKeywordSearchField"/> + <click selector="{{AdminDataGridHeaderSection.submitSearch}}" stepKey="clickKeywordSearch"/> + </actionGroup> + + <actionGroup name="resetAdminDataGridToDefaultView"> + <annotations> + <description>Resets an Admin Grid page to the 'Default View'.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ResetAdminDataGridToDefaultViewActionGroup` instead --> + <click selector="{{AdminDataGridHeaderSection.bookmarkToggle}}" stepKey="openViewBookmarks"/> + <click selector="{{AdminDataGridHeaderSection.bookmarkOption('Default View')}}" stepKey="selectDefaultGridView"/> + <see selector="{{AdminDataGridHeaderSection.bookmarkToggle}}" userInput="Default View" stepKey="seeDefaultViewSelected"/> + </actionGroup> + + <actionGroup name="clearFiltersAdminDataGrid"> + <annotations> + <description>Clicks on 'Clear Filters' on an Admin Grid page.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ClearFiltersAdminDataGridActionGroup` instead --> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + </actionGroup> + + <actionGroup name="adminDataGridSelectPerPage"> + <annotations> + <description>Sets the provided preset 'per page' display setting on an Admin Grid page.</description> + </annotations> + <arguments> + <argument name="perPage" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDataGridSelectPerPageActionGroup` instead --> + <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> + <click selector="{{AdminDataGridPaginationSection.perPageOption(perPage)}}" stepKey="selectCustomPerPage"/> + <waitForPageLoad stepKey="waitForGridLoad"/> + </actionGroup> + + <actionGroup name="adminDataGridSelectCustomPerPage"> + <annotations> + <description>Sets the provided custom 'per page' display setting on an Admin Grid page.</description> + </annotations> + <arguments> + <argument name="perPage"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDataGridSelectCustomPerPageActionGroup` instead --> + <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> + <click selector="{{AdminDataGridPaginationSection.perPageOption('Custom')}}" stepKey="selectCustomPerPage"/> + <waitForElementVisible selector="{{AdminDataGridPaginationSection.perPageInput}}" time="30" stepKey="waitForInputVisible"/> + <fillField selector="{{AdminDataGridPaginationSection.perPageInput}}" userInput="{{perPage}}" stepKey="fillCustomPerPage"/> + <click selector="{{AdminDataGridPaginationSection.perPageApplyInput}}" stepKey="applyCustomPerPage"/> + <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> + <seeInField selector="{{AdminDataGridPaginationSection.perPageDropDownValue}}" userInput="{{perPage}}" stepKey="seePerPageValueInDropDown"/> + </actionGroup> + + <actionGroup name="adminDataGridDeleteCustomPerPage"> + <annotations> + <description>Sets the provided custom 'per page' display setting on an Admin Grid page. Deletes the Items listed in a grid. Validates that the 'per page' count in NOT present.</description> + </annotations> + <arguments> + <argument name="perPage"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDataGridDeleteCustomPerPageActionGroup` instead --> + <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown1"/> + <click selector="{{AdminDataGridPaginationSection.perPageEditCustomValue(perPage)}}" stepKey="clickToEditCustomPerPage"/> + <waitForElementVisible selector="{{AdminDataGridPaginationSection.perPageDeleteCustomValue(perPage)}}" time="30" stepKey="waitForDeleteButtonVisible"/> + <click selector="{{AdminDataGridPaginationSection.perPageDeleteCustomValue(perPage)}}" stepKey="clickToDeleteCustomPerPage"/> + <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> + <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> + <dontSeeElement selector="{{AdminDataGridPaginationSection.perPageDropDownItem(perPage)}}" stepKey="dontSeeDropDownItem"/> + </actionGroup> +</actionGroups> From 8289f8cd676459040a0d23c22a2854debbcbfb87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 22:33:29 +0100 Subject: [PATCH 380/595] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- ...xml => AddCustomerTaxClassActionGroup.xml} | 0 .../ActionGroup/_Deprecated_ActionGroup.xml | 271 ++++++++++++++++++ 2 files changed, 271 insertions(+) rename app/code/Magento/Tax/Test/Mftf/ActionGroup/{AdminCustomerTaxClassActionGroup.xml => AddCustomerTaxClassActionGroup.xml} (100%) create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminCustomerTaxClassActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AddCustomerTaxClassActionGroup.xml similarity index 100% rename from app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminCustomerTaxClassActionGroup.xml rename to app/code/Magento/Tax/Test/Mftf/ActionGroup/AddCustomerTaxClassActionGroup.xml diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..95516361a74f5 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,271 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="addCustomerTaxClass"> + <annotations> + <description>Adds the provided Customer Tax Class on the Admin Tax Rule creation/edit page.</description> + </annotations> + <arguments> + <argument name="customerTaxClassName" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddCustomerTaxClassActionGroup` instead --> + <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> + <click stepKey="clickCustomerAddNewTaxClassBtn" selector="{{AdminTaxRulesSection.customerAddNewTaxClass}}"/> + <fillField stepKey="fillCustomerNewTaxClass" selector="{{AdminTaxRulesSection.fieldCustomerNewTaxClass}}" userInput="{{customerTaxClassName}}"/> + <click stepKey="saveProdTaxRate" selector="{{AdminTaxRulesSection.saveCustomerNewTaxClass}}"/> + </actionGroup> + + <actionGroup name="deleteCustomerTaxClass"> + <annotations> + <description>Goes to the Admin New Tax Rule page. Deletes the provided Tax Class Name.</description> + </annotations> + <arguments> + <argument name="taxClassName" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DeleteCustomerTaxClassActionGroup` instead --> + <amOnPage url="{{AdminNewTaxRulePage.url}}" stepKey="goToNewTaxRulePage"/> + <waitForPageLoad stepKey="waitForTaxRatePage"/> + <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> + <scrollTo stepKey="scrollToAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> + <moveMouseOver stepKey="hoverDeleteElement" selector="{{AdminTaxRulesSection.deleteTaxClassName(taxClassName)}}"/> + <click stepKey="deleteFirstTaxClass" selector="{{AdminTaxRulesSection.deleteTaxClass(taxClassName)}}"/> + <waitForElementVisible selector="{{AdminTaxRulesSection.popUpDialogOK}}" stepKey="waitForElementBecomeVisible"/> + <click stepKey="acceptPopUpDialog" selector="{{AdminTaxRulesSection.popUpDialogOK}}"/> + <waitForPageLoad stepKey="waitForProductTaxClassDeleted"/> + </actionGroup> + <actionGroup name="editTaxConfigurationByUI"> + <annotations> + <description>Goes to the 'Configuration' page for 'Tax'. Enables the display of Taxes in the Storefront Shopping Cart and Checkout page.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `EditTaxConfigurationByUIActionGroup` instead --> + <amOnPage url="{{AdminTaxConfigurationPage.url}}" stepKey="goToAdminTaxPage"/> + <waitForPageLoad stepKey="waitForTaxConfigLoad"/> + + <scrollTo selector="#tax_defaults-head" x="0" y="-80" stepKey="scrollToTaxDefaults"/> + + <conditionalClick stepKey="clickCalculationSettings" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="#tax_defaults" visible="false"/> + <conditionalClick stepKey="clickCalculationSettingsAgain" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="#tax_defaults" visible="false"/> + <uncheckOption stepKey="clickDefaultState" selector="{{AdminConfigureTaxSection.systemValueDefaultState}}"/> + <selectOption stepKey="selectDefaultState" selector="{{AdminConfigureTaxSection.dropdownDefaultState}}" userInput="California"/> + <fillField stepKey="fillDefaultPostCode" selector="{{AdminConfigureTaxSection.defaultPostCode}}" userInput="*"/> + + <scrollTo selector="#tax_cart_display-head" x="0" y="-80" stepKey="scrollToTaxShoppingCartDisplay"/> + + <conditionalClick stepKey="clickShoppingCartDisplaySettings" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="#tax_cart_display" visible="false"/> + <conditionalClick stepKey="clickShoppingCartDisplaySettingsAgain" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="#tax_cart_display" visible="false"/> + <uncheckOption stepKey="clickTaxTotalCart" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}"/> + <selectOption stepKey="selectTaxTotalCart" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalCart}}" userInput="Yes"/> + <uncheckOption stepKey="clickDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummaryCart}}"/> + <selectOption stepKey="selectDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummaryCart}}" userInput="Yes"/> + <uncheckOption stepKey="clickDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxCart}}"/> + <selectOption stepKey="selectDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxCart}}" userInput="Yes"/> + + <scrollTo selector="#tax_sales_display-head" x="0" y="-80" stepKey="scrollToTaxSalesDisplay"/> + + <conditionalClick stepKey="clickOrdersInvoicesCreditSales" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="#tax_sales_display" visible="false"/> + <conditionalClick stepKey="clickOrdersInvoicesCreditSalesAgain" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="#tax_sales_display" visible="false"/> + <uncheckOption stepKey="clickTaxTotalSales" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}"/> + <selectOption stepKey="selectTaxTotalSales" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalSales}}" userInput="Yes"/> + <uncheckOption stepKey="clickDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummarySales}}"/> + <selectOption stepKey="selectDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummarySales}}" userInput="Yes"/> + <uncheckOption stepKey="clickDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxSales}}"/> + <selectOption stepKey="selectDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxSales}}" userInput="Yes"/> + + <scrollToTopOfPage stepKey="scrollToTop"/> + <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> + <waitForPageLoad stepKey="waitForTaxSaved"/> + <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> + </actionGroup> + + <actionGroup name="changeToDefaultTaxConfigurationUI"> + <annotations> + <description>Goes to the 'Configuration' page for 'Tax'. Set the Tax Configuration Settings to the Default values. Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeToDefaultTaxConfigurationUIActionGroup` instead --> + <amOnPage url="{{AdminTaxConfigurationPage.url}}" stepKey="goToAdminTaxPage"/> + <waitForPageLoad stepKey="waitForTaxConfigLoad"/> + + <conditionalClick stepKey="clickCalculationSettings" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="{{AdminConfigureTaxSection.systemValueDefaultState}}" visible="false"/> + <conditionalClick stepKey="clickCalculationSettingsAgain" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="{{AdminConfigureTaxSection.systemValueDefaultState}}" visible="false"/> + <checkOption stepKey="clickDefaultState" selector="{{AdminConfigureTaxSection.systemValueDefaultState}}"/> + <selectOption stepKey="selectDefaultState" selector="{{AdminConfigureTaxSection.dropdownDefaultState}}" userInput="California"/> + <fillField stepKey="fillDefaultPostCode" selector="{{AdminConfigureTaxSection.defaultPostCode}}" userInput=""/> + + <conditionalClick stepKey="clickShoppingCartDisplaySettings" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}" visible="false"/> + <conditionalClick stepKey="clickShoppingCartDisplaySettingsAgain" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}" visible="false"/> + <checkOption stepKey="clickTaxTotalCart" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}"/> + <selectOption stepKey="selectTaxTotalCart" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalCart}}" userInput="Yes"/> + <checkOption stepKey="clickDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummaryCart}}"/> + <selectOption stepKey="selectDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummaryCart}}" userInput="Yes"/> + <checkOption stepKey="clickDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxCart}}"/> + <selectOption stepKey="selectDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxCart}}" userInput="Yes"/> + + <conditionalClick stepKey="clickOrdersInvoicesCreditSales" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}" visible="false"/> + <conditionalClick stepKey="clickOrdersInvoicesCreditSalesAgain" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}" visible="false"/> + <checkOption stepKey="clickTaxTotalSales" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}"/> + <selectOption stepKey="selectTaxTotalSales" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalSales}}" userInput="Yes"/> + <checkOption stepKey="clickDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummarySales}}"/> + <selectOption stepKey="selectDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummarySales}}" userInput="Yes"/> + <checkOption stepKey="clickDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxSales}}"/> + <selectOption stepKey="selectDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxSales}}" userInput="Yes"/> + + <scrollToTopOfPage stepKey="scrollToTop"/> + <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> + <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> + </actionGroup> + + <actionGroup name="addCustomTaxRate" extends="addNewTaxRateNoZip"> + <annotations> + <description>EXTENDS: addNewTaxRateNoZip. Removes 'fillZipCode' and 'fillRate'. Fills in the Zip Code and Rate. PLEASE NOTE: The values are Hardcoded.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddCustomTaxRateActionGroup` instead --> + <remove keyForRemoval="fillZipCode"/> + <remove keyForRemoval="fillRate"/> + <fillField stepKey="fillZipCode" selector="{{AdminTaxRulesSection.zipCode}}" userInput="US-NY-*-Rate 2" after="fillTaxIdentifier"/> + <fillField stepKey="fillRate" selector="{{AdminTaxRulesSection.rate}}" userInput="0" after="selectCountry"/> + </actionGroup> + + <actionGroup name="addNewTaxRateNoZip"> + <annotations> + <description>Goes to the Admin Tax Rules grid page. Adds the provided Tax Code.</description> + </annotations> + <arguments> + <argument name="taxCode"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddNewTaxRateNoZipActionGroup` instead --> + <click stepKey="addNewTaxRate" selector="{{AdminTaxRulesSection.addNewTaxRate}}"/> + + <fillField stepKey="fillTaxIdentifier" selector="{{AdminTaxRulesSection.taxIdentifier}}" userInput="{{taxCode.state}}-{{taxCode.rate}}"/> + <fillField stepKey="fillZipCode" selector="{{AdminTaxRulesSection.zipCode}}" userInput="{{taxCode.zip}}"/> + <selectOption stepKey="selectState" selector="{{AdminTaxRulesSection.state}}" userInput="{{taxCode.state}}"/> + <selectOption stepKey="selectCountry" selector="{{AdminTaxRulesSection.country}}" userInput="{{taxCode.country}}"/> + <fillField stepKey="fillRate" selector="{{AdminTaxRulesSection.rate}}" userInput="{{taxCode.rate}}"/> + + <click stepKey="saveTaxRate" selector="{{AdminTaxRulesSection.save}}"/> + </actionGroup> + + <actionGroup name="changeShippingTaxClass"> + <annotations> + <description>Goes to the 'Configuration' page for 'Tax'. Sets the 'Tax Class for Shipping' configuration setting to 'Taxable Goods'. Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeShippingTaxClassActionGroup` instead --> + <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES"/> + <waitForPageLoad stepKey="waitForConfiguration"/> + <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations"/> + <waitForPageLoad stepKey="waitForSales"/> + + <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES1"/> + <waitForPageLoad stepKey="waitForConfiguration1"/> + <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations1"/> + <waitForPageLoad stepKey="waitForSales1" time="5"/> + + <click selector="{{ConfigurationListSection.sales}}" stepKey="clickOnSales"/> + <waitForPageLoad stepKey="waitForPaymentMethods"/> + <click selector="{{AdminConfigureTaxSection.salesTax}}" stepKey="clickOnTax"/> + <waitForPageLoad stepKey="waitForTax"/> + <seeInCurrentUrl url="{{AdminTaxConfigurationPage.url}}" stepKey="adminTaxConfiguration"/> + <seeElement selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="taxClassSectionC"/> + <click selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="openTaxClassSection"/> + <click selector="{{AdminConfigureTaxSection.taxShippingClassSystem}}" stepKey="uncheckSystemValue"/> + <selectOption selector="{{AdminConfigureTaxSection.taxClassShipping}}" userInput="Taxable Goods" stepKey="setTaxClassForShipping"/> + + <scrollToTopOfPage stepKey="scrollToTop"/> + <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> + <waitForPageLoad stepKey="waitForTaxSaved"/> + <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> + </actionGroup> + + <actionGroup name="setDefaultShippingTaxClass"> + <annotations> + <description>Goes to the 'Configuration' page via the Admin Side Menu. Sets the 'Tax Class for Shipping' to the System Default. Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SetDefaultShippingTaxClassActionGroup` instead --> + <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES"/> + <waitForPageLoad stepKey="waitForConfiguration"/> + <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations"/> + <waitForPageLoad stepKey="waitForSales"/> + + <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES1"/> + <waitForPageLoad stepKey="waitForConfiguration1"/> + <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations1"/> + <waitForPageLoad stepKey="waitForSales1"/> + + <click selector="{{ConfigurationListSection.sales}}" stepKey="clickOnSales"/> + <waitForPageLoad stepKey="waitForPaymentMethods"/> + <click selector="{{AdminConfigureTaxSection.salesTax}}" stepKey="clickOnTax"/> + <waitForPageLoad stepKey="waitForTax"/> + <seeElement selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="taxClassSectionC"/> + <click selector="{{AdminConfigureTaxSection.taxShippingClassSystem}}" stepKey="checkSystemDefaultValue"/> + <click selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="closeTaxClassSection"/> + + <scrollToTopOfPage stepKey="scrollToTop"/> + <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> + <waitForPageLoad stepKey="waitForTaxSaved"/> + <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> + </actionGroup> + + <actionGroup name="addProductTaxClass"> + <annotations> + <description>Adds the provided Product Tax Class to a Tax Rule. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="prodTaxClassName" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddProductTaxClassActionGroup` instead --> + <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> + <click stepKey="clickProdAddNewTaxClassBtn" selector="{{AdminTaxRulesSection.productAddNewTaxClass}}"/> + <fillField stepKey="fillProdNewTaxClass" selector="{{AdminTaxRulesSection.fieldProdNewTaxClass}}" userInput="{{prodTaxClassName}}"/> + <click stepKey="saveProdTaxRate" selector="{{AdminTaxRulesSection.saveProdNewTaxClass}}"/> + </actionGroup> + + <actionGroup name="addNewTaxRuleActionGroup"> + <annotations> + <description>Goes to the Admin Tax Rules grid page. Clicks on the Add New Tax Rule button.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddNewTaxRuleActionGroup` instead --> + <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> + <waitForPageLoad stepKey="waitForTaxRatePage"/> + <click stepKey="addNewTaxRate" selector="{{AdminGridMainControls.add}}"/> + </actionGroup> + + <actionGroup name="deleteProductTaxClass"> + <annotations> + <description>Goes to the Admin Tax Rule creation page. Deletes the provided Tax Class.</description> + </annotations> + <arguments> + <argument name="taxClassName" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DeleteProductTaxClassActionGroup` instead --> + <amOnPage url="{{AdminNewTaxRulePage.url}}" stepKey="goToNewTaxRulePage"/> + <waitForPageLoad stepKey="waitForTaxRatePage"/> + <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> + <scrollTo stepKey="scrollToAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> + <moveMouseOver stepKey="hoverDeleteElement" selector="{{AdminTaxRulesSection.deleteTaxClassName(taxClassName)}}"/> + <click stepKey="deleteFirstTaxClass" selector="{{AdminTaxRulesSection.deleteTaxClass(taxClassName)}}"/> + <waitForElementVisible selector="{{AdminTaxRulesSection.popUpDialogOK}}" stepKey="waitForElementBecomeVisible"/> + <click stepKey="acceptPopUpDialog" selector="{{AdminTaxRulesSection.popUpDialogOK}}"/> + <waitForPageLoad stepKey="waitForProductTaxClassDeleted"/> + </actionGroup> +</actionGroups> From c58d35203e88d87d4b08bf1b981173134e00652d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 22:39:57 +0100 Subject: [PATCH 381/595] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..676d6bb2d3e37 --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,115 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="setColorPickerByHex"> + <annotations> + <description>Sets the provided HEX value in the provided Color Picker.</description> + </annotations> + <arguments> + <argument name="nthColorPicker" type="string" defaultValue="1"/> + <argument name="hexColor" type="string" defaultValue="e74c3c"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SetColorPickerByHexActionGroup` instead --> + <pressKey selector="{{AdminColorPickerSection.hexByIndex(nthColorPicker)}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,'{{hexColor}}']" stepKey="fillHex1"/> + <click selector="{{AdminColorPickerSection.submitByIndex(nthColorPicker)}}" stepKey="submitColor1"/> + </actionGroup> + + <actionGroup name="assertSwatchColor"> + <annotations> + <description>Validates that the provided Color Picker contains the provided Style.</description> + </annotations> + <arguments> + <argument name="nthSwatch" type="string" defaultValue="1"/> + <argument name="expectedStyle" type="string" defaultValue="background: rgb(0, 0, 0);"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertSwatchColorActionGroup` instead --> + <grabAttributeFrom selector="{{AdminManageSwatchSection.nthSwatch(nthSwatch)}}" userInput="style" stepKey="grabStyle1"/> + <assertEquals stepKey="assertStyle1"> + <actualResult type="string">{$grabStyle1}</actualResult> + <expectedResult type="string">{{expectedStyle}}</expectedResult> + </assertEquals> + </actionGroup> + + <actionGroup name="assertStorefrontSwatchColor"> + <annotations> + <description>Validates that the Storefront Product has the provided Swatch with the provided Color.</description> + </annotations> + <arguments> + <argument name="nthSwatch" type="string" defaultValue="1"/> + <argument name="expectedRgb" type="string" defaultValue="rgb(231, 77, 60)"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStorefrontSwatchColorActionGroup` instead --> + <grabAttributeFrom selector="{{StorefrontProductInfoMainSection.nthSwatchOption(nthSwatch)}}" userInput="style" stepKey="grabStyle1"/> + <assertEquals stepKey="assertStyle1"> + <actualResult type="string">{$grabStyle1}</actualResult> + <expectedResult type="string">background: center center no-repeat {{expectedRgb}};</expectedResult> + </assertEquals> + </actionGroup> + + <actionGroup name="openSwatchMenuByIndex"> + <annotations> + <description>Options the Swatch Menu based on the provided Index.</description> + </annotations> + <arguments> + <argument name="index" type="string" defaultValue="0"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `OpenSwatchMenuByIndexActionGroup` instead --> + <executeJS function="jQuery('#swatch_window_option_option_{{index}}').click()" stepKey="clickSwatch1"/> + </actionGroup> + + <actionGroup name="StorefrontSelectSwatchOptionOnProductPage"> + <arguments> + <argument name="optionName" type="string"/> + </arguments> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontSelectSwatchOptionOnProductPageActionGroup` instead --> + <click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(optionName)}}" stepKey="clickSwatchOption"/> + </actionGroup> + + <actionGroup name="StorefrontAssertSwatchOptionPrice"> + <arguments> + <argument name="optionName" type="string"/> + <argument name="optionPrice" type="string"/> + </arguments> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontAssertSwatchOptionPriceActionGroup` instead --> + <click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(optionName)}}" stepKey="clickOnOption"/> + <see userInput="{{optionPrice}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeOptionPrice"/> + </actionGroup> + + <actionGroup name="StorefrontSelectSwatchOptionOnProductPageAndCheckImage" extends="StorefrontSelectSwatchOptionOnProductPage"> + <arguments> + <argument name="fileName" type="string" defaultValue="magento-logo"/> + </arguments> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontSelectSwatchOptionOnProductPageAndCheckImageActionGroup` instead --> + <seeElement selector="{{StorefrontProductMediaSection.productImageActive(fileName)}}" stepKey="seeActiveImageDefault"/> + </actionGroup> + + <actionGroup name="StorefrontUpdateCartConfigurableProductWithSwatches"> + <arguments> + <argument name="product"/> + <argument name="productOption" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontUpdateCartConfigurableProductWithSwatchesActionGroup` instead --> + <click selector="{{CheckoutCartProductSection.nthEditButton('1')}}" stepKey="clickEditConfigurableProductButton"/> + <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> + <click selector="{{StorefrontProductInfoMainSection.visualSwatchOption(productOption)}}" stepKey="changeSwatchAttributeOption"/> + <click selector="{{StorefrontProductInfoMainSection.updateCart}}" stepKey="clickUpdateCartButton"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="{{product.name}} was updated in your shopping cart." stepKey="assertSuccessMessage"/> + </actionGroup> +</actionGroups> From a00875e37b6adea0be3511426bbb066d52544fe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 22:49:45 +0100 Subject: [PATCH 382/595] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 247 ++++++++++++++++++ 1 file changed, 247 insertions(+) create mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..7654b1baef2d8 --- /dev/null +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,247 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="CreateCustomStore"> + <annotations> + <description>Goes to the Admin Stores grid page. Clicks on 'Create Store'. Fills in the provided Details (Website, Store Group Name and Store Group Code). Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="website" type="string"/> + <argument name="store" type="string"/> + <argument name="rootCategory" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateCustomStoreActionGroup` instead --> + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <waitForPageLoad stepKey="waitForSystemStorePage"/> + <click selector="{{AdminStoresMainActionsSection.createStoreButton}}" stepKey="selectCreateStore"/> + <selectOption userInput="{{website}}" selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" stepKey="selectMainWebsite"/> + <fillField userInput="{{store}}" selector="{{AdminNewStoreGroupSection.storeGrpNameTextField}}" stepKey="fillStoreName"/> + <fillField userInput="{{store}}" selector="{{AdminNewStoreGroupSection.storeGrpCodeTextField}}" stepKey="fillStoreCode"/> + <selectOption userInput="{{rootCategory}}" selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" stepKey="selectStoreStatus"/> + <click selector="{{AdminStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup"/> + <waitForElementVisible selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="waitForStoreGridReload"/> + <see userInput="You saved the store." stepKey="seeSavedMessage"/> + </actionGroup> + + <actionGroup name="AssertStoreGroupInGrid"> + <annotations> + <description>Goes to the Admin Stores grid page. Searches for the provided Store Group Name. Validates that the provided Store Group Name is present in the grid.</description> + </annotations> + <arguments> + <argument name="storeGroupName" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStoreGroupInGridActionGroup` instead --> + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForStoreToLoad"/> + <see selector="{{AdminStoresGridSection.nthRow('1')}}" userInput="{{storeGroupName}}" stepKey="seeAssertStoreGroupInGridMessage"/> + </actionGroup> + + <actionGroup name="AssertStoreGroupForm"> + <annotations> + <description>Clicks on the 1st Store in the 'Stores' grid. Validates that the provided Details (Website, Store Group Name, Store Group Code and Root Category) are present and correct.</description> + </annotations> + <arguments> + <argument name="website" type="string"/> + <argument name="storeGroupName" type="string"/> + <argument name="storeGroupCode" type="string"/> + <argument name="rootCategory" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStoreGroupFormActionGroup` instead --> + <click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickEditExistingStoreRow"/> + <waitForPageLoad stepKey="waitTillAdminSystemStoreGroupPage"/> + <seeInField selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" userInput="{{website}}" stepKey="seeAssertWebsite"/> + <seeInField selector="{{AdminNewStoreGroupSection.storeGrpNameTextField}}" userInput="{{storeGroupName}}" stepKey="seeAssertStoreGroupName"/> + <seeInField selector="{{AdminNewStoreGroupSection.storeGrpCodeTextField}}" userInput="{{storeGroupCode}}" stepKey="seeAssertStoreGroupCode"/> + <seeInField selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" userInput="{{rootCategory}}" stepKey="seeAssertRootCategory"/> + </actionGroup> + + <actionGroup name="AdminCreateStoreViewActionSaveGroup"> + <annotations> + <description>Validates that the Success Message is present and correct.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateStoreViewSaveActionGroup` instead --> + <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> + <waitForElementVisible selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="waitForStoreGridToReload2"/> + <see userInput="You saved the store view." stepKey="seeSavedMessage"/> + </actionGroup> + + <actionGroup name="navigateToAdminContentManagementPage"> + <annotations> + <description>Goes to the 'Configuration' page for 'Content Management'.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `NavigateToAdminContentManagementPageActionGroup` instead --> + <amOnPage url="{{AdminContentManagementPage.url}}" stepKey="navigateToConfigurationPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + </actionGroup> + + <actionGroup name="saveStoreConfiguration"> + <annotations> + <description>Clicks on the Save button.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveStoreConfigurationActionGroup` instead --> + <comment userInput="saveStoreConfiguration" stepKey="comment"/> + <waitForElementVisible selector="{{StoreConfigSection.Save}}" stepKey="waitForSaveButton"/> + <click selector="{{StoreConfigSection.Save}}" stepKey="clickSaveButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> + + <actionGroup name="saveStoreConfigurationAndValidateFieldError"> + <annotations> + <description>Clicks on Save. Validates that the fields are required.</description> + </annotations> + <arguments> + <argument name="inputFieldError" type="string"/> + <argument name="errorMessageSelector" type="string"/> + <argument name="errorMessage" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveStoreConfigurationAndValidateFieldErrorActionGroup` instead --> + <comment userInput="saveStoreConfigurationAndValidateFieldError" stepKey="comment"/> + <waitForElementVisible selector="{{StoreConfigSection.Save}}" stepKey="waitForSaveButton"/> + <click selector="{{StoreConfigSection.Save}}" stepKey="clickSaveButton"/> + <waitForElement selector="{{inputFieldError}}" stepKey="waitForErrorField"/> + <waitForElementVisible selector="{{errorMessageSelector}}" stepKey="waitForErrorMessage"/> + <see selector="{{errorMessageSelector}}" userInput="{{errorMessage}}" stepKey="seeErrorMessage"/> + </actionGroup> + + <actionGroup name="AssertWebsiteInGrid"> + <annotations> + <description>Goes to the Admin Stores grid page. Searches the grid for the provided Website Name. Validates that the Website appears in the grid.</description> + </annotations> + <arguments> + <argument name="websiteName" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertWebsiteInGridActionGroup` instead --> + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <fillField userInput="{{websiteName}}" selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="fillWebsiteField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForStoreToLoad"/> + <seeElement selector="{{AdminStoresGridSection.websiteName(websiteName)}}" stepKey="seeAssertWebsiteInGrid"/> + </actionGroup> + + <actionGroup name="AssertWebsiteForm"> + <annotations> + <description>Clicks on the provided Website Name in the Admin Stores grid. Validates that the URL, Website Name/Code are present and correct.</description> + </annotations> + <arguments> + <argument name="websiteName" type="string"/> + <argument name="websiteCode" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertWebsiteFormActionGroup` instead --> + <click selector="{{AdminStoresGridSection.websiteName(websiteName)}}" stepKey="clickWebsiteFirstRowInGrid"/> + <waitForPageLoad stepKey="waitTillWebsiteFormPageIsOpened"/> + <grabFromCurrentUrl regex="~(\d+)/~" stepKey="grabWebsiteIdFromCurrentUrl"/> + <seeInCurrentUrl url="/system_store/editWebsite/website_id/{$grabWebsiteIdFromCurrentUrl}" stepKey="seeWebsiteId"/> + <seeInField selector="{{AdminNewWebsiteSection.name}}" userInput="{{websiteName}}" stepKey="seeAssertWebsiteName"/> + <seeInField selector="{{AdminNewWebsiteSection.code}}" userInput="{{websiteCode}}" stepKey="seeAssertWebsiteCode"/> + </actionGroup> + + <actionGroup name="AssertStoreViewNotInGrid"> + <annotations> + <description>Goes to the Admin Stores grid page. Searches the grid for the provided Store View name. Validates that it does NOT appear in the grid.</description> + </annotations> + <arguments> + <argument name="storeViewName" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStoreViewNotInGridActionGroup` instead --> + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <fillField userInput="{{storeViewName}}" selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="fillSearchStoreViewField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForStoreToLoad"/> + <see selector="{{AdminStoresGridSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertStoreViewNotInGridMessage"/> + </actionGroup> + + <actionGroup name="AdminAddCustomWebSiteToStoreGroup"> + <annotations> + <description>Goes to the Admin Stores grid page. Searches the grid for the provided Store Group. Edits the Store. Adds the provided Website to the Store. Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="storeGroup" defaultValue="customStoreGroup"/> + <argument name="website" defaultValue="customWebsite"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddCustomWebSiteToStoreGroupActionGroup` instead --> + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <fillField userInput="{{storeGroup.name}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <see userInput="{{storeGroup.name}}" selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="verifyThatCorrectStoreGroupFound"/> + <click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickEditExistingStoreRow"/> + <waitForPageLoad stepKey="waitForStoreGroupPageLoad"/> + <selectOption selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" userInput="{{website.name}}" stepKey="selectWebsite"/> + <selectOption selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" userInput="Default Category" stepKey="chooseRootCategory"/> + <click selector="{{AdminNewStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup"/> + <conditionalClick selector="{{AdminNewStoreGroupSection.acceptNewStoreGroupCreation}}" dependentSelector="{{AdminNewStoreGroupSection.acceptNewStoreGroupCreation}}" visible="true" stepKey="clickAcceptNewStoreGroupCreationButton"/> + <waitForElementVisible selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="waitForPageReload"/> + <see userInput="You saved the store." stepKey="seeSavedMessage"/> + </actionGroup> + + <actionGroup name="CreateStoreView"> + <annotations> + <description>Goes to the Admin Store Views creation page. Fills in the provided Store View, Store Group Name and Store View Status. Clicks on Save. Validates that the Success Message is present and correct.</description> + </annotations> + <arguments> + <argument name="storeView" defaultValue="customStore"/> + <argument name="storeGroupName" defaultValue="_defaultStoreGroup.name"/> + <argument name="storeViewStatus" defaultValue="_defaultStore.is_active"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateStoreViewActionGroup` instead --> + <amOnPage url="{{AdminSystemStoreViewPage.url}}" stepKey="amOnAdminSystemStoreViewPage"/> + <waitForPageLoad stepKey="waitForProductPageLoad"/> + <selectOption userInput="{{storeGroupName}}" selector="{{AdminNewStoreSection.storeGrpDropdown}}" stepKey="selectStoreGroup"/> + <fillField userInput="{{storeView.name}}" selector="{{AdminNewStoreSection.storeNameTextField}}" stepKey="fillStoreViewName"/> + <fillField userInput="{{storeView.code}}" selector="{{AdminNewStoreSection.storeCodeTextField}}" stepKey="fillStoreViewCode"/> + <selectOption userInput="{{storeViewStatus}}" selector="{{AdminNewStoreSection.statusDropdown}}" stepKey="selectStoreViewStatus"/> + <click selector="{{AdminStoresMainActionsSection.saveButton}}" stepKey="clickSaveStoreViewButton"/> + <waitForElementVisible selector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" stepKey="waitForAcceptNewStoreViewCreationButton"/> + <conditionalClick selector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" dependentSelector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" visible="true" stepKey="clickAcceptNewStoreViewCreationButton"/> + <see userInput="You saved the store view." stepKey="seeSavedMessage"/> + </actionGroup> + + <actionGroup name="AssertStoreNotInGrid"> + <annotations> + <description>Goes to the Admin Stores grid page. Validates that the provided Store Group Name is NOT present in the grid.</description> + </annotations> + <arguments> + <argument name="storeGroupName" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStoreNotInGridActionGroup` instead --> + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForStoreToLoad"/> + <see selector="{{AdminStoresGridSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertStoreGroupNotInGridMessage"/> + </actionGroup> +</actionGroups> From ccb04de3b72da75e6fed51140fb79558f887452c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 23:00:21 +0100 Subject: [PATCH 383/595] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 app/code/Magento/Search/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Search/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Search/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..6c860e8273bab --- /dev/null +++ b/app/code/Magento/Search/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="searchTermFilterBySearchQuery"> + <annotations> + <description>Fills in the provided Search Query on the Admin Search Term grid page.</description> + </annotations> + <arguments> + <argument name="searchQuery" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminSearchTermFilterBySearchQueryActionGroup` instead --> + <click selector="{{AdminCatalogSearchTermIndexSection.resetFilterButton}}" stepKey="clickOnResetButton"/> + <waitForPageLoad stepKey="waitForResetFilter"/> + <fillField selector="{{AdminCatalogSearchTermIndexSection.searchQuery}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/> + <click selector="{{AdminCatalogSearchTermIndexSection.searchButton}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForSearchResultLoad"/> + <checkOption selector="{{AdminCatalogSearchTermIndexSection.searchTermRowCheckboxBySearchQuery(searchQuery)}}" stepKey="checkCheckBox"/> + </actionGroup> + + <actionGroup name="deleteSearchTerm"> + <annotations> + <description>Deletes the Search Terms in the Admin Search Term grid.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDeleteSearchTermActionGroup` instead --> + <selectOption selector="{{AdminCatalogSearchTermIndexSection.massActions}}" userInput="delete" stepKey="selectDeleteOption"/> + <click selector="{{AdminCatalogSearchTermIndexSection.submit}}" stepKey="clickSubmitButton"/> + <click selector="{{AdminCatalogSearchTermIndexSection.okButton}}" stepKey="clickOkButton"/> + <waitForElementVisible selector="{{AdminCatalogSearchTermMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> + </actionGroup> + + <actionGroup name="DeleteAllSearchTerms"> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDeleteAllSearchTermsActionGroup` instead --> + <selectOption userInput="selectAll" selector="{{AdminCatalogSearchTermIndexSection.selectMassActionCheckbox}}" stepKey="checkAllSearchTerms"/> + <selectOption selector="{{AdminCatalogSearchTermIndexSection.massActions}}" userInput="delete" stepKey="selectDeleteOption"/> + <click selector="{{AdminCatalogSearchTermIndexSection.submit}}" stepKey="clickSubmitButton"/> + <click selector="{{AdminCatalogSearchTermIndexSection.okButton}}" stepKey="clickOkButton"/> + </actionGroup> +</actionGroups> From 8ff30a8dc9d2ce8854793d1654fcf5f7122b5ffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 23:11:51 +0100 Subject: [PATCH 384/595] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..648500bcaeb40 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,110 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="selectNotLoggedInCustomerGroup"> + <annotations> + <description>Selects 'NOT LOGGED IN' from the 'Customer Groups' list (Magento 2 B2B). PLEASE NOTE: The value is Hardcoded.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SelectNotLoggedInCustomerGroupActionGroup` instead --> + <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="NOT LOGGED IN" stepKey="selectCustomerGroup"/> + </actionGroup> + + <actionGroup name="selectRetailerCustomerGroup"> + <annotations> + <description>Selects 'Retailer' from the 'Customer Groups' list (Magento 2 B2B). PLEASE NOTE: The value is Hardcoded.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SelectRetailerCustomerGroupActionGroup` instead --> + <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="Retailer" stepKey="selectRetailerCustomerGroup"/> + </actionGroup> + + <actionGroup name="AdminCreateCartPriceRuleWithCouponCode" extends="AdminCreateCartPriceRuleActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'selectActionType' and 'fillDiscountAmount'. Adds the provided Coupon Code to a Cart Price Rule.</description> + </annotations> + <arguments> + <argument name="couponCode" defaultValue="_defaultCoupon.code"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateCartPriceRuleWithCouponCodeActionGroup` instead --> + <remove keyForRemoval="selectActionType"/> + <remove keyForRemoval="fillDiscountAmount"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="Specific Coupon" stepKey="selectCouponType" after="fillRuleName"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.couponCode}}" stepKey="waitForElementVisible" after="selectCouponType"/> + <fillField selector="{{AdminCartPriceRulesFormSection.couponCode}}" userInput="{{couponCode}}" stepKey="fillCouponCode" after="waitForElementVisible"/> + <fillField selector="{{AdminCartPriceRulesFormSection.userPerCoupon}}" userInput="99" stepKey="fillUserPerCoupon" after="fillCouponCode"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="Fixed amount discount for whole cart" stepKey="selectActionTypeToFixed" after="clickToExpandActions"/> + <fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="1" stepKey="fillDiscountAmount" after="selectActionTypeToFixed"/> + </actionGroup> + + <actionGroup name="AdminCreateCartPriceRuleWithConditions" extends="AdminCreateCartPriceRuleActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'fillDiscountAmount'. Adds the 2 provided Conditions (Name, Rule, Rule to Change and Category Name) to a Cart Price Rule.</description> + </annotations> + <arguments> + <argument name="condition1" type="string" defaultValue="Products subselection"/> + <argument name="condition2" type="string" defaultValue="Category"/> + <argument name="ruleToChange1" type="string" defaultValue="is"/> + <argument name="rule1" type="string" defaultValue="equals or greater than"/> + <argument name="ruleToChange2" type="string" defaultValue="..."/> + <argument name="rule2" type="string" defaultValue="2"/> + <argument name="categoryName" type="string" defaultValue="_defaultCategory.name"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateCartPriceRuleWithConditionsActionGroup` instead --> + <remove keyForRemoval="fillDiscountAmount"/> + + <click selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" stepKey="openConditionsSection" after="selectActionType"/> + <click selector="{{AdminCartPriceRulesFormSection.addCondition('1')}}" stepKey="addFirstCondition" after="openConditionsSection"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.ruleCondition('1')}}" userInput="{{condition1}}" stepKey="selectRule" after="addFirstCondition"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange1)}}" stepKey="waitForFirstRuleElement" after="selectRule"/> + <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange1)}}" stepKey="clickToChangeRule" after="waitForFirstRuleElement"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.ruleParameterSelect('1--1')}}" userInput="{{rule1}}" stepKey="selectRule1" after="clickToChangeRule"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="waitForSecondRuleElement" after="selectRule1"/> + <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="clickToChangeRule1" after="waitForSecondRuleElement"/> + <fillField selector="{{AdminCartPriceRulesFormSection.ruleParameterInput('1--1')}}" userInput="{{rule2}}" stepKey="fillRule" after="clickToChangeRule1"/> + <click selector="{{AdminCartPriceRulesFormSection.addCondition('1--1')}}" stepKey="addSecondCondition" after="fillRule"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.ruleCondition('1--1')}}" userInput="{{condition2}}" stepKey="selectSecondCondition" after="addSecondCondition"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="waitForThirdRuleElement" after="selectSecondCondition"/> + <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="addThirdCondition" after="waitForThirdRuleElement"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.openChooser('1--1--1')}}" stepKey="waitForForthRuleElement" after="addThirdCondition"/> + <click selector="{{AdminCartPriceRulesFormSection.openChooser('1--1--1')}}" stepKey="openChooser" after="waitForForthRuleElement"/> + <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.categoryCheckbox(categoryName)}}" stepKey="waitForCategoryVisible" after="openChooser"/> + <checkOption selector="{{AdminCartPriceRulesFormSection.categoryCheckbox(categoryName)}}" stepKey="checkCategoryName" after="waitForCategoryVisible"/> + </actionGroup> + + <actionGroup name="VerifyDiscountAmount"> + <annotations> + <description>Goes to the provided Storefront Product URL. Fills in provided Quantity. Clicks Add to Cart. Goes to Checkout. Validates that the provided Discount Amount is present and correct.</description> + </annotations> + <arguments> + <argument name="productUrl" type="string"/> + <argument name="quantity" type="string"/> + <argument name="expectedDiscount" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyDiscountAmountActionGroup` instead --> + <amOnPage url="{{productUrl}}" stepKey="goToProductPage"/> + <waitForPageLoad stepKey="waitForProductPageLoad"/> + <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> + <click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addProductToCart"/> + <waitForPageLoad stepKey="waitForAddToCart"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToCartPage"/> + <waitForPageLoad stepKey="waitForCartPage"/> + <waitForElementVisible selector="{{CheckoutCartSummarySection.discountAmount}}" stepKey="waitForDiscountElement"/> + <see selector="{{CheckoutCartSummarySection.discountAmount}}" userInput="{{expectedDiscount}}" stepKey="seeDiscountTotal"/> + </actionGroup> +</actionGroups> From 7311141cbd79bab02bb19b8e024610cadebae689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 23:30:56 +0100 Subject: [PATCH 385/595] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- ...BasicCreditMemoInformationActionGroup.xml} | 0 .../ActionGroup/_Deprecated_ActionGroup.xml | 673 ++++++++++++++++++ 2 files changed, 673 insertions(+) rename app/code/Magento/Sales/Test/Mftf/ActionGroup/{AdminCreditMemoActionGroup.xml => VerifyBasicCreditMemoInformationActionGroup.xml} (100%) create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreditMemoActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyBasicCreditMemoInformationActionGroup.xml similarity index 100% rename from app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCreditMemoActionGroup.xml rename to app/code/Magento/Sales/Test/Mftf/ActionGroup/VerifyBasicCreditMemoInformationActionGroup.xml diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..6a6ddfb514890 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,673 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="verifyBasicCreditMemoInformation"> + <annotations> + <description>Validates that the provided Customer, Shipping/Billing Address and Customer Group are present and correct on the Admin Credit Memo view page.</description> + </annotations> + <arguments> + <argument name="customer" defaultValue=""/> + <argument name="shippingAddress" defaultValue=""/> + <argument name="billingAddress" defaultValue=""/> + <argument name="customerGroup" defaultValue="GeneralCustomerGroup"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyBasicCreditMemoInformationActionGroup` instead --> + <see selector="{{AdminCreditMemoOrderInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/> + <see selector="{{AdminCreditMemoOrderInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/> + <see selector="{{AdminCreditMemoOrderInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/> + + <see selector="{{AdminCreditMemoAddressInformationSection.billingAddress}}" userInput="{{billingAddress.street[0]}}" stepKey="seeBillingAddressStreet"/> + <see selector="{{AdminCreditMemoAddressInformationSection.billingAddress}}" userInput="{{billingAddress.city}}" stepKey="seeBillingAddressCity"/> + <see selector="{{AdminCreditMemoAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country_id}}" stepKey="seeBillingAddressCountry"/> + <see selector="{{AdminCreditMemoAddressInformationSection.billingAddress}}" userInput="{{billingAddress.postcode}}" stepKey="seeBillingAddressPostcode"/> + + <see selector="{{AdminCreditMemoAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.street[0]}}" stepKey="seeShippingAddressStreet"/> + <see selector="{{AdminCreditMemoAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.city}}" stepKey="seeShippingAddressCity"/> + <see selector="{{AdminCreditMemoAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/> + <see selector="{{AdminCreditMemoAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> + </actionGroup> + + <actionGroup name="seeProductInItemsRefunded"> + <annotations> + <description>Validates that the provided Product appears in the 'Product' column on the Admin Credit Memo view page.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SeeProductInItemsRefundedActionGroup` instead --> + <see selector="{{AdminCreditMemoItemsSection.skuColumn}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> + </actionGroup> + + <actionGroup name="verifyBasicInvoiceInformation"> + <annotations> + <description>Validates that the provided Customer, Address and Customer Group details are present and correct on the Admin View Invoice page.</description> + </annotations> + <arguments> + <argument name="customer"/> + <argument name="shippingAddress"/> + <argument name="billingAddress"/> + <argument name="customerGroup" defaultValue="GeneralCustomerGroup"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyBasicInvoiceInformationActionGroup` instead --> + <see selector="{{AdminInvoiceOrderInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/> + <see selector="{{AdminInvoiceOrderInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/> + <see selector="{{AdminInvoiceOrderInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/> + <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.street[0]}}" stepKey="seeBillingAddressStreet"/> + <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.city}}" stepKey="seeBillingAddressCity"/> + <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country_id}}" stepKey="seeBillingAddressCountry"/> + <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.postcode}}" stepKey="seeBillingAddressPostcode"/> + <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.street[0]}}" stepKey="seeShippingAddressStreet"/> + <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.city}}" stepKey="seeShippingAddressCity"/> + <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/> + <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> + </actionGroup> + + <actionGroup name="seeProductInInvoiceItems"> + <annotations> + <description>Validates that the provided Product appears under the 'SKU' column in the Admin Invoices edit page.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SeeProductInInvoiceItemsActionGroup` instead --> + <see selector="{{AdminInvoiceItemsSection.skuColumn}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> + </actionGroup> + + <actionGroup name="adminFastCreateInvoice"> + <annotations> + <description>Clicks on 'Invoice' on the Admin Orders view page. Clicks on 'Submit Invoice'. Clicks on 'View Invoice'.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminFastCreateInvoiceActionGroup` instead --> + <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceButton"/> + <waitForPageLoad stepKey="waitForNewInvoicePageLoad"/> + <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> + <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeSuccessMessage"/> + <click selector="{{AdminOrderDetailsOrderViewSection.invoices}}" stepKey="clickInvoices"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask5"/> + <conditionalClick selector="{{AdminOrderInvoicesTabSection.clearFilters}}" dependentSelector="{{AdminOrderInvoicesTabSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <click selector="{{AdminOrderInvoicesTabSection.viewInvoice}}" stepKey="openInvoicePage"/> + <waitForPageLoad stepKey="waitForInvoicePageLoad"/> + </actionGroup> + + <actionGroup name="clearInvoicesGridFilters"> + <annotations> + <description>Goes to the Admin Invoices grid page. Clicks on 'Clear Filters', if present.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ClearInvoicesGridFiltersActionGroup` instead --> + <amOnPage url="{{AdminInvoicesPage.url}}" stepKey="goToInvoices"/> + <waitForPageLoad stepKey="waitInvoicesGridToLoad"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearFilters"/> + <waitForPageLoad stepKey="waitInvoicesGrid"/> + </actionGroup> + + <actionGroup name="goToInvoiceIntoOrder"> + <annotations> + <description>Clicks on 'Invoice' on the Admin Orders view page. Validates that the URL and Page Title are correct.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GoToInvoiceIntoOrderActionGroup` instead --> + <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction"/> + <seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeOrderInvoiceUrl"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seePageNameNewInvoicePage"/> + </actionGroup> + + <actionGroup name="StartCreateInvoiceFromOrderPage"> + <annotations> + <description>Clicks on 'Invoice' on the Admin Orders view page. Validates that the URL and Page Title are correct.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StartCreateInvoiceFromOrderPageActionGroup` instead --> + <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction"/> + <seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeNewInvoiceUrl"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seeNewInvoicePageTitle"/> + </actionGroup> + + <actionGroup name="SubmitInvoice"> + <annotations> + <description>Clicks on 'Submit Invoice' on the Admin 'New Invoice' page. Validates that the Success Message is present and correct. Validates that the Order ID appears in the URL.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SubmitInvoiceActionGroup` instead --> + <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/> + <see selector="{{AdminMessagesSection.success}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/> + <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/> + <seeInCurrentUrl url="{{AdminOrderDetailsPage.url('$grabOrderId')}}" stepKey="seeViewOrderPageInvoice"/> + </actionGroup> + + <actionGroup name="filterInvoiceGridByOrderId"> + <annotations> + <description>Goes to the Admin Invoices grid page. Filters the grid for the provided Order ID.</description> + </annotations> + <arguments> + <argument name="orderId" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterInvoiceGridByOrderIdActionGroup` instead --> + <amOnPage url="{{AdminInvoicesPage.url}}" stepKey="goToInvoices"/> + <click selector="{{AdminInvoicesGridSection.filter}}" stepKey="clickFilter"/> + <fillField selector="{{AdminInvoicesFiltersSection.orderNum}}" userInput="{{orderId}}" stepKey="fillOrderIdForFilter"/> + <click selector="{{AdminInvoicesFiltersSection.applyFilters}}" stepKey="clickApplyFilters"/> + <waitForPageLoad stepKey="waitForFiltersApply"/> + </actionGroup> + + <actionGroup name="navigateToNewOrderPageNewCustomer"> + <annotations> + <description>Goes to the Admin Orders grid page. Clicks on 'Create New Order'. Clicks on 'Create New Customer'. Select the provided Store View, if present. Validates that Page Title is present and correct.</description> + </annotations> + <arguments> + <argument name="storeView" defaultValue="_defaultStore"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `NavigateToNewOrderPageNewCustomerActionGroup` instead --> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> + <waitForPageLoad stepKey="waitForIndexPageLoad"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> + <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> + <click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/> + <conditionalClick selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" dependentSelector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" visible="true" stepKey="selectStoreViewIfAppears"/> + <waitForPageLoad stepKey="waitForCreateOrderPageLoadAfterStoreSelect"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> + </actionGroup> + + <actionGroup name="navigateToNewOrderPageNewCustomerSingleStore"> + <annotations> + <description>Goes to the Admin Orders grid page. Clicks on 'Create New Order'. Clicks on 'Create New Customer'. Validates that Page Title is present and correct.</description> + </annotations> + <arguments> + <argument name="storeView" defaultValue="_defaultStore"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `NavigateToNewOrderPageNewCustomerSingleStoreActionGroup` instead --> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> + <waitForPageLoad stepKey="waitForIndexPageLoad"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> + <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> + <click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> + </actionGroup> + + <actionGroup name="navigateToNewOrderPageExistingCustomer"> + <annotations> + <description>Goes tot he Admin Orders grid page. Clicks on 'Create New Order'. Filters the grid for the provided Customer. Clicks on the Customer. Selects the provided Store View, if present. Validates that the Page Title is present and correct.</description> + </annotations> + <arguments> + <argument name="customer"/> + <argument name="storeView" defaultValue="_defaultStore"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `NavigateToNewOrderPageExistingCustomerActionGroup` instead --> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> + <waitForPageLoad stepKey="waitForIndexPageLoad"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> + <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> + <waitForPageLoad stepKey="waitForCustomerGridLoad"/> + + <conditionalClick selector="{{AdminOrderCustomersGridSection.resetButton}}" dependentSelector="{{AdminOrderCustomersGridSection.resetButton}}" visible="true" stepKey="clearExistingCustomerFilters"/> + <fillField userInput="{{customer.email}}" selector="{{AdminOrderCustomersGridSection.emailInput}}" stepKey="filterEmail"/> + <click selector="{{AdminOrderCustomersGridSection.apply}}" stepKey="applyFilter"/> + <waitForPageLoad stepKey="waitForFilteredCustomerGridLoad"/> + <click selector="{{AdminOrderCustomersGridSection.firstRow}}" stepKey="clickOnCustomer"/> + <waitForPageLoad stepKey="waitForCreateOrderPageLoad"/> + + <conditionalClick selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" dependentSelector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" visible="true" stepKey="selectStoreViewIfAppears"/> + <waitForPageLoad stepKey="waitForCreateOrderPageLoadAfterStoreSelect"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> + </actionGroup> + + <actionGroup name="checkRequiredFieldsNewOrderForm"> + <annotations> + <description>Clears the Email, First Name, Last Name, Street Line 1, City, Postal Code and Phone fields when adding an Order and then verifies that they are required after attempting to Save.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CheckRequiredFieldsNewOrderFormActionGroup` instead --> + <seeElement selector="{{AdminOrderFormAccountSection.requiredGroup}}" stepKey="seeCustomerGroupRequired"/> + <seeElement selector="{{AdminOrderFormAccountSection.requiredEmail}}" stepKey="seeEmailRequired"/> + <clearField selector="{{AdminOrderFormAccountSection.email}}" stepKey="clearEmailField"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.FirstName}}" stepKey="clearFirstNameField"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.LastName}}" stepKey="clearLastNameField"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.StreetLine1}}" stepKey="clearStreetField"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.City}}" stepKey="clearCityField"/> + <selectOption selector="{{AdminOrderFormBillingAddressSection.Country}}" userInput="United States" stepKey="selectUSCountry"/> + <selectOption selector="{{AdminOrderFormBillingAddressSection.State}}" userInput="Please select" stepKey="selectNoState"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.PostalCode}}" stepKey="clearPostalCodeField"/> + <clearField selector="{{AdminOrderFormBillingAddressSection.Phone}}" stepKey="clearPhoneField"/> + <seeElement selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="seeShippingMethodNotSelected"/> + <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="trySubmitOrder"/> + <see selector="{{AdminOrderFormBillingAddressSection.emailError}}" userInput="This is a required field." stepKey="seeThatEmailIsRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.firstNameError}}" userInput="This is a required field." stepKey="seeFirstNameRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.lastNameError}}" userInput="This is a required field." stepKey="seeLastNameRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.streetAddressError}}" userInput="This is a required field." stepKey="seeStreetRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.cityError}}" userInput="This is a required field." stepKey="seeCityRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.stateError}}" userInput="This is a required field." stepKey="seeStateRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.postalCodeError}}" userInput="This is a required field." stepKey="seePostalCodeRequired"/> + <see selector="{{AdminOrderFormBillingAddressSection.phoneError}}" userInput="This is a required field." stepKey="seePhoneRequired"/> + <see selector="{{AdminOrderFormPaymentSection.shippingError}}" userInput="This is a required field." stepKey="seeShippingMethodRequired"/> + </actionGroup> + + <actionGroup name="addSimpleProductToOrder"> + <annotations> + <description>Adds the provided Simple Product to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct" type="entity"/> + <argument name="productQty" defaultValue="1" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddSimpleProductToOrderActionGroup` instead --> + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> + <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilter"/> + <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearch"/> + <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> + <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectProduct"/> + <fillField selector="{{AdminOrderFormItemsSection.rowQty('1')}}" userInput="{{productQty}}" stepKey="fillProductQty"/> + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + <wait time="5" stepKey="waitForOptionsToLoad"/> + </actionGroup> + + <actionGroup name="addConfigurableProductToOrder"> + <annotations> + <description>Adds the provided Configurable Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="attribute"/> + <argument name="option"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddConfigurableProductToOrderActionGroup` instead --> + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> + <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterConfigurable"/> + <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchConfigurable"/> + <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> + <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectConfigurableProduct"/> + <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_label)}}" stepKey="waitForConfigurablePopover"/> + <wait time="2" stepKey="waitForOptionsToLoad"/> + <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_label)}}" userInput="{{option.name}}" stepKey="selectionConfigurableOption"/> + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/> + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + </actionGroup> + + <actionGroup name="newAddConfigurableProductToOrder" extends="addConfigurableProductToOrder"> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `NewAddConfigurableProductToOrderActionGroup` instead --> + <remove keyForRemoval="waitForConfigurablePopover"/> + <remove keyForRemoval="selectionConfigurableOption"/> + <selectOption selector="{{AdminOrderFormConfigureProductSection.selectOption}}" userInput="{{option.value}}" stepKey="selectOption" after="waitForOptionsToLoad"/> + </actionGroup> + + <actionGroup name="addConfigurableProductToOrderFromAdmin" extends="addConfigurableProductToOrder"> + <annotations> + <description>EXTENDS: addConfigurableProductToOrder. Selects the provided Option to the Configurable Product.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddConfigurableProductToOrderFromAdminActionGroup` instead --> + <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" stepKey="waitForConfigurablePopover"/> + <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" userInput="{{option.label}}" stepKey="selectionConfigurableOption"/> + </actionGroup> + + <actionGroup name="configureOrderedConfigurableProduct"> + <annotations> + <description>Clicks on 'Configure' for a Product in the 'Please select products' under the 'Create New Order for' page. Selects the provided Option and Attribute. Fills in the provided Qty. Clicks on Ok.</description> + </annotations> + <arguments> + <argument name="attribute"/> + <argument name="option"/> + <argument name="quantity" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ConfigureOrderedConfigurableProductActionGroup` instead --> + <click selector="{{AdminOrderFormItemsSection.configure}}" stepKey="clickConfigure"/> + <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" stepKey="waitForConfigurablePopover"/> + <wait time="2" stepKey="waitForOptionsToLoad"/> + <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" userInput="{{option.label}}" stepKey="selectionConfigurableOption"/> + <fillField selector="{{AdminOrderFormConfigureProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/> + </actionGroup> + + <actionGroup name="addBundleProductToOrder"> + <annotations> + <description>Adds the provided Bundled Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="quantity" type="string" defaultValue="1"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleProductToOrderActionGroup` instead --> + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> + <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterBundle"/> + <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchBundle"/> + <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> + <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectBundleProduct"/> + <waitForElementVisible selector="{{AdminOrderFormBundleProductSection.quantity}}" stepKey="waitForBundleOptionLoad"/> + <wait time="2" stepKey="waitForOptionsToLoad"/> + <fillField selector="{{AdminOrderFormBundleProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/> + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + </actionGroup> + + <actionGroup name="addBundleProductToOrderAndCheckPriceInGrid" extends="addBundleProductToOrder"> + <annotations> + <description>EXTENDS: addBundleProductToOrder. Validates that the provided Product Price is present and correct in the 'Items Ordered' section.</description> + </annotations> + <arguments> + <argument name="price" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleProductToOrderAndCheckPriceInGridActionGroup` instead --> + <grabTextFrom selector="{{AdminOrderFormItemsSection.rowPrice('1')}}" stepKey="grabProductPriceFromGrid" after="clickOk"/> + <assertEquals stepKey="assertProductPriceInGrid" message="Bundle product price in grid should be equal {{price}}" after="grabProductPriceFromGrid"> + <expectedResult type="string">{{price}}</expectedResult> + <actualResult type="variable">grabProductPriceFromGrid</actualResult> + </assertEquals> + </actionGroup> + + <actionGroup name="addDownloadableProductToOrder"> + <annotations> + <description>Adds a Downloadable Product to an Order. Clicks on 'Add Selected Product(s) to Order'.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddDownloadableProductToOrderActionGroup` instead --> + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> + <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> + <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterDownloadable"/> + <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchDownloadable"/> + <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> + <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectDownloadableProduct"/> + <waitForElementVisible selector="{{AdminOrderFormDownloadableProductSection.optionSelect(link.title)}}" stepKey="waitForLinkLoad"/> + <click selector="{{AdminOrderFormDownloadableProductSection.optionSelect(link.title)}}" stepKey="selectLink"/> + <fillField selector="{{AdminOrderFormDownloadableProductSection.quantity}}" userInput="{{quantity}}" stepKey="setQuantity"/> + <click selector="{{AdminOrderFormDownloadableProductSection.ok}}" stepKey="confirmConfiguration"/> + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + </actionGroup> + + <actionGroup name="addGroupedProductOptionToOrder"> + <annotations> + <description>Adds the provided Grouped Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="option"/> + <argument name="quantity" type="string" defaultValue="1"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddGroupedProductOptionToOrderActionGroup` instead --> + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> + <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterGrouped"/> + <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchGrouped"/> + <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> + <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectGroupedProduct"/> + <waitForElementVisible selector="{{AdminOrderFormGroupedProductSection.optionQty(option.sku)}}" stepKey="waitForGroupedOptionLoad"/> + <wait time="2" stepKey="waitForOptionsToLoad"/> + <fillField selector="{{AdminOrderFormGroupedProductSection.optionQty(option.sku)}}" userInput="{{quantity}}" stepKey="fillOptionQuantity"/> + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/> + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + </actionGroup> + + <actionGroup name="fillOrderCustomerInformation"> + <annotations> + <description>Fills in the provided Customer and Address details on the Admin 'Create New Order for' page.</description> + </annotations> + <arguments> + <argument name="customer"/> + <argument name="address"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillOrderCustomerInformationActionGroup` instead --> + <fillField selector="{{AdminOrderFormBillingAddressSection.FirstName}}" userInput="{{customer.firstname}}" stepKey="fillFirstName"/> + <fillField selector="{{AdminOrderFormBillingAddressSection.LastName}}" userInput="{{customer.lastname}}" stepKey="fillLastName"/> + <fillField selector="{{AdminOrderFormBillingAddressSection.StreetLine1}}" userInput="{{address.street[0]}}" stepKey="fillStreetLine1"/> + <fillField selector="{{AdminOrderFormBillingAddressSection.City}}" userInput="{{address.city}}" stepKey="fillCity"/> + <selectOption selector="{{AdminOrderFormBillingAddressSection.Country}}" userInput="{{address.country_id}}" stepKey="fillCountry"/> + <selectOption selector="{{AdminOrderFormBillingAddressSection.State}}" userInput="{{address.state}}" stepKey="fillState"/> + <fillField selector="{{AdminOrderFormBillingAddressSection.PostalCode}}" userInput="{{address.postcode}}" stepKey="fillPostalCode"/> + <fillField selector="{{AdminOrderFormBillingAddressSection.Phone}}" userInput="{{address.telephone}}" stepKey="fillPhone"/> + </actionGroup> + + <actionGroup name="orderSelectFlatRateShipping"> + <annotations> + <description>Selects the 'Flat Rate' Shipping Method on the Admin 'Create New Order for' page.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `OrderSelectFlatRateShippingActionGroup` instead --> + <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> + <waitForPageLoad stepKey="waitForJavascriptToFinish"/> + <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods"/> + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.flatRateOption}}" stepKey="waitForShippingOptions"/> + <selectOption selector="{{AdminOrderFormPaymentSection.flatRateOption}}" userInput="flatrate_flatrate" stepKey="checkFlatRate"/> + </actionGroup> + + <actionGroup name="changeShippingMethod"> + <annotations> + <description>Change Shipping Method on the Admin 'Create New Order for' page.</description> + </annotations> + <arguments> + <argument name="shippingMethod" defaultValue="flatrate_flatrate" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeShippingMethodActionGroup` instead --> + <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> + <waitForPageLoad stepKey="waitForJavascriptToFinish"/> + <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods1"/> + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="waitForChangeShippingMethod"/> + <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods2"/> + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.shippingMethod}}" stepKey="waitForShippingOptions2"/> + <selectOption selector="{{AdminOrderFormPaymentSection.shippingMethod}}" userInput="{{shippingMethod}}" stepKey="checkFlatRate"/> + </actionGroup> + + <actionGroup name="orderSelectFreeShipping"> + <annotations> + <description>Selects the 'Free Shipping' Shipping Method on the Admin 'Create New Order for' page.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `OrderSelectFreeShippingActionGroup` instead --> + <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> + <waitForPageLoad stepKey="waitForJavascriptToFinish"/> + <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods"/> + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" stepKey="waitForShippingOptions"/> + <selectOption selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" userInput="freeshipping_freeshipping" stepKey="checkFreeShipping"/> + </actionGroup> + + <actionGroup name="verifyBasicOrderInformation"> + <annotations> + <description>Validates that the provided Customer, Shipping/Billing Address and Customer Group are present and correct on the Admin Orders view page.</description> + </annotations> + <arguments> + <argument name="customer"/> + <argument name="shippingAddress"/> + <argument name="billingAddress"/> + <argument name="customerGroup" defaultValue="GeneralCustomerGroup"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyBasicOrderInformationActionGroup` instead --> + <see selector="{{AdminOrderDetailsInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/> + <see selector="{{AdminOrderDetailsInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/> + <see selector="{{AdminOrderDetailsInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/> + <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.street[0]}}" stepKey="seeBillingAddressStreet"/> + <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.city}}" stepKey="seeBillingAddressCity"/> + <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country_id}}" stepKey="seeBillingAddressCountry"/> + <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.postcode}}" stepKey="seeBillingAddressPostcode"/> + <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.street[0]}}" stepKey="seeShippingAddressStreet"/> + <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.city}}" stepKey="seeShippingAddressCity"/> + <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/> + <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> + </actionGroup> + + <actionGroup name="verifyCreatedOrderInformation"> + <annotations> + <description>Validates that the Success Message, Order Status (Pending) and Order ID are present and correct.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyCreatedOrderInformationActionGroup` instead --> + <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeSuccessMessage"/> + <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderPendingStatus" after="seeSuccessMessage"/> + <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId" after="seeOrderPendingStatus"/> + <assertNotEmpty actual="$getOrderId" stepKey="assertOrderIdIsNotEmpty" after="getOrderId"/> + </actionGroup> + + <actionGroup name="seeProductInItemsOrdered"> + <annotations> + <description>Validates that the provided Product is present and correct in the 'Items Ordered' section on the Admin Orders view page.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SeeProductInItemsOrderedActionGroup` instead --> + <see selector="{{AdminOrderItemsOrderedSection.productSkuColumn}}" userInput="{{product.sku}}" stepKey="seeSkuInItemsOrdered"/> + </actionGroup> + + <actionGroup name="cancelPendingOrder"> + <annotations> + <description>Cancels the Pending Order on the Admin Orders view page. Validates that the provided Order Status is present and correct.</description> + </annotations> + <arguments> + <argument name="orderStatus" type="string" defaultValue="Canceled"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CancelPendingOrderActionGroup` instead --> + <click selector="{{AdminOrderDetailsMainActionsSection.cancel}}" stepKey="clickCancelOrder"/> + <waitForElement selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForCancelConfirmation"/> + <see selector="{{AdminConfirmationModalSection.message}}" userInput="Are you sure you want to cancel this order?" stepKey="seeConfirmationMessage"/> + <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmOrderCancel"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You canceled the order." stepKey="seeCancelSuccessMessage"/> + <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="{{orderStatus}}" stepKey="seeOrderStatusCanceled"/> + </actionGroup> + + <actionGroup name="dontSeeProductInItemsOrdered"> + <arguments> + <argument name="product"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DontSeeProductInItemsOrderedActionGroup` instead --> + <dontSee selector="{{AdminOrderItemsOrderedSection.productSkuColumn}}" userInput="{{product.sku}}" stepKey="dontseeSkuInItemsOrdered"/> + </actionGroup> + + <actionGroup name="SelectCheckMoneyPaymentMethod"> + <annotations> + <description>Selects the 'Check / Money Order' Payment Method on the Admin Create New Order page.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SelectCheckMoneyPaymentMethodActionGroup` instead --> + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/> + <conditionalClick selector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" dependentSelector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" visible="true" stepKey="checkCheckMoneyOption"/> + </actionGroup> + + <actionGroup name="filterOrderGridById"> + <annotations> + <description>Goes to the Admin Orders page. Filters the grid based on the provided Order ID.</description> + </annotations> + <arguments> + <argument name="orderId" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterOrderGridByIdActionGroup` instead --> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderGridPage"/> + <waitForPageLoad stepKey="waitForOrdersPage"/> + <conditionalClick selector="{{AdminOrdersGridSection.clearFilters}}" dependentSelector="{{AdminOrdersGridSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <waitForPageLoad stepKey="waitForClearFilters"/> + <click selector="{{AdminOrdersGridSection.filters}}" stepKey="openOrderGridFilters"/> + <waitForPageLoad stepKey="waitForClickFilters"/> + <fillField selector="{{AdminOrdersGridSection.idFilter}}" userInput="{{orderId}}" stepKey="fillOrderIdFilter"/> + <click selector="{{AdminOrdersGridSection.applyFilters}}" stepKey="clickOrderApplyFilters"/> + <waitForPageLoad stepKey="waitForApplyFilters"/> + </actionGroup> + + <actionGroup name="filterOrderGridByBillingName"> + <annotations> + <description>Goes to the Admin Orders page. Filters the grid based on the provided Customer.</description> + </annotations> + <arguments> + <argument name="customer"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterOrderGridByBillingNameActionGroup` instead --> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderGridPage"/> + <waitForPageLoad stepKey="waitForOrderGridLoad"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> + <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('billing_name')}}" userInput="{{customer.fullname}}" stepKey="fillBillToNameFilter"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters"/> + </actionGroup> + + <actionGroup name="filterOrderGridByBaseTotalRange"> + <annotations> + <description>Goes to the Admin Orders page. Filters the grid based on the provided Grand Total From/To values.</description> + </annotations> + <arguments> + <argument name="from"/> + <argument name="to"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterOrderGridByBaseTotalRangeActionGroup` instead --> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> + <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('base_grand_total[from]')}}" userInput="{{from}}" stepKey="fillOrderTotalFrom"/> + <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('base_grand_total[to]')}}" userInput="{{to}}" stepKey="fillOrderTotalTo"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> + </actionGroup> + + <actionGroup name="filterOrderGridByPurchaseDate"> + <annotations> + <description>Goes to the Admin Orders page. Filters the grid based on the provided Purchased Date From/To values.</description> + </annotations> + <arguments> + <argument name="from"/> + <argument name="to"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterOrderGridByPurchaseDateActionGroup` instead --> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> + <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[from]')}}" userInput="{{from}}" stepKey="fillOrderPurchaseDateFrom"/> + <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[to]')}}" userInput="{{to}}" stepKey="fillOrderPurchaseDateTo"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> + </actionGroup> + + <actionGroup name="filterOrderGridByStatus"> + <annotations> + <description>Filters the Admin Orders grid based on the provided Order Status.</description> + </annotations> + <arguments> + <argument name="status"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterOrderGridByStatusActionGroup` instead --> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> + <selectOption selector="{{AdminDataGridHeaderSection.filterFieldSelect('status')}}" userInput="{{status}}" stepKey="fillOrderStatusFilter"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> + </actionGroup> + + <actionGroup name="OpenOrderById" extends="filterOrderGridById"> + <annotations> + <description>EXTENDS: filterOrderGridById. Clicks on the 1st row of the Admin Orders grid.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `OpenOrderByIdActionGroup` instead --> + <click selector="{{AdminDataGridTableSection.firstRow}}" after="clickOrderApplyFilters" stepKey="openOrderViewPage"/> + <waitForPageLoad after="openOrderViewPage" stepKey="waitForOrderViewPageOpened"/> + </actionGroup> +</actionGroups> From 80f734bdf7cd0048780e5a83e8532081418f5472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 23:35:54 +0100 Subject: [PATCH 386/595] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..e9b6ec37f8f0a --- /dev/null +++ b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="addProductVideo"> + <annotations> + <description>Expands the 'Images And Videos' section on the Admin Product creation/edit page. Adds the provided Video to the Product. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="video" defaultValue="mftfTestProductVideo"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddProductVideoActionGroup` instead --> + <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> + <waitForElementVisible selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="waitForAddVideoButtonVisible" time="30"/> + <click selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="addVideo"/> + <waitForElementVisible selector=".modal-slide.mage-new-video-dialog.form-inline._show" stepKey="waitForUrlElementVisibleslide" time="30"/> + <waitForElementVisible selector="{{AdminProductNewVideoSection.videoUrlTextField}}" stepKey="waitForUrlElementVisible" time="60"/> + <fillField selector="{{AdminProductNewVideoSection.videoUrlTextField}}" userInput="{{video.videoUrl}}" stepKey="fillFieldVideoUrl"/> + <fillField selector="{{AdminProductNewVideoSection.videoTitleTextField}}" userInput="{{video.videoTitle}}" stepKey="fillFieldVideoTitle"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForElementNotVisible selector="{{AdminProductNewVideoSection.saveButtonDisabled}}" stepKey="waitForSaveButtonVisible" time="30"/> + <click selector="{{AdminProductNewVideoSection.saveButton}}" stepKey="saveVideo"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/> + </actionGroup> + + <actionGroup name="removeProductVideo"> + <annotations> + <description>Expands the 'Images And Videos' section on the Admin Product creation/edit page. Clicks on the Remove Video button.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `RemoveProductVideoActionGroup` instead --> + <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> + <waitForElementVisible selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="waitForAddVideoButtonVisible" time="30"/> + <click selector="{{AdminProductImagesSection.removeVideoButton}}" stepKey="removeVideo"/> + </actionGroup> + + <actionGroup name="assertProductVideoAdminProductPage"> + <annotations> + <description>Validates that the provided Video is present on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="video" defaultValue="mftfTestProductVideo"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertProductVideoAdminProductPageActionGroup` instead --> + <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <seeElement selector="{{AdminProductImagesSection.videoTitleText(video.videoShortTitle)}}" stepKey="seeVideoTitle"/> + <seeElementInDOM selector="{{AdminProductImagesSection.videoUrlHiddenField(video.videoUrl)}}" stepKey="seeVideoItem"/> + </actionGroup> + + <actionGroup name="assertProductVideoNotInAdminProductPage"> + <annotations> + <description>Validates that the provided Video is NOT present on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="video" defaultValue="mftfTestProductVideo"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertProductVideoNotInAdminProductPageActionGroup` instead --> + <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> + <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <dontSeeElement selector="{{AdminProductImagesSection.videoTitleText(video.videoShortTitle)}}" stepKey="seeVideoTitle"/> + <dontSeeElementInDOM selector="{{AdminProductImagesSection.videoUrlHiddenField(video.videoUrl)}}" stepKey="seeVideoItem"/> + </actionGroup> + + <actionGroup name="assertProductVideoStorefrontProductPage"> + <annotations> + <description>Validates that the provided Video is present on the Storefront Product page.</description> + </annotations> + <arguments> + <argument name="dataTypeAttribute" defaultValue="'youtube'"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertProductVideoStorefrontProductPageActionGroup` instead --> + <seeElement selector="{{StorefrontProductInfoMainSection.productVideo(dataTypeAttribute)}}" stepKey="seeProductVideoDataType"/> + </actionGroup> + + <actionGroup name="assertProductVideoNotInStorefrontProductPage"> + <annotations> + <description>Validates that the provided Video is NOT present on the Storefront Product page.</description> + </annotations> + <arguments> + <argument name="dataTypeAttribute" defaultValue="'youtube'"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertProductVideoNotInStorefrontProductPageActionGroup` instead --> + <dontSeeElement selector="{{StorefrontProductInfoMainSection.productVideo(dataTypeAttribute)}}" stepKey="dontSeeProductVideoDataType"/> + </actionGroup> +</actionGroups> From f4f7ca689126b093e87283b1123438624c266ac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 23:44:01 +0100 Subject: [PATCH 387/595] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 app/code/Magento/Paypal/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..e6765a6a520e1 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,150 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="EnablePayPalConfiguration"> + <annotations> + <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code.</description> + </annotations> + <arguments> + <argument name="payPalConfigType"/> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `EnablePayPalConfigurationActionGroup` instead --> + <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> + <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> + <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> + <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn"/> + <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> + <selectOption selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableWPSExpressSolution"/> + <seeInPopup userInput="There is already another PayPal solution enabled. Enable this solution instead?" stepKey="seeAlertMessage"/> + <acceptPopup stepKey="acceptEnablePopUp"/> + <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + </actionGroup> + + <actionGroup name="EnablePayPalSolutionWithoutSave" > + <annotations> + <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code without saving.</description> + </annotations> + <arguments> + <argument name="payPalConfigType"/> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `EnablePayPalSolutionWithoutSaveActionGroup` instead --> + <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> + <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> + <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> + <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn"/> + <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> + <selectOption selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableWPSExpressSolution"/> + </actionGroup> + + <actionGroup name="CheckEnableOptionPayPalConfiguration"> + <annotations> + <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code.</description> + </annotations> + <arguments> + <argument name="payPalConfigType"/> + <argument name="enabledOption" type="string"/> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CheckEnableOptionPayPalConfigurationActionGroup` instead --> + <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> + <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> + <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> + <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn1"/> + <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> + <seeOptionIsSelected selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="{{enabledOption}}" stepKey="seeSelectedOption"/> + <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn2"/> + </actionGroup> + + <actionGroup name="ConfigPayPalExpressCheckout"> + <annotations> + <description>Goes to the 'Configuration' page for 'Payment Methods'. Fills in the provided PayPal credentials and other details. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="credentials" defaultValue="_CREDS"/> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ConfigPayPalExpressCheckoutActionGroup` instead --> + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/> + <waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="waitForAdvancedSettingTab"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.email(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_business_account}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/> + <selectOption selector ="{{PayPalExpressCheckoutConfigSection.apiMethod(countryCode)}}" userInput="API Signature" stepKey="inputAPIAuthenticationMethods"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.username(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_username}}" stepKey="inputAPIUsername"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.password(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_password}}" stepKey="inputAPIPassword"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.signature(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_signature}}" stepKey="inputAPISignature"/> + <selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode(countryCode)}}" userInput="Yes" stepKey="enableSandboxMode"/> + <selectOption selector="{{PayPalExpressCheckoutConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_merchant_id}}" stepKey="inputMerchantID"/> + <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> + </actionGroup> + + <actionGroup name="SampleConfigPayPalExpressCheckout"> + <annotations> + <description>Goes to the 'Configuration' page for 'Payment Methods'. Fills in the provided Sample PayPal credentials and other details. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="credentials" defaultValue="SamplePaypalExpressConfig"/> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SampleConfigPayPalExpressCheckoutActionGroup` instead --> + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/> + <waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="waitForAdvancedSettingTab"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.email(countryCode)}}" userInput="{{credentials.paypal_express_email}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/> + <selectOption selector ="{{PayPalExpressCheckoutConfigSection.apiMethod(countryCode)}}" userInput="API Signature" stepKey="inputAPIAuthenticationMethods"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.username(countryCode)}}" userInput="{{credentials.paypal_express_api_username}}" stepKey="inputAPIUsername"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.password(countryCode)}}" userInput="{{credentials.paypal_express_api_password}}" stepKey="inputAPIPassword"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.signature(countryCode)}}" userInput="{{credentials.paypal_express_api_signature}}" stepKey="inputAPISignature"/> + <selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode(countryCode)}}" userInput="Yes" stepKey="enableSandboxMode"/> + <selectOption selector="{{PayPalExpressCheckoutConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/> + <fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID(countryCode)}}" userInput="{{credentials.paypal_express_merchantID}}" stepKey="inputMerchantID"/> + <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> + </actionGroup> + + <actionGroup name="addProductToCheckoutPage"> + <annotations> + <description>Goes to the provided Category page on the Storefront. Adds the 1st Product to the Cart. Goes to Checkout. Select the Shipping Method. Selects PayPal as the Payment Method.</description> + </annotations> + <arguments> + <argument name="Category"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddProductToCheckoutPageActionGroup` instead --> + <amOnPage url="{{StorefrontCategoryPage.url(Category.name)}}" stepKey="onCategoryPage"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverProduct"/> + <click selector="{{StorefrontCategoryMainSection.AddToCartBtn}}" stepKey="addToCart"/> + <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="waitForProductAdded"/> + <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/> + <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + <click selector="{{CheckoutShippingMethodsSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask2"/> + <waitForElement selector="{{CheckoutShippingMethodsSection.next}}" time="30" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext"/> + <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPlaceOrderButton"/> + <click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="clickPayPalCheckbox"/> + </actionGroup> +</actionGroups> From 76f310f82d94c2df8f6b8f4255577441a1ff1964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 23:47:06 +0100 Subject: [PATCH 388/595] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 app/code/Magento/PageCache/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/PageCache/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/PageCache/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..65e8a0604f505 --- /dev/null +++ b/app/code/Magento/PageCache/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="clearPageCache"> + <annotations> + <description>Goes to the Admin Cache Management page. Selects 'Refresh'. Checks the 'Page Cache' row. Clicks on Submit.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ClearPageCacheActionGroup` instead --> + <amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/admin/cache/" stepKey="amOnCacheManagementPage"/> + <waitForPageLoad stepKey="waitForCacheManagement"/> + <selectOption selector="{{AdminCacheManagementSection.massActionSelect}}" userInput="refresh" stepKey="selectRefresh"/> + <click selector="{{AdminCacheManagementSection.pageCacheCheckbox}}" stepKey="selectPageCache"/> + <click selector="{{AdminCacheManagementSection.massActionSubmit}}" stepKey="submitCacheForm"/> + <waitForPageLoad stepKey="waitForCacheFlush"/> + </actionGroup> +</actionGroups> From b04160805c925901fe7c0e397a3590c8cfacada7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 23:53:08 +0100 Subject: [PATCH 389/595] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 app/code/Magento/Newsletter/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..c3f29feb63b8d --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontCreateNewAccountNewsletterChecked" extends="SignUpNewUserFromStorefrontActionGroup"> + <annotations> + <description>EXTENDS: SignUpNewUserFromStorefrontActionGroup. Clicks on 'Sign Up for Newsletter'. Validates that the Subscription Confirmation message is present and correct.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCreateNewAccountNewsletterCheckedActionGroup` instead --> + <click selector="{{StorefrontCustomerCreateFormSection.signUpForNewsletter}}" stepKey="selectSignUpForNewsletterCheckbox" after="fillLastName"/> + <see stepKey="seeDescriptionNewsletter" userInput='You are subscribed to "General Subscription".' selector="{{CustomerMyAccountPage.DescriptionNewsletter}}"/> + </actionGroup> + + <actionGroup name="StorefrontCreateNewAccountNewsletterUnchecked" extends="SignUpNewUserFromStorefrontActionGroup"> + <annotations> + <description>EXTENDS: SignUpNewUserFromStorefrontActionGroup. Validates that the you are NOT subscribed message is present and correct.</description> + </annotations> + <arguments> + <argument name="Customer"/> + <argument name="Store"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCreateNewAccountNewsletterUncheckedActionGroup` instead --> + <amOnPage stepKey="amOnStorefrontPage" url="{{Store.code}}"/> + <see stepKey="seeDescriptionNewsletter" userInput="You aren't subscribed to our newsletter." selector="{{CustomerMyAccountPage.DescriptionNewsletter}}"/> + <see stepKey="seeThankYouMessage" userInput="Thank you for registering with NewStore."/> + </actionGroup> +</actionGroups> From a5a025a47f2f9a0940aac1453a9c61f27e87e701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 23:56:15 +0100 Subject: [PATCH 390/595] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..41d8803a253f9 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontGoCheckoutWithMultipleAddresses"> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontGoCheckoutWithMultipleAddressesActionGroup` instead --> + <click selector="{{MultishippingSection.shippingMultipleCheckout}}" stepKey="clickToMultipleAddressShippingButton"/> + </actionGroup> +</actionGroups> From 450138063018e4cf893e5da8a6c9f4ea8ccfb642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Wed, 4 Dec 2019 23:59:53 +0100 Subject: [PATCH 391/595] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..6da85827f77ec --- /dev/null +++ b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,96 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="checkRequiredFieldsInGroupedProductForm"> + <annotations> + <description>Clears the Product Name and SKU fields when adding a Grouped Product and then verifies that they are required after attempting to Save.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CheckRequiredFieldsInGroupedProductFormActionGroup` instead --> + <clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductSku"/> + <clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductName"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/> + <see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/> + <see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/> + </actionGroup> + + <!--Fill main fields in grouped product form--> + <actionGroup name="fillGroupedProductForm"> + <annotations> + <description>Fills in the provided Product Name and SKU on the Grouped Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="GroupedProduct"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillGroupedProductFormActionGroup` instead --> + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> + </actionGroup> + + <actionGroup name="viewGroupedProductInAdminGrid"> + <annotations> + <description>Goes to the Admin Products grid page. Filters the grid for the provided Product. Validates that the provided Product appears in the grid.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="GroupedProduct"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ViewGroupedProductInAdminGridActionGroup` instead --> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <waitForPageLoad stepKey="waitForPageLoadInitial"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> + <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionProductType"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeProductNameInGrid"/> + <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> + </actionGroup> + + <actionGroup name="fillDefaultQuantityForLinkedToGroupProductInGrid"> + <annotations> + <description>Fills the provided Qty for a Product linked to a Grouped Product.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="qty" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillDefaultQuantityForLinkedToGroupProductInGridActionGroup` instead --> + <fillField selector="{{AdminAddedProductsToGroupGrid.inputByProductName(productName)}}" userInput="{{qty}}" stepKey="fillDefaultQtyForLinkedProduct"/> + </actionGroup> + + <actionGroup name="AdminAssignProductToGroup"> + <annotations> + <description>Adds the provided Product to a Grouped Product on an Admin Grouped Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="product"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAssignProductToGroupActionGroup` instead --> + <scrollTo selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" x="0" y="-100" stepKey="scrollToGroupedSection"/> + <conditionalClick selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" dependentSelector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" visible="false" stepKey="openGroupedProductsSection"/> + <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/> + <conditionalClick selector="{{AdminAddProductsToGroupPanel.clearFilters}}" dependentSelector="{{AdminAddProductsToGroupPanel.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> + <click selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="showFiltersPanel"/> + <fillField userInput="{{product.name}}" selector="{{AdminAddProductsToGroupPanel.nameFilter}}" stepKey="fillNameFilter"/> + <click selector="{{AdminAddProductsToGroupPanel.applyFilters}}" stepKey="clickApplyFilters"/> + <click selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="selectProduct"/> + <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="clickAddSelectedGroupProducts"/> + </actionGroup> +</actionGroups> From 6245374d9b178a94f722ecc65e498769bbbeac79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 5 Dec 2019 00:03:42 +0100 Subject: [PATCH 392/595] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 app/code/Magento/Email/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Email/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Email/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..855ec8790f8f2 --- /dev/null +++ b/app/code/Magento/Email/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,90 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="CreateNewTemplate"> + <annotations> + <description>Clicks on Add New Template. Fills the Template details. Clicks on Save. PLEASE NOTE: The values are Hardcoded.</description> + </annotations> + <arguments> + <argument name="template" defaultValue="EmailTemplate"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateNewTemplateActionGroup` instead --> + <amOnPage url="{{AdminEmailTemplateIndexPage.url}}" stepKey="navigateToEmailTemplatePage"/> + <click selector="{{AdminMainActionsSection.add}}" stepKey="clickAddNewTemplateButton"/> + <selectOption selector="{{AdminEmailTemplateEditSection.templateDropDown}}" userInput="Registry Update" stepKey="selectValueFromTemplateDropDown"/> + <click selector="{{AdminEmailTemplateEditSection.loadTemplateButton}}" stepKey="clickLoadTemplateButton"/> + <fillField selector="{{AdminEmailTemplateEditSection.templateCode}}" userInput="{{EmailTemplate.templateName}}" stepKey="fillTemplateNameField"/> + <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveTemplateButton"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the email template." stepKey="seeSuccessMessage"/> + </actionGroup> + + <actionGroup name="CreateCustomTemplate" extends="CreateNewTemplate"> + <remove keyForRemoval="selectValueFromTemplateDropDown"/> + <remove keyForRemoval="clickLoadTemplateButton"/> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateCustomTemplateActionGroup` instead --> + <fillField selector="{{AdminEmailTemplateEditSection.templateSubject}}" userInput="{{template.templateSubject}}" after="fillTemplateNameField" stepKey="fillTemplateSubject"/> + <fillField selector="{{AdminEmailTemplateEditSection.templateText}}" userInput="{{template.templateText}}" after="fillTemplateSubject" stepKey="fillTemplateText"/> + </actionGroup> + + <actionGroup name="FindAndOpenEmailTemplate"> + <arguments> + <argument name="template" defaultValue="EmailTemplate"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FindAndOpenEmailTemplateActionGroup` instead --> + <amOnPage url="{{AdminEmailTemplateIndexPage.url}}" stepKey="navigateEmailTemplatePage" /> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clearFilters"/> + <fillField selector="{{AdminEmailTemplateIndexSection.searchTemplateField}}" userInput="{{template.templateName}}" stepKey="findCreatedTemplate"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearch"/> + <waitForElementVisible selector="{{AdminEmailTemplateIndexSection.templateRowByName(template.templateName)}}" stepKey="waitForTemplatesAppeared"/> + <click selector="{{AdminEmailTemplateIndexSection.templateRowByName(template.templateName)}}" stepKey="clickToOpenTemplate"/> + <waitForElementVisible selector="{{AdminEmailTemplateEditSection.templateCode}}" stepKey="waitForTemplateNameisible"/> + <seeInField selector="{{AdminEmailTemplateEditSection.templateCode}}" userInput="{{template.templateName}}" stepKey="checkTemplateName"/> + </actionGroup> + + <actionGroup name="DeleteEmailTemplate" extends="FindAndOpenEmailTemplate"> + <annotations> + <description>Clicks on Delete Template. Accepts the Popup. Validates that the Email Template is NOT present in the Email Templates Grid.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DeleteEmailTemplateActionGroup` instead --> + <click selector="{{AdminEmailTemplateEditSection.deleteTemplateButton}}" after="checkTemplateName" stepKey="deleteTemplate"/> + <waitForElementVisible selector="{{AdminEmailTemplateEditSection.acceptPopupButton}}" after="deleteTemplate" stepKey="waitForConfirmButton"/> + <click selector="{{AdminEmailTemplateEditSection.acceptPopupButton}}" after="waitForConfirmButton" stepKey="acceptPopup"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" after="acceptPopup" stepKey="waitForSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the email template." after="waitForSuccessMessage" stepKey="seeSuccessfulMessage"/> + </actionGroup> + + <actionGroup name="PreviewEmailTemplateActionGroup" extends="FindAndOpenEmailTemplate"> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateSystemBackupActionGroup` instead --> + <click selector="{{AdminEmailTemplateEditSection.previewTemplateButton}}" after="checkTemplateName" stepKey="clickPreviewTemplate"/> + <switchToNextTab after="clickPreviewTemplate" stepKey="switchToNewOpenedTab"/> + <seeInCurrentUrl url="{{AdminEmailTemplatePreviewPage.url}}" after="switchToNewOpenedTab" stepKey="seeCurrentUrl"/> + <seeElement selector="{{AdminEmailTemplatePreviewSection.iframe}}" after="seeCurrentUrl" stepKey="seeIframeOnPage"/> + <switchToIFrame userInput="preview_iframe" after="seeIframeOnPage" stepKey="switchToIframe"/> + <waitForPageLoad after="switchToIframe" stepKey="waitForPageLoaded"/> + </actionGroup> + + <actionGroup name="AssertEmailTemplateContent"> + <arguments> + <argument name="expectedContent" type="string" defaultValue="{{EmailTemplate.templateText}}"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertEmailTemplateContentActionGroup` instead --> + <see userInput="{{expectedContent}}" stepKey="checkTemplateContainText"/> + </actionGroup> +</actionGroups> From 84f9267d61c0f278849381d2bdb3b07a1f1c064a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 5 Dec 2019 00:07:15 +0100 Subject: [PATCH 393/595] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 app/code/Magento/Downloadable/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..9d739995e99e6 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,106 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="fillMainDownloadableProductForm"> + <annotations> + <description>Fills the Name, SKU, Price and Quantity on the Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="DownloadableProduct"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillMainDownloadableProductFormActionGroup` instead --> + <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> + <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> + <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/> + <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="fillProductQty"/> + </actionGroup> + + <actionGroup name="addDownloadableProductLinkWithMaxDownloads"> + <annotations> + <description>Clicks on 'Add Link'. Fills in the provided Link details including a Max Downloads limit.</description> + </annotations> + <arguments> + <argument name="link" defaultValue="downloadableLinkWithMaxDownloads"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddDownloadableProductLinkWithMaxDownloadsActionGroup` instead --> + <click selector="{{AdminProductDownloadableSection.linksAddLinkButton}}" stepKey="clickLinkAddLinkButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <fillField userInput="{{link.title}}" selector="{{AdminProductDownloadableSection.addLinkTitleInput('0')}}" stepKey="fillDownloadableLinkTitle"/> + <fillField userInput="{{link.price}}" selector="{{AdminProductDownloadableSection.addLinkPriceInput('0')}}" stepKey="fillDownloadableLinkPrice"/> + <selectOption userInput="{{link.file_type}}" selector="{{AdminProductDownloadableSection.addLinkFileTypeSelector('0')}}" stepKey="selectDownloadableLinkFileType"/> + <selectOption userInput="{{link.sample_type}}" selector="{{AdminProductDownloadableSection.addLinkSampleTypeSelector('0')}}" stepKey="selectDownloadableLinkSampleType"/> + <selectOption userInput="{{link.shareable}}" selector="{{AdminProductDownloadableSection.addLinkShareableSelector('0')}}" stepKey="selectDownloadableLinkShareable"/> + <fillField userInput="{{link.max_downloads}}" selector="{{AdminProductDownloadableSection.addLinkMaxDownloadsInput('0')}}" stepKey="fillDownloadableLinkMaxDownloads"/> + <attachFile userInput="{{link.file}}" selector="{{AdminProductDownloadableSection.addLinkFileUploadFile('0')}}" stepKey="fillDownloadableLinkUploadFile"/> + <fillField userInput="{{link.sample}}" selector="{{AdminProductDownloadableSection.addLinkSampleUrlInput('0')}}" stepKey="fillDownloadableLinkSampleUrl"/> + </actionGroup> + + <actionGroup name="addDownloadableProductLink"> + <annotations> + <description>Clicks on 'Add Link', under the 'Links' section. Fills in the provided Link details including Unlimited Downloads.</description> + </annotations> + <arguments> + <argument name="link" defaultValue="downloadableLink"/> + <argument name="index" type="string" defaultValue="1"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddDownloadableProductLinkActionGroup` instead --> + <click selector="{{AdminProductDownloadableSection.linksAddLinkButton}}" stepKey="clickLinkAddLinkButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <fillField userInput="{{link.title}}" selector="{{AdminProductDownloadableSection.addLinkTitleInput(index)}}" stepKey="fillDownloadableLinkTitle"/> + <fillField userInput="{{link.price}}" selector="{{AdminProductDownloadableSection.addLinkPriceInput(index)}}" stepKey="fillDownloadableLinkPrice"/> + <selectOption userInput="{{link.file_type}}" selector="{{AdminProductDownloadableSection.addLinkFileTypeSelector(index)}}" stepKey="selectDownloadableLinkFileType"/> + <selectOption userInput="{{link.sample_type}}" selector="{{AdminProductDownloadableSection.addLinkSampleTypeSelector(index)}}" stepKey="selectDownloadableLinkSampleType"/> + <selectOption userInput="{{link.shareable}}" selector="{{AdminProductDownloadableSection.addLinkShareableSelector(index)}}" stepKey="selectDownloadableLinkShareable"/> + <checkOption selector="{{AdminProductDownloadableSection.addLinkIsUnlimitedDownloads(index)}}" stepKey="checkDownloadableLinkUnlimited"/> + <fillField userInput="{{link.file}}" selector="{{AdminProductDownloadableSection.addLinkFileUrlInput(index)}}" stepKey="fillDownloadableLinkFileUrl"/> + <attachFile userInput="{{link.sample}}" selector="{{AdminProductDownloadableSection.addLinkSampleUploadFile(index)}}" stepKey="attachDownloadableLinkUploadSample"/> + <waitForPageLoad stepKey="waitForPageLoadAfterFillingOutForm" /> + </actionGroup> + + <actionGroup name="addDownloadableSampleFile"> + <annotations> + <description>Clicks on 'Add Link' under the 'Samples' section. Fills in the provided Downloadable Sample File details.</description> + </annotations> + <arguments> + <argument name="sample" defaultValue="downloadableSampleFile"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddDownloadableSampleFileActionGroup` instead --> + <click selector="{{AdminProductDownloadableSection.samplesAddLinkButton}}" stepKey="clickSampleAddLinkButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <fillField userInput="{{sample.title}}" selector="{{AdminProductDownloadableSection.addSampleTitleInput('0')}}" stepKey="fillDownloadableSampleTitle"/> + <selectOption userInput="{{sample.file_type}}" selector="{{AdminProductDownloadableSection.addSampleFileTypeSelector('0')}}" stepKey="selectDownloadableSampleFileType"/> + <attachFile userInput="{{sample.file}}" selector="{{AdminProductDownloadableSection.addSampleFileUploadFile('0')}}" stepKey="selectDownloadableSampleUpload"/> + <waitForAjaxLoad stepKey="waitForSampleFileUpload"/> + </actionGroup> + + <actionGroup name="addDownloadableSampleUrl"> + <annotations> + <description>Clicks on 'Add Link' under the 'Samples' section. Fills in the provided Downloadable Sample URL details.</description> + </annotations> + <arguments> + <argument name="sample" defaultValue="downloadableSampleUrl"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddDownloadableSampleUrlActionGroup` instead --> + <click selector="{{AdminProductDownloadableSection.samplesAddLinkButton}}" stepKey="clickSampleAddLinkButton2"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <fillField userInput="{{sample.title}}" selector="{{AdminProductDownloadableSection.addSampleTitleInput('1')}}" stepKey="fillDownloadableSampleTitle"/> + <selectOption userInput="{{sample.file_type}}" selector="{{AdminProductDownloadableSection.addSampleFileTypeSelector('1')}}" stepKey="selectDownloadableSampleFileType"/> + <fillField userInput="{{sample.file}}" selector="{{AdminProductDownloadableSection.addSampleFileUrlInput('1')}}" stepKey="fillDownloadableSampleFileUrl"/> + </actionGroup> +</actionGroups> From c60bbaa506e08541081deed8c3562164947ebea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 5 Dec 2019 00:22:21 +0100 Subject: [PATCH 394/595] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- ...> StorefrontSwitchCurrencyActionGroup.xml} | 0 .../ActionGroup/_Deprecated_ActionGroup.xml | 27 +++++++++++++++++++ 2 files changed, 27 insertions(+) rename app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/{StorefrontCurrencyRatesActionGroup.xml => StorefrontSwitchCurrencyActionGroup.xml} (100%) create mode 100644 app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/StorefrontCurrencyRatesActionGroup.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/StorefrontSwitchCurrencyActionGroup.xml similarity index 100% rename from app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/StorefrontCurrencyRatesActionGroup.xml rename to app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/StorefrontSwitchCurrencyActionGroup.xml diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..0bb23b04b66a9 --- /dev/null +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + + <actionGroup name="StorefrontSwitchCurrency"> + <arguments> + <argument name="currency" type="string" defaultValue="EUR"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontSwitchCurrencyActionGroup` instead --> + <click selector="{{StorefrontSwitchCurrencyRatesSection.currencyTrigger}}" stepKey="openTrigger"/> + <waitForElementVisible selector="{{StorefrontSwitchCurrencyRatesSection.currency(currency)}}" stepKey="waitForCurrency"/> + <click selector="{{StorefrontSwitchCurrencyRatesSection.currency(currency)}}" stepKey="chooseCurrency"/> + <see selector="{{StorefrontSwitchCurrencyRatesSection.selectedCurrency}}" userInput="{{currency}}" stepKey="seeSelectedCurrency"/> + </actionGroup> +</actionGroups> From 910cc76c985b5559be0bfc287c5593803fc9ac0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 5 Dec 2019 00:36:29 +0100 Subject: [PATCH 395/595] BACKWARD COMPATIBILITY: Deprecated ActionGroups to make change Backward Compatible. --- .../ActionGroup/_Deprecated_ActionGroup.xml | 853 ++++++++++++++++++ 1 file changed, 853 insertions(+) create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml new file mode 100644 index 0000000000000..672465ad4120b --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml @@ -0,0 +1,853 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<!-- +NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. + Please find the Comment with proper replacement for each of ActionGroups provided. +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="CreateConfigurableProductWithAttributeSet"> + <annotations> + <description>Admin edit created product as configurable. Choose created options</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + <argument name="category" defaultValue="_defaultCategory"/> + <argument name="label" type="string" defaultValue="mySet"/> + <argument name="option" type="string" defaultValue="['option1', 'option2', 'option3', 'option4']"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurableProductWithAttributeSetActionGroup` instead --> + <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/> + <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{label}}" stepKey="searchForAttrSet"/> + <click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/> + <fillField userInput="{{product.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> + <selectOption selector="{{AdminProductFormSection.additionalOptions}}" parameterArray="{{option}}" stepKey="searchAndMultiSelectCreatedOption"/> + </actionGroup> + + <actionGroup name="AdminCreateConfigurationsForAttribute" extends="generateConfigurationsByAttributeCode"> + <annotations> + <description>EXTENDS: generateConfigurationsByAttributeCode. Click to apply single price to all Skus. Enter Attribute price</description> + </annotations> + <arguments> + <argument name="price" type="string" defaultValue="100"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateConfigurationsForAttributeActionGroup` instead --> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="clickOnNextButton2" stepKey="waitForNextPageOpened2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="waitForNextPageOpened2" stepKey="clickOnApplySinglePriceToAllSkus"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="{{price}}" before="clickOnApplySingleQuantityToEachSku" stepKey="enterAttributePrice"/> + </actionGroup> + + <actionGroup name="AdminCreateConfigurableProductWithAttributeUncheckOption" extends="generateConfigurationsByAttributeCode"> + <annotations> + <description>EXTENDS: generateConfigurationsByAttributeCode. Click to uncheck created option. Enter Attribute price</description> + </annotations> + <arguments> + <argument name="attributeOption" type="string" defaultValue="option1"/> + <argument name="price" type="string" defaultValue="100"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateConfigurableProductWithAttributeUncheckOptionActionGroup` instead --> + <click selector="{{AdminCreateProductConfigurationsPanel.attributeOption('attributeOption')}}" after="clickOnSelectAll" stepKey="clickToUncheckOption"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" after="clickToUncheckOption" stepKey="clickOnNextButton22"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="clickOnNextButton22" stepKey="waitForNextPageOpened2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="waitForNextPageOpened2" stepKey="clickOnApplySinglePriceToAllSkus"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="{{price}}" before="clickOnApplySingleQuantityToEachSku" stepKey="enterAttributePrice"/> + </actionGroup> + + <actionGroup name="viewConfigurableProductInAdminGrid"> + <annotations> + <description>Goes to the Admin Product grid page. Validates the provided Configurable Product is present and correct in the grid.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ViewConfigurableProductInAdminGridActionGroup` instead --> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <waitForPageLoad stepKey="waitForPageLoadInitial"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="3" stepKey="seeCorrectNumberOfProducts"/> + + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFiltersSimple"/> + <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="simple" stepKey="selectionProductType"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersWithSimpleType"/> + <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeSimpleProductNameInGrid"/> + <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.price}}" stepKey="seeSimpleProductPriceInGrid"/> + + <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFiltersConfigurable"/> + <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionConfigurableProductType"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersWithConfigurableType"/> + <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeConfigurableProductNameInGrid"/> + <dontSee selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.price}}" stepKey="dontSeeProductPriceNameInGrid"/> + + <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> + </actionGroup> + + <actionGroup name="createConfigurableProduct"> + <annotations> + <description>Goes to the Admin Product grid page. Creates a Configurable Product using the default Product Options.</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + <argument name="category" defaultValue="_defaultCategory"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurableProductActionGroup` instead --> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> + <waitForPageLoad time="30" stepKey="wait1"/> + <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickOnAddProductToggle"/> + <click selector="{{AdminProductGridActionSection.addConfigurableProduct}}" stepKey="clickOnAddConfigurableProduct"/> + <fillField userInput="{{product.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> + <fillField userInput="{{product.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/> + <fillField userInput="{{product.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/> + <fillField userInput="{{product.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/> + <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="fillCategory"/> + <selectOption userInput="{{product.visibility}}" selector="{{AdminProductFormSection.visibility}}" stepKey="fillVisibility"/> + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> + <fillField userInput="{{product.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> + + <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurations"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickOnNewAttribute"/> + <waitForPageLoad stepKey="waitForIFrame"/> + <switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/> + <fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{colorProductAttribute.default_label}}" stepKey="fillDefaultLabel"/> + <click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/> + <waitForPageLoad stepKey="waitForSaveAttribute"/> + <switchToIFrame stepKey="switchOutOfIFrame"/> + <waitForPageLoad stepKey="waitForFilters"/> + <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> + <fillField userInput="{{colorProductAttribute.default_label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue1"/> + <fillField userInput="{{colorProductAttribute1.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute1"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute1"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue2"/> + <fillField userInput="{{colorProductAttribute2.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue3"/> + <fillField userInput="{{colorProductAttribute3.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute3"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute3"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applyUniquePricesByAttributeToEachSku}}" stepKey="clickOnApplyUniquePricesByAttributeToEachSku"/> + <selectOption selector="{{AdminCreateProductConfigurationsPanel.selectAttribute}}" userInput="{{colorProductAttribute.default_label}}" stepKey="selectAttributes"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute1}}" userInput="{{colorProductAttribute1.price}}" stepKey="fillAttributePrice1"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute2}}" userInput="{{colorProductAttribute2.price}}" stepKey="fillAttributePrice2"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute3}}" userInput="{{colorProductAttribute3.price}}" stepKey="fillAttributePrice3"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="1" stepKey="enterAttributeQuantity"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> + <seeInTitle userInput="{{product.name}}" stepKey="seeProductNameInTitle"/> + </actionGroup> + + <actionGroup name="createConfigurableProductWithTwoAttributes" extends="createConfigurableProduct"> + <annotations> + <description>Goes to the Admin Product grid page. Creates a Configurable Product with 2 product attributes.</description> + </annotations> + <arguments> + <argument name="attribute1" defaultValue="ProductColorAttribute"/> + <argument name="attribute2" defaultValue="ProductSizeAttribute"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurableProductWithTwoAttributesActionGroup` instead --> + <remove keyForRemoval="clickOnNewAttribute"/> + <remove keyForRemoval="waitForIFrame"/> + <remove keyForRemoval="switchToNewAttributeIFrame"/> + <remove keyForRemoval="fillDefaultLabel"/> + <remove keyForRemoval="clickOnNewAttributePanel"/> + <remove keyForRemoval="waitForSaveAttribute"/> + <remove keyForRemoval="switchOutOfIFrame"/> + <remove keyForRemoval="waitForFilters"/> + <remove keyForRemoval="clickOnFilters"/> + <remove keyForRemoval="fillFilterAttributeCodeField"/> + <remove keyForRemoval="clickApplyFiltersButton"/> + <remove keyForRemoval="clickOnFirstCheckbox"/> + <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attribute1.attribute_code)}}" stepKey="selectAttribute1" after="clickOnCreateConfigurations"/> + <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attribute2.attribute_code)}}" stepKey="selectAttribute2" after="selectAttribute1"/> + <remove keyForRemoval="waitCreateNewValueAppears"/> + <remove keyForRemoval="clickOnCreateNewValue1"/> + <remove keyForRemoval="fillFieldForNewAttribute1"/> + <remove keyForRemoval="clickOnSaveNewAttribute1"/> + <remove keyForRemoval="clickOnCreateNewValue2"/> + <remove keyForRemoval="fillFieldForNewAttribute2"/> + <remove keyForRemoval="clickOnSaveNewAttribute2"/> + <remove keyForRemoval="clickOnCreateNewValue3"/> + <remove keyForRemoval="fillFieldForNewAttribute3"/> + <remove keyForRemoval="clickOnSaveNewAttribute3"/> + <remove keyForRemoval="clickOnSelectAll"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attribute1.frontend_label)}}" stepKey="selectAllOptionsOfAttribute1" before="clickOnNextButton2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attribute2.frontend_label)}}" stepKey="selectAllOptionsOfAttribute2" before="clickOnNextButton2"/> + <remove keyForRemoval="applyUniquePricesByAttributeToEachSku"/> + <remove keyForRemoval="clickOnApplyUniquePricesByAttributeToEachSku"/> + <remove keyForRemoval="selectAttributes"/> + <remove keyForRemoval="fillAttributePrice1"/> + <remove keyForRemoval="fillAttributePrice2"/> + <remove keyForRemoval="fillAttributePrice3"/> + <remove keyForRemoval="clickOnSaveButton2"/> + <remove keyForRemoval="clickOnConfirmInPopup"/> + <remove keyForRemoval="seeSaveProductMessage"/> + <remove keyForRemoval="seeProductNameInTitle"/> + </actionGroup> + + <actionGroup name="saveConfigurableProduct"> + <annotations> + <description>Save configurable product</description> + </annotations> + <arguments> + <argument name="product" defaultValue="_defaultProduct"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveConfigurableProductActionGroup` instead --> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> + <seeInTitle userInput="{{product.name}}" stepKey="seeProductNameInTitle"/> + </actionGroup> + + <actionGroup name="generateConfigurationsByAttributeCode"> + <annotations> + <description>Generates the Product Configurations for the provided Attribute Code on the Configurable Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="attributeCode" type="string" defaultValue="SomeString"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GenerateConfigurationsByAttributeCodeActionGroup` instead --> + <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickCreateConfigurations"/> + <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickFilters"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" userInput="{{attributeCode}}" stepKey="fillFilterAttributeCodeField"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="99" stepKey="enterAttributeQuantity"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/> + </actionGroup> + + <actionGroup name="createOptionsForAttribute"> + <arguments> + <argument name="attributeName" type="string" defaultValue="{{productAttributeColor.default_label}}"/> + <argument name="firstOptionName" type="string" defaultValue="option1"/> + <argument name="secondOptionName" type="string" defaultValue="option2"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateOptionsForAttributeActionGroup` instead --> + <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> + <fillField userInput="{{attributeName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateFirstNewValue"/> + <fillField userInput="{{firstOptionName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateSecondNewValue"/> + <fillField userInput="{{secondOptionName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveAttribute"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> + </actionGroup> + + <actionGroup name="createConfigurationsForAttribute" extends="generateConfigurationsByAttributeCode"> + <annotations> + <description>EXTENDS: generateConfigurationsByAttributeCode. Clicks on the Save button. Clicks on the Confirm button.</description> + </annotations> + <arguments> + <argument name="attributeCode" type="string" defaultValue="SomeString"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurationsForAttributeActionGroup` instead --> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> + </actionGroup> + + <actionGroup name="createConfigurationsForAttributeWithImages" extends="generateConfigurationsByAttributeCode"> + <annotations> + <description>EXTENDS: generateConfigurationsByAttributeCode. Adds the provided Attribute Image to the provided Attribute Code.</description> + </annotations> + <arguments> + <argument name="attributeCode" type="string" defaultValue="SomeString"/> + <argument name="image" defaultValue="ProductImage"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurationsForAttributeWithImagesActionGroup` instead --> + <click selector="{{AdminCreateProductConfigurationsPanel.applySingleSetOfImages}}" stepKey="clickOnApplySingleImageSetToAllSku" after="enterAttributeQuantity"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageUploadButton}}" stepKey="seeImageSectionIsReady" after="clickOnApplySingleImageSetToAllSku"/> + <attachFile selector="{{AdminCreateProductConfigurationsPanel.imageFileUpload}}" userInput="{{image.file}}" stepKey="uploadFile" after="seeImageSectionIsReady"/> + <waitForElementNotVisible selector="{{AdminCreateProductConfigurationsPanel.uploadProgressBar}}" stepKey="waitForUpload" after="uploadFile"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageFile(image.fileName)}}" stepKey="waitForThumbnail" after="waitForUpload"/> + + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2" after="clickOnNextButton4"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup" after="clickOnSaveButton2"/> + </actionGroup> + + <actionGroup name="createConfigurationsForTwoAttribute" extends="generateConfigurationsByAttributeCode"> + <annotations> + <description>EXTENDS: generateConfigurationsByAttributeCode. Generates the Product Configurations for the 2 provided Attribute Codes on the Configurable Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="secondAttributeCode" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurationsForTwoAttributeActionGroup` instead --> + <remove keyForRemoval="clickOnSelectAll"/> + <remove keyForRemoval="clickFilters"/> + <remove keyForRemoval="fillFilterAttributeCodeField"/> + <remove keyForRemoval="clickApplyFiltersButton"/> + <remove keyForRemoval="clickOnFirstCheckbox"/> + + <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attributeCode)}}" stepKey="clickOnFirstAttributeCheckbox" after="clickCreateConfigurations"/> + <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(secondAttributeCode)}}" stepKey="clickOnSecondAttributeCheckbox" after="clickOnFirstAttributeCheckbox"/> + <grabTextFrom selector="{{AdminCreateProductConfigurationsPanel.defaultLabel(attributeCode)}}" stepKey="grabFirstAttributeDefaultLabel" after="clickOnSecondAttributeCheckbox"/> + <grabTextFrom selector="{{AdminCreateProductConfigurationsPanel.defaultLabel(secondAttributeCode)}}" stepKey="grabSecondAttributeDefaultLabel" after="grabFirstAttributeDefaultLabel"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute({$grabFirstAttributeDefaultLabel})}}" stepKey="clickOnSelectAllForFirstAttribute" after="clickOnNextButton1"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute({$grabSecondAttributeDefaultLabel})}}" stepKey="clickOnSelectAllForSecondAttribute" after="clickOnSelectAllForFirstAttribute"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> + </actionGroup> + + <actionGroup name="saveConfiguredProduct"> + <annotations> + <description>Save the Configurable Product on the Configurable Product creation/edit page. Validates that the Success Message is present.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveConfiguredProductActionGroup` instead --> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> + </actionGroup> + + <actionGroup name="GenerateAndSaveConfiguredProductAfterSettingOptions" extends="saveConfiguredProduct"> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GenerateAndSaveConfiguredProductAfterSettingOptionsActionGroup` instead --> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" before="clickOnSaveButton2" stepKey="clickOnNextButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" after="clickOnNextButton" stepKey="clickOnGenerateProductsButton"/> + </actionGroup> + + <actionGroup name="addNewProductConfigurationAttribute"> + <annotations> + <description>Generates the Product Configurations for the 2 provided Attribute Names on the Configurable Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="attribute" type="entity"/> + <argument name="firstOption" type="entity"/> + <argument name="secondOption" type="entity"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddNewProductConfigurationAttributeActionGroup` instead --> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickOnNewAttribute"/> + <waitForPageLoad stepKey="waitForIFrame"/> + <switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/> + <fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{attribute.default_label}}" stepKey="fillDefaultLabel"/> + <click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/> + <waitForPageLoad stepKey="waitForSaveAttribute"/> + <switchToIFrame stepKey="switchOutOfIFrame"/> + <waitForPageLoad stepKey="waitForFilters"/> + + <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> + <fillField userInput="{{attribute.default_label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateFirstNewValue"/> + <fillField userInput="{{firstOption.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateSecondNewValue"/> + <fillField userInput="{{secondOption.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> + <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveAttribute"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnSecondNextButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnThirdNextButton"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnFourthNextButton"/> + </actionGroup> + + <actionGroup name="selectCreatedAttributeAndCreateTwoOptions" extends="addNewProductConfigurationAttribute"> + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SelectCreatedAttributeAndCreateTwoOptionsActionGroup` instead --> + <remove keyForRemoval="clickOnNewAttribute"/> + <remove keyForRemoval="waitForIFrame"/> + <remove keyForRemoval="switchToNewAttributeIFrame"/> + <remove keyForRemoval="fillDefaultLabel"/> + <remove keyForRemoval="clickOnNewAttributePanel"/> + <remove keyForRemoval="waitForSaveAttribute"/> + <remove keyForRemoval="switchOutOfIFrame"/> + <remove keyForRemoval="waitForFilters"/> + <fillField userInput="{{attribute.attribute_code}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> + <fillField userInput="{{firstOption.label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> + <fillField userInput="{{secondOption.label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> + <remove keyForRemoval="clickOnSelectAll"/> + <remove keyForRemoval="clickOnSecondNextButton"/> + <remove keyForRemoval="clickOnThirdNextButton"/> + <remove keyForRemoval="clickOnFourthNextButton"/> + </actionGroup> + + <actionGroup name="changeProductConfigurationsInGrid"> + <annotations> + <description>Edit the Product Configuration via the Admin Product grid page.</description> + </annotations> + <arguments> + <argument name="firstOption" type="entity"/> + <argument name="secondOption" type="entity"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeProductConfigurationsInGridActionGroup` instead --> + <fillField userInput="{{firstOption.name}}" selector="{{AdminProductFormConfigurationsSection.confProductNameCell(firstOption.name)}}" stepKey="fillFieldNameForFirstAttributeOption"/> + <fillField userInput="{{secondOption.name}}" selector="{{AdminProductFormConfigurationsSection.confProductNameCell(secondOption.name)}}" stepKey="fillFieldNameForSecondAttributeOption"/> + <fillField userInput="{{firstOption.sku}}" selector="{{AdminProductFormConfigurationsSection.confProductSkuCell(firstOption.name)}}" stepKey="fillFieldSkuForFirstAttributeOption"/> + <fillField userInput="{{secondOption.sku}}" selector="{{AdminProductFormConfigurationsSection.confProductSkuCell(secondOption.name)}}" stepKey="fillFieldSkuForSecondAttributeOption"/> + <fillField userInput="{{firstOption.price}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(firstOption.name)}}" stepKey="fillFieldPriceForFirstAttributeOption"/> + <fillField userInput="{{secondOption.price}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(secondOption.name)}}" stepKey="fillFieldPriceForSecondAttributeOption"/> + <fillField userInput="{{firstOption.quantity}}" selector="{{AdminProductFormConfigurationsSection.confProductQuantityCell(firstOption.name)}}" stepKey="fillFieldQuantityForFirstAttributeOption"/> + <fillField userInput="{{secondOption.quantity}}" selector="{{AdminProductFormConfigurationsSection.confProductQuantityCell(secondOption.name)}}" stepKey="fillFieldQuantityForSecondAttributeOption"/> + <fillField userInput="{{firstOption.weight}}" selector="{{AdminProductFormConfigurationsSection.confProductWeightCell(firstOption.name)}}" stepKey="fillFieldWeightForFirstAttributeOption"/> + <fillField userInput="{{secondOption.weight}}" selector="{{AdminProductFormConfigurationsSection.confProductWeightCell(secondOption.name)}}" stepKey="fillFieldWeightForSecondAttributeOption"/> + </actionGroup> + + <actionGroup name="changeConfigurableProductChildProductPrice"> + <annotations> + <description>Change the price of a configurable child product in the grid under configurations.</description> + </annotations> + <arguments> + <argument name="productAttributes" type="string"/> + <argument name="productPrice" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeConfigurableProductChildProductPriceActionGroup` instead --> + <fillField userInput="{{productPrice}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(productAttributes)}}" stepKey="fillPriceForConfigurableProductAttributeOption"/> + </actionGroup> + + <actionGroup name="changeProductConfigurationsInGridExceptSku" extends="changeProductConfigurationsInGrid"> + <annotations> + <description>EXTENDS: changeProductConfigurationsInGrid. Removes 'fillFieldSkuForFirstAttributeOption' and 'fillFieldSkuForSecondAttributeOption'.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeProductConfigurationsInGridExceptSkuActionGroup` instead --> + <remove keyForRemoval="fillFieldSkuForFirstAttributeOption"/> + <remove keyForRemoval="fillFieldSkuForSecondAttributeOption"/> + </actionGroup> + + <actionGroup name="addProductToConfigurationsGrid"> + <annotations> + <description>Adds the provided Product SKU to the provided Product Name.</description> + </annotations> + <arguments> + <argument name="sku" type="string"/> + <argument name="name" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddProductToConfigurationsGridActionGroup` instead --> + <click selector="{{AdminProductFormConfigurationsSection.actionsBtnByProductName(name)}}" stepKey="clickToExpandFirstActions"/> + <click selector="{{AdminProductFormConfigurationsSection.addProduct(name)}}" stepKey="clickChooseFirstDifferentProduct"/> + <switchToIFrame stepKey="switchOutOfIFrame"/> + <waitForPageLoad stepKey="waitForFilters"/> + <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickFilters"/> + <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> + <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> + <click selector="{{AdminProductGridFilterSection.firstRowBySku(sku)}}" stepKey="clickOnFirstRow"/> + </actionGroup> + + <actionGroup name="addUniqueImageToConfigurableProductOption"> + <annotations> + <description>Adds the provided Image to a Configurable Product on the Admin Product creation/edit page.</description> + </annotations> + <arguments> + <argument name="image" defaultValue="ProductImage"/> + <argument name="frontend_label" type="string"/> + <argument name="label" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddUniqueImageToConfigurableProductOptionActionGroup` instead --> + <click selector="{{AdminCreateProductConfigurationsPanel.applyUniqueImagesToEachSkus}}" stepKey="clickOnApplyUniqueImagesToEachSku"/> + <selectOption userInput="{{frontend_label}}" selector="{{AdminCreateProductConfigurationsPanel.selectImagesButton}}" stepKey="selectOption"/> + <attachFile selector="{{AdminCreateProductConfigurationsPanel.uploadImagesButton(label)}}" userInput="{{image.file}}" stepKey="uploadFile"/> + <waitForElementNotVisible selector="{{AdminCreateProductConfigurationsPanel.uploadProgressBar}}" stepKey="waitForUpload"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageFile(image.fileName)}}" stepKey="waitForThumbnail"/> + </actionGroup> + + <actionGroup name="addUniquePriceToConfigurableProductOption"> + <annotations> + <description>On the 'Step 3: Bulk Images, Price and Quantity' page of the 'Create Product Configurations' model click on 'Apply unique prices...'. Select provided Option. Fill price.</description> + </annotations> + <arguments> + <argument name="frontend_label" type="string"/> + <argument name="label" type="string"/> + <argument name="price" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddUniquePriceToConfigurableProductOptionActionGroup` instead --> + <click selector="{{AdminCreateProductConfigurationsPanel.applyUniquePricesToEachSkus}}" stepKey="clickOnApplyUniquePricesToEachSku"/> + <selectOption userInput="{{frontend_label}}" selector="{{AdminCreateProductConfigurationsPanel.selectPriceButton}}" stepKey="selectOption"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.price(label)}}" userInput="{{price}}" stepKey="enterAttributeQuantity"/> + </actionGroup> + + <actionGroup name="addUniqueQuantityToConfigurableProductOption"> + <arguments> + <argument name="frontend_label" type="string" defaultValue="{{productAttributeColor.default_label}}"/> + <argument name="label" type="string" defaultValue="option1"/> + <argument name="quantity" type="string" defaultValue="10"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddUniqueQuantityToConfigurableProductOptionActionGroup` instead --> + <click selector="{{AdminCreateProductConfigurationsPanel.applyUniqueQuantityToEachSkus}}" stepKey="clickOnApplyUniqueQuantitiesToEachSku"/> + <selectOption selector="{{AdminCreateProductConfigurationsPanel.selectQuantity}}" userInput="{{frontend_label}}" stepKey="selectOption"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.applyUniqueQuantity(label)}}" userInput="{{quantity}}" stepKey="enterAttributeQuantity"/> + </actionGroup> + + <actionGroup name="saveConfigurableProductWithNewAttributeSet"> + <annotations> + <description>Clicks on 'Save'. Clicks radio for '...new Attribute Set...' in the 'Choose Affected Attribute Set' modal. Clicks on 'Confirm' in the model on the Configurable Product creation/edit page.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveConfigurableProductWithNewAttributeSetActionGroup` instead --> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveConfigurableProduct"/> + <waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" time="30" stepKey="waitForAttributeSetConfirmation"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.addNewAttrSet}}" stepKey="clickAddNewAttributeSet"/> + <fillField selector="{{AdminChooseAffectedAttributeSetPopup.createNewAttrSetName}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="fillFieldNewAttrSetName"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickConfirmAttributeSet"/> + <see selector="You saved the product" stepKey="seeConfigurableSaveConfirmation" after="clickConfirmAttributeSet"/> + </actionGroup> + + <actionGroup name="saveConfigurableProductAddToCurrentAttributeSet"> + <annotations> + <description>Clicks on 'Save'. Clicks on 'Confirm' in the 'Choose Affected Attribute Set' model on the Configurable Product creation/edit page.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveConfigurableProductAddToCurrentAttributeSetActionGroup` instead --> + <waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveBtnVisible"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProductAgain"/> + <waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="waitPopUpVisible"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmPopup"/> + <seeElement selector="{{AdminMessagesSection.success}}" stepKey="seeSaveProductMessage"/> + </actionGroup> + + <actionGroup name="assertConfigurableProductOnAdminProductPage"> + <annotations> + <description>Validates that the provided Configurable Product Name, SKU and Price are present and correct on the Configurable Product creation/edit page. PLEASE NOTE: The Product Data is Hardcoded.</description> + </annotations> + <arguments> + <argument name="product" type="entity"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertConfigurableProductOnAdminProductPageActionGroup` instead --> + <seeInField userInput="{{ApiConfigurableProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="seeNameRequired"/> + <seeInField userInput="{{ApiConfigurableProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="seeSkuRequired"/> + <dontSeeInField userInput="{{ApiConfigurableProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="dontSeePriceRequired"/> + </actionGroup> + + <actionGroup name="StartCreateConfigurationsForAttribute" extends="generateConfigurationsByAttributeCode"> + <remove keyForRemoval="clickOnNextButton3"/> + <remove keyForRemoval="clickOnNextButton4"/> + </actionGroup> + + <actionGroup name="GotoCatalogProductsPage"> + <annotations> + <description>Goes to the Admin Products grid via the Admin Side Menu.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GotoCatalogProductsPageActionGroup` instead --> + <click stepKey="clickOnCatalogItem" selector="{{CatalogProductsSection.catalogItem}}"/> + <waitForPageLoad stepKey="waitForCatalogLoad"/> + <click stepKey="clickOnProductItem" selector="{{CatalogProductsSection.productItem}}"/> + <waitForPageLoad stepKey="waitForCatalogProductPageLoad"/> + <seeInCurrentUrl stepKey="assertWeAreOnTheCatalogProductPage" url="{{assertionData.catalogProduct}}"/> + </actionGroup> + + <actionGroup name="GotoConfigurableProductPage"> + <annotations> + <description>Clicks on create Configurable Product from the Admin Products grid page.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GotoConfigurableProductPageActionGroup` instead --> + <click stepKey="clickOnAddProductItem" selector="{{ConfigurableProductSection.addProductItem}}"/> + <click stepKey="clickOnConfigurationProductItem" selector="{{ConfigurableProductSection.configProductItem}}"/> + <waitForPageLoad stepKey="waitForConfigurableProductPageLoad"/> + <seeInCurrentUrl stepKey="assertWeAreOnTheConfigurableProductPage" url="{{assertionData.configurableProduct}}"/> + </actionGroup> + + <actionGroup name="FillAllRequiredFields"> + <annotations> + <description>Fills the Product Name, Price and Weight fields. Clicks on 'Create Configurations'. Clicks on 'Create New Attribute'.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillAllRequiredFieldsActionGroup` instead --> + <fillField stepKey="fillInProductNameFields" selector="{{NewProduct.productName}}" userInput="{{NewProductsData.productName}}"/> + <fillField stepKey="fillInPriceFields" selector="{{NewProduct.price}}" userInput="{{NewProductsData.price}}"/> + <fillField stepKey="fillInWeightFields" selector="{{NewProduct.weight}}" userInput="{{NewProductsData.weight}}"/> + <click stepKey="clickOnCreateConfigurationsButton" selector="{{NewProduct.createConfigurationButton}}"/> + <waitForPageLoad stepKey="waitForCreateProductConfigurationsPageLoad"/> + <click stepKey="clickOnCreateNewAttributeButton" selector="{{NewProduct.createNewAttributeButton}}"/> + <waitForPageLoad stepKey="waitForNewAttributePageLoad"/> + </actionGroup> + + <actionGroup name="CreateNewAttribute"> + <annotations> + <description>Creates a new Product Attribute via the Admin Products creation/edit page. PLEASE NOTE: The Product Attributes are Hardcoded.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateNewAttributeActionGroup` instead --> + <switchToIFrame stepKey="NewAttributePage" selector="{{NewProduct.newAttributeIFrame}}"/> + <fillField stepKey="fillInDefaultLabelField" selector="{{NewProduct.defaultLabel}}" userInput="{{NewProductsData.defaultLabel}}"/> + + <!--Add option 1 to attribute--> + <click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption1"/> + <waitForPageLoad stepKey="waitForOption1"/> + <fillField stepKey="fillInAdminFieldRed" selector="{{NewProduct.adminFieldRed}}" userInput="{{NewProductsData.adminFieldRed}}"/> + <fillField stepKey="fillInDefaultStoreViewFieldRed" selector="{{NewProduct.defaultStoreViewFieldRed}}" userInput="{{NewProductsData.defaultStoreViewFieldRed}}"/> + + <!--Add option 2 to attribute--> + <click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption2"/> + <waitForPageLoad stepKey="waitForOption2"/> + <fillField stepKey="fillInAdminFieldBlue" selector="{{NewProduct.adminFieldBlue}}" userInput="{{NewProductsData.adminFieldBlue}}"/> + <fillField stepKey="fillInDefaultStoreViewFieldBlue" selector="{{NewProduct.defaultStoreViewFieldBlue}}" userInput="{{NewProductsData.defaultStoreViewFieldBlue}}"/> + + <!--Add option 3 to attribute--> + <click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption3"/> + <waitForPageLoad stepKey="waitForOption3"/> + <fillField stepKey="fillInAdminFieldYellow" selector="{{NewProduct.adminFieldYellow}}" userInput="{{NewProductsData.adminFieldYellow}}"/> + <fillField stepKey="fillInDefaultStoreViewFieldYellow" selector="{{NewProduct.defaultStoreViewFieldYellow}}" userInput="{{NewProductsData.defaultStoreViewFieldYellow}}"/> + + <!--Add option 4 to attribute--> + <click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption4"/> + <waitForPageLoad stepKey="waitForOption4"/> + <fillField stepKey="fillInAdminFieldGreen" selector="{{NewProduct.adminFieldGreen}}" userInput="{{NewProductsData.adminFieldGreen}}"/> + <fillField stepKey="fillInDefaultStoreViewFieldGreen" selector="{{NewProduct.defaultStoreViewFieldGreen}}" userInput="{{NewProductsData.defaultStoreViewFieldGreen}}"/> + + <!--Add option 5 to attribute--> + <click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption5"/> + <waitForPageLoad stepKey="waitForOption5"/> + <fillField stepKey="fillInAdminFieldBlack" selector="{{NewProduct.adminFieldBlack}}" userInput="{{NewProductsData.adminFieldBlack}}"/> + <fillField stepKey="fillInDefaultStoreViewFieldBlack" selector="{{NewProduct.defaultStoreViewFieldBlack}}" userInput="{{NewProductsData.defaultStoreViewFieldBlack}}"/> + + <!--Click Save Attribute button--> + <click selector="{{NewProduct.saveAttributeButton}}" stepKey="clickSaveAttributeButton"/> + <waitForPageLoad stepKey="waitForSavingSettings"/> + + <!--Select created Attribute --> + <click selector="{{ConfigurableProductSection.selectCreatedAttribute}}" stepKey="selectCreatedAttribute"/> + + <!--Click Next button--> + <click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton"/> + <waitForPageLoad stepKey="waitForNextPageLoaded"/> + + <!--Select all the options of all the attributes button--> + <click selector="{{CreateProductConfigurations.checkboxRed}}" stepKey="selectCheckboxRed"/> + <click selector="{{CreateProductConfigurations.checkboxBlue}}" stepKey="selectCheckboxBlue"/> + <click selector="{{CreateProductConfigurations.checkboxYellow}}" stepKey="selectCheckboxYellow"/> + <click selector="{{CreateProductConfigurations.checkboxGreen}}" stepKey="selectCheckboxGreen"/> + <click selector="{{CreateProductConfigurations.checkboxBlack}}" stepKey="selectCheckboxBlack"/> + + <!--Click Next button--> + <click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton2"/> + <waitForPageLoad stepKey="waitForBulkImagesPricePageLoaded"/> + + <!--Click Next button--> + <click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton3"/> + <waitForPageLoad stepKey="waitForSummaryPageLoaded"/> + + <!--Click Generate Configure button--> + <click selector="{{ConfigurableProductSection.generateConfigure}}" stepKey="generateConfigure"/> + <waitForPageLoad stepKey="waitForGenerateConfigure"/> + + <!-- This Error message shouldn't appear: Test will pass when bug will be fixed--> + <dontSee selector="{{CreateProductConfigurations.errorMessage}}" userInput="{{assertionData.errorMessage}}" stepKey="dontSeeError"/> + + <!--Close frame--> + <conditionalClick selector="{{ConfigurableProductSection.closeFrame}}" dependentSelector="{{ConfigurableProductSection.closeFrame}}" visible="1" stepKey="closeFrame"/> + <waitForPageLoad stepKey="waitForClosingFrame"/> + </actionGroup> + + <actionGroup name="DeleteCreatedAttribute"> + <annotations> + <description>Deletes the Configurable Product Attribute.</description> + </annotations> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DeleteCreatedAttributeActionGroup` instead --> + <click stepKey="clickOnStoresItem" selector="{{CatalogProductsSection.storesItem}}"/> + <waitForPageLoad stepKey="waitForNavigationPanel"/> + + <!--Click on Products item--> + <waitForElementVisible selector="{{CatalogProductsSection.storesProductItem}}" stepKey="waitForCatalogLoad"/> + <click stepKey="clickOnStoresProductItem" selector="{{CatalogProductsSection.storesProductItem}}"/> + <waitForPageLoad stepKey="waitForStoresProductPageLoad"/> + + <!--Click on created Attribute --> + <fillField stepKey="searchProductDefaultLabel" selector="{{CatalogProductsSection.searchDefaultLabelField}}" userInput="{{NewProductsData.defaultLabel}}"/> + <click stepKey="clickSearchButton" selector="{{CatalogProductsSection.searchButton}}"/> + <waitForPageLoad stepKey="waitForCreatedAttributeLoad"/> + <click stepKey="clickOnCreatedAttributeItem" selector="{{CatalogProductsSection.createdAttributeItem}}"/> + <waitForPageLoad stepKey="waitForAttributePropertiesPageLoad"/> + + <!--Click on Delete Attribute item--> + <click stepKey="clickOnDeleteAttributeItem" selector="{{CatalogProductsSection.deleteAttributeItem}}"/> + <waitForPageLoad stepKey="waitForDeletedDialogOpened"/> + + <!--Click on OK button--> + <click stepKey="clickOnOKButton" selector="{{CatalogProductsSection.okButton}}"/> + <waitForPageLoad stepKey="waitFordAttributeDeleted"/> + <see userInput="You deleted the product attribute." stepKey="seeDeletedTheProductAttributeMessage"/> + + <!-- Click Reset Filter button--> + <click stepKey="clickResetFilterButton" selector="{{CatalogProductsSection.resetFilter}}"/> + <waitForPageLoad stepKey="waitForAllFilterReset"/> + </actionGroup> + + <actionGroup name="StorefrontCheckCategoryConfigurableProduct"> + <annotations> + <description>Validates that the provided Configurable Product is present and correct on a Category page.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="optionProduct"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCheckCategoryConfigurableProductActionGroup` instead --> + <seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName(product.name)}}" stepKey="assertProductName"/> + <see userInput="${{optionProduct.price}}.00" selector="{{StorefrontCategoryProductSection.ProductPriceByName(product.name)}}" stepKey="AssertProductPrice"/> + <!-- @TODO: MAGETWO-80272 Move to Magento_Checkout --> + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> + <!-- @TODO: MAGETWO-80272 Move to Magento_Checkout --> + <seeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="AssertAddToCart"/> + </actionGroup> + + <actionGroup name="StorefrontCheckCategoryOutOfStockConfigurableProduct"> + <annotations> + <description>Validates that the provided Configurable Product is present and correct on a Category page.</description> + </annotations> + <arguments> + <argument name="product" type="entity"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCheckCategoryOutOfStockConfigurableProductActionGroup` instead --> + <seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName(product.name)}}" stepKey="assertProductName"/> + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> + <seeElement selector="{{StorefrontCategoryProductSection.ProductStockUnavailable}}" stepKey="AssertOutOfStock"/> + <dontSeeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="AssertAddToCart"/> + </actionGroup> + + <actionGroup name="StorefrontCheckConfigurableProduct"> + <annotations> + <description>Goes to the provided Storefront Product page. Validates that the Product details are present and correct.</description> + </annotations> + <arguments> + <argument name="product"/> + <argument name="optionProduct"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCheckConfigurableProductActionGroup` instead --> + <seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> + <seeInTitle userInput="{{product.name}}" stepKey="AssertProductNameInTitle"/> + <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> + <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> + <see userInput="${{optionProduct.price}}.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/> + <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertInStock"/> + <seeElement selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="assertAddToCart"/> + <see userInput="{{product.custom_attributes[description]}}" selector="{{StorefrontProductInfoMainSection.productDescription}}" stepKey="assertProductDescription"/> + <see userInput="{{product.custom_attributes[short_description]}}" selector="{{StorefrontProductInfoMainSection.productShortDescription}}" stepKey="assertProductShortDescription"/> + </actionGroup> + + <actionGroup name="VerifyOptionInProductStorefront"> + <annotations> + <description>Validates that the provided Option Code and Option Name are present and correct on a Configurable Product page.</description> + </annotations> + <arguments> + <argument name="attributeCode" type="string"/> + <argument name="optionName" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyOptionInProductStorefrontActionGroup` instead --> + <seeElement selector="{{StorefrontProductInfoMainSection.attributeOptionByAttributeID(attributeCode, optionName)}}" stepKey="verifyOptionExists"/> + </actionGroup> + + <actionGroup name="SelectSingleAttributeAndAddToCart"> + <annotations> + <description>Selects a Product Option. Clicks 'Add to Cart'. Validates that the Product Added Success message appears.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="attributeCode" type="string"/> + <argument name="optionName" type="string"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SelectSingleAttributeAndAddToCartActionGroup` instead --> + <selectOption selector="{{StorefrontProductInfoMainSection.attributeSelectByAttributeID(attributeCode)}}" userInput="{{optionName}}" stepKey="selectAttribute"/> + <click stepKey="addProduct" selector="{{StorefrontProductActionSection.addToCart}}"/> + <waitForElementVisible selector="{{StorefrontQuickSearchResultsSection.messageSection}}" time="30" stepKey="waitForProductAdded"/> + <see selector="{{StorefrontQuickSearchResultsSection.messageSection}}" userInput="You added {{productName}} to your shopping cart." stepKey="seeAddedToCartMessage"/> + </actionGroup> + + <actionGroup name="storefrontCheckConfigurableProductOptions"> + <annotations> + <description>Validates that the Options for a Configurable Product are present and correct.</description> + </annotations> + <arguments> + <argument name="product" type="entity"/> + <argument name="firstOption" type="entity"/> + <argument name="secondOption" type="entity"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCheckConfigurableProductOptionsActionGroup` instead --> + <selectOption userInput="{{firstOption.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/> + <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="seeConfigurableProductName"/> + <see userInput="{{firstOption.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPricePresent"/> + <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="seeConfigurableProductSku"/> + <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertInStock"/> + <see userInput="{{colorProductAttribute.default_label}}" selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" stepKey="seeColorAttributeName"/> + <dontSee userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeProductPriceLabel1"/> + <selectOption userInput="{{secondOption.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption2"/> + <dontSee userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeProductPriceLabel2"/> + <see userInput="{{secondOption.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeProductPrice2"/> + </actionGroup> + + <actionGroup name="assertOptionImageInStorefrontProductPage"> + <annotations> + <description>Validates that the provided Product Image is present when the provided Product Option is selected.</description> + </annotations> + <arguments> + <argument name="product" type="entity"/> + <argument name="label" type="string"/> + <argument name="image" defaultValue="MagentoLogo"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertOptionImageInStorefrontProductPageActionGroup` instead --> + <seeInCurrentUrl url="/{{product.urlKey}}.html" stepKey="checkUrl"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <selectOption userInput="{{label}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/> + <seeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeFirstImage"/> + </actionGroup> + + <actionGroup name="assertConfigurableProductWithSpecialPriceOnStorefrontProductPage"> + <annotations> + <description>Validates that Special Price for a Configurable Product is present and correct when the provided Product Option is selected.</description> + </annotations> + <arguments> + <argument name="option" type="string"/> + <argument name="price" type="string"/> + <argument name="specialPrice" defaultValue="specialProductPrice"/> + </arguments> + + <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertConfigurableProductWithSpecialPriceOnStorefrontProductPageActionGroup` instead --> + <selectOption userInput="{{option}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOptionWithSpecialPrice"/> + <see userInput="{{specialProductPrice.price}}" selector="{{StorefrontProductInfoMainSection.productSpecialPrice}}" stepKey="seeSpecialProductPrice"/> + <see userInput="Regular Price" selector="{{StorefrontProductInfoMainSection.specialProductText}}" stepKey="seeText"/> + <see userInput="{{price}}" selector="{{StorefrontProductInfoMainSection.oldProductPrice}}" stepKey="seeOldProductPrice"/> + </actionGroup> +</actionGroups> From 706826899aa6c9452938d8d241b51106caa51633 Mon Sep 17 00:00:00 2001 From: Ihor Sviziev <svizev.igor@gmail.com> Date: Thu, 5 Dec 2019 13:49:33 +0200 Subject: [PATCH 396/595] magento/magento2#25911 Fix notice on incorrect price param --- .../Magento/Catalog/Model/Layer/Filter/DataProvider/Price.php | 2 +- .../Test/Unit/Model/Layer/Filter/DataProvider/PriceTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Layer/Filter/DataProvider/Price.php b/app/code/Magento/Catalog/Model/Layer/Filter/DataProvider/Price.php index d1aee8c4c5ba6..35c5a1cb29c84 100644 --- a/app/code/Magento/Catalog/Model/Layer/Filter/DataProvider/Price.php +++ b/app/code/Magento/Catalog/Model/Layer/Filter/DataProvider/Price.php @@ -310,7 +310,7 @@ public function validateFilter($filter) return false; } foreach ($filter as $v) { - if ($v !== '' && $v !== '0' && (double)$v <= 0 || is_infinite((double)$v)) { + if ($v !== '' && $v !== '0' && (!is_numeric($v) || (double)$v <= 0 || is_infinite((double)$v))) { return false; } } diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Layer/Filter/DataProvider/PriceTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Layer/Filter/DataProvider/PriceTest.php index 8ca23df31cdee..c59aa1988be55 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Layer/Filter/DataProvider/PriceTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Layer/Filter/DataProvider/PriceTest.php @@ -178,6 +178,7 @@ public function validateFilterDataProvider() ['filter' => '0', 'result' => false], ['filter' => 0, 'result' => false], ['filter' => '100500INF', 'result' => false], + ['filter' => '-10\'[0]', 'result' => false], ]; } From 9cd0d395e3fece75fa5cb849feea13758832b133 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Thu, 5 Dec 2019 14:43:38 +0200 Subject: [PATCH 397/595] Covering the Backend Decoding Helper by UnitTest --- .../Backend/Test/Unit/Helper/JsTest.php | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 app/code/Magento/Backend/Test/Unit/Helper/JsTest.php diff --git a/app/code/Magento/Backend/Test/Unit/Helper/JsTest.php b/app/code/Magento/Backend/Test/Unit/Helper/JsTest.php new file mode 100644 index 0000000000000..d2afdbbaf49a6 --- /dev/null +++ b/app/code/Magento/Backend/Test/Unit/Helper/JsTest.php @@ -0,0 +1,81 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Backend\Test\Unit\Helper; + +use Magento\Backend\Helper\Js; +use PHPUnit\Framework\TestCase; + +/** + * Class JsTest + */ +class JsTest extends TestCase +{ + /** + * @var Js + */ + private $helper; + + /** + * Set Up + */ + protected function setUp() + { + $this->helper = new Js(); + } + + /** + * Test decoding the serialized input + * + * @dataProvider getEncodedDataProvider + * + * @param string $encoded + * @param array $expected + */ + public function testDecodeGridSerializedInput(string $encoded, array $expected) + { + $this->assertEquals($expected, $this->helper->decodeGridSerializedInput($encoded)); + } + + /** + * Get serialized grid input + * + * @return array + */ + public function getEncodedDataProvider(): array + { + return [ + 'Decoding empty serialized string' => [ + '', + [] + ], + 'Decoding a simplified serialized string' => [ + '1&2&3&4', + [1, 2, 3, 4] + ], + 'Decoding encoded serialized string' => [ + '2=dGVzdC1zdHJpbmc=', + [ + 2 => [ + 'test-string' => '' + ] + ] + ], + 'Decoding multiple encoded serialized strings' => [ + '2=dGVzdC1zdHJpbmc=&3=bmV3LXN0cmluZw==', + [ + 2 => [ + 'test-string' => '' + ], + 3 => [ + 'new-string' => '' + ] + ] + ] + ]; + } +} From 7c53b1efae82ceb0d925e274ccf4faaf01adf8b2 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Thu, 5 Dec 2019 16:20:13 +0200 Subject: [PATCH 398/595] Adding class description --- app/code/Magento/Backend/Test/Unit/Helper/JsTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Backend/Test/Unit/Helper/JsTest.php b/app/code/Magento/Backend/Test/Unit/Helper/JsTest.php index d2afdbbaf49a6..ff10158a11943 100644 --- a/app/code/Magento/Backend/Test/Unit/Helper/JsTest.php +++ b/app/code/Magento/Backend/Test/Unit/Helper/JsTest.php @@ -12,6 +12,8 @@ /** * Class JsTest + * + * Testing decoding serialized grid data */ class JsTest extends TestCase { From 67c55ec5b8bd00ad78355df34362e1a754980bf7 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Thu, 5 Dec 2019 17:39:16 +0200 Subject: [PATCH 399/595] Adding admin class for password input type. Removing duplcated classes. --- .../Magento/Backend/Block/System/Account/Edit/Form.php | 6 +++--- .../Block/Adminhtml/Integration/Edit/Tab/Info.php | 2 +- app/code/Magento/User/Block/Role/Tab/Info.php | 2 +- app/code/Magento/User/Block/User/Edit/Tab/Main.php | 2 +- .../Magento/Framework/Data/Form/Element/Password.php | 7 ++++++- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Backend/Block/System/Account/Edit/Form.php b/app/code/Magento/Backend/Block/System/Account/Edit/Form.php index 7c5246143b2c6..49ec305ddd761 100644 --- a/app/code/Magento/Backend/Block/System/Account/Edit/Form.php +++ b/app/code/Magento/Backend/Block/System/Account/Edit/Form.php @@ -114,7 +114,7 @@ protected function _prepareForm() 'name' => 'password', 'label' => __('New Password'), 'title' => __('New Password'), - 'class' => 'validate-admin-password admin__control-text' + 'class' => 'validate-admin-password' ] ); @@ -124,7 +124,7 @@ protected function _prepareForm() [ 'name' => 'password_confirmation', 'label' => __('Password Confirmation'), - 'class' => 'validate-cpassword admin__control-text' + 'class' => 'validate-cpassword' ] ); @@ -152,7 +152,7 @@ protected function _prepareForm() 'label' => __('Your Password'), 'id' => self::IDENTITY_VERIFICATION_PASSWORD_FIELD, 'title' => __('Your Password'), - 'class' => 'validate-current-password required-entry admin__control-text', + 'class' => 'validate-current-password required-entry', 'required' => true ] ); diff --git a/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tab/Info.php b/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tab/Info.php index 4042c2ebde87d..89cad471933e6 100644 --- a/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tab/Info.php +++ b/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tab/Info.php @@ -179,7 +179,7 @@ protected function _addGeneralFieldset($form, $integrationData) 'label' => __('Your Password'), 'id' => self::DATA_CONSUMER_PASSWORD, 'title' => __('Your Password'), - 'class' => 'input-text validate-current-password required-entry', + 'class' => 'validate-current-password required-entry', 'required' => true ] ); diff --git a/app/code/Magento/User/Block/Role/Tab/Info.php b/app/code/Magento/User/Block/Role/Tab/Info.php index 8a656efa97443..f71b7eebd3c32 100644 --- a/app/code/Magento/User/Block/Role/Tab/Info.php +++ b/app/code/Magento/User/Block/Role/Tab/Info.php @@ -99,7 +99,7 @@ protected function _initForm() 'label' => __('Your Password'), 'id' => self::IDENTITY_VERIFICATION_PASSWORD_FIELD, 'title' => __('Your Password'), - 'class' => 'input-text validate-current-password required-entry', + 'class' => 'validate-current-password required-entry', 'required' => true ] ); diff --git a/app/code/Magento/User/Block/User/Edit/Tab/Main.php b/app/code/Magento/User/Block/User/Edit/Tab/Main.php index 27e00483733d0..3182393db8eaf 100644 --- a/app/code/Magento/User/Block/User/Edit/Tab/Main.php +++ b/app/code/Magento/User/Block/User/Edit/Tab/Main.php @@ -184,7 +184,7 @@ protected function _prepareForm() 'label' => __('Your Password'), 'id' => self::CURRENT_USER_PASSWORD_FIELD, 'title' => __('Your Password'), - 'class' => 'input-text validate-current-password required-entry', + 'class' => 'validate-current-password required-entry', 'required' => true ] ); diff --git a/lib/internal/Magento/Framework/Data/Form/Element/Password.php b/lib/internal/Magento/Framework/Data/Form/Element/Password.php index 8d330e1a810ab..c71048dabd1df 100644 --- a/lib/internal/Magento/Framework/Data/Form/Element/Password.php +++ b/lib/internal/Magento/Framework/Data/Form/Element/Password.php @@ -13,6 +13,11 @@ use Magento\Framework\Escaper; +/** + * Class Password + * + * Password input type + */ class Password extends AbstractElement { /** @@ -37,7 +42,7 @@ public function __construct( */ public function getHtml() { - $this->addClass('input-text'); + $this->addClass('input-text admin__control-text'); return parent::getHtml(); } } From d67374f1b888dfd9b40da3c89dd191075e0ea618 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Thu, 5 Dec 2019 21:24:48 +0530 Subject: [PATCH 400/595] Code refactor in Catalog Viewmodel breadcrumbs --- .../Catalog/ViewModel/Product/Breadcrumbs.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php b/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php index d1424d637937b..330d1e0d3fbdf 100644 --- a/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php +++ b/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php @@ -10,7 +10,7 @@ use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\ObjectManager; use Magento\Framework\DataObject; -use Magento\Framework\Serialize\Serializer\Json; +use Magento\Framework\Serialize\Serializer\JsonHexTag; use Magento\Framework\View\Element\Block\ArgumentInterface; use Magento\Framework\Escaper; @@ -31,6 +31,11 @@ class Breadcrumbs extends DataObject implements ArgumentInterface */ private $scopeConfig; + /** + * @var JsonHexTag + */ + private $jsonSerializer; + /** * @var Escaper */ @@ -39,20 +44,21 @@ class Breadcrumbs extends DataObject implements ArgumentInterface /** * @param Data $catalogData * @param ScopeConfigInterface $scopeConfig - * @param Json|null $json + * @param JsonHexTag $jsonSerializer * @param Escaper|null $escaper * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function __construct( Data $catalogData, ScopeConfigInterface $scopeConfig, - Json $json = null, + JsonHexTag $jsonSerializer, Escaper $escaper = null ) { parent::__construct(); $this->catalogData = $catalogData; $this->scopeConfig = $scopeConfig; + $this->jsonSerializer = $jsonSerializer; $this->escaper = $escaper ?: ObjectManager::getInstance()->get(Escaper::class); } @@ -101,15 +107,14 @@ public function getProductName(): string */ public function getJsonConfigurationHtmlEscaped() : string { - return json_encode( + return $this->jsonSerializer->serialize( [ 'breadcrumbs' => [ 'categoryUrlSuffix' => $this->escaper->escapeHtml($this->getCategoryUrlSuffix()), 'useCategoryPathInUrl' => (int)$this->isCategoryUsedInProductUrl(), 'product' => $this->escaper->escapeHtml($this->getProductName()) ] - ], - JSON_HEX_TAG + ] ); } From 1e5a9db638e79f527e9c1865dc380d35d30f30b2 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Thu, 5 Dec 2019 21:34:40 +0530 Subject: [PATCH 401/595] Updated unit test with JsonHexTag --- .../Catalog/Test/Unit/ViewModel/Product/BreadcrumbsTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/BreadcrumbsTest.php b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/BreadcrumbsTest.php index a4ccaffc8fb6a..38b5f35634ad7 100644 --- a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/BreadcrumbsTest.php +++ b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/BreadcrumbsTest.php @@ -54,12 +54,14 @@ protected function setUp() : void ->getMockForAbstractClass(); $escaper = $this->getObjectManager()->getObject(\Magento\Framework\Escaper::class); + $this->serializer = $this->createMock(\Magento\Framework\Serialize\Serializer\JsonHexTag::class); $this->viewModel = $this->getObjectManager()->getObject( Breadcrumbs::class, [ 'catalogData' => $this->catalogHelper, 'scopeConfig' => $this->scopeConfig, + 'jsonSerializer' => $this->serializer, 'escaper' => $escaper ] ); @@ -141,6 +143,8 @@ public function testGetJsonConfiguration($product, string $expectedJson) : void ->with('catalog/seo/category_url_suffix', \Magento\Store\Model\ScopeInterface::SCOPE_STORE) ->willReturn('."html'); + $this->serializer->expects($this->once())->method('serialize')->willReturn($expectedJson); + $this->assertEquals($expectedJson, $this->viewModel->getJsonConfiguration()); } From 2cdd48f259729c6eafba0612772c5a8aec32e2ef Mon Sep 17 00:00:00 2001 From: Joan He <johe@magento.com> Date: Thu, 5 Dec 2019 13:26:33 -0600 Subject: [PATCH 402/595] B2B-299: Fix Skipped MFTF Tests From MC-17140: MC-15884, MC-16695 --- .../AdminCatalogPriceRuleStagingSection.xml | 15 --------------- .../Test/AdminReorderWithCatalogPriceTest.xml | 3 --- 2 files changed, 18 deletions(-) delete mode 100644 app/code/Magento/CatalogRule/Test/Mftf/Section/AdminCatalogPriceRuleStagingSection.xml diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Section/AdminCatalogPriceRuleStagingSection.xml b/app/code/Magento/CatalogRule/Test/Mftf/Section/AdminCatalogPriceRuleStagingSection.xml deleted file mode 100644 index 7a92829e2371e..0000000000000 --- a/app/code/Magento/CatalogRule/Test/Mftf/Section/AdminCatalogPriceRuleStagingSection.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?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="AdminCatalogPriceRuleStagingSection"> - <element name="status" type="select" selector=".modal-component [data-index='is_active'] select"/> - <element name="isActive" type="select" selector=".modals-wrapper input[name='is_active']+label"/> - </section> -</sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml index 587b23e857c0c..bddc114f5dd5e 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml @@ -18,9 +18,6 @@ <useCaseId value="MAGETWO-99691"/> <group value="sales"/> <group value="catalogRule"/> - <skip> - <issueId value="MC-17140"/> - </skip> </annotations> <before> <!--Create the catalog price rule --> From 839fed39f56cc8582f3195ef754718250411451c Mon Sep 17 00:00:00 2001 From: Ji Lu <jilu1@adobe.com> Date: Thu, 5 Dec 2019 15:04:56 -0600 Subject: [PATCH 403/595] MQE-1907: stabilize mtf to mftf migration pr #744 --- .../AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml | 2 +- .../Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml index ca292c384979f..5a05dab7aa707 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml @@ -30,7 +30,7 @@ <!--Create the Category Url Rewrite--> <actionGroup ref="AdminAddUrlRewrite" stepKey="addUrlRewrite"> <argument name="category" value="$$category.name$$"/> - <argument name="customUrlRewriteValue" value="For Category'"/> + <argument name="customUrlRewriteValue" value="For Category"/> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="-"/> <argument name="redirectTypeValue" value="No"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml index 3c0dc8dc2be10..e94e10767c632 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml @@ -30,7 +30,7 @@ <!--Create the Category Url Rewrite--> <actionGroup ref="AdminAddUrlRewrite" stepKey="addUrlRewriteSecondTime"> <argument name="category" value="$$category.name$$"/> - <argument name="customUrlRewriteValue" value="For Category'"/> + <argument name="customUrlRewriteValue" value="For Category"/> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="newrequestpath.html"/> <argument name="redirectTypeValue" value="No"/> From c070d8e4248d1dca30773c20055b869a1cac3df4 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov <oiegorov@magento.com> Date: Thu, 5 Dec 2019 16:43:42 -0600 Subject: [PATCH 404/595] MC-22998: Asynchronous image resizing --- .../MediaStorage/Console/Command/ImagesResizeCommand.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/code/Magento/MediaStorage/Console/Command/ImagesResizeCommand.php b/app/code/Magento/MediaStorage/Console/Command/ImagesResizeCommand.php index ea8cdef8598f4..4ed84829c2ad0 100644 --- a/app/code/Magento/MediaStorage/Console/Command/ImagesResizeCommand.php +++ b/app/code/Magento/MediaStorage/Console/Command/ImagesResizeCommand.php @@ -22,8 +22,6 @@ /** * Resizes product images according to theme view definitions. - * - * @package Magento\MediaStorage\Console\Command */ class ImagesResizeCommand extends Command { From 37a9929ad036fd8e8309111d87f8ce7f1e0e35cc Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Fri, 6 Dec 2019 08:19:27 +0700 Subject: [PATCH 405/595] Resolve A "500 (Internal Server Error)" appears in Developer Console if Delete the image that is added to Page Content issue25893 --- .../Adminhtml/Wysiwyg/Directive.php | 17 ++++++++--- .../Adminhtml/Wysiwyg/DirectiveTest.php | 29 +++++++++++++++++++ 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php index b21ea9fd7ef7b..db53c6a415ddd 100644 --- a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php +++ b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php @@ -4,6 +4,9 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +declare(strict_types=1); + namespace Magento\Cms\Controller\Adminhtml\Wysiwyg; use Magento\Backend\App\Action; @@ -13,6 +16,8 @@ /** * Process template text for wysiwyg editor. + * + * Class Directive */ class Directive extends Action implements HttpGetActionInterface { @@ -73,10 +78,14 @@ public function execute() /** @var Config $config */ $config = $this->_objectManager->get(Config::class); $imagePath = $config->getSkinImagePlaceholderPath(); - $image->open($imagePath); - $resultRaw->setHeader('Content-Type', $image->getMimeType()); - $resultRaw->setContents($image->getImage()); - $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e); + try { + $image->open($imagePath); + $resultRaw->setHeader('Content-Type', $image->getMimeType()); + $resultRaw->setContents($image->getImage()); + $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e); + } catch (\Exception $e) { + $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e); + } } return $resultRaw; } diff --git a/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php b/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php index 16b218ebf6493..85c48e3fa3b7d 100644 --- a/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php +++ b/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php @@ -274,4 +274,33 @@ protected function prepareExecuteTest() ->method('create') ->willReturn($this->imageAdapterMock); } + + /** + * Test Execute With Deleted Image + * + * @covers \Magento\Cms\Controller\Adminhtml\Wysiwyg\Directive::execute + */ + public function testExecuteWithDeletedImage() + { + $exception = new \Exception('epic fail'); + $placeholderPath = 'pub/static/adminhtml/Magento/backend/en_US/Magento_Cms/images/wysiwyg_skin_image.png'; + $this->prepareExecuteTest(); + + $this->imageAdapterMock->expects($this->at(0)) + ->method('open') + ->with(self::IMAGE_PATH) + ->willThrowException($exception); + $this->wysiwygConfigMock->expects($this->once()) + ->method('getSkinImagePlaceholderPath') + ->willReturn($placeholderPath); + $this->imageAdapterMock->expects($this->at(1)) + ->method('open') + ->willThrowException($exception); + + $this->loggerMock->expects($this->once()) + ->method('critical') + ->with($exception); + + $this->wysiwygDirective->execute(); + } } From 66bf8d18bf6d5f88ffd5dc674106c52a8fd066a2 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Fri, 6 Dec 2019 08:21:24 +0700 Subject: [PATCH 406/595] Unit Test for Directive --- .../Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php b/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php index 85c48e3fa3b7d..cede3a80cb98b 100644 --- a/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php +++ b/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php @@ -286,15 +286,18 @@ public function testExecuteWithDeletedImage() $placeholderPath = 'pub/static/adminhtml/Magento/backend/en_US/Magento_Cms/images/wysiwyg_skin_image.png'; $this->prepareExecuteTest(); - $this->imageAdapterMock->expects($this->at(0)) + $this->imageAdapterMock->expects($this->any()) ->method('open') ->with(self::IMAGE_PATH) ->willThrowException($exception); + $this->wysiwygConfigMock->expects($this->once()) ->method('getSkinImagePlaceholderPath') ->willReturn($placeholderPath); - $this->imageAdapterMock->expects($this->at(1)) + + $this->imageAdapterMock->expects($this->any()) ->method('open') + ->with($placeholderPath) ->willThrowException($exception); $this->loggerMock->expects($this->once()) From fa2ed5347963585c3f8c8f639511fdf25a28df24 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Fri, 6 Dec 2019 13:53:37 +0700 Subject: [PATCH 407/595] Resolve Duplicate Records when sorting column in Content->Themes Grid issue25925 --- .../Theme/view/adminhtml/ui_component/design_theme_listing.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/Theme/view/adminhtml/ui_component/design_theme_listing.xml b/app/code/Magento/Theme/view/adminhtml/ui_component/design_theme_listing.xml index 14aea72d87357..d2e5fa7ae1ca9 100644 --- a/app/code/Magento/Theme/view/adminhtml/ui_component/design_theme_listing.xml +++ b/app/code/Magento/Theme/view/adminhtml/ui_component/design_theme_listing.xml @@ -20,6 +20,9 @@ <dataSource name="design_theme_listing_data_source" component="Magento_Ui/js/grid/provider"> <settings> <updateUrl path="mui/index/render"/> + <storageConfig> + <param name="indexField" xsi:type="string">theme_id</param> + </storageConfig> </settings> <aclResource>Magento_Theme::theme</aclResource> <dataProvider class="Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider" name="design_theme_listing_data_source"> From febe51cde0b75356b5041b3d6952fe2b8d047d48 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Fri, 6 Dec 2019 15:49:11 +0700 Subject: [PATCH 408/595] [Variable] Cover Variable Data Model by Unit Test --- .../Test/Unit/Model/Variable/DataTest.php | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 app/code/Magento/Variable/Test/Unit/Model/Variable/DataTest.php diff --git a/app/code/Magento/Variable/Test/Unit/Model/Variable/DataTest.php b/app/code/Magento/Variable/Test/Unit/Model/Variable/DataTest.php new file mode 100644 index 0000000000000..36e6dbcceb507 --- /dev/null +++ b/app/code/Magento/Variable/Test/Unit/Model/Variable/DataTest.php @@ -0,0 +1,128 @@ +<?php +/*** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Variable\Test\Unit\Model\Variable; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use PHPUnit\Framework\TestCase; +use Magento\Variable\Model\Variable\Data as VariableDataModel; +use Magento\Variable\Model\ResourceModel\Variable\CollectionFactory as VariableCollectionFactory; +use Magento\Variable\Model\ResourceModel\Variable\Collection as VariableCollection; +use Magento\Variable\Model\Source\Variables as StoreVariables; + +class DataTest extends TestCase +{ + /** + * @var VariableDataModel + */ + private $model; + + /** + * @var ObjectManagerHelper + */ + private $objectManagerHelper; + + /** + * @var StoreVariables|PHPUnit_Framework_MockObject_MockObject + */ + private $storesVariablesMock; + + /** + * @var VariableCollectionFactory|PHPUnit_Framework_MockObject_MockObject + */ + private $variableCollectionFactoryMock; + + /** + * Set up before tests + */ + protected function setUp() + { + $this->storesVariablesMock = $this->createMock(StoreVariables::class); + $this->variableCollectionFactoryMock = $this->getMockBuilder( + VariableCollectionFactory::class + )->disableOriginalConstructor()->setMethods(['create'])->getMock(); + + $this->objectManagerHelper = new ObjectManagerHelper($this); + $this->model = $this->objectManagerHelper->getObject( + VariableDataModel::class, + [ + 'collectionFactory' => $this->variableCollectionFactoryMock, + 'storesVariables' => $this->storesVariablesMock + ] + ); + } + + /** + * @covers VariableDataModel::getDefaultVariables + */ + public function testGetDefaultVariables() + { + $storesVariablesData = [ + [ + 'value' => 'test 1', + 'label' => 'Test Label 1', + 'group_label' => 'Group Label 1' + ], + [ + 'value' => 'test 2', + 'label' => 'Test Label 2', + 'group_label' => 'Group Label 2' + ] + ]; + $expectedResult = [ + [ + 'code' => 'test 1', + 'variable_name' => 'Group Label 1 / Test Label 1', + 'variable_type' => StoreVariables::DEFAULT_VARIABLE_TYPE + ], + [ + 'code' => 'test 2', + 'variable_name' => 'Group Label 2 / Test Label 2', + 'variable_type' => StoreVariables::DEFAULT_VARIABLE_TYPE + ] + ]; + $this->storesVariablesMock->expects($this->any())->method('getData')->willReturn($storesVariablesData); + + $this->assertEquals($expectedResult, $this->model->getDefaultVariables()); + } + + /** + * @covers VariableDataModel::getCustomVariables + */ + public function testGetCustomVariables() + { + $customVariables = [ + [ + 'code' => 'test 1', + 'name' => 'Test 1' + ], + [ + 'code' => 'test 2', + 'name' => 'Test 2' + ] + ]; + $expectedResult = [ + [ + 'code' => 'test 1', + 'variable_name' => 'Custom Variable / Test 1', + 'variable_type' => StoreVariables::CUSTOM_VARIABLE_TYPE + ], + [ + 'code' => 'test 2', + 'variable_name' => 'Custom Variable / Test 2', + 'variable_type' => StoreVariables::CUSTOM_VARIABLE_TYPE + ] + ]; + $variableCollectionMock = $this->createMock(VariableCollection::class); + $this->variableCollectionFactoryMock->expects($this->once())->method('create') + ->willReturn($variableCollectionMock); + $variableCollectionMock->expects($this->any())->method('getData')->willReturn($customVariables); + + $this->assertEquals($expectedResult, $this->model->getCustomVariables()); + } +} From 25e1c1e917fc0001d483d5a63168c71b43efe3b4 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Fri, 6 Dec 2019 16:28:18 +0700 Subject: [PATCH 409/595] Fix static test --- .../Magento/Variable/Test/Unit/Model/Variable/DataTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Variable/Test/Unit/Model/Variable/DataTest.php b/app/code/Magento/Variable/Test/Unit/Model/Variable/DataTest.php index 36e6dbcceb507..50191de66efbf 100644 --- a/app/code/Magento/Variable/Test/Unit/Model/Variable/DataTest.php +++ b/app/code/Magento/Variable/Test/Unit/Model/Variable/DataTest.php @@ -58,7 +58,7 @@ protected function setUp() } /** - * @covers VariableDataModel::getDefaultVariables + * Test getDefaultVariables() function */ public function testGetDefaultVariables() { @@ -92,7 +92,7 @@ public function testGetDefaultVariables() } /** - * @covers VariableDataModel::getCustomVariables + * Test getCustomVariables() function */ public function testGetCustomVariables() { From b92aef02958c7820d2d4e9456eb22f3cebba107d Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Fri, 6 Dec 2019 16:56:06 +0700 Subject: [PATCH 410/595] Resolve Refresh Statistics: Updated At = Null should be display as "Never" instead of "undefined". issue25931 --- .../Reports/Controller/Adminhtml/Report/AbstractReport.php | 2 +- app/code/Magento/Reports/i18n/en_US.csv | 2 ++ .../view/adminhtml/layout/reports_report_statistics_index.xml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/AbstractReport.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/AbstractReport.php index 2fbff13a5b644..c6d79459a2b52 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/AbstractReport.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/AbstractReport.php @@ -140,7 +140,7 @@ protected function _showLastExecutionTime($flagCode, $refreshCode) $flag = $this->_objectManager->create(\Magento\Reports\Model\Flag::class) ->setReportFlagCode($flagCode) ->loadSelf(); - $updatedAt = 'undefined'; + $updatedAt = __('Never'); if ($flag->hasData()) { $updatedAt = $this->timezone->formatDate( $flag->getLastUpdate(), diff --git a/app/code/Magento/Reports/i18n/en_US.csv b/app/code/Magento/Reports/i18n/en_US.csv index 3225f2fc41409..169d3cc2b74b4 100644 --- a/app/code/Magento/Reports/i18n/en_US.csv +++ b/app/code/Magento/Reports/i18n/en_US.csv @@ -224,3 +224,5 @@ Action,Action Report,Report Description,Description undefined,undefined +Never,Never + diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_statistics_index.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_statistics_index.xml index 649dc7ceeb065..5b841e3523649 100644 --- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_statistics_index.xml +++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_statistics_index.xml @@ -71,7 +71,7 @@ <argument name="sortable" xsi:type="string">0</argument> <argument name="id" xsi:type="string">updated_at</argument> <argument name="index" xsi:type="string">updated_at</argument> - <argument name="default" xsi:type="string" translate="true">undefined</argument> + <argument name="default" xsi:type="string" translate="true">Never</argument> <argument name="column_css_class" xsi:type="string">col-period</argument> <argument name="header_css_class" xsi:type="string">col-period</argument> </arguments> From 414105e20221688f94e45b0563f1b38f9e9ea258 Mon Sep 17 00:00:00 2001 From: Ihor Sviziev <svizev.igor@gmail.com> Date: Fri, 6 Dec 2019 14:29:33 +0200 Subject: [PATCH 411/595] magento/magento2#25911 Fix notice on incorrect price param Fix static tests --- .../Model/Layer/Filter/DataProvider/Price.php | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/app/code/Magento/Catalog/Model/Layer/Filter/DataProvider/Price.php b/app/code/Magento/Catalog/Model/Layer/Filter/DataProvider/Price.php index 35c5a1cb29c84..229844fbe84b5 100644 --- a/app/code/Magento/Catalog/Model/Layer/Filter/DataProvider/Price.php +++ b/app/code/Magento/Catalog/Model/Layer/Filter/DataProvider/Price.php @@ -10,6 +10,9 @@ use Magento\Framework\Registry; use Magento\Store\Model\ScopeInterface; +/** + * Data provider for price filter in layered navigation + */ class Price { /** @@ -103,6 +106,8 @@ public function __construct( } /** + * Getter for interval + * * @return array */ public function getInterval() @@ -111,6 +116,8 @@ public function getInterval() } /** + * Setter for interval + * * @param array $interval * @return void */ @@ -120,6 +127,10 @@ public function setInterval($interval) } /** + * Retrieves price layered navigation modes + * + * @see RANGE_CALCULATION_AUTO + * * @return mixed */ public function getRangeCalculationValue() @@ -131,6 +142,8 @@ public function getRangeCalculationValue() } /** + * Retrieves range step + * * @return mixed */ public function getRangeStepValue() @@ -142,6 +155,8 @@ public function getRangeStepValue() } /** + * Retrieves one price interval + * * @return mixed */ public function getOnePriceIntervalValue() @@ -179,6 +194,8 @@ public function getRangeMaxIntervalsValue() } /** + * Retrieves Catalog Layer object + * * @return Layer */ public function getLayer() @@ -276,6 +293,8 @@ public function getMaxPrice() } /** + * Retrieve list of prior filters + * * @param string $filterParams * @return array */ @@ -339,6 +358,8 @@ public function getResetValue() } /** + * Getter for prior intervals + * * @return array */ public function getPriorIntervals() @@ -347,6 +368,8 @@ public function getPriorIntervals() } /** + * Setter for prior intervals + * * @param array $priorInterval * @return void */ @@ -356,6 +379,8 @@ public function setPriorIntervals($priorInterval) } /** + * Get Resource model for price filter + * * @return \Magento\Catalog\Model\ResourceModel\Layer\Filter\Price */ public function getResource() @@ -364,6 +389,8 @@ public function getResource() } /** + * Retrieves additional request data + * * @return string */ public function getAdditionalRequestData() From f9a510a10ed9cf8a3c8a1f0f4ffd374b59333f82 Mon Sep 17 00:00:00 2001 From: Serhiy Yelahin <serhiy.yelahin@transoftgroup.com> Date: Fri, 6 Dec 2019 15:04:15 +0200 Subject: [PATCH 412/595] MC-23900: Authorize Net issue on the admin order creation page --- .../Magento/Sales/view/adminhtml/web/order/create/scripts.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js b/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js index 4e07414510748..8803e2ea48f02 100644 --- a/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js +++ b/app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js @@ -482,11 +482,6 @@ define([ }, switchPaymentMethod: function(method){ - jQuery('#edit_form') - .off('submitOrder') - .on('submitOrder', function(){ - jQuery(this).trigger('realOrder'); - }); jQuery('#edit_form').trigger('changePaymentMethod', [method]); this.setPaymentMethod(method); var data = {}; From f33199f77fe16beb22478dd9773035185b576a0d Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Fri, 6 Dec 2019 22:03:30 +0700 Subject: [PATCH 413/595] Fix static test --- .../Reports/Controller/Adminhtml/Report/AbstractReport.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Reports/Controller/Adminhtml/Report/AbstractReport.php b/app/code/Magento/Reports/Controller/Adminhtml/Report/AbstractReport.php index c6d79459a2b52..d5d8d32744e49 100644 --- a/app/code/Magento/Reports/Controller/Adminhtml/Report/AbstractReport.php +++ b/app/code/Magento/Reports/Controller/Adminhtml/Report/AbstractReport.php @@ -18,6 +18,7 @@ /** * Reports api controller * + * phpcs:disable Magento2.Classes.AbstractApi * @api * @since 100.0.2 * @SuppressWarnings(PHPMD.AllPurposeAction) From a6badea946e710b4e9c306f86ec4707d1cfaa528 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Fri, 6 Dec 2019 23:35:04 +0700 Subject: [PATCH 414/595] [ProductAlert] Cover Helper Data by Unit Test --- .../Test/Unit/Helper/DataTest.php | 163 ++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 app/code/Magento/ProductAlert/Test/Unit/Helper/DataTest.php diff --git a/app/code/Magento/ProductAlert/Test/Unit/Helper/DataTest.php b/app/code/Magento/ProductAlert/Test/Unit/Helper/DataTest.php new file mode 100644 index 0000000000000..1818da2289b58 --- /dev/null +++ b/app/code/Magento/ProductAlert/Test/Unit/Helper/DataTest.php @@ -0,0 +1,163 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ProductAlert\Test\Unit\Helper; + +use PHPUnit\Framework\TestCase; +use Magento\ProductAlert\Helper\Data as HelperData; +use Magento\Framework\App\Helper\Context; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Framework\UrlInterface; +use Magento\Framework\Url\EncoderInterface; +use Magento\Catalog\Model\Product; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\ProductAlert\Model\Observer; +use Magento\Store\Model\ScopeInterface; +use Magento\Framework\View\LayoutInterface; +use Magento\ProductAlert\Block\Email\Price; +use Magento\Framework\Exception\LocalizedException; + +class DataTest extends TestCase +{ + /** + * @var HelperData + */ + private $helper; + + /** + * @var ObjectManagerHelper + */ + private $objectManagerHelper; + + /** + * @var Context|\PHPUnit_Framework_MockObject_MockObject + */ + private $contextMock; + + /** + * @var UrlInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $urlBuilderMock; + + /** + * @var EncoderInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $encoderMock; + + /** + * @var ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $scopeConfigMock; + + /** + * @var LayoutInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $layoutMock; + + /** + * Setup environment for testing + */ + protected function setUp() + { + $this->contextMock = $this->createMock(Context::class); + $this->urlBuilderMock = $this->createMock(UrlInterface::class); + $this->encoderMock = $this->createMock(EncoderInterface::class); + $this->scopeConfigMock = $this->createMock(ScopeConfigInterface::class); + $this->layoutMock = $this->createMock(LayoutInterface::class); + $this->contextMock->expects($this->once())->method('getUrlBuilder')->willReturn($this->urlBuilderMock); + $this->contextMock->expects($this->once())->method('getUrlEncoder')->willReturn($this->encoderMock); + $this->contextMock->expects($this->once())->method('getScopeConfig')->willReturn($this->scopeConfigMock); + + $this->objectManagerHelper = new ObjectManagerHelper($this); + + $productMock = $this->createMock(Product::class); + $productMock->expects($this->any())->method('getId')->willReturn(1); + + $this->helper = $this->objectManagerHelper->getObject( + HelperData::class, + [ + 'context' => $this->contextMock, + 'layout' => $this->layoutMock + ] + ); + $this->helper->setProduct($productMock); + } + + /** + * Test getSaveUrl() function + */ + public function testGetSaveUrl() + { + $currentUrl = 'http://www.example.com/'; + $type = 'stock'; + $uenc = strtr(base64_encode($currentUrl), '+/=', '-_,'); + $expected = 'http://www.example.com/roductalert/add/stock/product_id/1/uenc/' . $uenc; + + $this->urlBuilderMock->expects($this->any())->method('getCurrentUrl')->willReturn($currentUrl); + $this->encoderMock->expects($this->any())->method('encode') + ->with($currentUrl) + ->willReturn($uenc); + $this->urlBuilderMock->expects($this->any())->method('getUrl') + ->with( + 'productalert/add/' . $type, + [ + 'product_id' => 1, + 'uenc' => $uenc + ] + ) + ->willReturn($expected); + + $this->assertEquals($expected, $this->helper->getSaveUrl($type)); + } + + /** + * Test createBlock() with no exception + */ + public function testCreateBlockWithNoException() + { + $priceBlockMock = $this->createMock(Price::class); + $this->layoutMock->expects($this->once())->method('createBlock')->willReturn($priceBlockMock); + + $this->assertEquals($priceBlockMock, $this->helper->createBlock(Price::class)); + } + + /** + * Test createBlock() with exception + */ + public function testCreateBlockWithException() + { + $invalidBlock = $this->createMock(Product::class); + $this->expectException(LocalizedException::class); + $this->expectExceptionMessage((string)__('Invalid block type: %1')); + + $this->helper->createBlock($invalidBlock); + } + + /** + * Test isStockAlertAllowed() function with Yes settings + */ + public function testIsStockAlertAllowedWithYesSettings() + { + $this->scopeConfigMock->expects($this->any())->method('isSetFlag') + ->with(Observer::XML_PATH_STOCK_ALLOW, ScopeInterface::SCOPE_STORE) + ->willReturn('1'); + + $this->assertEquals('1', $this->helper->isStockAlertAllowed()); + } + + /** + * Test isPriceAlertAllowed() function with Yes settings + */ + public function testIsPriceAlertAllowedWithYesSetting() + { + $this->scopeConfigMock->expects($this->any())->method('isSetFlag') + ->with(Observer::XML_PATH_PRICE_ALLOW, ScopeInterface::SCOPE_STORE) + ->willReturn('1'); + + $this->assertEquals('1', $this->helper->isPriceAlertAllowed()); + } +} From dc8821dc2e297c1b73064ea49c1c4e7253b7e84f Mon Sep 17 00:00:00 2001 From: sdovbenko <sdovbenko@magecom.us> Date: Fri, 6 Dec 2019 19:44:52 +0200 Subject: [PATCH 415/595] Add OperationStatusPool and OperationStatusValidator --- .../Model/Operation.php | 21 +++++++++ .../Model/OperationStatusPool.php | 37 +++++++++++++++ .../Model/OperationStatusValidator.php | 47 +++++++++++++++++++ .../Magento/AsynchronousOperations/etc/di.xml | 11 +++++ 4 files changed, 116 insertions(+) create mode 100644 app/code/Magento/AsynchronousOperations/Model/OperationStatusPool.php create mode 100644 app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php diff --git a/app/code/Magento/AsynchronousOperations/Model/Operation.php b/app/code/Magento/AsynchronousOperations/Model/Operation.php index dbe6ecc1b6b1f..9e0039d2ee151 100644 --- a/app/code/Magento/AsynchronousOperations/Model/Operation.php +++ b/app/code/Magento/AsynchronousOperations/Model/Operation.php @@ -6,6 +6,7 @@ namespace Magento\AsynchronousOperations\Model; use Magento\AsynchronousOperations\Api\Data\OperationInterface; +use Magento\AsynchronousOperations\Model\OperationStatusValidator; use Magento\Framework\DataObject; /** @@ -13,6 +14,25 @@ */ class Operation extends DataObject implements OperationInterface { + /** + * @var OperationStatusValidator + */ + protected $operationStatusValidator; + + /** + * Operation constructor. + * + * @param array $data + * @param OperationStatusValidator $operationStatusValidator + */ + public function __construct( + array $data = [], + OperationStatusValidator $operationStatusValidator + ) { + $this->operationStatusValidator = $operationStatusValidator; + parent::__construct($data); + } + /** * @inheritDoc */ @@ -106,6 +126,7 @@ public function getStatus() */ public function setStatus($status) { + $this->operationStatusValidator->validate($status); return $this->setData(self::STATUS, $status); } diff --git a/app/code/Magento/AsynchronousOperations/Model/OperationStatusPool.php b/app/code/Magento/AsynchronousOperations/Model/OperationStatusPool.php new file mode 100644 index 0000000000000..73eeedbdb7a20 --- /dev/null +++ b/app/code/Magento/AsynchronousOperations/Model/OperationStatusPool.php @@ -0,0 +1,37 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\AsynchronousOperations\Model; + +/** + * Class OperationStatusPool + * + * Pool of statuses that require validate + */ +class OperationStatusPool +{ + /** + * @var array + */ + protected $statuses; + + /** + * @param array $statuses + */ + public function __construct(array $statuses = []) + { + $this->statuses = $statuses; + } + + /** + * Retrieve statuses that require validate + * + * @return array + */ + public function getStatuses() + { + return $this->statuses; + } +} diff --git a/app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php b/app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php new file mode 100644 index 0000000000000..3da94f1c4d7fb --- /dev/null +++ b/app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php @@ -0,0 +1,47 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\AsynchronousOperations\Model; + +use Magento\AsynchronousOperations\Model\OperationStatusPool; +use Magento\Framework\Exception\NoSuchEntityException; +use Doctrine\Instantiator\Exception\InvalidArgumentException; + +/** + * Class OperationStatusValidator to validate operation status + */ +class OperationStatusValidator +{ + /** + * @var OperationStatusPool + */ + protected $operationStatusPool; + + /** + * OperationStatusValidator constructor. + * + * @param OperationStatusPool $operationStatusPool + */ + public function __construct(OperationStatusPool $operationStatusPool) + { + $this->operationStatusPool = $operationStatusPool; + } + + /** + * Validate method + * + * @param $status + */ + public function validate($status) + { + $statuses = $this->operationStatusPool->getStatuses(); + + if (!in_array($status, $statuses)) { + throw new \InvalidArgumentException('Invalid Operation Status.'); + } + + return; + } +} diff --git a/app/code/Magento/AsynchronousOperations/etc/di.xml b/app/code/Magento/AsynchronousOperations/etc/di.xml index 94a4c56c19cea..171a01cedf289 100644 --- a/app/code/Magento/AsynchronousOperations/etc/di.xml +++ b/app/code/Magento/AsynchronousOperations/etc/di.xml @@ -80,6 +80,17 @@ </argument> </arguments> </type> + <type name="Magento\AsynchronousOperations\Model\OperationStatusPool"> + <arguments> + <argument name="statuses" xsi:type="array"> + <item name="complete" xsi:type="string">1</item> + <item name="retriablyFailed" xsi:type="string">2</item> + <item name="notRetriablyFailed" xsi:type="string">3</item> + <item name="open" xsi:type="string">4</item> + <item name="rejected" xsi:type="string">5</item> + </argument> + </arguments> + </type> <virtualType name="Magento\AsynchronousOperations\Ui\Component\DataProvider" type="Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider"/> From f305a84472fc0222147844ffa83542c01cd1c023 Mon Sep 17 00:00:00 2001 From: sdovbenko <sdovbenko@magecom.us> Date: Fri, 6 Dec 2019 20:12:55 +0200 Subject: [PATCH 416/595] Changed protected to private modifier --- app/code/Magento/AsynchronousOperations/Model/Operation.php | 2 +- .../AsynchronousOperations/Model/OperationStatusPool.php | 2 +- .../AsynchronousOperations/Model/OperationStatusValidator.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/AsynchronousOperations/Model/Operation.php b/app/code/Magento/AsynchronousOperations/Model/Operation.php index 9e0039d2ee151..de2b56d0a0dd7 100644 --- a/app/code/Magento/AsynchronousOperations/Model/Operation.php +++ b/app/code/Magento/AsynchronousOperations/Model/Operation.php @@ -17,7 +17,7 @@ class Operation extends DataObject implements OperationInterface /** * @var OperationStatusValidator */ - protected $operationStatusValidator; + private $operationStatusValidator; /** * Operation constructor. diff --git a/app/code/Magento/AsynchronousOperations/Model/OperationStatusPool.php b/app/code/Magento/AsynchronousOperations/Model/OperationStatusPool.php index 73eeedbdb7a20..890eb8c1c8c75 100644 --- a/app/code/Magento/AsynchronousOperations/Model/OperationStatusPool.php +++ b/app/code/Magento/AsynchronousOperations/Model/OperationStatusPool.php @@ -15,7 +15,7 @@ class OperationStatusPool /** * @var array */ - protected $statuses; + private $statuses; /** * @param array $statuses diff --git a/app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php b/app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php index 3da94f1c4d7fb..ae154edfb50f7 100644 --- a/app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php +++ b/app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php @@ -17,7 +17,7 @@ class OperationStatusValidator /** * @var OperationStatusPool */ - protected $operationStatusPool; + private $operationStatusPool; /** * OperationStatusValidator constructor. From 345ece3f5277c1add6a1fd31cf8c830b3615c96f Mon Sep 17 00:00:00 2001 From: sdovbenko <sdovbenko@magecom.us> Date: Fri, 6 Dec 2019 20:13:59 +0200 Subject: [PATCH 417/595] Added OperationStatusValidatorTest class to Unit --- .../Model/OperationStatusValidatorTest.php | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 app/code/Magento/AsynchronousOperations/Test/Unit/Model/OperationStatusValidatorTest.php diff --git a/app/code/Magento/AsynchronousOperations/Test/Unit/Model/OperationStatusValidatorTest.php b/app/code/Magento/AsynchronousOperations/Test/Unit/Model/OperationStatusValidatorTest.php new file mode 100644 index 0000000000000..2209564d03aee --- /dev/null +++ b/app/code/Magento/AsynchronousOperations/Test/Unit/Model/OperationStatusValidatorTest.php @@ -0,0 +1,155 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\AsynchronousOperations\Test\Unit\Model; + +use Magento\AsynchronousOperations\Model\OperationStatusValidator; +use Magento\AsynchronousOperations\Model\Operation; +use Magento\AsynchronousOperations\Model\OperationStatusPool; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\TestCase; + +/** + * Class OperationStatusValidatorTest + */ +class OperationStatusValidatorTest extends TestCase +{ + /** + * @var OperationStatusPool + */ + private $operationStatusPool; + + /** + * @var OperationStatusValidator + */ + private $operationStatusValidator; + + /** + * @var Operation + */ + private $operation; + + protected function setUp() + { + $this->operationStatusPool = $this->getMockBuilder(OperationStatusPool::class) + ->disableOriginalConstructor() + ->getMock(); + + $objectManager = new ObjectManager($this); + + $this->operationStatusValidator = $objectManager->getObject( + OperationStatusValidator::class, + [ + 'operationStatusPool' => $this->operationStatusPool + ] + ); + + $this->operation = $objectManager->getObject( + Operation::class, + [ + 'operationStatusValidator' => $this->operationStatusValidator + ] + ); + } + + /** + * @param string $status + * @param array $statusPool + * @param string $expectedResult + * @dataProvider dataProviderForTestSetStatus + */ + public function testSetStatus ( + string $status, + array $statusPool, + string $expectedResult + ) { + $this->operationStatusPool + ->expects($this->any()) + ->method('getStatuses') + ->willReturn($statusPool); + + try { + $this->operation->setStatus($status); + $this->assertEquals($expectedResult, $this->operation->getStatus()); + } catch (\Exception $exception) { + $this->assertEquals($expectedResult, $exception->getMessage()); + } + } + + /** + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function dataProviderForTestSetStatus() + { + return [ + [ + 'status' => 0, + 'statusPool' => [ + 'complete' => 1, + 'retriablyFailed' => 2, + 'notRetriablyFailed' => 3, + 'open' => 4, + 'rejected' => 5 + ], + 'expectedResult' => 'Invalid Operation Status.' + ], + [ + 'status' => 1, + 'statusPool' => [ + 'complete' => 1, + 'retriablyFailed' => 2, + 'notRetriablyFailed' => 3, + 'open' => 4, + 'rejected' => 5 + ], + 'expectedResult' => 1 + ], + [ + 'status' => 2, + 'statusPool' => [ + 'complete' => 1, + 'retriablyFailed' => 2, + 'notRetriablyFailed' => 3, + 'open' => 4, + 'rejected' => 5 + ], + 'expectedResult' => 2 + ], + [ + 'status' => 3, + 'statusPool' => [ + 'complete' => 1, + 'retriablyFailed' => 2, + 'notRetriablyFailed' => 3, + 'open' => 4, + 'rejected' => 5 + ], + 'expectedResult' => 3 + ], + [ + 'status' => 4, + 'statusPool' => [ + 'complete' => 1, + 'retriablyFailed' => 2, + 'notRetriablyFailed' => 3, + 'open' => 4, + 'rejected' => 5 + ], + 'expectedResult' => 4 + ], + [ + 'status' => 5, + 'statusPool' => [ + 'complete' => 1, + 'retriablyFailed' => 2, + 'notRetriablyFailed' => 3, + 'open' => 4, + 'rejected' => 5 + ], + 'expectedResult' => 5 + ] + ]; + } +} From b1e518ca649a862abca2856db0c99d385ba964a3 Mon Sep 17 00:00:00 2001 From: Sergey Dovbenko <sdovbenko@magecom.us> Date: Fri, 6 Dec 2019 18:16:25 +0000 Subject: [PATCH 418/595] Corrected Code Styles --- .../Magento/AsynchronousOperations/Model/Operation.php | 8 ++++---- .../Model/OperationStatusValidator.php | 6 +++--- .../Test/Unit/Model/OperationStatusValidatorTest.php | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/AsynchronousOperations/Model/Operation.php b/app/code/Magento/AsynchronousOperations/Model/Operation.php index de2b56d0a0dd7..00f33d10a1e1b 100644 --- a/app/code/Magento/AsynchronousOperations/Model/Operation.php +++ b/app/code/Magento/AsynchronousOperations/Model/Operation.php @@ -10,7 +10,7 @@ use Magento\Framework\DataObject; /** - * Class Operation + * Class Operation encapsulates methods for Operation Model Object */ class Operation extends DataObject implements OperationInterface { @@ -22,12 +22,12 @@ class Operation extends DataObject implements OperationInterface /** * Operation constructor. * - * @param array $data * @param OperationStatusValidator $operationStatusValidator + * @param array $data */ public function __construct( - array $data = [], - OperationStatusValidator $operationStatusValidator + OperationStatusValidator $operationStatusValidator, + array $data = [] ) { $this->operationStatusValidator = $operationStatusValidator; parent::__construct($data); diff --git a/app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php b/app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php index ae154edfb50f7..f2ae135e4303c 100644 --- a/app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php +++ b/app/code/Magento/AsynchronousOperations/Model/OperationStatusValidator.php @@ -32,7 +32,9 @@ public function __construct(OperationStatusPool $operationStatusPool) /** * Validate method * - * @param $status + * @param int $status + * @throws \InvalidArgumentException + * @return void */ public function validate($status) { @@ -41,7 +43,5 @@ public function validate($status) if (!in_array($status, $statuses)) { throw new \InvalidArgumentException('Invalid Operation Status.'); } - - return; } } diff --git a/app/code/Magento/AsynchronousOperations/Test/Unit/Model/OperationStatusValidatorTest.php b/app/code/Magento/AsynchronousOperations/Test/Unit/Model/OperationStatusValidatorTest.php index 2209564d03aee..b93d9701a7a69 100644 --- a/app/code/Magento/AsynchronousOperations/Test/Unit/Model/OperationStatusValidatorTest.php +++ b/app/code/Magento/AsynchronousOperations/Test/Unit/Model/OperationStatusValidatorTest.php @@ -12,7 +12,7 @@ use PHPUnit\Framework\TestCase; /** - * Class OperationStatusValidatorTest + * Class OperationStatusValidatorTest implements logic for testing Operation::setStatus() method */ class OperationStatusValidatorTest extends TestCase { @@ -60,7 +60,7 @@ protected function setUp() * @param string $expectedResult * @dataProvider dataProviderForTestSetStatus */ - public function testSetStatus ( + public function testSetStatus( string $status, array $statusPool, string $expectedResult From 12217115413c9028658b552c9fa4b46029aaeaba Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Fri, 6 Dec 2019 15:07:18 -0600 Subject: [PATCH 419/595] Remove deprecated action groups that were introduced to backward compatibility --- .../ActionGroup/_Deprecated_ActionGroup.xml | 68 -- .../_Deprecated_ActionGroup.xml .xml | 139 --- .../ActionGroup/_Deprecated_ActionGroup.xml | 263 ------ .../ActionGroup/_Deprecated_ActionGroup.xml | 853 ------------------ .../ActionGroup/_Deprecated_ActionGroup.xml | 27 - .../ActionGroup/_Deprecated_ActionGroup.xml | 106 --- .../ActionGroup/_Deprecated_ActionGroup.xml | 90 -- .../ActionGroup/_Deprecated_ActionGroup.xml | 96 -- .../ActionGroup/_Deprecated_ActionGroup.xml | 19 - .../ActionGroup/_Deprecated_ActionGroup.xml | 39 - .../ActionGroup/_Deprecated_ActionGroup.xml | 28 - .../ActionGroup/_Deprecated_ActionGroup.xml | 150 --- .../ActionGroup/_Deprecated_ActionGroup.xml | 105 --- .../ActionGroup/_Deprecated_ActionGroup.xml | 673 -------------- .../ActionGroup/_Deprecated_ActionGroup.xml | 110 --- .../ActionGroup/_Deprecated_ActionGroup.xml | 51 -- .../ActionGroup/_Deprecated_ActionGroup.xml | 247 ----- .../ActionGroup/_Deprecated_ActionGroup.xml | 115 --- .../ActionGroup/_Deprecated_ActionGroup.xml | 271 ------ .../ActionGroup/_Deprecated_ActionGroup.xml | 98 -- .../ActionGroup/_Deprecated_ActionGroup.xml | 296 ------ .../ActionGroup/_Deprecated_ActionGroup.xml | 69 -- .../ActionGroup/_Deprecated_ActionGroup.xml | 99 -- 23 files changed, 4012 deletions(-) delete mode 100644 app/code/Magento/Backup/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Braintree/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml .xml delete mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Downloadable/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Email/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Newsletter/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/PageCache/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Paypal/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/SalesRule/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Search/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Store/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Ui/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml delete mode 100644 app/code/Magento/Wishlist/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml diff --git a/app/code/Magento/Backup/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Backup/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 84c6812ddf183..0000000000000 --- a/app/code/Magento/Backup/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,68 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="createSystemBackup"> - <annotations> - <description>Creates a System Backup using provided Backup Entity.</description> - </annotations> - <arguments> - <argument name="backup" defaultValue="SystemBackup"/> - </arguments> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateSystemBackupActionGroup` instead --> - <click selector="{{AdminMainActionsSection.systemBackup}}" stepKey="clickCreateBackupButton"/> - <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> - <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> - <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> - <waitForElementNotVisible selector=".loading-mask" time="300" stepKey="waitForBackupProcess"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You created the system backup." stepKey="seeSuccessMessage"/> - <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> - <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> - </actionGroup> - - <actionGroup name="createMediaBackup"> - <annotations> - <description>Creates a Media Backup using provided Backup Entity.</description> - </annotations> - <arguments> - <argument name="backup" defaultValue="MediaBackup"/> - </arguments> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateMediaBackupActionGroup` instead --> - <click selector="{{AdminMainActionsSection.mediaBackup}}" stepKey="clickCreateBackupButton"/> - <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> - <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> - <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> - <waitForPageLoad time="120" stepKey="waitForBackupProcess"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You created the database and media backup." stepKey="seeSuccessMessage"/> - <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> - <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> - </actionGroup> - - <actionGroup name="createDatabaseBackup"> - <annotations> - <description>Creates a Database Backup using provided Backup Entity.</description> - </annotations> - <arguments> - <argument name="backup" defaultValue="DatabaseBackup"/> - </arguments> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateDatabaseBackupActionGroup` instead --> - <click selector="{{AdminMainActionsSection.databaseBackup}}" stepKey="clickCreateBackupButton"/> - <waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/> - <fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/> - <click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/> - <waitForPageLoad time="120" stepKey="waitForBackupProcess"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You created the database backup." stepKey="seeSuccessMessage"/> - <see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/> - <see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml .xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml .xml deleted file mode 100644 index 5bfd2d15de72a..0000000000000 --- a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml .xml +++ /dev/null @@ -1,139 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="GoToAllUsers"> - <annotations> - <description>Navigate to the Users page via Backend Admin Side Menu. PLEASE NOTE: Use the amOnPage action instead.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GoToAllUsersActionGroup` instead --> - <click selector="{{AdminCreateUserSection.system}}" stepKey="clickOnSystemIcon"/> - <waitForPageLoad stepKey="waitForSystemsPageToOpen"/> - <click selector="{{AdminCreateUserSection.allUsers}}" stepKey="clickToSelectUserRoles"/> - <waitForPageLoad stepKey="waitForUserRolesPageToOpen"/> - </actionGroup> - - <actionGroup name="GoToUserRoles"> - <annotations> - <description>Navigate to the User Roles page via Backend Admin Side Menu. PLEASE NOTE: Use the amOnPage action instead.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GoToUserRolesActionGroup` instead --> - <click selector="#menu-magento-backend-system" stepKey="clickOnSystemIcon"/> - <waitForPageLoad stepKey="waitForSystemsPageToOpen"/> - <click selector="//span[contains(text(), 'User Roles')]" stepKey="clickToSelectUserRoles"/> - <waitForPageLoad stepKey="waitForUserRolesPageToOpen"/> - </actionGroup> - - <actionGroup name="AdminCreateNewRole"> - <annotations> - <description>Creates a User Role using the provided Data.</description> - </annotations> - <arguments> - <argument name="role" type="string" defaultValue=""/> - <argument name="resource" type="string" defaultValue="All"/> - <argument name="scope" type="string" defaultValue="Custom"/> - <argument name="websites" type="string" defaultValue="Main Website"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateNewRoleActionGroup` instead --> - <click selector="{{AdminCreateRoleSection.create}}" stepKey="clickToAddNewRole"/> - <fillField selector="{{AdminCreateRoleSection.name}}" userInput="{{role.name}}" stepKey="setRoleName"/> - <fillField stepKey="setPassword" selector="{{AdminCreateRoleSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> - <click selector="{{AdminCreateRoleSection.roleResources}}" stepKey="clickToOpenRoleResources"/> - <waitForPageLoad stepKey="waitForRoleResourcePage" time="5"/> - <click stepKey="checkSales" selector="//a[text()='Sales']"/> - <click selector="{{AdminCreateRoleSection.save}}" stepKey="clickToSaveRole"/> - <waitForPageLoad stepKey="waitForPageLoad" time="10"/> - <see userInput="You saved the role." stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="AdminCreateUserAction"> - <annotations> - <description>Creates a User using the NewAdmin User Entity and User Role Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateUserActionGroup` instead --> - <click selector="{{AdminCreateUserSection.create}}" stepKey="clickToCreateNewUser"/> - <waitForPageLoad stepKey="waitForNewUserPageLoad" time="10"/> - <fillField selector="{{AdminCreateUserSection.usernameTextField}}" userInput="{{NewAdmin.username}}" stepKey="enterUserName"/> - <fillField selector="{{AdminCreateUserSection.firstNameTextField}}" userInput="{{NewAdmin.firstName}}" stepKey="enterFirstName"/> - <fillField selector="{{AdminCreateUserSection.lastNameTextField}}" userInput="{{NewAdmin.lastName}}" stepKey="enterLastName"/> - <fillField selector="{{AdminCreateUserSection.emailTextField}}" userInput="{{NewAdmin.email}}" stepKey="enterEmail"/> - <fillField selector="{{AdminCreateUserSection.passwordTextField}}" userInput="{{NewAdmin.password}}" stepKey="enterPassword"/> - <fillField selector="{{AdminCreateUserSection.pwConfirmationTextField}}" userInput="{{NewAdmin.password}}" stepKey="confirmPassword"/> - <fillField selector="{{AdminCreateUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword"/> - <scrollToTopOfPage stepKey="scrollToTopOfPage"/> - <click selector="{{AdminCreateUserSection.userRoleTab}}" stepKey="clickUserRole"/> - <waitForAjaxLoad stepKey="waitForRoles" time="5"/> - <fillField selector="{{AdminCreateRoleSection.roleNameFilterTextField}}" userInput="{{role.name}}" stepKey="filterRole"/> - <click selector="{{AdminCreateRoleSection.searchButton}}" stepKey="clickSearch"/> - <waitForPageLoad stepKey="waitForSearch" time="10"/> - <click selector="{{AdminCreateRoleSection.searchResultFirstRow}}" stepKey="selectRole"/> - <click selector="{{AdminCreateUserSection.saveButton}}" stepKey="clickSaveUser"/> - <waitForPageLoad stepKey="waitForSaveUser" time="10"/> - <see userInput="You saved the user." stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="ConfigureBraintree"> - <annotations> - <description>Sets up the Braintree configuration setting using the BraintreeConfigurationSection Data Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ConfigureBraintreeActionGroup` instead --> - <click stepKey="clickOnSTORES" selector="{{AdminMenuSection.stores}}"/> - <waitForPageLoad stepKey="waitForConfiguration" time="2"/> - <click stepKey="clickOnConfigurations" selector="{{AdminMenuSection.configuration}}"/> - <waitForPageLoad stepKey="waitForSales" time="2"/> - <click stepKey="clickOnSales" selector="{{ConfigurationListSection.sales}}"/> - <waitForPageLoad stepKey="waitForPaymentMethods" time="2"/> - <click stepKey="clickOnPaymentMethods" selector="{{ConfigurationListSection.salesPaymentMethods}}"/> - <waitForPageLoad stepKey="waitForConfigureButton" time="2"/> - <click stepKey="clickOnConfigureButtonForBraintree" selector="{{ConfigurationPaymentSection.configureButton}}"/> - <waitForPageLoad stepKey="BraintreeSettings" time="2"/> - - <fillField stepKey="fillTitleForBraintreeSettings" selector="{{BraintreeConfiguraionSection.titleForBraintreeSettings}}" userInput="{{BraintreeConfigurationData.title}}"/> - <click stepKey="openEnvironmentSelect" selector="{{BraintreeConfiguraionSection.environment}}"/> - <click stepKey="chooseEnvironment" selector="{{BraintreeConfiguraionSection.sandbox}}"/> - <click stepKey="openPaymentActionSelect" selector="{{BraintreeConfiguraionSection.paymentActionSelect}}"/> - <click stepKey="choosePaymentAction" selector="{{BraintreeConfiguraionSection.paymentAction}}"/> - <fillField stepKey="fillMerchantID" selector="{{BraintreeConfiguraionSection.merchantID}}" userInput="{{BraintreeConfigurationData.merchantID}}"/> - <fillField stepKey="fillPublicKey" selector="{{BraintreeConfiguraionSection.publicKey}}" userInput="{{BraintreeConfigurationData.publicKey}}"/> - <fillField stepKey="fillPrivateKey" selector="{{BraintreeConfiguraionSection.privateKey}}" userInput="{{BraintreeConfigurationData.privateKey}}"/> - <click stepKey="expandEnableThisSolution" selector="{{BraintreeConfiguraionSection.enableThisSolution}}"/> - <click stepKey="chooseYesForEnableThisSolution" selector="{{BraintreeConfiguraionSection.yesForEnable}}"/> - <click stepKey="expandEnablePayPalThroughBraintree" selector="{{BraintreeConfiguraionSection.payPalThroughBraintree}}"/> - <click stepKey="chooseYesForEnablePayPalThroughBraintree" selector="{{BraintreeConfiguraionSection.yesForPayPalThroughBraintree}}"/> - <click stepKey="expandAdvancedBraintreeSettings" selector="{{BraintreeConfiguraionSection.advancedBraintreeSettings}}"/> - <fillField stepKey="fillMerchantAccountID" selector="{{BraintreeConfiguraionSection.merchantAccountID}}" userInput="{{BraintreeConfigurationData.merchantAccountID}}"/> - <click stepKey="expandCVVVerification" selector="{{BraintreeConfiguraionSection.CVVVerification}}"/> - <click stepKey="chooseYes" selector="{{BraintreeConfiguraionSection.yesForCVV}}"/> - <click stepKey="expandPayPalThroughBraintree" selector="{{BraintreeConfiguraionSection.payPalThroughBraintreeSelector}}"/> - <fillField stepKey="fillTitleForPayPalThroughBraintree" selector="{{BraintreeConfiguraionSection.titleForPayPalThroughBraintree}}" userInput="{{BraintreeConfigurationData.titleForPayPalThroughBraintree}}"/> - <click stepKey="expandPaymentAction" selector="{{BraintreeConfiguraionSection.paymentActionInPayPal}}"/> - <click stepKey="chooseAuthorize" selector="{{BraintreeConfiguraionSection.actionAuthorize}}"/> - <click stepKey="save" selector="{{BraintreeConfiguraionSection.save}}"/> - <waitForElementVisible selector="{{BraintreeConfiguraionSection.successfulMessage}}" stepKey="waitForSuccessfullyConfigured" time="10"/> - </actionGroup> - - <actionGroup name="DisableBrainTree"> - <annotations> - <description>Disables the Braintree and BraintreePaypal configuration settings via the CLI.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DisableBraintreeActionGroup` instead --> - <magentoCLI stepKey="disableBrainTree" command="config:set payment/braintree/active 0"/> - <magentoCLI stepKey="disableBrainTreePaypal" command="config:set payment/braintree_paypal/active 0"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index d5413d2269a5b..0000000000000 --- a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,263 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AncillaryPrepBundleProduct"> - <annotations> - <description>Requires Navigation to the Product Creation page. Fills out Name, Sku, and SEO information using the BundleProduct Data Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AncillaryPrepBundleProductActionGroup` instead --> - <fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/> - - <scrollTo selector="{{AdminProductFormBundleSection.seoDropdown}}" stepKey="moveToSEOSection"/> - <conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.urlKey}}" visible="false" stepKey="openDropDownIfClosed"/> - <waitForPageLoad stepKey="WaitForDropDownSEO"/> - - <fillField userInput="{{BundleProduct.urlKey}}" selector="{{AdminProductFormBundleSection.urlKey}}" stepKey="FillsinSEOlinkExtension"/> - </actionGroup> - - <actionGroup name="FindProductToEdit"> - <annotations> - <description>Clears the Backend Admin Grid Filters on the Backend Admin Product Grid page. Searches for the BundleProduct Data Entity. Then clicks on the first item in the Admin Grid. PLEASE NOTE: The Action Group values are Hardcoded.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FindProductToEditActionGroup` instead --> - <amOnPage url="{{ProductCatalogPage.url}}" stepKey="GoToProductCatalog"/> - <waitForPageLoad stepKey="WaitForCatalogProductPageToLoad"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <fillField userInput="{{BundleProduct.name}}" selector="#fulltext" stepKey="EnterProductNameInSearch"/> - <click stepKey="ClickSearch" selector="{{AdminProductFormBundleSection.searchButton}}"/> - <click stepKey="ClickOnProduct" selector="{{AdminProductFormBundleSection.firstCatalogProduct}}"/> - <waitForPageLoad stepKey="WaitForProductEditPageToLoad"/> - </actionGroup> - - <actionGroup name="CreateBasicBundleProduct"> - <annotations> - <description>Requires Navigation to the Product Creation page. Fills out Name, Sku, and SEO information using the BundleProduct Data Entity. PLEASE NOTE: The Action Group values are Hardcoded.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateBasicBundleProductActionGroup` instead --> - <fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku}}" stepKey="fillProductSku"/> - - <scrollTo selector="{{AdminProductFormBundleSection.seoDropdown}}" stepKey="scrollToSeoDropDown"/> - <conditionalClick selector="{{AdminProductFormBundleSection.seoDropdown}}" dependentSelector="{{AdminProductFormBundleSection.urlKey}}" visible="false" stepKey="openDropDownIfClosed"/> - <waitForPageLoad stepKey="waitForDropDownSEO"/> - - <fillField userInput="{{BundleProduct.urlKey}}" selector="{{AdminProductFormBundleSection.urlKey}}" stepKey="fillsInSeoLinkExtension"/> - </actionGroup> - - <actionGroup name="addBundleOptionWithTwoProducts"> - <annotations> - <description>Requires Navigation to the Product Creation page. Adds Bundle Option with Two Products using the provided arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleOptionWithTwoProductsActionGroup` instead --> - <arguments> - <argument name="x" type="string"/> - <argument name="n" type="string"/> - <argument name="prodOneSku" type="string"/> - <argument name="prodTwoSku" type="string"/> - <argument name="optionTitle" type="string"/> - <argument name="inputType" type="string"/> - </arguments> - - <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> - <scrollTo selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" stepKey="scrollUpABit"/> - <click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption"/> - <waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle(x)}}" stepKey="waitForOptions"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle(x)}}" userInput="{{optionTitle}}" stepKey="fillTitle"/> - <selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType(x)}}" userInput="{{inputType}}" stepKey="selectType"/> - <waitForElementVisible selector="{{AdminProductFormBundleSection.nthAddProductsToOption(n)}}" stepKey="waitForAddBtn"/> - <click selector="{{AdminProductFormBundleSection.nthAddProductsToOption(n)}}" stepKey="clickAdd"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters1"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters1"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodOneSku}}" stepKey="fillProductSkuFilter1"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters1"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad1" time="30"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct1"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters2"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters2"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTwoSku}}" stepKey="fillProductSkuFilter2"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters2"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad2" time="30"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct2"/> - <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddButton1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="50" stepKey="fillQuantity1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="50" stepKey="fillQuantity2"/> - </actionGroup> - - <actionGroup name="addBundleOptionWithOneProduct" extends="addBundleOptionWithTwoProducts"> - <annotations> - <description>Requires Navigation to the Product Creation page. Adds Bundle Option with One Product as specified in arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleOptionWithOneProductActionGroup` instead --> - <remove keyForRemoval="openProductFilters2"/> - <remove keyForRemoval="fillProductSkuFilter2"/> - <remove keyForRemoval="clickApplyFilters2"/> - <remove keyForRemoval="waitForFilteredGridLoad2"/> - <remove keyForRemoval="selectProduct2"/> - <remove keyForRemoval="selectProduct2"/> - <remove keyForRemoval="fillQuantity1"/> - <remove keyForRemoval="fillQuantity2"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity" after="clickAddButton1"/> - </actionGroup> - - <actionGroup name="addBundleOptionWithTreeProducts" extends="addBundleOptionWithTwoProducts"> - <annotations> - <description>Requires Navigation to the Product Creation page. Adds Bundle Option with Three Products using the provided arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> - </annotations> - <arguments> - <argument name="prodTreeSku" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleOptionWithThreeProductsActionGroup` instead --> - <remove keyForRemoval="fillQuantity1"/> - <remove keyForRemoval="fillQuantity2"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="1" stepKey="fillQuantity1" after="clickAddButton1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="1" stepKey="fillQuantity2" after="fillQuantity1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="1" stepKey="fillQuantity3" after="fillQuantity2"/> - </actionGroup> - - <actionGroup name="addBundleOptionWithSixProducts" extends="addBundleOptionWithTwoProducts"> - <annotations> - <description>Requires Navigation to Product Creation page. Adds Bundle Option with Six Products as specified in arguments. 'x' refers to Bundle option number. 'n' refers to the first number after x.</description> - </annotations> - <arguments> - <argument name="prodTreeSku" type="string"/> - <argument name="prodFourSku" type="string"/> - <argument name="prodFiveSku" type="string"/> - <argument name="prodSixSku" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleOptionWithSixProductsActionGroup` instead --> - <remove keyForRemoval="fillQuantity1"/> - <remove keyForRemoval="fillQuantity2"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters3" after="selectProduct2"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters3" after="clickClearFilters3"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodTreeSku}}" stepKey="fillProductSkuFilter3" after="openProductFilters3"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters3" after="fillProductSkuFilter3"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad3" time="30" after="clickApplyFilters3"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct3" after="waitForFilteredGridLoad3"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters4" after="selectProduct3"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters4" after="clickClearFilters4"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFourSku}}" stepKey="fillProductSkuFilter4" after="openProductFilters4"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters4" after="fillProductSkuFilter4"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad4" time="30" after="clickApplyFilters4"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct4" after="clickApplyFilters4"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters5" after="selectProduct4"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters5" after="clickClearFilters5"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodFiveSku}}" stepKey="fillProductSkuFilter5" after="openProductFilters5"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters5" after="fillProductSkuFilter5"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad5" time="30" after="clickApplyFilters5"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct5" after="waitForFilteredGridLoad5"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters6" after="selectProduct5"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters6" after="clickClearFilters6"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{prodSixSku}}" stepKey="fillProductSkuFilter6" after="openProductFilters6"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters6" after="fillProductSkuFilter6"/> - <waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad6" time="30" after="clickApplyFilters6"/> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectProduct6" after="waitForFilteredGridLoad6"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '0')}}" userInput="2" stepKey="fillQuantity1" after="clickAddButton1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '1')}}" userInput="2" stepKey="fillQuantity2" after="fillQuantity1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '2')}}" userInput="2" stepKey="fillQuantity3" after="fillQuantity2"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '3')}}" userInput="2" stepKey="fillQuantity4" after="fillQuantity3"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '4')}}" userInput="2" stepKey="fillQuantity5" after="fillQuantity4"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(x, '5')}}" userInput="2" stepKey="fillQuantity6" after="fillQuantity5"/> - </actionGroup> - - <actionGroup name="deleteBundleOptionByIndex"> - <annotations> - <description>Requires Navigation to Product Creation page. Removes any Bundle Option by index specified in arguments. 'deleteIndex' refers to Bundle option number.</description> - </annotations> - <arguments> - <argument name="deleteIndex" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DeleteBundleOptionByIndexActionGroup` instead --> - <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> - <scrollTo selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" stepKey="scrollUpABit"/> - <click selector="{{AdminProductFormBundleSection.deleteOption(deleteIndex)}}" stepKey="clickDeleteOption"/> - </actionGroup> - - <actionGroup name="StorefrontAddBundleProductFromProductToCartWithMultiOption" extends="StorefrontAddBundleProductFromProductToCartActionGroup"> - <annotations> - <description>Selects a Bundled Product option on the Bundled Product page. PLEASE NOTE: The Quantity selection is not available in the Action Group.</description> - </annotations> - <arguments> - <argument name="optionName" type="string"/> - <argument name="value" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontAddBundleProductFromProductToCartWithMultiOptionActionGroup` instead --> - <selectOption selector="{{StorefrontBundledSection.multiselectOptionFourProducts(optionName)}}" userInput="{{value}}" stepKey="selectValue" before="clickAddBundleProductToCart"/> - </actionGroup> - - <actionGroup name="fillMainBundleProductForm"> - <annotations> - <description>Fills the Name, SKU and Stock Status fields.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="BundleProduct"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillMainBundleProductFormActionGroup` instead --> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> - <selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="selectStockStatus"/> - </actionGroup> - - <actionGroup name="checkRequiredFieldsInBundleProductForm"> - <annotations> - <description>Clears the Name and SKU fields when adding a Product and then verifies that they are required after attempting to Save.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CheckRequiredFieldsInBundleProductFormActionGroup` instead --> - <clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductSku"/> - <clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductName"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/> - <see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/> - <see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/> - </actionGroup> - - <actionGroup name="viewBundleProductInAdminGrid"> - <annotations> - <description>Clears the Grid Filters on the Catalog Grid page and applies Filter by Name and Sku. Then checks to see if the Product exists in the 1st row. Then clears the Grid Filters again for future Tests.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="BundleProduct"/> - <argument name="thumbnail" defaultValue="ProductPlaceholderImage"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ViewBundleProductInAdminGridActionGroup` instead --> - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <waitForPageLoad stepKey="waitForPageLoadInitial"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> - <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionProductType"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeProductNameInGrid"/> - <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 672465ad4120b..0000000000000 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,853 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="CreateConfigurableProductWithAttributeSet"> - <annotations> - <description>Admin edit created product as configurable. Choose created options</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - <argument name="category" defaultValue="_defaultCategory"/> - <argument name="label" type="string" defaultValue="mySet"/> - <argument name="option" type="string" defaultValue="['option1', 'option2', 'option3', 'option4']"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurableProductWithAttributeSetActionGroup` instead --> - <click selector="{{AdminProductFormSection.attributeSet}}" stepKey="startEditAttrSet"/> - <fillField selector="{{AdminProductFormSection.attributeSetFilter}}" userInput="{{label}}" stepKey="searchForAttrSet"/> - <click selector="{{AdminProductFormSection.attributeSetFilterResult}}" stepKey="selectAttrSet"/> - <fillField userInput="{{product.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> - <selectOption selector="{{AdminProductFormSection.additionalOptions}}" parameterArray="{{option}}" stepKey="searchAndMultiSelectCreatedOption"/> - </actionGroup> - - <actionGroup name="AdminCreateConfigurationsForAttribute" extends="generateConfigurationsByAttributeCode"> - <annotations> - <description>EXTENDS: generateConfigurationsByAttributeCode. Click to apply single price to all Skus. Enter Attribute price</description> - </annotations> - <arguments> - <argument name="price" type="string" defaultValue="100"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateConfigurationsForAttributeActionGroup` instead --> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="clickOnNextButton2" stepKey="waitForNextPageOpened2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="waitForNextPageOpened2" stepKey="clickOnApplySinglePriceToAllSkus"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="{{price}}" before="clickOnApplySingleQuantityToEachSku" stepKey="enterAttributePrice"/> - </actionGroup> - - <actionGroup name="AdminCreateConfigurableProductWithAttributeUncheckOption" extends="generateConfigurationsByAttributeCode"> - <annotations> - <description>EXTENDS: generateConfigurationsByAttributeCode. Click to uncheck created option. Enter Attribute price</description> - </annotations> - <arguments> - <argument name="attributeOption" type="string" defaultValue="option1"/> - <argument name="price" type="string" defaultValue="100"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateConfigurableProductWithAttributeUncheckOptionActionGroup` instead --> - <click selector="{{AdminCreateProductConfigurationsPanel.attributeOption('attributeOption')}}" after="clickOnSelectAll" stepKey="clickToUncheckOption"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" after="clickToUncheckOption" stepKey="clickOnNextButton22"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="clickOnNextButton22" stepKey="waitForNextPageOpened2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" after="waitForNextPageOpened2" stepKey="clickOnApplySinglePriceToAllSkus"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="{{price}}" before="clickOnApplySingleQuantityToEachSku" stepKey="enterAttributePrice"/> - </actionGroup> - - <actionGroup name="viewConfigurableProductInAdminGrid"> - <annotations> - <description>Goes to the Admin Product grid page. Validates the provided Configurable Product is present and correct in the grid.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ViewConfigurableProductInAdminGridActionGroup` instead --> - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <waitForPageLoad stepKey="waitForPageLoadInitial"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <seeNumberOfElements selector="{{AdminProductGridSection.productGridRows}}" userInput="3" stepKey="seeCorrectNumberOfProducts"/> - - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFiltersSimple"/> - <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="simple" stepKey="selectionProductType"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersWithSimpleType"/> - <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeSimpleProductNameInGrid"/> - <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.price}}" stepKey="seeSimpleProductPriceInGrid"/> - - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFiltersConfigurable"/> - <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionConfigurableProductType"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersWithConfigurableType"/> - <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeConfigurableProductNameInGrid"/> - <dontSee selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.price}}" stepKey="dontSeeProductPriceNameInGrid"/> - - <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> - </actionGroup> - - <actionGroup name="createConfigurableProduct"> - <annotations> - <description>Goes to the Admin Product grid page. Creates a Configurable Product using the default Product Options.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - <argument name="category" defaultValue="_defaultCategory"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurableProductActionGroup` instead --> - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/> - <waitForPageLoad time="30" stepKey="wait1"/> - <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickOnAddProductToggle"/> - <click selector="{{AdminProductGridActionSection.addConfigurableProduct}}" stepKey="clickOnAddConfigurableProduct"/> - <fillField userInput="{{product.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/> - <fillField userInput="{{product.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/> - <fillField userInput="{{product.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/> - <fillField userInput="{{product.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/> - <searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="fillCategory"/> - <selectOption userInput="{{product.visibility}}" selector="{{AdminProductFormSection.visibility}}" stepKey="fillVisibility"/> - <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> - <fillField userInput="{{product.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/> - - <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurations"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickOnNewAttribute"/> - <waitForPageLoad stepKey="waitForIFrame"/> - <switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/> - <fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{colorProductAttribute.default_label}}" stepKey="fillDefaultLabel"/> - <click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/> - <waitForPageLoad stepKey="waitForSaveAttribute"/> - <switchToIFrame stepKey="switchOutOfIFrame"/> - <waitForPageLoad stepKey="waitForFilters"/> - <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> - <fillField userInput="{{colorProductAttribute.default_label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue1"/> - <fillField userInput="{{colorProductAttribute1.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute1"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute1"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue2"/> - <fillField userInput="{{colorProductAttribute2.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue3"/> - <fillField userInput="{{colorProductAttribute3.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute3"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute3"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applyUniquePricesByAttributeToEachSku}}" stepKey="clickOnApplyUniquePricesByAttributeToEachSku"/> - <selectOption selector="{{AdminCreateProductConfigurationsPanel.selectAttribute}}" userInput="{{colorProductAttribute.default_label}}" stepKey="selectAttributes"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute1}}" userInput="{{colorProductAttribute1.price}}" stepKey="fillAttributePrice1"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute2}}" userInput="{{colorProductAttribute2.price}}" stepKey="fillAttributePrice2"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.attribute3}}" userInput="{{colorProductAttribute3.price}}" stepKey="fillAttributePrice3"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="1" stepKey="enterAttributeQuantity"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> - <seeInTitle userInput="{{product.name}}" stepKey="seeProductNameInTitle"/> - </actionGroup> - - <actionGroup name="createConfigurableProductWithTwoAttributes" extends="createConfigurableProduct"> - <annotations> - <description>Goes to the Admin Product grid page. Creates a Configurable Product with 2 product attributes.</description> - </annotations> - <arguments> - <argument name="attribute1" defaultValue="ProductColorAttribute"/> - <argument name="attribute2" defaultValue="ProductSizeAttribute"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurableProductWithTwoAttributesActionGroup` instead --> - <remove keyForRemoval="clickOnNewAttribute"/> - <remove keyForRemoval="waitForIFrame"/> - <remove keyForRemoval="switchToNewAttributeIFrame"/> - <remove keyForRemoval="fillDefaultLabel"/> - <remove keyForRemoval="clickOnNewAttributePanel"/> - <remove keyForRemoval="waitForSaveAttribute"/> - <remove keyForRemoval="switchOutOfIFrame"/> - <remove keyForRemoval="waitForFilters"/> - <remove keyForRemoval="clickOnFilters"/> - <remove keyForRemoval="fillFilterAttributeCodeField"/> - <remove keyForRemoval="clickApplyFiltersButton"/> - <remove keyForRemoval="clickOnFirstCheckbox"/> - <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attribute1.attribute_code)}}" stepKey="selectAttribute1" after="clickOnCreateConfigurations"/> - <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attribute2.attribute_code)}}" stepKey="selectAttribute2" after="selectAttribute1"/> - <remove keyForRemoval="waitCreateNewValueAppears"/> - <remove keyForRemoval="clickOnCreateNewValue1"/> - <remove keyForRemoval="fillFieldForNewAttribute1"/> - <remove keyForRemoval="clickOnSaveNewAttribute1"/> - <remove keyForRemoval="clickOnCreateNewValue2"/> - <remove keyForRemoval="fillFieldForNewAttribute2"/> - <remove keyForRemoval="clickOnSaveNewAttribute2"/> - <remove keyForRemoval="clickOnCreateNewValue3"/> - <remove keyForRemoval="fillFieldForNewAttribute3"/> - <remove keyForRemoval="clickOnSaveNewAttribute3"/> - <remove keyForRemoval="clickOnSelectAll"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attribute1.frontend_label)}}" stepKey="selectAllOptionsOfAttribute1" before="clickOnNextButton2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attribute2.frontend_label)}}" stepKey="selectAllOptionsOfAttribute2" before="clickOnNextButton2"/> - <remove keyForRemoval="applyUniquePricesByAttributeToEachSku"/> - <remove keyForRemoval="clickOnApplyUniquePricesByAttributeToEachSku"/> - <remove keyForRemoval="selectAttributes"/> - <remove keyForRemoval="fillAttributePrice1"/> - <remove keyForRemoval="fillAttributePrice2"/> - <remove keyForRemoval="fillAttributePrice3"/> - <remove keyForRemoval="clickOnSaveButton2"/> - <remove keyForRemoval="clickOnConfirmInPopup"/> - <remove keyForRemoval="seeSaveProductMessage"/> - <remove keyForRemoval="seeProductNameInTitle"/> - </actionGroup> - - <actionGroup name="saveConfigurableProduct"> - <annotations> - <description>Save configurable product</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveConfigurableProductActionGroup` instead --> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> - <seeInTitle userInput="{{product.name}}" stepKey="seeProductNameInTitle"/> - </actionGroup> - - <actionGroup name="generateConfigurationsByAttributeCode"> - <annotations> - <description>Generates the Product Configurations for the provided Attribute Code on the Configurable Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="attributeCode" type="string" defaultValue="SomeString"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GenerateConfigurationsByAttributeCodeActionGroup` instead --> - <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickCreateConfigurations"/> - <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickFilters"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" userInput="{{attributeCode}}" stepKey="fillFilterAttributeCodeField"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="99" stepKey="enterAttributeQuantity"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/> - </actionGroup> - - <actionGroup name="createOptionsForAttribute"> - <arguments> - <argument name="attributeName" type="string" defaultValue="{{productAttributeColor.default_label}}"/> - <argument name="firstOptionName" type="string" defaultValue="option1"/> - <argument name="secondOptionName" type="string" defaultValue="option2"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateOptionsForAttributeActionGroup` instead --> - <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> - <fillField userInput="{{attributeName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateFirstNewValue"/> - <fillField userInput="{{firstOptionName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateSecondNewValue"/> - <fillField userInput="{{secondOptionName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveAttribute"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> - </actionGroup> - - <actionGroup name="createConfigurationsForAttribute" extends="generateConfigurationsByAttributeCode"> - <annotations> - <description>EXTENDS: generateConfigurationsByAttributeCode. Clicks on the Save button. Clicks on the Confirm button.</description> - </annotations> - <arguments> - <argument name="attributeCode" type="string" defaultValue="SomeString"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurationsForAttributeActionGroup` instead --> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> - </actionGroup> - - <actionGroup name="createConfigurationsForAttributeWithImages" extends="generateConfigurationsByAttributeCode"> - <annotations> - <description>EXTENDS: generateConfigurationsByAttributeCode. Adds the provided Attribute Image to the provided Attribute Code.</description> - </annotations> - <arguments> - <argument name="attributeCode" type="string" defaultValue="SomeString"/> - <argument name="image" defaultValue="ProductImage"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurationsForAttributeWithImagesActionGroup` instead --> - <click selector="{{AdminCreateProductConfigurationsPanel.applySingleSetOfImages}}" stepKey="clickOnApplySingleImageSetToAllSku" after="enterAttributeQuantity"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageUploadButton}}" stepKey="seeImageSectionIsReady" after="clickOnApplySingleImageSetToAllSku"/> - <attachFile selector="{{AdminCreateProductConfigurationsPanel.imageFileUpload}}" userInput="{{image.file}}" stepKey="uploadFile" after="seeImageSectionIsReady"/> - <waitForElementNotVisible selector="{{AdminCreateProductConfigurationsPanel.uploadProgressBar}}" stepKey="waitForUpload" after="uploadFile"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageFile(image.fileName)}}" stepKey="waitForThumbnail" after="waitForUpload"/> - - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2" after="clickOnNextButton4"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup" after="clickOnSaveButton2"/> - </actionGroup> - - <actionGroup name="createConfigurationsForTwoAttribute" extends="generateConfigurationsByAttributeCode"> - <annotations> - <description>EXTENDS: generateConfigurationsByAttributeCode. Generates the Product Configurations for the 2 provided Attribute Codes on the Configurable Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="secondAttributeCode" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateConfigurationsForTwoAttributeActionGroup` instead --> - <remove keyForRemoval="clickOnSelectAll"/> - <remove keyForRemoval="clickFilters"/> - <remove keyForRemoval="fillFilterAttributeCodeField"/> - <remove keyForRemoval="clickApplyFiltersButton"/> - <remove keyForRemoval="clickOnFirstCheckbox"/> - - <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(attributeCode)}}" stepKey="clickOnFirstAttributeCheckbox" after="clickCreateConfigurations"/> - <click selector="{{AdminCreateProductConfigurationsPanel.attributeCheckbox(secondAttributeCode)}}" stepKey="clickOnSecondAttributeCheckbox" after="clickOnFirstAttributeCheckbox"/> - <grabTextFrom selector="{{AdminCreateProductConfigurationsPanel.defaultLabel(attributeCode)}}" stepKey="grabFirstAttributeDefaultLabel" after="clickOnSecondAttributeCheckbox"/> - <grabTextFrom selector="{{AdminCreateProductConfigurationsPanel.defaultLabel(secondAttributeCode)}}" stepKey="grabSecondAttributeDefaultLabel" after="grabFirstAttributeDefaultLabel"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute({$grabFirstAttributeDefaultLabel})}}" stepKey="clickOnSelectAllForFirstAttribute" after="clickOnNextButton1"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute({$grabSecondAttributeDefaultLabel})}}" stepKey="clickOnSelectAllForSecondAttribute" after="clickOnSelectAllForFirstAttribute"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> - </actionGroup> - - <actionGroup name="saveConfiguredProduct"> - <annotations> - <description>Save the Configurable Product on the Configurable Product creation/edit page. Validates that the Success Message is present.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveConfiguredProductActionGroup` instead --> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/> - </actionGroup> - - <actionGroup name="GenerateAndSaveConfiguredProductAfterSettingOptions" extends="saveConfiguredProduct"> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GenerateAndSaveConfiguredProductAfterSettingOptionsActionGroup` instead --> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" before="clickOnSaveButton2" stepKey="clickOnNextButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" after="clickOnNextButton" stepKey="clickOnGenerateProductsButton"/> - </actionGroup> - - <actionGroup name="addNewProductConfigurationAttribute"> - <annotations> - <description>Generates the Product Configurations for the 2 provided Attribute Names on the Configurable Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="attribute" type="entity"/> - <argument name="firstOption" type="entity"/> - <argument name="secondOption" type="entity"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddNewProductConfigurationAttributeActionGroup` instead --> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickOnNewAttribute"/> - <waitForPageLoad stepKey="waitForIFrame"/> - <switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/> - <fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{attribute.default_label}}" stepKey="fillDefaultLabel"/> - <click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/> - <waitForPageLoad stepKey="waitForSaveAttribute"/> - <switchToIFrame stepKey="switchOutOfIFrame"/> - <waitForPageLoad stepKey="waitForFilters"/> - - <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/> - <fillField userInput="{{attribute.default_label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> - <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateFirstNewValue"/> - <fillField userInput="{{firstOption.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute"/> - <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateSecondNewValue"/> - <fillField userInput="{{secondOption.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> - <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveAttribute"/> - <click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnSecondNextButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnThirdNextButton"/> - <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnFourthNextButton"/> - </actionGroup> - - <actionGroup name="selectCreatedAttributeAndCreateTwoOptions" extends="addNewProductConfigurationAttribute"> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SelectCreatedAttributeAndCreateTwoOptionsActionGroup` instead --> - <remove keyForRemoval="clickOnNewAttribute"/> - <remove keyForRemoval="waitForIFrame"/> - <remove keyForRemoval="switchToNewAttributeIFrame"/> - <remove keyForRemoval="fillDefaultLabel"/> - <remove keyForRemoval="clickOnNewAttributePanel"/> - <remove keyForRemoval="waitForSaveAttribute"/> - <remove keyForRemoval="switchOutOfIFrame"/> - <remove keyForRemoval="waitForFilters"/> - <fillField userInput="{{attribute.attribute_code}}" selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" stepKey="fillFilterAttributeCodeField"/> - <fillField userInput="{{firstOption.label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> - <fillField userInput="{{secondOption.label}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewSecondOption"/> - <remove keyForRemoval="clickOnSelectAll"/> - <remove keyForRemoval="clickOnSecondNextButton"/> - <remove keyForRemoval="clickOnThirdNextButton"/> - <remove keyForRemoval="clickOnFourthNextButton"/> - </actionGroup> - - <actionGroup name="changeProductConfigurationsInGrid"> - <annotations> - <description>Edit the Product Configuration via the Admin Product grid page.</description> - </annotations> - <arguments> - <argument name="firstOption" type="entity"/> - <argument name="secondOption" type="entity"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeProductConfigurationsInGridActionGroup` instead --> - <fillField userInput="{{firstOption.name}}" selector="{{AdminProductFormConfigurationsSection.confProductNameCell(firstOption.name)}}" stepKey="fillFieldNameForFirstAttributeOption"/> - <fillField userInput="{{secondOption.name}}" selector="{{AdminProductFormConfigurationsSection.confProductNameCell(secondOption.name)}}" stepKey="fillFieldNameForSecondAttributeOption"/> - <fillField userInput="{{firstOption.sku}}" selector="{{AdminProductFormConfigurationsSection.confProductSkuCell(firstOption.name)}}" stepKey="fillFieldSkuForFirstAttributeOption"/> - <fillField userInput="{{secondOption.sku}}" selector="{{AdminProductFormConfigurationsSection.confProductSkuCell(secondOption.name)}}" stepKey="fillFieldSkuForSecondAttributeOption"/> - <fillField userInput="{{firstOption.price}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(firstOption.name)}}" stepKey="fillFieldPriceForFirstAttributeOption"/> - <fillField userInput="{{secondOption.price}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(secondOption.name)}}" stepKey="fillFieldPriceForSecondAttributeOption"/> - <fillField userInput="{{firstOption.quantity}}" selector="{{AdminProductFormConfigurationsSection.confProductQuantityCell(firstOption.name)}}" stepKey="fillFieldQuantityForFirstAttributeOption"/> - <fillField userInput="{{secondOption.quantity}}" selector="{{AdminProductFormConfigurationsSection.confProductQuantityCell(secondOption.name)}}" stepKey="fillFieldQuantityForSecondAttributeOption"/> - <fillField userInput="{{firstOption.weight}}" selector="{{AdminProductFormConfigurationsSection.confProductWeightCell(firstOption.name)}}" stepKey="fillFieldWeightForFirstAttributeOption"/> - <fillField userInput="{{secondOption.weight}}" selector="{{AdminProductFormConfigurationsSection.confProductWeightCell(secondOption.name)}}" stepKey="fillFieldWeightForSecondAttributeOption"/> - </actionGroup> - - <actionGroup name="changeConfigurableProductChildProductPrice"> - <annotations> - <description>Change the price of a configurable child product in the grid under configurations.</description> - </annotations> - <arguments> - <argument name="productAttributes" type="string"/> - <argument name="productPrice" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeConfigurableProductChildProductPriceActionGroup` instead --> - <fillField userInput="{{productPrice}}" selector="{{AdminProductFormConfigurationsSection.confProductPriceCell(productAttributes)}}" stepKey="fillPriceForConfigurableProductAttributeOption"/> - </actionGroup> - - <actionGroup name="changeProductConfigurationsInGridExceptSku" extends="changeProductConfigurationsInGrid"> - <annotations> - <description>EXTENDS: changeProductConfigurationsInGrid. Removes 'fillFieldSkuForFirstAttributeOption' and 'fillFieldSkuForSecondAttributeOption'.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeProductConfigurationsInGridExceptSkuActionGroup` instead --> - <remove keyForRemoval="fillFieldSkuForFirstAttributeOption"/> - <remove keyForRemoval="fillFieldSkuForSecondAttributeOption"/> - </actionGroup> - - <actionGroup name="addProductToConfigurationsGrid"> - <annotations> - <description>Adds the provided Product SKU to the provided Product Name.</description> - </annotations> - <arguments> - <argument name="sku" type="string"/> - <argument name="name" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddProductToConfigurationsGridActionGroup` instead --> - <click selector="{{AdminProductFormConfigurationsSection.actionsBtnByProductName(name)}}" stepKey="clickToExpandFirstActions"/> - <click selector="{{AdminProductFormConfigurationsSection.addProduct(name)}}" stepKey="clickChooseFirstDifferentProduct"/> - <switchToIFrame stepKey="switchOutOfIFrame"/> - <waitForPageLoad stepKey="waitForFilters"/> - <click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickFilters"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <click selector="{{AdminProductGridFilterSection.firstRowBySku(sku)}}" stepKey="clickOnFirstRow"/> - </actionGroup> - - <actionGroup name="addUniqueImageToConfigurableProductOption"> - <annotations> - <description>Adds the provided Image to a Configurable Product on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="image" defaultValue="ProductImage"/> - <argument name="frontend_label" type="string"/> - <argument name="label" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddUniqueImageToConfigurableProductOptionActionGroup` instead --> - <click selector="{{AdminCreateProductConfigurationsPanel.applyUniqueImagesToEachSkus}}" stepKey="clickOnApplyUniqueImagesToEachSku"/> - <selectOption userInput="{{frontend_label}}" selector="{{AdminCreateProductConfigurationsPanel.selectImagesButton}}" stepKey="selectOption"/> - <attachFile selector="{{AdminCreateProductConfigurationsPanel.uploadImagesButton(label)}}" userInput="{{image.file}}" stepKey="uploadFile"/> - <waitForElementNotVisible selector="{{AdminCreateProductConfigurationsPanel.uploadProgressBar}}" stepKey="waitForUpload"/> - <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.imageFile(image.fileName)}}" stepKey="waitForThumbnail"/> - </actionGroup> - - <actionGroup name="addUniquePriceToConfigurableProductOption"> - <annotations> - <description>On the 'Step 3: Bulk Images, Price and Quantity' page of the 'Create Product Configurations' model click on 'Apply unique prices...'. Select provided Option. Fill price.</description> - </annotations> - <arguments> - <argument name="frontend_label" type="string"/> - <argument name="label" type="string"/> - <argument name="price" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddUniquePriceToConfigurableProductOptionActionGroup` instead --> - <click selector="{{AdminCreateProductConfigurationsPanel.applyUniquePricesToEachSkus}}" stepKey="clickOnApplyUniquePricesToEachSku"/> - <selectOption userInput="{{frontend_label}}" selector="{{AdminCreateProductConfigurationsPanel.selectPriceButton}}" stepKey="selectOption"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.price(label)}}" userInput="{{price}}" stepKey="enterAttributeQuantity"/> - </actionGroup> - - <actionGroup name="addUniqueQuantityToConfigurableProductOption"> - <arguments> - <argument name="frontend_label" type="string" defaultValue="{{productAttributeColor.default_label}}"/> - <argument name="label" type="string" defaultValue="option1"/> - <argument name="quantity" type="string" defaultValue="10"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddUniqueQuantityToConfigurableProductOptionActionGroup` instead --> - <click selector="{{AdminCreateProductConfigurationsPanel.applyUniqueQuantityToEachSkus}}" stepKey="clickOnApplyUniqueQuantitiesToEachSku"/> - <selectOption selector="{{AdminCreateProductConfigurationsPanel.selectQuantity}}" userInput="{{frontend_label}}" stepKey="selectOption"/> - <fillField selector="{{AdminCreateProductConfigurationsPanel.applyUniqueQuantity(label)}}" userInput="{{quantity}}" stepKey="enterAttributeQuantity"/> - </actionGroup> - - <actionGroup name="saveConfigurableProductWithNewAttributeSet"> - <annotations> - <description>Clicks on 'Save'. Clicks radio for '...new Attribute Set...' in the 'Choose Affected Attribute Set' modal. Clicks on 'Confirm' in the model on the Configurable Product creation/edit page.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveConfigurableProductWithNewAttributeSetActionGroup` instead --> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveConfigurableProduct"/> - <waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" time="30" stepKey="waitForAttributeSetConfirmation"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.addNewAttrSet}}" stepKey="clickAddNewAttributeSet"/> - <fillField selector="{{AdminChooseAffectedAttributeSetPopup.createNewAttrSetName}}" userInput="{{ProductAttributeFrontendLabel.label}}" stepKey="fillFieldNewAttrSetName"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickConfirmAttributeSet"/> - <see selector="You saved the product" stepKey="seeConfigurableSaveConfirmation" after="clickConfirmAttributeSet"/> - </actionGroup> - - <actionGroup name="saveConfigurableProductAddToCurrentAttributeSet"> - <annotations> - <description>Clicks on 'Save'. Clicks on 'Confirm' in the 'Choose Affected Attribute Set' model on the Configurable Product creation/edit page.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveConfigurableProductAddToCurrentAttributeSetActionGroup` instead --> - <waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveBtnVisible"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProductAgain"/> - <waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="waitPopUpVisible"/> - <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmPopup"/> - <seeElement selector="{{AdminMessagesSection.success}}" stepKey="seeSaveProductMessage"/> - </actionGroup> - - <actionGroup name="assertConfigurableProductOnAdminProductPage"> - <annotations> - <description>Validates that the provided Configurable Product Name, SKU and Price are present and correct on the Configurable Product creation/edit page. PLEASE NOTE: The Product Data is Hardcoded.</description> - </annotations> - <arguments> - <argument name="product" type="entity"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertConfigurableProductOnAdminProductPageActionGroup` instead --> - <seeInField userInput="{{ApiConfigurableProduct.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="seeNameRequired"/> - <seeInField userInput="{{ApiConfigurableProduct.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="seeSkuRequired"/> - <dontSeeInField userInput="{{ApiConfigurableProduct.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="dontSeePriceRequired"/> - </actionGroup> - - <actionGroup name="StartCreateConfigurationsForAttribute" extends="generateConfigurationsByAttributeCode"> - <remove keyForRemoval="clickOnNextButton3"/> - <remove keyForRemoval="clickOnNextButton4"/> - </actionGroup> - - <actionGroup name="GotoCatalogProductsPage"> - <annotations> - <description>Goes to the Admin Products grid via the Admin Side Menu.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GotoCatalogProductsPageActionGroup` instead --> - <click stepKey="clickOnCatalogItem" selector="{{CatalogProductsSection.catalogItem}}"/> - <waitForPageLoad stepKey="waitForCatalogLoad"/> - <click stepKey="clickOnProductItem" selector="{{CatalogProductsSection.productItem}}"/> - <waitForPageLoad stepKey="waitForCatalogProductPageLoad"/> - <seeInCurrentUrl stepKey="assertWeAreOnTheCatalogProductPage" url="{{assertionData.catalogProduct}}"/> - </actionGroup> - - <actionGroup name="GotoConfigurableProductPage"> - <annotations> - <description>Clicks on create Configurable Product from the Admin Products grid page.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GotoConfigurableProductPageActionGroup` instead --> - <click stepKey="clickOnAddProductItem" selector="{{ConfigurableProductSection.addProductItem}}"/> - <click stepKey="clickOnConfigurationProductItem" selector="{{ConfigurableProductSection.configProductItem}}"/> - <waitForPageLoad stepKey="waitForConfigurableProductPageLoad"/> - <seeInCurrentUrl stepKey="assertWeAreOnTheConfigurableProductPage" url="{{assertionData.configurableProduct}}"/> - </actionGroup> - - <actionGroup name="FillAllRequiredFields"> - <annotations> - <description>Fills the Product Name, Price and Weight fields. Clicks on 'Create Configurations'. Clicks on 'Create New Attribute'.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillAllRequiredFieldsActionGroup` instead --> - <fillField stepKey="fillInProductNameFields" selector="{{NewProduct.productName}}" userInput="{{NewProductsData.productName}}"/> - <fillField stepKey="fillInPriceFields" selector="{{NewProduct.price}}" userInput="{{NewProductsData.price}}"/> - <fillField stepKey="fillInWeightFields" selector="{{NewProduct.weight}}" userInput="{{NewProductsData.weight}}"/> - <click stepKey="clickOnCreateConfigurationsButton" selector="{{NewProduct.createConfigurationButton}}"/> - <waitForPageLoad stepKey="waitForCreateProductConfigurationsPageLoad"/> - <click stepKey="clickOnCreateNewAttributeButton" selector="{{NewProduct.createNewAttributeButton}}"/> - <waitForPageLoad stepKey="waitForNewAttributePageLoad"/> - </actionGroup> - - <actionGroup name="CreateNewAttribute"> - <annotations> - <description>Creates a new Product Attribute via the Admin Products creation/edit page. PLEASE NOTE: The Product Attributes are Hardcoded.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateNewAttributeActionGroup` instead --> - <switchToIFrame stepKey="NewAttributePage" selector="{{NewProduct.newAttributeIFrame}}"/> - <fillField stepKey="fillInDefaultLabelField" selector="{{NewProduct.defaultLabel}}" userInput="{{NewProductsData.defaultLabel}}"/> - - <!--Add option 1 to attribute--> - <click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption1"/> - <waitForPageLoad stepKey="waitForOption1"/> - <fillField stepKey="fillInAdminFieldRed" selector="{{NewProduct.adminFieldRed}}" userInput="{{NewProductsData.adminFieldRed}}"/> - <fillField stepKey="fillInDefaultStoreViewFieldRed" selector="{{NewProduct.defaultStoreViewFieldRed}}" userInput="{{NewProductsData.defaultStoreViewFieldRed}}"/> - - <!--Add option 2 to attribute--> - <click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption2"/> - <waitForPageLoad stepKey="waitForOption2"/> - <fillField stepKey="fillInAdminFieldBlue" selector="{{NewProduct.adminFieldBlue}}" userInput="{{NewProductsData.adminFieldBlue}}"/> - <fillField stepKey="fillInDefaultStoreViewFieldBlue" selector="{{NewProduct.defaultStoreViewFieldBlue}}" userInput="{{NewProductsData.defaultStoreViewFieldBlue}}"/> - - <!--Add option 3 to attribute--> - <click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption3"/> - <waitForPageLoad stepKey="waitForOption3"/> - <fillField stepKey="fillInAdminFieldYellow" selector="{{NewProduct.adminFieldYellow}}" userInput="{{NewProductsData.adminFieldYellow}}"/> - <fillField stepKey="fillInDefaultStoreViewFieldYellow" selector="{{NewProduct.defaultStoreViewFieldYellow}}" userInput="{{NewProductsData.defaultStoreViewFieldYellow}}"/> - - <!--Add option 4 to attribute--> - <click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption4"/> - <waitForPageLoad stepKey="waitForOption4"/> - <fillField stepKey="fillInAdminFieldGreen" selector="{{NewProduct.adminFieldGreen}}" userInput="{{NewProductsData.adminFieldGreen}}"/> - <fillField stepKey="fillInDefaultStoreViewFieldGreen" selector="{{NewProduct.defaultStoreViewFieldGreen}}" userInput="{{NewProductsData.defaultStoreViewFieldGreen}}"/> - - <!--Add option 5 to attribute--> - <click selector="{{NewProduct.addOptionButton}}" stepKey="clickAddOption5"/> - <waitForPageLoad stepKey="waitForOption5"/> - <fillField stepKey="fillInAdminFieldBlack" selector="{{NewProduct.adminFieldBlack}}" userInput="{{NewProductsData.adminFieldBlack}}"/> - <fillField stepKey="fillInDefaultStoreViewFieldBlack" selector="{{NewProduct.defaultStoreViewFieldBlack}}" userInput="{{NewProductsData.defaultStoreViewFieldBlack}}"/> - - <!--Click Save Attribute button--> - <click selector="{{NewProduct.saveAttributeButton}}" stepKey="clickSaveAttributeButton"/> - <waitForPageLoad stepKey="waitForSavingSettings"/> - - <!--Select created Attribute --> - <click selector="{{ConfigurableProductSection.selectCreatedAttribute}}" stepKey="selectCreatedAttribute"/> - - <!--Click Next button--> - <click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton"/> - <waitForPageLoad stepKey="waitForNextPageLoaded"/> - - <!--Select all the options of all the attributes button--> - <click selector="{{CreateProductConfigurations.checkboxRed}}" stepKey="selectCheckboxRed"/> - <click selector="{{CreateProductConfigurations.checkboxBlue}}" stepKey="selectCheckboxBlue"/> - <click selector="{{CreateProductConfigurations.checkboxYellow}}" stepKey="selectCheckboxYellow"/> - <click selector="{{CreateProductConfigurations.checkboxGreen}}" stepKey="selectCheckboxGreen"/> - <click selector="{{CreateProductConfigurations.checkboxBlack}}" stepKey="selectCheckboxBlack"/> - - <!--Click Next button--> - <click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton2"/> - <waitForPageLoad stepKey="waitForBulkImagesPricePageLoaded"/> - - <!--Click Next button--> - <click selector="{{ConfigurableProductSection.nextButton}}" stepKey="clickNextButton3"/> - <waitForPageLoad stepKey="waitForSummaryPageLoaded"/> - - <!--Click Generate Configure button--> - <click selector="{{ConfigurableProductSection.generateConfigure}}" stepKey="generateConfigure"/> - <waitForPageLoad stepKey="waitForGenerateConfigure"/> - - <!-- This Error message shouldn't appear: Test will pass when bug will be fixed--> - <dontSee selector="{{CreateProductConfigurations.errorMessage}}" userInput="{{assertionData.errorMessage}}" stepKey="dontSeeError"/> - - <!--Close frame--> - <conditionalClick selector="{{ConfigurableProductSection.closeFrame}}" dependentSelector="{{ConfigurableProductSection.closeFrame}}" visible="1" stepKey="closeFrame"/> - <waitForPageLoad stepKey="waitForClosingFrame"/> - </actionGroup> - - <actionGroup name="DeleteCreatedAttribute"> - <annotations> - <description>Deletes the Configurable Product Attribute.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DeleteCreatedAttributeActionGroup` instead --> - <click stepKey="clickOnStoresItem" selector="{{CatalogProductsSection.storesItem}}"/> - <waitForPageLoad stepKey="waitForNavigationPanel"/> - - <!--Click on Products item--> - <waitForElementVisible selector="{{CatalogProductsSection.storesProductItem}}" stepKey="waitForCatalogLoad"/> - <click stepKey="clickOnStoresProductItem" selector="{{CatalogProductsSection.storesProductItem}}"/> - <waitForPageLoad stepKey="waitForStoresProductPageLoad"/> - - <!--Click on created Attribute --> - <fillField stepKey="searchProductDefaultLabel" selector="{{CatalogProductsSection.searchDefaultLabelField}}" userInput="{{NewProductsData.defaultLabel}}"/> - <click stepKey="clickSearchButton" selector="{{CatalogProductsSection.searchButton}}"/> - <waitForPageLoad stepKey="waitForCreatedAttributeLoad"/> - <click stepKey="clickOnCreatedAttributeItem" selector="{{CatalogProductsSection.createdAttributeItem}}"/> - <waitForPageLoad stepKey="waitForAttributePropertiesPageLoad"/> - - <!--Click on Delete Attribute item--> - <click stepKey="clickOnDeleteAttributeItem" selector="{{CatalogProductsSection.deleteAttributeItem}}"/> - <waitForPageLoad stepKey="waitForDeletedDialogOpened"/> - - <!--Click on OK button--> - <click stepKey="clickOnOKButton" selector="{{CatalogProductsSection.okButton}}"/> - <waitForPageLoad stepKey="waitFordAttributeDeleted"/> - <see userInput="You deleted the product attribute." stepKey="seeDeletedTheProductAttributeMessage"/> - - <!-- Click Reset Filter button--> - <click stepKey="clickResetFilterButton" selector="{{CatalogProductsSection.resetFilter}}"/> - <waitForPageLoad stepKey="waitForAllFilterReset"/> - </actionGroup> - - <actionGroup name="StorefrontCheckCategoryConfigurableProduct"> - <annotations> - <description>Validates that the provided Configurable Product is present and correct on a Category page.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="optionProduct"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCheckCategoryConfigurableProductActionGroup` instead --> - <seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName(product.name)}}" stepKey="assertProductName"/> - <see userInput="${{optionProduct.price}}.00" selector="{{StorefrontCategoryProductSection.ProductPriceByName(product.name)}}" stepKey="AssertProductPrice"/> - <!-- @TODO: MAGETWO-80272 Move to Magento_Checkout --> - <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> - <!-- @TODO: MAGETWO-80272 Move to Magento_Checkout --> - <seeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="AssertAddToCart"/> - </actionGroup> - - <actionGroup name="StorefrontCheckCategoryOutOfStockConfigurableProduct"> - <annotations> - <description>Validates that the provided Configurable Product is present and correct on a Category page.</description> - </annotations> - <arguments> - <argument name="product" type="entity"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCheckCategoryOutOfStockConfigurableProductActionGroup` instead --> - <seeElement selector="{{StorefrontCategoryProductSection.ProductTitleByName(product.name)}}" stepKey="assertProductName"/> - <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName(product.name)}}" stepKey="moveMouseOverProduct"/> - <seeElement selector="{{StorefrontCategoryProductSection.ProductStockUnavailable}}" stepKey="AssertOutOfStock"/> - <dontSeeElement selector="{{StorefrontCategoryProductSection.ProductAddToCartByName(product.name)}}" stepKey="AssertAddToCart"/> - </actionGroup> - - <actionGroup name="StorefrontCheckConfigurableProduct"> - <annotations> - <description>Goes to the provided Storefront Product page. Validates that the Product details are present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="optionProduct"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCheckConfigurableProductActionGroup` instead --> - <seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkUrl"/> - <seeInTitle userInput="{{product.name}}" stepKey="AssertProductNameInTitle"/> - <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> - <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> - <see userInput="${{optionProduct.price}}.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/> - <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertInStock"/> - <seeElement selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="assertAddToCart"/> - <see userInput="{{product.custom_attributes[description]}}" selector="{{StorefrontProductInfoMainSection.productDescription}}" stepKey="assertProductDescription"/> - <see userInput="{{product.custom_attributes[short_description]}}" selector="{{StorefrontProductInfoMainSection.productShortDescription}}" stepKey="assertProductShortDescription"/> - </actionGroup> - - <actionGroup name="VerifyOptionInProductStorefront"> - <annotations> - <description>Validates that the provided Option Code and Option Name are present and correct on a Configurable Product page.</description> - </annotations> - <arguments> - <argument name="attributeCode" type="string"/> - <argument name="optionName" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyOptionInProductStorefrontActionGroup` instead --> - <seeElement selector="{{StorefrontProductInfoMainSection.attributeOptionByAttributeID(attributeCode, optionName)}}" stepKey="verifyOptionExists"/> - </actionGroup> - - <actionGroup name="SelectSingleAttributeAndAddToCart"> - <annotations> - <description>Selects a Product Option. Clicks 'Add to Cart'. Validates that the Product Added Success message appears.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - <argument name="attributeCode" type="string"/> - <argument name="optionName" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SelectSingleAttributeAndAddToCartActionGroup` instead --> - <selectOption selector="{{StorefrontProductInfoMainSection.attributeSelectByAttributeID(attributeCode)}}" userInput="{{optionName}}" stepKey="selectAttribute"/> - <click stepKey="addProduct" selector="{{StorefrontProductActionSection.addToCart}}"/> - <waitForElementVisible selector="{{StorefrontQuickSearchResultsSection.messageSection}}" time="30" stepKey="waitForProductAdded"/> - <see selector="{{StorefrontQuickSearchResultsSection.messageSection}}" userInput="You added {{productName}} to your shopping cart." stepKey="seeAddedToCartMessage"/> - </actionGroup> - - <actionGroup name="storefrontCheckConfigurableProductOptions"> - <annotations> - <description>Validates that the Options for a Configurable Product are present and correct.</description> - </annotations> - <arguments> - <argument name="product" type="entity"/> - <argument name="firstOption" type="entity"/> - <argument name="secondOption" type="entity"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCheckConfigurableProductOptionsActionGroup` instead --> - <selectOption userInput="{{firstOption.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/> - <see userInput="{{product.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="seeConfigurableProductName"/> - <see userInput="{{firstOption.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPricePresent"/> - <see userInput="{{product.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="seeConfigurableProductSku"/> - <see userInput="IN STOCK" selector="{{StorefrontProductInfoMainSection.productStockStatus}}" stepKey="assertInStock"/> - <see userInput="{{colorProductAttribute.default_label}}" selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" stepKey="seeColorAttributeName"/> - <dontSee userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeProductPriceLabel1"/> - <selectOption userInput="{{secondOption.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption2"/> - <dontSee userInput="As low as" selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeProductPriceLabel2"/> - <see userInput="{{secondOption.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeProductPrice2"/> - </actionGroup> - - <actionGroup name="assertOptionImageInStorefrontProductPage"> - <annotations> - <description>Validates that the provided Product Image is present when the provided Product Option is selected.</description> - </annotations> - <arguments> - <argument name="product" type="entity"/> - <argument name="label" type="string"/> - <argument name="image" defaultValue="MagentoLogo"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertOptionImageInStorefrontProductPageActionGroup` instead --> - <seeInCurrentUrl url="/{{product.urlKey}}.html" stepKey="checkUrl"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <selectOption userInput="{{label}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/> - <seeElement selector="{{StorefrontProductMediaSection.imageFile(image.filename)}}" stepKey="seeFirstImage"/> - </actionGroup> - - <actionGroup name="assertConfigurableProductWithSpecialPriceOnStorefrontProductPage"> - <annotations> - <description>Validates that Special Price for a Configurable Product is present and correct when the provided Product Option is selected.</description> - </annotations> - <arguments> - <argument name="option" type="string"/> - <argument name="price" type="string"/> - <argument name="specialPrice" defaultValue="specialProductPrice"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertConfigurableProductWithSpecialPriceOnStorefrontProductPageActionGroup` instead --> - <selectOption userInput="{{option}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOptionWithSpecialPrice"/> - <see userInput="{{specialProductPrice.price}}" selector="{{StorefrontProductInfoMainSection.productSpecialPrice}}" stepKey="seeSpecialProductPrice"/> - <see userInput="Regular Price" selector="{{StorefrontProductInfoMainSection.specialProductText}}" stepKey="seeText"/> - <see userInput="{{price}}" selector="{{StorefrontProductInfoMainSection.oldProductPrice}}" stepKey="seeOldProductPrice"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 0bb23b04b66a9..0000000000000 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - - <actionGroup name="StorefrontSwitchCurrency"> - <arguments> - <argument name="currency" type="string" defaultValue="EUR"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontSwitchCurrencyActionGroup` instead --> - <click selector="{{StorefrontSwitchCurrencyRatesSection.currencyTrigger}}" stepKey="openTrigger"/> - <waitForElementVisible selector="{{StorefrontSwitchCurrencyRatesSection.currency(currency)}}" stepKey="waitForCurrency"/> - <click selector="{{StorefrontSwitchCurrencyRatesSection.currency(currency)}}" stepKey="chooseCurrency"/> - <see selector="{{StorefrontSwitchCurrencyRatesSection.selectedCurrency}}" userInput="{{currency}}" stepKey="seeSelectedCurrency"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 9d739995e99e6..0000000000000 --- a/app/code/Magento/Downloadable/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,106 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="fillMainDownloadableProductForm"> - <annotations> - <description>Fills the Name, SKU, Price and Quantity on the Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="DownloadableProduct"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillMainDownloadableProductFormActionGroup` instead --> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/> - <fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="fillProductQty"/> - </actionGroup> - - <actionGroup name="addDownloadableProductLinkWithMaxDownloads"> - <annotations> - <description>Clicks on 'Add Link'. Fills in the provided Link details including a Max Downloads limit.</description> - </annotations> - <arguments> - <argument name="link" defaultValue="downloadableLinkWithMaxDownloads"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddDownloadableProductLinkWithMaxDownloadsActionGroup` instead --> - <click selector="{{AdminProductDownloadableSection.linksAddLinkButton}}" stepKey="clickLinkAddLinkButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <fillField userInput="{{link.title}}" selector="{{AdminProductDownloadableSection.addLinkTitleInput('0')}}" stepKey="fillDownloadableLinkTitle"/> - <fillField userInput="{{link.price}}" selector="{{AdminProductDownloadableSection.addLinkPriceInput('0')}}" stepKey="fillDownloadableLinkPrice"/> - <selectOption userInput="{{link.file_type}}" selector="{{AdminProductDownloadableSection.addLinkFileTypeSelector('0')}}" stepKey="selectDownloadableLinkFileType"/> - <selectOption userInput="{{link.sample_type}}" selector="{{AdminProductDownloadableSection.addLinkSampleTypeSelector('0')}}" stepKey="selectDownloadableLinkSampleType"/> - <selectOption userInput="{{link.shareable}}" selector="{{AdminProductDownloadableSection.addLinkShareableSelector('0')}}" stepKey="selectDownloadableLinkShareable"/> - <fillField userInput="{{link.max_downloads}}" selector="{{AdminProductDownloadableSection.addLinkMaxDownloadsInput('0')}}" stepKey="fillDownloadableLinkMaxDownloads"/> - <attachFile userInput="{{link.file}}" selector="{{AdminProductDownloadableSection.addLinkFileUploadFile('0')}}" stepKey="fillDownloadableLinkUploadFile"/> - <fillField userInput="{{link.sample}}" selector="{{AdminProductDownloadableSection.addLinkSampleUrlInput('0')}}" stepKey="fillDownloadableLinkSampleUrl"/> - </actionGroup> - - <actionGroup name="addDownloadableProductLink"> - <annotations> - <description>Clicks on 'Add Link', under the 'Links' section. Fills in the provided Link details including Unlimited Downloads.</description> - </annotations> - <arguments> - <argument name="link" defaultValue="downloadableLink"/> - <argument name="index" type="string" defaultValue="1"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddDownloadableProductLinkActionGroup` instead --> - <click selector="{{AdminProductDownloadableSection.linksAddLinkButton}}" stepKey="clickLinkAddLinkButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <fillField userInput="{{link.title}}" selector="{{AdminProductDownloadableSection.addLinkTitleInput(index)}}" stepKey="fillDownloadableLinkTitle"/> - <fillField userInput="{{link.price}}" selector="{{AdminProductDownloadableSection.addLinkPriceInput(index)}}" stepKey="fillDownloadableLinkPrice"/> - <selectOption userInput="{{link.file_type}}" selector="{{AdminProductDownloadableSection.addLinkFileTypeSelector(index)}}" stepKey="selectDownloadableLinkFileType"/> - <selectOption userInput="{{link.sample_type}}" selector="{{AdminProductDownloadableSection.addLinkSampleTypeSelector(index)}}" stepKey="selectDownloadableLinkSampleType"/> - <selectOption userInput="{{link.shareable}}" selector="{{AdminProductDownloadableSection.addLinkShareableSelector(index)}}" stepKey="selectDownloadableLinkShareable"/> - <checkOption selector="{{AdminProductDownloadableSection.addLinkIsUnlimitedDownloads(index)}}" stepKey="checkDownloadableLinkUnlimited"/> - <fillField userInput="{{link.file}}" selector="{{AdminProductDownloadableSection.addLinkFileUrlInput(index)}}" stepKey="fillDownloadableLinkFileUrl"/> - <attachFile userInput="{{link.sample}}" selector="{{AdminProductDownloadableSection.addLinkSampleUploadFile(index)}}" stepKey="attachDownloadableLinkUploadSample"/> - <waitForPageLoad stepKey="waitForPageLoadAfterFillingOutForm" /> - </actionGroup> - - <actionGroup name="addDownloadableSampleFile"> - <annotations> - <description>Clicks on 'Add Link' under the 'Samples' section. Fills in the provided Downloadable Sample File details.</description> - </annotations> - <arguments> - <argument name="sample" defaultValue="downloadableSampleFile"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddDownloadableSampleFileActionGroup` instead --> - <click selector="{{AdminProductDownloadableSection.samplesAddLinkButton}}" stepKey="clickSampleAddLinkButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <fillField userInput="{{sample.title}}" selector="{{AdminProductDownloadableSection.addSampleTitleInput('0')}}" stepKey="fillDownloadableSampleTitle"/> - <selectOption userInput="{{sample.file_type}}" selector="{{AdminProductDownloadableSection.addSampleFileTypeSelector('0')}}" stepKey="selectDownloadableSampleFileType"/> - <attachFile userInput="{{sample.file}}" selector="{{AdminProductDownloadableSection.addSampleFileUploadFile('0')}}" stepKey="selectDownloadableSampleUpload"/> - <waitForAjaxLoad stepKey="waitForSampleFileUpload"/> - </actionGroup> - - <actionGroup name="addDownloadableSampleUrl"> - <annotations> - <description>Clicks on 'Add Link' under the 'Samples' section. Fills in the provided Downloadable Sample URL details.</description> - </annotations> - <arguments> - <argument name="sample" defaultValue="downloadableSampleUrl"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddDownloadableSampleUrlActionGroup` instead --> - <click selector="{{AdminProductDownloadableSection.samplesAddLinkButton}}" stepKey="clickSampleAddLinkButton2"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <fillField userInput="{{sample.title}}" selector="{{AdminProductDownloadableSection.addSampleTitleInput('1')}}" stepKey="fillDownloadableSampleTitle"/> - <selectOption userInput="{{sample.file_type}}" selector="{{AdminProductDownloadableSection.addSampleFileTypeSelector('1')}}" stepKey="selectDownloadableSampleFileType"/> - <fillField userInput="{{sample.file}}" selector="{{AdminProductDownloadableSection.addSampleFileUrlInput('1')}}" stepKey="fillDownloadableSampleFileUrl"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Email/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Email/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 855ec8790f8f2..0000000000000 --- a/app/code/Magento/Email/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,90 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="CreateNewTemplate"> - <annotations> - <description>Clicks on Add New Template. Fills the Template details. Clicks on Save. PLEASE NOTE: The values are Hardcoded.</description> - </annotations> - <arguments> - <argument name="template" defaultValue="EmailTemplate"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateNewTemplateActionGroup` instead --> - <amOnPage url="{{AdminEmailTemplateIndexPage.url}}" stepKey="navigateToEmailTemplatePage"/> - <click selector="{{AdminMainActionsSection.add}}" stepKey="clickAddNewTemplateButton"/> - <selectOption selector="{{AdminEmailTemplateEditSection.templateDropDown}}" userInput="Registry Update" stepKey="selectValueFromTemplateDropDown"/> - <click selector="{{AdminEmailTemplateEditSection.loadTemplateButton}}" stepKey="clickLoadTemplateButton"/> - <fillField selector="{{AdminEmailTemplateEditSection.templateCode}}" userInput="{{EmailTemplate.templateName}}" stepKey="fillTemplateNameField"/> - <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveTemplateButton"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You saved the email template." stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="CreateCustomTemplate" extends="CreateNewTemplate"> - <remove keyForRemoval="selectValueFromTemplateDropDown"/> - <remove keyForRemoval="clickLoadTemplateButton"/> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateCustomTemplateActionGroup` instead --> - <fillField selector="{{AdminEmailTemplateEditSection.templateSubject}}" userInput="{{template.templateSubject}}" after="fillTemplateNameField" stepKey="fillTemplateSubject"/> - <fillField selector="{{AdminEmailTemplateEditSection.templateText}}" userInput="{{template.templateText}}" after="fillTemplateSubject" stepKey="fillTemplateText"/> - </actionGroup> - - <actionGroup name="FindAndOpenEmailTemplate"> - <arguments> - <argument name="template" defaultValue="EmailTemplate"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FindAndOpenEmailTemplateActionGroup` instead --> - <amOnPage url="{{AdminEmailTemplateIndexPage.url}}" stepKey="navigateEmailTemplatePage" /> - <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clearFilters"/> - <fillField selector="{{AdminEmailTemplateIndexSection.searchTemplateField}}" userInput="{{template.templateName}}" stepKey="findCreatedTemplate"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearch"/> - <waitForElementVisible selector="{{AdminEmailTemplateIndexSection.templateRowByName(template.templateName)}}" stepKey="waitForTemplatesAppeared"/> - <click selector="{{AdminEmailTemplateIndexSection.templateRowByName(template.templateName)}}" stepKey="clickToOpenTemplate"/> - <waitForElementVisible selector="{{AdminEmailTemplateEditSection.templateCode}}" stepKey="waitForTemplateNameisible"/> - <seeInField selector="{{AdminEmailTemplateEditSection.templateCode}}" userInput="{{template.templateName}}" stepKey="checkTemplateName"/> - </actionGroup> - - <actionGroup name="DeleteEmailTemplate" extends="FindAndOpenEmailTemplate"> - <annotations> - <description>Clicks on Delete Template. Accepts the Popup. Validates that the Email Template is NOT present in the Email Templates Grid.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DeleteEmailTemplateActionGroup` instead --> - <click selector="{{AdminEmailTemplateEditSection.deleteTemplateButton}}" after="checkTemplateName" stepKey="deleteTemplate"/> - <waitForElementVisible selector="{{AdminEmailTemplateEditSection.acceptPopupButton}}" after="deleteTemplate" stepKey="waitForConfirmButton"/> - <click selector="{{AdminEmailTemplateEditSection.acceptPopupButton}}" after="waitForConfirmButton" stepKey="acceptPopup"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" after="acceptPopup" stepKey="waitForSuccessMessage"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the email template." after="waitForSuccessMessage" stepKey="seeSuccessfulMessage"/> - </actionGroup> - - <actionGroup name="PreviewEmailTemplateActionGroup" extends="FindAndOpenEmailTemplate"> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateSystemBackupActionGroup` instead --> - <click selector="{{AdminEmailTemplateEditSection.previewTemplateButton}}" after="checkTemplateName" stepKey="clickPreviewTemplate"/> - <switchToNextTab after="clickPreviewTemplate" stepKey="switchToNewOpenedTab"/> - <seeInCurrentUrl url="{{AdminEmailTemplatePreviewPage.url}}" after="switchToNewOpenedTab" stepKey="seeCurrentUrl"/> - <seeElement selector="{{AdminEmailTemplatePreviewSection.iframe}}" after="seeCurrentUrl" stepKey="seeIframeOnPage"/> - <switchToIFrame userInput="preview_iframe" after="seeIframeOnPage" stepKey="switchToIframe"/> - <waitForPageLoad after="switchToIframe" stepKey="waitForPageLoaded"/> - </actionGroup> - - <actionGroup name="AssertEmailTemplateContent"> - <arguments> - <argument name="expectedContent" type="string" defaultValue="{{EmailTemplate.templateText}}"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertEmailTemplateContentActionGroup` instead --> - <see userInput="{{expectedContent}}" stepKey="checkTemplateContainText"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 6da85827f77ec..0000000000000 --- a/app/code/Magento/GroupedProduct/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,96 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="checkRequiredFieldsInGroupedProductForm"> - <annotations> - <description>Clears the Product Name and SKU fields when adding a Grouped Product and then verifies that they are required after attempting to Save.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CheckRequiredFieldsInGroupedProductFormActionGroup` instead --> - <clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductSku"/> - <clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductName"/> - <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/> - <see selector="{{AdminProductFormSection.fieldError('name')}}" userInput="This is a required field." stepKey="seeNameRequired"/> - <see selector="{{AdminProductFormSection.fieldError('sku')}}" userInput="This is a required field." stepKey="seeSkuRequired"/> - </actionGroup> - - <!--Fill main fields in grouped product form--> - <actionGroup name="fillGroupedProductForm"> - <annotations> - <description>Fills in the provided Product Name and SKU on the Grouped Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="GroupedProduct"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillGroupedProductFormActionGroup` instead --> - <fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/> - <fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/> - </actionGroup> - - <actionGroup name="viewGroupedProductInAdminGrid"> - <annotations> - <description>Goes to the Admin Products grid page. Filters the grid for the provided Product. Validates that the provided Product appears in the grid.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="GroupedProduct"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ViewGroupedProductInAdminGridActionGroup` instead --> - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> - <waitForPageLoad stepKey="waitForPageLoadInitial"/> - <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> - <click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/> - <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="{{product.name}}" stepKey="fillProductNameFilter"/> - <fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillProductSkuFilter"/> - <selectOption selector="{{AdminProductGridFilterSection.typeFilter}}" userInput="{{product.type_id}}" stepKey="selectionProductType"/> - <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/> - <see selector="{{AdminProductGridSection.firstProductRow}}" userInput="{{product.name}}" stepKey="seeProductNameInGrid"/> - <click selector="{{AdminProductGridFilterSection.clearFilters}}" stepKey="clickClearFiltersAfter"/> - </actionGroup> - - <actionGroup name="fillDefaultQuantityForLinkedToGroupProductInGrid"> - <annotations> - <description>Fills the provided Qty for a Product linked to a Grouped Product.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - <argument name="qty" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillDefaultQuantityForLinkedToGroupProductInGridActionGroup` instead --> - <fillField selector="{{AdminAddedProductsToGroupGrid.inputByProductName(productName)}}" userInput="{{qty}}" stepKey="fillDefaultQtyForLinkedProduct"/> - </actionGroup> - - <actionGroup name="AdminAssignProductToGroup"> - <annotations> - <description>Adds the provided Product to a Grouped Product on an Admin Grouped Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAssignProductToGroupActionGroup` instead --> - <scrollTo selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" x="0" y="-100" stepKey="scrollToGroupedSection"/> - <conditionalClick selector="{{AdminProductFormGroupedProductsSection.toggleGroupedProduct}}" dependentSelector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" visible="false" stepKey="openGroupedProductsSection"/> - <click selector="{{AdminProductFormGroupedProductsSection.addProductsToGroup}}" stepKey="clickAddProductsToGroup"/> - <conditionalClick selector="{{AdminAddProductsToGroupPanel.clearFilters}}" dependentSelector="{{AdminAddProductsToGroupPanel.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> - <click selector="{{AdminAddProductsToGroupPanel.filters}}" stepKey="showFiltersPanel"/> - <fillField userInput="{{product.name}}" selector="{{AdminAddProductsToGroupPanel.nameFilter}}" stepKey="fillNameFilter"/> - <click selector="{{AdminAddProductsToGroupPanel.applyFilters}}" stepKey="clickApplyFilters"/> - <click selector="{{AdminAddProductsToGroupPanel.firstCheckbox}}" stepKey="selectProduct"/> - <click selector="{{AdminAddProductsToGroupPanel.addSelectedProducts}}" stepKey="clickAddSelectedGroupProducts"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 41d8803a253f9..0000000000000 --- a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="StorefrontGoCheckoutWithMultipleAddresses"> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontGoCheckoutWithMultipleAddressesActionGroup` instead --> - <click selector="{{MultishippingSection.shippingMultipleCheckout}}" stepKey="clickToMultipleAddressShippingButton"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index c3f29feb63b8d..0000000000000 --- a/app/code/Magento/Newsletter/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="StorefrontCreateNewAccountNewsletterChecked" extends="SignUpNewUserFromStorefrontActionGroup"> - <annotations> - <description>EXTENDS: SignUpNewUserFromStorefrontActionGroup. Clicks on 'Sign Up for Newsletter'. Validates that the Subscription Confirmation message is present and correct.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCreateNewAccountNewsletterCheckedActionGroup` instead --> - <click selector="{{StorefrontCustomerCreateFormSection.signUpForNewsletter}}" stepKey="selectSignUpForNewsletterCheckbox" after="fillLastName"/> - <see stepKey="seeDescriptionNewsletter" userInput='You are subscribed to "General Subscription".' selector="{{CustomerMyAccountPage.DescriptionNewsletter}}"/> - </actionGroup> - - <actionGroup name="StorefrontCreateNewAccountNewsletterUnchecked" extends="SignUpNewUserFromStorefrontActionGroup"> - <annotations> - <description>EXTENDS: SignUpNewUserFromStorefrontActionGroup. Validates that the you are NOT subscribed message is present and correct.</description> - </annotations> - <arguments> - <argument name="Customer"/> - <argument name="Store"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCreateNewAccountNewsletterUncheckedActionGroup` instead --> - <amOnPage stepKey="amOnStorefrontPage" url="{{Store.code}}"/> - <see stepKey="seeDescriptionNewsletter" userInput="You aren't subscribed to our newsletter." selector="{{CustomerMyAccountPage.DescriptionNewsletter}}"/> - <see stepKey="seeThankYouMessage" userInput="Thank you for registering with NewStore."/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/PageCache/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/PageCache/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 65e8a0604f505..0000000000000 --- a/app/code/Magento/PageCache/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="clearPageCache"> - <annotations> - <description>Goes to the Admin Cache Management page. Selects 'Refresh'. Checks the 'Page Cache' row. Clicks on Submit.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ClearPageCacheActionGroup` instead --> - <amOnPage url="{{_ENV.MAGENTO_BACKEND_NAME}}/admin/cache/" stepKey="amOnCacheManagementPage"/> - <waitForPageLoad stepKey="waitForCacheManagement"/> - <selectOption selector="{{AdminCacheManagementSection.massActionSelect}}" userInput="refresh" stepKey="selectRefresh"/> - <click selector="{{AdminCacheManagementSection.pageCacheCheckbox}}" stepKey="selectPageCache"/> - <click selector="{{AdminCacheManagementSection.massActionSubmit}}" stepKey="submitCacheForm"/> - <waitForPageLoad stepKey="waitForCacheFlush"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index e6765a6a520e1..0000000000000 --- a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,150 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="EnablePayPalConfiguration"> - <annotations> - <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code.</description> - </annotations> - <arguments> - <argument name="payPalConfigType"/> - <argument name="countryCode" type="string" defaultValue="us"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `EnablePayPalConfigurationActionGroup` instead --> - <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> - <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> - <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> - <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn"/> - <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> - <selectOption selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableWPSExpressSolution"/> - <seeInPopup userInput="There is already another PayPal solution enabled. Enable this solution instead?" stepKey="seeAlertMessage"/> - <acceptPopup stepKey="acceptEnablePopUp"/> - <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - </actionGroup> - - <actionGroup name="EnablePayPalSolutionWithoutSave" > - <annotations> - <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code without saving.</description> - </annotations> - <arguments> - <argument name="payPalConfigType"/> - <argument name="countryCode" type="string" defaultValue="us"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `EnablePayPalSolutionWithoutSaveActionGroup` instead --> - <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> - <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> - <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> - <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn"/> - <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> - <selectOption selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableWPSExpressSolution"/> - </actionGroup> - - <actionGroup name="CheckEnableOptionPayPalConfiguration"> - <annotations> - <description>Expands the 'OTHER PAYPAL PAYMENT SOLUTIONS' tab on the Admin Configuration page. Enables the provided PayPal Config type for the provided Country Code.</description> - </annotations> - <arguments> - <argument name="payPalConfigType"/> - <argument name="enabledOption" type="string"/> - <argument name="countryCode" type="string" defaultValue="us"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CheckEnableOptionPayPalConfigurationActionGroup` instead --> - <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> - <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> - <waitForElementVisible selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="waitForWPSExpressConfigureBtn"/> - <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn1"/> - <waitForElementVisible selector="{{payPalConfigType.enableSolution(countryCode)}}" stepKey="waitForWPSExpressEnable"/> - <seeOptionIsSelected selector="{{payPalConfigType.enableSolution(countryCode)}}" userInput="{{enabledOption}}" stepKey="seeSelectedOption"/> - <click selector="{{payPalConfigType.configureBtn(countryCode)}}" stepKey="clickWPSExpressConfigureBtn2"/> - </actionGroup> - - <actionGroup name="ConfigPayPalExpressCheckout"> - <annotations> - <description>Goes to the 'Configuration' page for 'Payment Methods'. Fills in the provided PayPal credentials and other details. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="credentials" defaultValue="_CREDS"/> - <argument name="countryCode" type="string" defaultValue="us"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ConfigPayPalExpressCheckoutActionGroup` instead --> - <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/> - <waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="waitForAdvancedSettingTab"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.email(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_business_account}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/> - <selectOption selector ="{{PayPalExpressCheckoutConfigSection.apiMethod(countryCode)}}" userInput="API Signature" stepKey="inputAPIAuthenticationMethods"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.username(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_username}}" stepKey="inputAPIUsername"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.password(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_password}}" stepKey="inputAPIPassword"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.signature(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_api_signature}}" stepKey="inputAPISignature"/> - <selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode(countryCode)}}" userInput="Yes" stepKey="enableSandboxMode"/> - <selectOption selector="{{PayPalExpressCheckoutConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID(countryCode)}}" userInput="{{credentials.magento/paypal_express_checkout_us_merchant_id}}" stepKey="inputMerchantID"/> - <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> - </actionGroup> - - <actionGroup name="SampleConfigPayPalExpressCheckout"> - <annotations> - <description>Goes to the 'Configuration' page for 'Payment Methods'. Fills in the provided Sample PayPal credentials and other details. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="credentials" defaultValue="SamplePaypalExpressConfig"/> - <argument name="countryCode" type="string" defaultValue="us"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SampleConfigPayPalExpressCheckoutActionGroup` instead --> - <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <click selector="{{PayPalExpressCheckoutConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalConfigureBtn"/> - <waitForElementVisible selector="{{PayPalAdvancedSettingConfigSection.advancedSettingTab(countryCode)}}" stepKey="waitForAdvancedSettingTab"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.email(countryCode)}}" userInput="{{credentials.paypal_express_email}}" stepKey="inputEmailAssociatedWithPayPalMerchantAccount"/> - <selectOption selector ="{{PayPalExpressCheckoutConfigSection.apiMethod(countryCode)}}" userInput="API Signature" stepKey="inputAPIAuthenticationMethods"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.username(countryCode)}}" userInput="{{credentials.paypal_express_api_username}}" stepKey="inputAPIUsername"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.password(countryCode)}}" userInput="{{credentials.paypal_express_api_password}}" stepKey="inputAPIPassword"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.signature(countryCode)}}" userInput="{{credentials.paypal_express_api_signature}}" stepKey="inputAPISignature"/> - <selectOption selector ="{{PayPalExpressCheckoutConfigSection.sandboxMode(countryCode)}}" userInput="Yes" stepKey="enableSandboxMode"/> - <selectOption selector="{{PayPalExpressCheckoutConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/> - <fillField selector ="{{PayPalExpressCheckoutConfigSection.merchantID(countryCode)}}" userInput="{{credentials.paypal_express_merchantID}}" stepKey="inputMerchantID"/> - <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> - </actionGroup> - - <actionGroup name="addProductToCheckoutPage"> - <annotations> - <description>Goes to the provided Category page on the Storefront. Adds the 1st Product to the Cart. Goes to Checkout. Select the Shipping Method. Selects PayPal as the Payment Method.</description> - </annotations> - <arguments> - <argument name="Category"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddProductToCheckoutPageActionGroup` instead --> - <amOnPage url="{{StorefrontCategoryPage.url(Category.name)}}" stepKey="onCategoryPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <moveMouseOver selector="{{StorefrontCategoryMainSection.ProductItemInfo}}" stepKey="hoverProduct"/> - <click selector="{{StorefrontCategoryMainSection.AddToCartBtn}}" stepKey="addToCart"/> - <waitForElementVisible selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="waitForProductAdded"/> - <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/> - <click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> - <click selector="{{CheckoutShippingMethodsSection.firstShippingMethod}}" stepKey="selectFirstShippingMethod"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask2"/> - <waitForElement selector="{{CheckoutShippingMethodsSection.next}}" time="30" stepKey="waitForNextButton"/> - <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickNext"/> - <waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="clickPayPalCheckbox"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index e9b6ec37f8f0a..0000000000000 --- a/app/code/Magento/ProductVideo/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,105 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="addProductVideo"> - <annotations> - <description>Expands the 'Images And Videos' section on the Admin Product creation/edit page. Adds the provided Video to the Product. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="video" defaultValue="mftfTestProductVideo"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddProductVideoActionGroup` instead --> - <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> - <waitForElementVisible selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="waitForAddVideoButtonVisible" time="30"/> - <click selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="addVideo"/> - <waitForElementVisible selector=".modal-slide.mage-new-video-dialog.form-inline._show" stepKey="waitForUrlElementVisibleslide" time="30"/> - <waitForElementVisible selector="{{AdminProductNewVideoSection.videoUrlTextField}}" stepKey="waitForUrlElementVisible" time="60"/> - <fillField selector="{{AdminProductNewVideoSection.videoUrlTextField}}" userInput="{{video.videoUrl}}" stepKey="fillFieldVideoUrl"/> - <fillField selector="{{AdminProductNewVideoSection.videoTitleTextField}}" userInput="{{video.videoTitle}}" stepKey="fillFieldVideoTitle"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <waitForElementNotVisible selector="{{AdminProductNewVideoSection.saveButtonDisabled}}" stepKey="waitForSaveButtonVisible" time="30"/> - <click selector="{{AdminProductNewVideoSection.saveButton}}" stepKey="saveVideo"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/> - </actionGroup> - - <actionGroup name="removeProductVideo"> - <annotations> - <description>Expands the 'Images And Videos' section on the Admin Product creation/edit page. Clicks on the Remove Video button.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `RemoveProductVideoActionGroup` instead --> - <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> - <waitForElementVisible selector="{{AdminProductImagesSection.addVideoButton}}" stepKey="waitForAddVideoButtonVisible" time="30"/> - <click selector="{{AdminProductImagesSection.removeVideoButton}}" stepKey="removeVideo"/> - </actionGroup> - - <actionGroup name="assertProductVideoAdminProductPage"> - <annotations> - <description>Validates that the provided Video is present on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="video" defaultValue="mftfTestProductVideo"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertProductVideoAdminProductPageActionGroup` instead --> - <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <seeElement selector="{{AdminProductImagesSection.videoTitleText(video.videoShortTitle)}}" stepKey="seeVideoTitle"/> - <seeElementInDOM selector="{{AdminProductImagesSection.videoUrlHiddenField(video.videoUrl)}}" stepKey="seeVideoItem"/> - </actionGroup> - - <actionGroup name="assertProductVideoNotInAdminProductPage"> - <annotations> - <description>Validates that the provided Video is NOT present on the Admin Product creation/edit page.</description> - </annotations> - <arguments> - <argument name="video" defaultValue="mftfTestProductVideo"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertProductVideoNotInAdminProductPageActionGroup` instead --> - <scrollTo selector="{{AdminProductImagesSection.productImagesToggle}}" x="0" y="-100" stepKey="scrollToArea"/> - <conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductVideoSection"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <dontSeeElement selector="{{AdminProductImagesSection.videoTitleText(video.videoShortTitle)}}" stepKey="seeVideoTitle"/> - <dontSeeElementInDOM selector="{{AdminProductImagesSection.videoUrlHiddenField(video.videoUrl)}}" stepKey="seeVideoItem"/> - </actionGroup> - - <actionGroup name="assertProductVideoStorefrontProductPage"> - <annotations> - <description>Validates that the provided Video is present on the Storefront Product page.</description> - </annotations> - <arguments> - <argument name="dataTypeAttribute" defaultValue="'youtube'"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertProductVideoStorefrontProductPageActionGroup` instead --> - <seeElement selector="{{StorefrontProductInfoMainSection.productVideo(dataTypeAttribute)}}" stepKey="seeProductVideoDataType"/> - </actionGroup> - - <actionGroup name="assertProductVideoNotInStorefrontProductPage"> - <annotations> - <description>Validates that the provided Video is NOT present on the Storefront Product page.</description> - </annotations> - <arguments> - <argument name="dataTypeAttribute" defaultValue="'youtube'"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertProductVideoNotInStorefrontProductPageActionGroup` instead --> - <dontSeeElement selector="{{StorefrontProductInfoMainSection.productVideo(dataTypeAttribute)}}" stepKey="dontSeeProductVideoDataType"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 6a6ddfb514890..0000000000000 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,673 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="verifyBasicCreditMemoInformation"> - <annotations> - <description>Validates that the provided Customer, Shipping/Billing Address and Customer Group are present and correct on the Admin Credit Memo view page.</description> - </annotations> - <arguments> - <argument name="customer" defaultValue=""/> - <argument name="shippingAddress" defaultValue=""/> - <argument name="billingAddress" defaultValue=""/> - <argument name="customerGroup" defaultValue="GeneralCustomerGroup"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyBasicCreditMemoInformationActionGroup` instead --> - <see selector="{{AdminCreditMemoOrderInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/> - <see selector="{{AdminCreditMemoOrderInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/> - <see selector="{{AdminCreditMemoOrderInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/> - - <see selector="{{AdminCreditMemoAddressInformationSection.billingAddress}}" userInput="{{billingAddress.street[0]}}" stepKey="seeBillingAddressStreet"/> - <see selector="{{AdminCreditMemoAddressInformationSection.billingAddress}}" userInput="{{billingAddress.city}}" stepKey="seeBillingAddressCity"/> - <see selector="{{AdminCreditMemoAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country_id}}" stepKey="seeBillingAddressCountry"/> - <see selector="{{AdminCreditMemoAddressInformationSection.billingAddress}}" userInput="{{billingAddress.postcode}}" stepKey="seeBillingAddressPostcode"/> - - <see selector="{{AdminCreditMemoAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.street[0]}}" stepKey="seeShippingAddressStreet"/> - <see selector="{{AdminCreditMemoAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.city}}" stepKey="seeShippingAddressCity"/> - <see selector="{{AdminCreditMemoAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/> - <see selector="{{AdminCreditMemoAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> - </actionGroup> - - <actionGroup name="seeProductInItemsRefunded"> - <annotations> - <description>Validates that the provided Product appears in the 'Product' column on the Admin Credit Memo view page.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SeeProductInItemsRefundedActionGroup` instead --> - <see selector="{{AdminCreditMemoItemsSection.skuColumn}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> - </actionGroup> - - <actionGroup name="verifyBasicInvoiceInformation"> - <annotations> - <description>Validates that the provided Customer, Address and Customer Group details are present and correct on the Admin View Invoice page.</description> - </annotations> - <arguments> - <argument name="customer"/> - <argument name="shippingAddress"/> - <argument name="billingAddress"/> - <argument name="customerGroup" defaultValue="GeneralCustomerGroup"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyBasicInvoiceInformationActionGroup` instead --> - <see selector="{{AdminInvoiceOrderInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/> - <see selector="{{AdminInvoiceOrderInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/> - <see selector="{{AdminInvoiceOrderInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/> - <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.street[0]}}" stepKey="seeBillingAddressStreet"/> - <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.city}}" stepKey="seeBillingAddressCity"/> - <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country_id}}" stepKey="seeBillingAddressCountry"/> - <see selector="{{AdminInvoiceAddressInformationSection.billingAddress}}" userInput="{{billingAddress.postcode}}" stepKey="seeBillingAddressPostcode"/> - <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.street[0]}}" stepKey="seeShippingAddressStreet"/> - <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.city}}" stepKey="seeShippingAddressCity"/> - <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/> - <see selector="{{AdminInvoiceAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> - </actionGroup> - - <actionGroup name="seeProductInInvoiceItems"> - <annotations> - <description>Validates that the provided Product appears under the 'SKU' column in the Admin Invoices edit page.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SeeProductInInvoiceItemsActionGroup` instead --> - <see selector="{{AdminInvoiceItemsSection.skuColumn}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> - </actionGroup> - - <actionGroup name="adminFastCreateInvoice"> - <annotations> - <description>Clicks on 'Invoice' on the Admin Orders view page. Clicks on 'Submit Invoice'. Clicks on 'View Invoice'.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminFastCreateInvoiceActionGroup` instead --> - <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceButton"/> - <waitForPageLoad stepKey="waitForNewInvoicePageLoad"/> - <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> - <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeSuccessMessage"/> - <click selector="{{AdminOrderDetailsOrderViewSection.invoices}}" stepKey="clickInvoices"/> - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask5"/> - <conditionalClick selector="{{AdminOrderInvoicesTabSection.clearFilters}}" dependentSelector="{{AdminOrderInvoicesTabSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <click selector="{{AdminOrderInvoicesTabSection.viewInvoice}}" stepKey="openInvoicePage"/> - <waitForPageLoad stepKey="waitForInvoicePageLoad"/> - </actionGroup> - - <actionGroup name="clearInvoicesGridFilters"> - <annotations> - <description>Goes to the Admin Invoices grid page. Clicks on 'Clear Filters', if present.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ClearInvoicesGridFiltersActionGroup` instead --> - <amOnPage url="{{AdminInvoicesPage.url}}" stepKey="goToInvoices"/> - <waitForPageLoad stepKey="waitInvoicesGridToLoad"/> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearFilters"/> - <waitForPageLoad stepKey="waitInvoicesGrid"/> - </actionGroup> - - <actionGroup name="goToInvoiceIntoOrder"> - <annotations> - <description>Clicks on 'Invoice' on the Admin Orders view page. Validates that the URL and Page Title are correct.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `GoToInvoiceIntoOrderActionGroup` instead --> - <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction"/> - <seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeOrderInvoiceUrl"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seePageNameNewInvoicePage"/> - </actionGroup> - - <actionGroup name="StartCreateInvoiceFromOrderPage"> - <annotations> - <description>Clicks on 'Invoice' on the Admin Orders view page. Validates that the URL and Page Title are correct.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StartCreateInvoiceFromOrderPageActionGroup` instead --> - <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction"/> - <seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeNewInvoiceUrl"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seeNewInvoicePageTitle"/> - </actionGroup> - - <actionGroup name="SubmitInvoice"> - <annotations> - <description>Clicks on 'Submit Invoice' on the Admin 'New Invoice' page. Validates that the Success Message is present and correct. Validates that the Order ID appears in the URL.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SubmitInvoiceActionGroup` instead --> - <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForMessageAppears"/> - <see selector="{{AdminMessagesSection.success}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess"/> - <grabFromCurrentUrl regex="~/order_id/(\d+)/~" stepKey="grabOrderId"/> - <seeInCurrentUrl url="{{AdminOrderDetailsPage.url('$grabOrderId')}}" stepKey="seeViewOrderPageInvoice"/> - </actionGroup> - - <actionGroup name="filterInvoiceGridByOrderId"> - <annotations> - <description>Goes to the Admin Invoices grid page. Filters the grid for the provided Order ID.</description> - </annotations> - <arguments> - <argument name="orderId" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterInvoiceGridByOrderIdActionGroup` instead --> - <amOnPage url="{{AdminInvoicesPage.url}}" stepKey="goToInvoices"/> - <click selector="{{AdminInvoicesGridSection.filter}}" stepKey="clickFilter"/> - <fillField selector="{{AdminInvoicesFiltersSection.orderNum}}" userInput="{{orderId}}" stepKey="fillOrderIdForFilter"/> - <click selector="{{AdminInvoicesFiltersSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForPageLoad stepKey="waitForFiltersApply"/> - </actionGroup> - - <actionGroup name="navigateToNewOrderPageNewCustomer"> - <annotations> - <description>Goes to the Admin Orders grid page. Clicks on 'Create New Order'. Clicks on 'Create New Customer'. Select the provided Store View, if present. Validates that Page Title is present and correct.</description> - </annotations> - <arguments> - <argument name="storeView" defaultValue="_defaultStore"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `NavigateToNewOrderPageNewCustomerActionGroup` instead --> - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> - <waitForPageLoad stepKey="waitForIndexPageLoad"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> - <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> - <click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/> - <conditionalClick selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" dependentSelector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" visible="true" stepKey="selectStoreViewIfAppears"/> - <waitForPageLoad stepKey="waitForCreateOrderPageLoadAfterStoreSelect"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> - </actionGroup> - - <actionGroup name="navigateToNewOrderPageNewCustomerSingleStore"> - <annotations> - <description>Goes to the Admin Orders grid page. Clicks on 'Create New Order'. Clicks on 'Create New Customer'. Validates that Page Title is present and correct.</description> - </annotations> - <arguments> - <argument name="storeView" defaultValue="_defaultStore"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `NavigateToNewOrderPageNewCustomerSingleStoreActionGroup` instead --> - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> - <waitForPageLoad stepKey="waitForIndexPageLoad"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> - <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> - <click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> - </actionGroup> - - <actionGroup name="navigateToNewOrderPageExistingCustomer"> - <annotations> - <description>Goes tot he Admin Orders grid page. Clicks on 'Create New Order'. Filters the grid for the provided Customer. Clicks on the Customer. Selects the provided Store View, if present. Validates that the Page Title is present and correct.</description> - </annotations> - <arguments> - <argument name="customer"/> - <argument name="storeView" defaultValue="_defaultStore"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `NavigateToNewOrderPageExistingCustomerActionGroup` instead --> - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> - <waitForPageLoad stepKey="waitForIndexPageLoad"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> - <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> - <waitForPageLoad stepKey="waitForCustomerGridLoad"/> - - <conditionalClick selector="{{AdminOrderCustomersGridSection.resetButton}}" dependentSelector="{{AdminOrderCustomersGridSection.resetButton}}" visible="true" stepKey="clearExistingCustomerFilters"/> - <fillField userInput="{{customer.email}}" selector="{{AdminOrderCustomersGridSection.emailInput}}" stepKey="filterEmail"/> - <click selector="{{AdminOrderCustomersGridSection.apply}}" stepKey="applyFilter"/> - <waitForPageLoad stepKey="waitForFilteredCustomerGridLoad"/> - <click selector="{{AdminOrderCustomersGridSection.firstRow}}" stepKey="clickOnCustomer"/> - <waitForPageLoad stepKey="waitForCreateOrderPageLoad"/> - - <conditionalClick selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" dependentSelector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" visible="true" stepKey="selectStoreViewIfAppears"/> - <waitForPageLoad stepKey="waitForCreateOrderPageLoadAfterStoreSelect"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> - </actionGroup> - - <actionGroup name="checkRequiredFieldsNewOrderForm"> - <annotations> - <description>Clears the Email, First Name, Last Name, Street Line 1, City, Postal Code and Phone fields when adding an Order and then verifies that they are required after attempting to Save.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CheckRequiredFieldsNewOrderFormActionGroup` instead --> - <seeElement selector="{{AdminOrderFormAccountSection.requiredGroup}}" stepKey="seeCustomerGroupRequired"/> - <seeElement selector="{{AdminOrderFormAccountSection.requiredEmail}}" stepKey="seeEmailRequired"/> - <clearField selector="{{AdminOrderFormAccountSection.email}}" stepKey="clearEmailField"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.FirstName}}" stepKey="clearFirstNameField"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.LastName}}" stepKey="clearLastNameField"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.StreetLine1}}" stepKey="clearStreetField"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.City}}" stepKey="clearCityField"/> - <selectOption selector="{{AdminOrderFormBillingAddressSection.Country}}" userInput="United States" stepKey="selectUSCountry"/> - <selectOption selector="{{AdminOrderFormBillingAddressSection.State}}" userInput="Please select" stepKey="selectNoState"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.PostalCode}}" stepKey="clearPostalCodeField"/> - <clearField selector="{{AdminOrderFormBillingAddressSection.Phone}}" stepKey="clearPhoneField"/> - <seeElement selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="seeShippingMethodNotSelected"/> - <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="trySubmitOrder"/> - <see selector="{{AdminOrderFormBillingAddressSection.emailError}}" userInput="This is a required field." stepKey="seeThatEmailIsRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.firstNameError}}" userInput="This is a required field." stepKey="seeFirstNameRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.lastNameError}}" userInput="This is a required field." stepKey="seeLastNameRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.streetAddressError}}" userInput="This is a required field." stepKey="seeStreetRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.cityError}}" userInput="This is a required field." stepKey="seeCityRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.stateError}}" userInput="This is a required field." stepKey="seeStateRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.postalCodeError}}" userInput="This is a required field." stepKey="seePostalCodeRequired"/> - <see selector="{{AdminOrderFormBillingAddressSection.phoneError}}" userInput="This is a required field." stepKey="seePhoneRequired"/> - <see selector="{{AdminOrderFormPaymentSection.shippingError}}" userInput="This is a required field." stepKey="seeShippingMethodRequired"/> - </actionGroup> - - <actionGroup name="addSimpleProductToOrder"> - <annotations> - <description>Adds the provided Simple Product to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> - </annotations> - <arguments> - <argument name="product" defaultValue="_defaultProduct" type="entity"/> - <argument name="productQty" defaultValue="1" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddSimpleProductToOrderActionGroup` instead --> - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> - <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilter"/> - <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearch"/> - <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> - <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectProduct"/> - <fillField selector="{{AdminOrderFormItemsSection.rowQty('1')}}" userInput="{{productQty}}" stepKey="fillProductQty"/> - <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> - <wait time="5" stepKey="waitForOptionsToLoad"/> - </actionGroup> - - <actionGroup name="addConfigurableProductToOrder"> - <annotations> - <description>Adds the provided Configurable Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="attribute"/> - <argument name="option"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddConfigurableProductToOrderActionGroup` instead --> - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> - <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterConfigurable"/> - <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchConfigurable"/> - <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> - <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectConfigurableProduct"/> - <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_label)}}" stepKey="waitForConfigurablePopover"/> - <wait time="2" stepKey="waitForOptionsToLoad"/> - <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_label)}}" userInput="{{option.name}}" stepKey="selectionConfigurableOption"/> - <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/> - <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> - </actionGroup> - - <actionGroup name="newAddConfigurableProductToOrder" extends="addConfigurableProductToOrder"> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `NewAddConfigurableProductToOrderActionGroup` instead --> - <remove keyForRemoval="waitForConfigurablePopover"/> - <remove keyForRemoval="selectionConfigurableOption"/> - <selectOption selector="{{AdminOrderFormConfigureProductSection.selectOption}}" userInput="{{option.value}}" stepKey="selectOption" after="waitForOptionsToLoad"/> - </actionGroup> - - <actionGroup name="addConfigurableProductToOrderFromAdmin" extends="addConfigurableProductToOrder"> - <annotations> - <description>EXTENDS: addConfigurableProductToOrder. Selects the provided Option to the Configurable Product.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddConfigurableProductToOrderFromAdminActionGroup` instead --> - <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" stepKey="waitForConfigurablePopover"/> - <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" userInput="{{option.label}}" stepKey="selectionConfigurableOption"/> - </actionGroup> - - <actionGroup name="configureOrderedConfigurableProduct"> - <annotations> - <description>Clicks on 'Configure' for a Product in the 'Please select products' under the 'Create New Order for' page. Selects the provided Option and Attribute. Fills in the provided Qty. Clicks on Ok.</description> - </annotations> - <arguments> - <argument name="attribute"/> - <argument name="option"/> - <argument name="quantity" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ConfigureOrderedConfigurableProductActionGroup` instead --> - <click selector="{{AdminOrderFormItemsSection.configure}}" stepKey="clickConfigure"/> - <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" stepKey="waitForConfigurablePopover"/> - <wait time="2" stepKey="waitForOptionsToLoad"/> - <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect(attribute.default_frontend_label)}}" userInput="{{option.label}}" stepKey="selectionConfigurableOption"/> - <fillField selector="{{AdminOrderFormConfigureProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> - <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/> - </actionGroup> - - <actionGroup name="addBundleProductToOrder"> - <annotations> - <description>Adds the provided Bundled Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="quantity" type="string" defaultValue="1"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleProductToOrderActionGroup` instead --> - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> - <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterBundle"/> - <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchBundle"/> - <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> - <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectBundleProduct"/> - <waitForElementVisible selector="{{AdminOrderFormBundleProductSection.quantity}}" stepKey="waitForBundleOptionLoad"/> - <wait time="2" stepKey="waitForOptionsToLoad"/> - <fillField selector="{{AdminOrderFormBundleProductSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> - <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/> - <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> - </actionGroup> - - <actionGroup name="addBundleProductToOrderAndCheckPriceInGrid" extends="addBundleProductToOrder"> - <annotations> - <description>EXTENDS: addBundleProductToOrder. Validates that the provided Product Price is present and correct in the 'Items Ordered' section.</description> - </annotations> - <arguments> - <argument name="price" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddBundleProductToOrderAndCheckPriceInGridActionGroup` instead --> - <grabTextFrom selector="{{AdminOrderFormItemsSection.rowPrice('1')}}" stepKey="grabProductPriceFromGrid" after="clickOk"/> - <assertEquals stepKey="assertProductPriceInGrid" message="Bundle product price in grid should be equal {{price}}" after="grabProductPriceFromGrid"> - <expectedResult type="string">{{price}}</expectedResult> - <actualResult type="variable">grabProductPriceFromGrid</actualResult> - </assertEquals> - </actionGroup> - - <actionGroup name="addDownloadableProductToOrder"> - <annotations> - <description>Adds a Downloadable Product to an Order. Clicks on 'Add Selected Product(s) to Order'.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddDownloadableProductToOrderActionGroup` instead --> - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> - <waitForPageLoad time="30" stepKey="waitForPageLoad1"/> - <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterDownloadable"/> - <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchDownloadable"/> - <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> - <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectDownloadableProduct"/> - <waitForElementVisible selector="{{AdminOrderFormDownloadableProductSection.optionSelect(link.title)}}" stepKey="waitForLinkLoad"/> - <click selector="{{AdminOrderFormDownloadableProductSection.optionSelect(link.title)}}" stepKey="selectLink"/> - <fillField selector="{{AdminOrderFormDownloadableProductSection.quantity}}" userInput="{{quantity}}" stepKey="setQuantity"/> - <click selector="{{AdminOrderFormDownloadableProductSection.ok}}" stepKey="confirmConfiguration"/> - <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> - </actionGroup> - - <actionGroup name="addGroupedProductOptionToOrder"> - <annotations> - <description>Adds the provided Grouped Product with the provided Option to an Order. Fills in the provided Product Qty. Clicks on 'Add Selected Product(s) to Order'.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="option"/> - <argument name="quantity" type="string" defaultValue="1"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddGroupedProductOptionToOrderActionGroup` instead --> - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> - <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{product.sku}}" stepKey="fillSkuFilterGrouped"/> - <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchGrouped"/> - <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> - <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectGroupedProduct"/> - <waitForElementVisible selector="{{AdminOrderFormGroupedProductSection.optionQty(option.sku)}}" stepKey="waitForGroupedOptionLoad"/> - <wait time="2" stepKey="waitForOptionsToLoad"/> - <fillField selector="{{AdminOrderFormGroupedProductSection.optionQty(option.sku)}}" userInput="{{quantity}}" stepKey="fillOptionQuantity"/> - <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOk"/> - <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> - <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> - </actionGroup> - - <actionGroup name="fillOrderCustomerInformation"> - <annotations> - <description>Fills in the provided Customer and Address details on the Admin 'Create New Order for' page.</description> - </annotations> - <arguments> - <argument name="customer"/> - <argument name="address"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FillOrderCustomerInformationActionGroup` instead --> - <fillField selector="{{AdminOrderFormBillingAddressSection.FirstName}}" userInput="{{customer.firstname}}" stepKey="fillFirstName"/> - <fillField selector="{{AdminOrderFormBillingAddressSection.LastName}}" userInput="{{customer.lastname}}" stepKey="fillLastName"/> - <fillField selector="{{AdminOrderFormBillingAddressSection.StreetLine1}}" userInput="{{address.street[0]}}" stepKey="fillStreetLine1"/> - <fillField selector="{{AdminOrderFormBillingAddressSection.City}}" userInput="{{address.city}}" stepKey="fillCity"/> - <selectOption selector="{{AdminOrderFormBillingAddressSection.Country}}" userInput="{{address.country_id}}" stepKey="fillCountry"/> - <selectOption selector="{{AdminOrderFormBillingAddressSection.State}}" userInput="{{address.state}}" stepKey="fillState"/> - <fillField selector="{{AdminOrderFormBillingAddressSection.PostalCode}}" userInput="{{address.postcode}}" stepKey="fillPostalCode"/> - <fillField selector="{{AdminOrderFormBillingAddressSection.Phone}}" userInput="{{address.telephone}}" stepKey="fillPhone"/> - </actionGroup> - - <actionGroup name="orderSelectFlatRateShipping"> - <annotations> - <description>Selects the 'Flat Rate' Shipping Method on the Admin 'Create New Order for' page.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `OrderSelectFlatRateShippingActionGroup` instead --> - <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> - <waitForPageLoad stepKey="waitForJavascriptToFinish"/> - <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods"/> - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.flatRateOption}}" stepKey="waitForShippingOptions"/> - <selectOption selector="{{AdminOrderFormPaymentSection.flatRateOption}}" userInput="flatrate_flatrate" stepKey="checkFlatRate"/> - </actionGroup> - - <actionGroup name="changeShippingMethod"> - <annotations> - <description>Change Shipping Method on the Admin 'Create New Order for' page.</description> - </annotations> - <arguments> - <argument name="shippingMethod" defaultValue="flatrate_flatrate" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeShippingMethodActionGroup` instead --> - <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> - <waitForPageLoad stepKey="waitForJavascriptToFinish"/> - <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods1"/> - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="waitForChangeShippingMethod"/> - <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods2"/> - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.shippingMethod}}" stepKey="waitForShippingOptions2"/> - <selectOption selector="{{AdminOrderFormPaymentSection.shippingMethod}}" userInput="{{shippingMethod}}" stepKey="checkFlatRate"/> - </actionGroup> - - <actionGroup name="orderSelectFreeShipping"> - <annotations> - <description>Selects the 'Free Shipping' Shipping Method on the Admin 'Create New Order for' page.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `OrderSelectFreeShippingActionGroup` instead --> - <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> - <waitForPageLoad stepKey="waitForJavascriptToFinish"/> - <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods"/> - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" stepKey="waitForShippingOptions"/> - <selectOption selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" userInput="freeshipping_freeshipping" stepKey="checkFreeShipping"/> - </actionGroup> - - <actionGroup name="verifyBasicOrderInformation"> - <annotations> - <description>Validates that the provided Customer, Shipping/Billing Address and Customer Group are present and correct on the Admin Orders view page.</description> - </annotations> - <arguments> - <argument name="customer"/> - <argument name="shippingAddress"/> - <argument name="billingAddress"/> - <argument name="customerGroup" defaultValue="GeneralCustomerGroup"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyBasicOrderInformationActionGroup` instead --> - <see selector="{{AdminOrderDetailsInformationSection.customerName}}" userInput="{{customer.firstname}}" stepKey="seeCustomerName"/> - <see selector="{{AdminOrderDetailsInformationSection.customerEmail}}" userInput="{{customer.email}}" stepKey="seeCustomerEmail"/> - <see selector="{{AdminOrderDetailsInformationSection.customerGroup}}" userInput="{{customerGroup.code}}" stepKey="seeCustomerGroup"/> - <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.street[0]}}" stepKey="seeBillingAddressStreet"/> - <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.city}}" stepKey="seeBillingAddressCity"/> - <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country_id}}" stepKey="seeBillingAddressCountry"/> - <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.postcode}}" stepKey="seeBillingAddressPostcode"/> - <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.street[0]}}" stepKey="seeShippingAddressStreet"/> - <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.city}}" stepKey="seeShippingAddressCity"/> - <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/> - <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> - </actionGroup> - - <actionGroup name="verifyCreatedOrderInformation"> - <annotations> - <description>Validates that the Success Message, Order Status (Pending) and Order ID are present and correct.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyCreatedOrderInformationActionGroup` instead --> - <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeSuccessMessage"/> - <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderPendingStatus" after="seeSuccessMessage"/> - <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId" after="seeOrderPendingStatus"/> - <assertNotEmpty actual="$getOrderId" stepKey="assertOrderIdIsNotEmpty" after="getOrderId"/> - </actionGroup> - - <actionGroup name="seeProductInItemsOrdered"> - <annotations> - <description>Validates that the provided Product is present and correct in the 'Items Ordered' section on the Admin Orders view page.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SeeProductInItemsOrderedActionGroup` instead --> - <see selector="{{AdminOrderItemsOrderedSection.productSkuColumn}}" userInput="{{product.sku}}" stepKey="seeSkuInItemsOrdered"/> - </actionGroup> - - <actionGroup name="cancelPendingOrder"> - <annotations> - <description>Cancels the Pending Order on the Admin Orders view page. Validates that the provided Order Status is present and correct.</description> - </annotations> - <arguments> - <argument name="orderStatus" type="string" defaultValue="Canceled"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CancelPendingOrderActionGroup` instead --> - <click selector="{{AdminOrderDetailsMainActionsSection.cancel}}" stepKey="clickCancelOrder"/> - <waitForElement selector="{{AdminConfirmationModalSection.message}}" stepKey="waitForCancelConfirmation"/> - <see selector="{{AdminConfirmationModalSection.message}}" userInput="Are you sure you want to cancel this order?" stepKey="seeConfirmationMessage"/> - <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmOrderCancel"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You canceled the order." stepKey="seeCancelSuccessMessage"/> - <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="{{orderStatus}}" stepKey="seeOrderStatusCanceled"/> - </actionGroup> - - <actionGroup name="dontSeeProductInItemsOrdered"> - <arguments> - <argument name="product"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DontSeeProductInItemsOrderedActionGroup` instead --> - <dontSee selector="{{AdminOrderItemsOrderedSection.productSkuColumn}}" userInput="{{product.sku}}" stepKey="dontseeSkuInItemsOrdered"/> - </actionGroup> - - <actionGroup name="SelectCheckMoneyPaymentMethod"> - <annotations> - <description>Selects the 'Check / Money Order' Payment Method on the Admin Create New Order page.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SelectCheckMoneyPaymentMethodActionGroup` instead --> - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/> - <conditionalClick selector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" dependentSelector="{{AdminOrderFormPaymentSection.checkMoneyOption}}" visible="true" stepKey="checkCheckMoneyOption"/> - </actionGroup> - - <actionGroup name="filterOrderGridById"> - <annotations> - <description>Goes to the Admin Orders page. Filters the grid based on the provided Order ID.</description> - </annotations> - <arguments> - <argument name="orderId" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterOrderGridByIdActionGroup` instead --> - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderGridPage"/> - <waitForPageLoad stepKey="waitForOrdersPage"/> - <conditionalClick selector="{{AdminOrdersGridSection.clearFilters}}" dependentSelector="{{AdminOrdersGridSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <waitForPageLoad stepKey="waitForClearFilters"/> - <click selector="{{AdminOrdersGridSection.filters}}" stepKey="openOrderGridFilters"/> - <waitForPageLoad stepKey="waitForClickFilters"/> - <fillField selector="{{AdminOrdersGridSection.idFilter}}" userInput="{{orderId}}" stepKey="fillOrderIdFilter"/> - <click selector="{{AdminOrdersGridSection.applyFilters}}" stepKey="clickOrderApplyFilters"/> - <waitForPageLoad stepKey="waitForApplyFilters"/> - </actionGroup> - - <actionGroup name="filterOrderGridByBillingName"> - <annotations> - <description>Goes to the Admin Orders page. Filters the grid based on the provided Customer.</description> - </annotations> - <arguments> - <argument name="customer"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterOrderGridByBillingNameActionGroup` instead --> - <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderGridPage"/> - <waitForPageLoad stepKey="waitForOrderGridLoad"/> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> - <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('billing_name')}}" userInput="{{customer.fullname}}" stepKey="fillBillToNameFilter"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters"/> - </actionGroup> - - <actionGroup name="filterOrderGridByBaseTotalRange"> - <annotations> - <description>Goes to the Admin Orders page. Filters the grid based on the provided Grand Total From/To values.</description> - </annotations> - <arguments> - <argument name="from"/> - <argument name="to"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterOrderGridByBaseTotalRangeActionGroup` instead --> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> - <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('base_grand_total[from]')}}" userInput="{{from}}" stepKey="fillOrderTotalFrom"/> - <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('base_grand_total[to]')}}" userInput="{{to}}" stepKey="fillOrderTotalTo"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> - </actionGroup> - - <actionGroup name="filterOrderGridByPurchaseDate"> - <annotations> - <description>Goes to the Admin Orders page. Filters the grid based on the provided Purchased Date From/To values.</description> - </annotations> - <arguments> - <argument name="from"/> - <argument name="to"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterOrderGridByPurchaseDateActionGroup` instead --> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> - <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[from]')}}" userInput="{{from}}" stepKey="fillOrderPurchaseDateFrom"/> - <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[to]')}}" userInput="{{to}}" stepKey="fillOrderPurchaseDateTo"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> - </actionGroup> - - <actionGroup name="filterOrderGridByStatus"> - <annotations> - <description>Filters the Admin Orders grid based on the provided Order Status.</description> - </annotations> - <arguments> - <argument name="status"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `FilterOrderGridByStatusActionGroup` instead --> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderGridFilters"/> - <selectOption selector="{{AdminDataGridHeaderSection.filterFieldSelect('status')}}" userInput="{{status}}" stepKey="fillOrderStatusFilter"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> - </actionGroup> - - <actionGroup name="OpenOrderById" extends="filterOrderGridById"> - <annotations> - <description>EXTENDS: filterOrderGridById. Clicks on the 1st row of the Admin Orders grid.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `OpenOrderByIdActionGroup` instead --> - <click selector="{{AdminDataGridTableSection.firstRow}}" after="clickOrderApplyFilters" stepKey="openOrderViewPage"/> - <waitForPageLoad after="openOrderViewPage" stepKey="waitForOrderViewPageOpened"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 648500bcaeb40..0000000000000 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,110 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="selectNotLoggedInCustomerGroup"> - <annotations> - <description>Selects 'NOT LOGGED IN' from the 'Customer Groups' list (Magento 2 B2B). PLEASE NOTE: The value is Hardcoded.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SelectNotLoggedInCustomerGroupActionGroup` instead --> - <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="NOT LOGGED IN" stepKey="selectCustomerGroup"/> - </actionGroup> - - <actionGroup name="selectRetailerCustomerGroup"> - <annotations> - <description>Selects 'Retailer' from the 'Customer Groups' list (Magento 2 B2B). PLEASE NOTE: The value is Hardcoded.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SelectRetailerCustomerGroupActionGroup` instead --> - <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="Retailer" stepKey="selectRetailerCustomerGroup"/> - </actionGroup> - - <actionGroup name="AdminCreateCartPriceRuleWithCouponCode" extends="AdminCreateCartPriceRuleActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'selectActionType' and 'fillDiscountAmount'. Adds the provided Coupon Code to a Cart Price Rule.</description> - </annotations> - <arguments> - <argument name="couponCode" defaultValue="_defaultCoupon.code"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateCartPriceRuleWithCouponCodeActionGroup` instead --> - <remove keyForRemoval="selectActionType"/> - <remove keyForRemoval="fillDiscountAmount"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="Specific Coupon" stepKey="selectCouponType" after="fillRuleName"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.couponCode}}" stepKey="waitForElementVisible" after="selectCouponType"/> - <fillField selector="{{AdminCartPriceRulesFormSection.couponCode}}" userInput="{{couponCode}}" stepKey="fillCouponCode" after="waitForElementVisible"/> - <fillField selector="{{AdminCartPriceRulesFormSection.userPerCoupon}}" userInput="99" stepKey="fillUserPerCoupon" after="fillCouponCode"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="Fixed amount discount for whole cart" stepKey="selectActionTypeToFixed" after="clickToExpandActions"/> - <fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="1" stepKey="fillDiscountAmount" after="selectActionTypeToFixed"/> - </actionGroup> - - <actionGroup name="AdminCreateCartPriceRuleWithConditions" extends="AdminCreateCartPriceRuleActionGroup"> - <annotations> - <description>EXTENDS: AdminCreateCartPriceRuleActionGroup. Removes 'fillDiscountAmount'. Adds the 2 provided Conditions (Name, Rule, Rule to Change and Category Name) to a Cart Price Rule.</description> - </annotations> - <arguments> - <argument name="condition1" type="string" defaultValue="Products subselection"/> - <argument name="condition2" type="string" defaultValue="Category"/> - <argument name="ruleToChange1" type="string" defaultValue="is"/> - <argument name="rule1" type="string" defaultValue="equals or greater than"/> - <argument name="ruleToChange2" type="string" defaultValue="..."/> - <argument name="rule2" type="string" defaultValue="2"/> - <argument name="categoryName" type="string" defaultValue="_defaultCategory.name"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateCartPriceRuleWithConditionsActionGroup` instead --> - <remove keyForRemoval="fillDiscountAmount"/> - - <click selector="{{AdminCartPriceRulesFormSection.conditionsHeader}}" stepKey="openConditionsSection" after="selectActionType"/> - <click selector="{{AdminCartPriceRulesFormSection.addCondition('1')}}" stepKey="addFirstCondition" after="openConditionsSection"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.ruleCondition('1')}}" userInput="{{condition1}}" stepKey="selectRule" after="addFirstCondition"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange1)}}" stepKey="waitForFirstRuleElement" after="selectRule"/> - <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange1)}}" stepKey="clickToChangeRule" after="waitForFirstRuleElement"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.ruleParameterSelect('1--1')}}" userInput="{{rule1}}" stepKey="selectRule1" after="clickToChangeRule"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="waitForSecondRuleElement" after="selectRule1"/> - <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="clickToChangeRule1" after="waitForSecondRuleElement"/> - <fillField selector="{{AdminCartPriceRulesFormSection.ruleParameterInput('1--1')}}" userInput="{{rule2}}" stepKey="fillRule" after="clickToChangeRule1"/> - <click selector="{{AdminCartPriceRulesFormSection.addCondition('1--1')}}" stepKey="addSecondCondition" after="fillRule"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.ruleCondition('1--1')}}" userInput="{{condition2}}" stepKey="selectSecondCondition" after="addSecondCondition"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="waitForThirdRuleElement" after="selectSecondCondition"/> - <click selector="{{AdminCartPriceRulesFormSection.ruleParameter(ruleToChange2)}}" stepKey="addThirdCondition" after="waitForThirdRuleElement"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.openChooser('1--1--1')}}" stepKey="waitForForthRuleElement" after="addThirdCondition"/> - <click selector="{{AdminCartPriceRulesFormSection.openChooser('1--1--1')}}" stepKey="openChooser" after="waitForForthRuleElement"/> - <waitForElementVisible selector="{{AdminCartPriceRulesFormSection.categoryCheckbox(categoryName)}}" stepKey="waitForCategoryVisible" after="openChooser"/> - <checkOption selector="{{AdminCartPriceRulesFormSection.categoryCheckbox(categoryName)}}" stepKey="checkCategoryName" after="waitForCategoryVisible"/> - </actionGroup> - - <actionGroup name="VerifyDiscountAmount"> - <annotations> - <description>Goes to the provided Storefront Product URL. Fills in provided Quantity. Clicks Add to Cart. Goes to Checkout. Validates that the provided Discount Amount is present and correct.</description> - </annotations> - <arguments> - <argument name="productUrl" type="string"/> - <argument name="quantity" type="string"/> - <argument name="expectedDiscount" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `VerifyDiscountAmountActionGroup` instead --> - <amOnPage url="{{productUrl}}" stepKey="goToProductPage"/> - <waitForPageLoad stepKey="waitForProductPageLoad"/> - <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="{{quantity}}" stepKey="fillQuantity"/> - <click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addProductToCart"/> - <waitForPageLoad stepKey="waitForAddToCart"/> - <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> - <amOnPage url="{{CheckoutCartPage.url}}" stepKey="goToCartPage"/> - <waitForPageLoad stepKey="waitForCartPage"/> - <waitForElementVisible selector="{{CheckoutCartSummarySection.discountAmount}}" stepKey="waitForDiscountElement"/> - <see selector="{{CheckoutCartSummarySection.discountAmount}}" userInput="{{expectedDiscount}}" stepKey="seeDiscountTotal"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Search/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Search/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 6c860e8273bab..0000000000000 --- a/app/code/Magento/Search/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,51 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="searchTermFilterBySearchQuery"> - <annotations> - <description>Fills in the provided Search Query on the Admin Search Term grid page.</description> - </annotations> - <arguments> - <argument name="searchQuery" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminSearchTermFilterBySearchQueryActionGroup` instead --> - <click selector="{{AdminCatalogSearchTermIndexSection.resetFilterButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForResetFilter"/> - <fillField selector="{{AdminCatalogSearchTermIndexSection.searchQuery}}" userInput="{{searchQuery}}" stepKey="fillSearchQuery"/> - <click selector="{{AdminCatalogSearchTermIndexSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForSearchResultLoad"/> - <checkOption selector="{{AdminCatalogSearchTermIndexSection.searchTermRowCheckboxBySearchQuery(searchQuery)}}" stepKey="checkCheckBox"/> - </actionGroup> - - <actionGroup name="deleteSearchTerm"> - <annotations> - <description>Deletes the Search Terms in the Admin Search Term grid.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDeleteSearchTermActionGroup` instead --> - <selectOption selector="{{AdminCatalogSearchTermIndexSection.massActions}}" userInput="delete" stepKey="selectDeleteOption"/> - <click selector="{{AdminCatalogSearchTermIndexSection.submit}}" stepKey="clickSubmitButton"/> - <click selector="{{AdminCatalogSearchTermIndexSection.okButton}}" stepKey="clickOkButton"/> - <waitForElementVisible selector="{{AdminCatalogSearchTermMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> - </actionGroup> - - <actionGroup name="DeleteAllSearchTerms"> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDeleteAllSearchTermsActionGroup` instead --> - <selectOption userInput="selectAll" selector="{{AdminCatalogSearchTermIndexSection.selectMassActionCheckbox}}" stepKey="checkAllSearchTerms"/> - <selectOption selector="{{AdminCatalogSearchTermIndexSection.massActions}}" userInput="delete" stepKey="selectDeleteOption"/> - <click selector="{{AdminCatalogSearchTermIndexSection.submit}}" stepKey="clickSubmitButton"/> - <click selector="{{AdminCatalogSearchTermIndexSection.okButton}}" stepKey="clickOkButton"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 7654b1baef2d8..0000000000000 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,247 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="CreateCustomStore"> - <annotations> - <description>Goes to the Admin Stores grid page. Clicks on 'Create Store'. Fills in the provided Details (Website, Store Group Name and Store Group Code). Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="website" type="string"/> - <argument name="store" type="string"/> - <argument name="rootCategory" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateCustomStoreActionGroup` instead --> - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <waitForPageLoad stepKey="waitForSystemStorePage"/> - <click selector="{{AdminStoresMainActionsSection.createStoreButton}}" stepKey="selectCreateStore"/> - <selectOption userInput="{{website}}" selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" stepKey="selectMainWebsite"/> - <fillField userInput="{{store}}" selector="{{AdminNewStoreGroupSection.storeGrpNameTextField}}" stepKey="fillStoreName"/> - <fillField userInput="{{store}}" selector="{{AdminNewStoreGroupSection.storeGrpCodeTextField}}" stepKey="fillStoreCode"/> - <selectOption userInput="{{rootCategory}}" selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" stepKey="selectStoreStatus"/> - <click selector="{{AdminStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup"/> - <waitForElementVisible selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="waitForStoreGridReload"/> - <see userInput="You saved the store." stepKey="seeSavedMessage"/> - </actionGroup> - - <actionGroup name="AssertStoreGroupInGrid"> - <annotations> - <description>Goes to the Admin Stores grid page. Searches for the provided Store Group Name. Validates that the provided Store Group Name is present in the grid.</description> - </annotations> - <arguments> - <argument name="storeGroupName" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStoreGroupInGridActionGroup` instead --> - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForStoreToLoad"/> - <see selector="{{AdminStoresGridSection.nthRow('1')}}" userInput="{{storeGroupName}}" stepKey="seeAssertStoreGroupInGridMessage"/> - </actionGroup> - - <actionGroup name="AssertStoreGroupForm"> - <annotations> - <description>Clicks on the 1st Store in the 'Stores' grid. Validates that the provided Details (Website, Store Group Name, Store Group Code and Root Category) are present and correct.</description> - </annotations> - <arguments> - <argument name="website" type="string"/> - <argument name="storeGroupName" type="string"/> - <argument name="storeGroupCode" type="string"/> - <argument name="rootCategory" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStoreGroupFormActionGroup` instead --> - <click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickEditExistingStoreRow"/> - <waitForPageLoad stepKey="waitTillAdminSystemStoreGroupPage"/> - <seeInField selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" userInput="{{website}}" stepKey="seeAssertWebsite"/> - <seeInField selector="{{AdminNewStoreGroupSection.storeGrpNameTextField}}" userInput="{{storeGroupName}}" stepKey="seeAssertStoreGroupName"/> - <seeInField selector="{{AdminNewStoreGroupSection.storeGrpCodeTextField}}" userInput="{{storeGroupCode}}" stepKey="seeAssertStoreGroupCode"/> - <seeInField selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" userInput="{{rootCategory}}" stepKey="seeAssertRootCategory"/> - </actionGroup> - - <actionGroup name="AdminCreateStoreViewActionSaveGroup"> - <annotations> - <description>Validates that the Success Message is present and correct.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateStoreViewSaveActionGroup` instead --> - <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> - <waitForElementVisible selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="waitForStoreGridToReload2"/> - <see userInput="You saved the store view." stepKey="seeSavedMessage"/> - </actionGroup> - - <actionGroup name="navigateToAdminContentManagementPage"> - <annotations> - <description>Goes to the 'Configuration' page for 'Content Management'.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `NavigateToAdminContentManagementPageActionGroup` instead --> - <amOnPage url="{{AdminContentManagementPage.url}}" stepKey="navigateToConfigurationPage"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - </actionGroup> - - <actionGroup name="saveStoreConfiguration"> - <annotations> - <description>Clicks on the Save button.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveStoreConfigurationActionGroup` instead --> - <comment userInput="saveStoreConfiguration" stepKey="comment"/> - <waitForElementVisible selector="{{StoreConfigSection.Save}}" stepKey="waitForSaveButton"/> - <click selector="{{StoreConfigSection.Save}}" stepKey="clickSaveButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - </actionGroup> - - <actionGroup name="saveStoreConfigurationAndValidateFieldError"> - <annotations> - <description>Clicks on Save. Validates that the fields are required.</description> - </annotations> - <arguments> - <argument name="inputFieldError" type="string"/> - <argument name="errorMessageSelector" type="string"/> - <argument name="errorMessage" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SaveStoreConfigurationAndValidateFieldErrorActionGroup` instead --> - <comment userInput="saveStoreConfigurationAndValidateFieldError" stepKey="comment"/> - <waitForElementVisible selector="{{StoreConfigSection.Save}}" stepKey="waitForSaveButton"/> - <click selector="{{StoreConfigSection.Save}}" stepKey="clickSaveButton"/> - <waitForElement selector="{{inputFieldError}}" stepKey="waitForErrorField"/> - <waitForElementVisible selector="{{errorMessageSelector}}" stepKey="waitForErrorMessage"/> - <see selector="{{errorMessageSelector}}" userInput="{{errorMessage}}" stepKey="seeErrorMessage"/> - </actionGroup> - - <actionGroup name="AssertWebsiteInGrid"> - <annotations> - <description>Goes to the Admin Stores grid page. Searches the grid for the provided Website Name. Validates that the Website appears in the grid.</description> - </annotations> - <arguments> - <argument name="websiteName" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertWebsiteInGridActionGroup` instead --> - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{websiteName}}" selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="fillWebsiteField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForStoreToLoad"/> - <seeElement selector="{{AdminStoresGridSection.websiteName(websiteName)}}" stepKey="seeAssertWebsiteInGrid"/> - </actionGroup> - - <actionGroup name="AssertWebsiteForm"> - <annotations> - <description>Clicks on the provided Website Name in the Admin Stores grid. Validates that the URL, Website Name/Code are present and correct.</description> - </annotations> - <arguments> - <argument name="websiteName" type="string"/> - <argument name="websiteCode" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertWebsiteFormActionGroup` instead --> - <click selector="{{AdminStoresGridSection.websiteName(websiteName)}}" stepKey="clickWebsiteFirstRowInGrid"/> - <waitForPageLoad stepKey="waitTillWebsiteFormPageIsOpened"/> - <grabFromCurrentUrl regex="~(\d+)/~" stepKey="grabWebsiteIdFromCurrentUrl"/> - <seeInCurrentUrl url="/system_store/editWebsite/website_id/{$grabWebsiteIdFromCurrentUrl}" stepKey="seeWebsiteId"/> - <seeInField selector="{{AdminNewWebsiteSection.name}}" userInput="{{websiteName}}" stepKey="seeAssertWebsiteName"/> - <seeInField selector="{{AdminNewWebsiteSection.code}}" userInput="{{websiteCode}}" stepKey="seeAssertWebsiteCode"/> - </actionGroup> - - <actionGroup name="AssertStoreViewNotInGrid"> - <annotations> - <description>Goes to the Admin Stores grid page. Searches the grid for the provided Store View name. Validates that it does NOT appear in the grid.</description> - </annotations> - <arguments> - <argument name="storeViewName" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStoreViewNotInGridActionGroup` instead --> - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{storeViewName}}" selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="fillSearchStoreViewField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForStoreToLoad"/> - <see selector="{{AdminStoresGridSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertStoreViewNotInGridMessage"/> - </actionGroup> - - <actionGroup name="AdminAddCustomWebSiteToStoreGroup"> - <annotations> - <description>Goes to the Admin Stores grid page. Searches the grid for the provided Store Group. Edits the Store. Adds the provided Website to the Store. Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="storeGroup" defaultValue="customStoreGroup"/> - <argument name="website" defaultValue="customWebsite"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddCustomWebSiteToStoreGroupActionGroup` instead --> - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{storeGroup.name}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <see userInput="{{storeGroup.name}}" selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="verifyThatCorrectStoreGroupFound"/> - <click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickEditExistingStoreRow"/> - <waitForPageLoad stepKey="waitForStoreGroupPageLoad"/> - <selectOption selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" userInput="{{website.name}}" stepKey="selectWebsite"/> - <selectOption selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" userInput="Default Category" stepKey="chooseRootCategory"/> - <click selector="{{AdminNewStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup"/> - <conditionalClick selector="{{AdminNewStoreGroupSection.acceptNewStoreGroupCreation}}" dependentSelector="{{AdminNewStoreGroupSection.acceptNewStoreGroupCreation}}" visible="true" stepKey="clickAcceptNewStoreGroupCreationButton"/> - <waitForElementVisible selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="waitForPageReload"/> - <see userInput="You saved the store." stepKey="seeSavedMessage"/> - </actionGroup> - - <actionGroup name="CreateStoreView"> - <annotations> - <description>Goes to the Admin Store Views creation page. Fills in the provided Store View, Store Group Name and Store View Status. Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="storeView" defaultValue="customStore"/> - <argument name="storeGroupName" defaultValue="_defaultStoreGroup.name"/> - <argument name="storeViewStatus" defaultValue="_defaultStore.is_active"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `CreateStoreViewActionGroup` instead --> - <amOnPage url="{{AdminSystemStoreViewPage.url}}" stepKey="amOnAdminSystemStoreViewPage"/> - <waitForPageLoad stepKey="waitForProductPageLoad"/> - <selectOption userInput="{{storeGroupName}}" selector="{{AdminNewStoreSection.storeGrpDropdown}}" stepKey="selectStoreGroup"/> - <fillField userInput="{{storeView.name}}" selector="{{AdminNewStoreSection.storeNameTextField}}" stepKey="fillStoreViewName"/> - <fillField userInput="{{storeView.code}}" selector="{{AdminNewStoreSection.storeCodeTextField}}" stepKey="fillStoreViewCode"/> - <selectOption userInput="{{storeViewStatus}}" selector="{{AdminNewStoreSection.statusDropdown}}" stepKey="selectStoreViewStatus"/> - <click selector="{{AdminStoresMainActionsSection.saveButton}}" stepKey="clickSaveStoreViewButton"/> - <waitForElementVisible selector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" stepKey="waitForAcceptNewStoreViewCreationButton"/> - <conditionalClick selector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" dependentSelector="{{AdminNewStoreSection.acceptNewStoreViewCreation}}" visible="true" stepKey="clickAcceptNewStoreViewCreationButton"/> - <see userInput="You saved the store view." stepKey="seeSavedMessage"/> - </actionGroup> - - <actionGroup name="AssertStoreNotInGrid"> - <annotations> - <description>Goes to the Admin Stores grid page. Validates that the provided Store Group Name is NOT present in the grid.</description> - </annotations> - <arguments> - <argument name="storeGroupName" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStoreNotInGridActionGroup` instead --> - <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> - <waitForPageLoad stepKey="waitForAdminSystemStorePageLoad"/> - <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> - <fillField userInput="{{storeGroupName}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> - <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> - <waitForPageLoad stepKey="waitForStoreToLoad"/> - <see selector="{{AdminStoresGridSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertStoreGroupNotInGridMessage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 676d6bb2d3e37..0000000000000 --- a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,115 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="setColorPickerByHex"> - <annotations> - <description>Sets the provided HEX value in the provided Color Picker.</description> - </annotations> - <arguments> - <argument name="nthColorPicker" type="string" defaultValue="1"/> - <argument name="hexColor" type="string" defaultValue="e74c3c"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SetColorPickerByHexActionGroup` instead --> - <pressKey selector="{{AdminColorPickerSection.hexByIndex(nthColorPicker)}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,\Facebook\WebDriver\WebDriverKeys::BACKSPACE,'{{hexColor}}']" stepKey="fillHex1"/> - <click selector="{{AdminColorPickerSection.submitByIndex(nthColorPicker)}}" stepKey="submitColor1"/> - </actionGroup> - - <actionGroup name="assertSwatchColor"> - <annotations> - <description>Validates that the provided Color Picker contains the provided Style.</description> - </annotations> - <arguments> - <argument name="nthSwatch" type="string" defaultValue="1"/> - <argument name="expectedStyle" type="string" defaultValue="background: rgb(0, 0, 0);"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertSwatchColorActionGroup` instead --> - <grabAttributeFrom selector="{{AdminManageSwatchSection.nthSwatch(nthSwatch)}}" userInput="style" stepKey="grabStyle1"/> - <assertEquals stepKey="assertStyle1"> - <actualResult type="string">{$grabStyle1}</actualResult> - <expectedResult type="string">{{expectedStyle}}</expectedResult> - </assertEquals> - </actionGroup> - - <actionGroup name="assertStorefrontSwatchColor"> - <annotations> - <description>Validates that the Storefront Product has the provided Swatch with the provided Color.</description> - </annotations> - <arguments> - <argument name="nthSwatch" type="string" defaultValue="1"/> - <argument name="expectedRgb" type="string" defaultValue="rgb(231, 77, 60)"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStorefrontSwatchColorActionGroup` instead --> - <grabAttributeFrom selector="{{StorefrontProductInfoMainSection.nthSwatchOption(nthSwatch)}}" userInput="style" stepKey="grabStyle1"/> - <assertEquals stepKey="assertStyle1"> - <actualResult type="string">{$grabStyle1}</actualResult> - <expectedResult type="string">background: center center no-repeat {{expectedRgb}};</expectedResult> - </assertEquals> - </actionGroup> - - <actionGroup name="openSwatchMenuByIndex"> - <annotations> - <description>Options the Swatch Menu based on the provided Index.</description> - </annotations> - <arguments> - <argument name="index" type="string" defaultValue="0"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `OpenSwatchMenuByIndexActionGroup` instead --> - <executeJS function="jQuery('#swatch_window_option_option_{{index}}').click()" stepKey="clickSwatch1"/> - </actionGroup> - - <actionGroup name="StorefrontSelectSwatchOptionOnProductPage"> - <arguments> - <argument name="optionName" type="string"/> - </arguments> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontSelectSwatchOptionOnProductPageActionGroup` instead --> - <click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(optionName)}}" stepKey="clickSwatchOption"/> - </actionGroup> - - <actionGroup name="StorefrontAssertSwatchOptionPrice"> - <arguments> - <argument name="optionName" type="string"/> - <argument name="optionPrice" type="string"/> - </arguments> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontAssertSwatchOptionPriceActionGroup` instead --> - <click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(optionName)}}" stepKey="clickOnOption"/> - <see userInput="{{optionPrice}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seeOptionPrice"/> - </actionGroup> - - <actionGroup name="StorefrontSelectSwatchOptionOnProductPageAndCheckImage" extends="StorefrontSelectSwatchOptionOnProductPage"> - <arguments> - <argument name="fileName" type="string" defaultValue="magento-logo"/> - </arguments> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontSelectSwatchOptionOnProductPageAndCheckImageActionGroup` instead --> - <seeElement selector="{{StorefrontProductMediaSection.productImageActive(fileName)}}" stepKey="seeActiveImageDefault"/> - </actionGroup> - - <actionGroup name="StorefrontUpdateCartConfigurableProductWithSwatches"> - <arguments> - <argument name="product"/> - <argument name="productOption" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontUpdateCartConfigurableProductWithSwatchesActionGroup` instead --> - <click selector="{{CheckoutCartProductSection.nthEditButton('1')}}" stepKey="clickEditConfigurableProductButton"/> - <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <click selector="{{StorefrontProductInfoMainSection.visualSwatchOption(productOption)}}" stepKey="changeSwatchAttributeOption"/> - <click selector="{{StorefrontProductInfoMainSection.updateCart}}" stepKey="clickUpdateCartButton"/> - <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> - <see selector="{{StorefrontMessagesSection.success}}" userInput="{{product.name}} was updated in your shopping cart." stepKey="assertSuccessMessage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 95516361a74f5..0000000000000 --- a/app/code/Magento/Tax/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,271 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="addCustomerTaxClass"> - <annotations> - <description>Adds the provided Customer Tax Class on the Admin Tax Rule creation/edit page.</description> - </annotations> - <arguments> - <argument name="customerTaxClassName" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddCustomerTaxClassActionGroup` instead --> - <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> - <click stepKey="clickCustomerAddNewTaxClassBtn" selector="{{AdminTaxRulesSection.customerAddNewTaxClass}}"/> - <fillField stepKey="fillCustomerNewTaxClass" selector="{{AdminTaxRulesSection.fieldCustomerNewTaxClass}}" userInput="{{customerTaxClassName}}"/> - <click stepKey="saveProdTaxRate" selector="{{AdminTaxRulesSection.saveCustomerNewTaxClass}}"/> - </actionGroup> - - <actionGroup name="deleteCustomerTaxClass"> - <annotations> - <description>Goes to the Admin New Tax Rule page. Deletes the provided Tax Class Name.</description> - </annotations> - <arguments> - <argument name="taxClassName" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DeleteCustomerTaxClassActionGroup` instead --> - <amOnPage url="{{AdminNewTaxRulePage.url}}" stepKey="goToNewTaxRulePage"/> - <waitForPageLoad stepKey="waitForTaxRatePage"/> - <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> - <scrollTo stepKey="scrollToAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> - <moveMouseOver stepKey="hoverDeleteElement" selector="{{AdminTaxRulesSection.deleteTaxClassName(taxClassName)}}"/> - <click stepKey="deleteFirstTaxClass" selector="{{AdminTaxRulesSection.deleteTaxClass(taxClassName)}}"/> - <waitForElementVisible selector="{{AdminTaxRulesSection.popUpDialogOK}}" stepKey="waitForElementBecomeVisible"/> - <click stepKey="acceptPopUpDialog" selector="{{AdminTaxRulesSection.popUpDialogOK}}"/> - <waitForPageLoad stepKey="waitForProductTaxClassDeleted"/> - </actionGroup> - <actionGroup name="editTaxConfigurationByUI"> - <annotations> - <description>Goes to the 'Configuration' page for 'Tax'. Enables the display of Taxes in the Storefront Shopping Cart and Checkout page.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `EditTaxConfigurationByUIActionGroup` instead --> - <amOnPage url="{{AdminTaxConfigurationPage.url}}" stepKey="goToAdminTaxPage"/> - <waitForPageLoad stepKey="waitForTaxConfigLoad"/> - - <scrollTo selector="#tax_defaults-head" x="0" y="-80" stepKey="scrollToTaxDefaults"/> - - <conditionalClick stepKey="clickCalculationSettings" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="#tax_defaults" visible="false"/> - <conditionalClick stepKey="clickCalculationSettingsAgain" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="#tax_defaults" visible="false"/> - <uncheckOption stepKey="clickDefaultState" selector="{{AdminConfigureTaxSection.systemValueDefaultState}}"/> - <selectOption stepKey="selectDefaultState" selector="{{AdminConfigureTaxSection.dropdownDefaultState}}" userInput="California"/> - <fillField stepKey="fillDefaultPostCode" selector="{{AdminConfigureTaxSection.defaultPostCode}}" userInput="*"/> - - <scrollTo selector="#tax_cart_display-head" x="0" y="-80" stepKey="scrollToTaxShoppingCartDisplay"/> - - <conditionalClick stepKey="clickShoppingCartDisplaySettings" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="#tax_cart_display" visible="false"/> - <conditionalClick stepKey="clickShoppingCartDisplaySettingsAgain" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="#tax_cart_display" visible="false"/> - <uncheckOption stepKey="clickTaxTotalCart" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}"/> - <selectOption stepKey="selectTaxTotalCart" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalCart}}" userInput="Yes"/> - <uncheckOption stepKey="clickDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummaryCart}}"/> - <selectOption stepKey="selectDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummaryCart}}" userInput="Yes"/> - <uncheckOption stepKey="clickDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxCart}}"/> - <selectOption stepKey="selectDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxCart}}" userInput="Yes"/> - - <scrollTo selector="#tax_sales_display-head" x="0" y="-80" stepKey="scrollToTaxSalesDisplay"/> - - <conditionalClick stepKey="clickOrdersInvoicesCreditSales" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="#tax_sales_display" visible="false"/> - <conditionalClick stepKey="clickOrdersInvoicesCreditSalesAgain" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="#tax_sales_display" visible="false"/> - <uncheckOption stepKey="clickTaxTotalSales" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}"/> - <selectOption stepKey="selectTaxTotalSales" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalSales}}" userInput="Yes"/> - <uncheckOption stepKey="clickDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummarySales}}"/> - <selectOption stepKey="selectDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummarySales}}" userInput="Yes"/> - <uncheckOption stepKey="clickDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxSales}}"/> - <selectOption stepKey="selectDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxSales}}" userInput="Yes"/> - - <scrollToTopOfPage stepKey="scrollToTop"/> - <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> - <waitForPageLoad stepKey="waitForTaxSaved"/> - <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> - </actionGroup> - - <actionGroup name="changeToDefaultTaxConfigurationUI"> - <annotations> - <description>Goes to the 'Configuration' page for 'Tax'. Set the Tax Configuration Settings to the Default values. Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeToDefaultTaxConfigurationUIActionGroup` instead --> - <amOnPage url="{{AdminTaxConfigurationPage.url}}" stepKey="goToAdminTaxPage"/> - <waitForPageLoad stepKey="waitForTaxConfigLoad"/> - - <conditionalClick stepKey="clickCalculationSettings" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="{{AdminConfigureTaxSection.systemValueDefaultState}}" visible="false"/> - <conditionalClick stepKey="clickCalculationSettingsAgain" selector="{{AdminConfigureTaxSection.defaultDestination}}" dependentSelector="{{AdminConfigureTaxSection.systemValueDefaultState}}" visible="false"/> - <checkOption stepKey="clickDefaultState" selector="{{AdminConfigureTaxSection.systemValueDefaultState}}"/> - <selectOption stepKey="selectDefaultState" selector="{{AdminConfigureTaxSection.dropdownDefaultState}}" userInput="California"/> - <fillField stepKey="fillDefaultPostCode" selector="{{AdminConfigureTaxSection.defaultPostCode}}" userInput=""/> - - <conditionalClick stepKey="clickShoppingCartDisplaySettings" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}" visible="false"/> - <conditionalClick stepKey="clickShoppingCartDisplaySettingsAgain" selector="{{AdminConfigureTaxSection.shoppingCartDisplay}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}" visible="false"/> - <checkOption stepKey="clickTaxTotalCart" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalCart}}"/> - <selectOption stepKey="selectTaxTotalCart" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalCart}}" userInput="Yes"/> - <checkOption stepKey="clickDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummaryCart}}"/> - <selectOption stepKey="selectDisplayTaxSummaryCart" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummaryCart}}" userInput="Yes"/> - <checkOption stepKey="clickDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxCart}}"/> - <selectOption stepKey="selectDisplayZeroTaxCart" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxCart}}" userInput="Yes"/> - - <conditionalClick stepKey="clickOrdersInvoicesCreditSales" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}" visible="false"/> - <conditionalClick stepKey="clickOrdersInvoicesCreditSalesAgain" selector="{{AdminConfigureTaxSection.ordersInvoicesCreditSales}}" dependentSelector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}" visible="false"/> - <checkOption stepKey="clickTaxTotalSales" selector="{{AdminConfigureTaxSection.systemValueIncludeTaxTotalSales}}"/> - <selectOption stepKey="selectTaxTotalSales" selector="{{AdminConfigureTaxSection.dropdownIncludeTaxTotalSales}}" userInput="Yes"/> - <checkOption stepKey="clickDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.systemValueDisplayTaxSummarySales}}"/> - <selectOption stepKey="selectDisplayTaxSummarySales" selector="{{AdminConfigureTaxSection.dropdownDisplayTaxSummarySales}}" userInput="Yes"/> - <checkOption stepKey="clickDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.systemValueDisplayZeroTaxSales}}"/> - <selectOption stepKey="selectDisplayZeroTaxSales" selector="{{AdminConfigureTaxSection.dropdownDisplayZeroTaxSales}}" userInput="Yes"/> - - <scrollToTopOfPage stepKey="scrollToTop"/> - <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> - <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> - </actionGroup> - - <actionGroup name="addCustomTaxRate" extends="addNewTaxRateNoZip"> - <annotations> - <description>EXTENDS: addNewTaxRateNoZip. Removes 'fillZipCode' and 'fillRate'. Fills in the Zip Code and Rate. PLEASE NOTE: The values are Hardcoded.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddCustomTaxRateActionGroup` instead --> - <remove keyForRemoval="fillZipCode"/> - <remove keyForRemoval="fillRate"/> - <fillField stepKey="fillZipCode" selector="{{AdminTaxRulesSection.zipCode}}" userInput="US-NY-*-Rate 2" after="fillTaxIdentifier"/> - <fillField stepKey="fillRate" selector="{{AdminTaxRulesSection.rate}}" userInput="0" after="selectCountry"/> - </actionGroup> - - <actionGroup name="addNewTaxRateNoZip"> - <annotations> - <description>Goes to the Admin Tax Rules grid page. Adds the provided Tax Code.</description> - </annotations> - <arguments> - <argument name="taxCode"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddNewTaxRateNoZipActionGroup` instead --> - <click stepKey="addNewTaxRate" selector="{{AdminTaxRulesSection.addNewTaxRate}}"/> - - <fillField stepKey="fillTaxIdentifier" selector="{{AdminTaxRulesSection.taxIdentifier}}" userInput="{{taxCode.state}}-{{taxCode.rate}}"/> - <fillField stepKey="fillZipCode" selector="{{AdminTaxRulesSection.zipCode}}" userInput="{{taxCode.zip}}"/> - <selectOption stepKey="selectState" selector="{{AdminTaxRulesSection.state}}" userInput="{{taxCode.state}}"/> - <selectOption stepKey="selectCountry" selector="{{AdminTaxRulesSection.country}}" userInput="{{taxCode.country}}"/> - <fillField stepKey="fillRate" selector="{{AdminTaxRulesSection.rate}}" userInput="{{taxCode.rate}}"/> - - <click stepKey="saveTaxRate" selector="{{AdminTaxRulesSection.save}}"/> - </actionGroup> - - <actionGroup name="changeShippingTaxClass"> - <annotations> - <description>Goes to the 'Configuration' page for 'Tax'. Sets the 'Tax Class for Shipping' configuration setting to 'Taxable Goods'. Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ChangeShippingTaxClassActionGroup` instead --> - <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES"/> - <waitForPageLoad stepKey="waitForConfiguration"/> - <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations"/> - <waitForPageLoad stepKey="waitForSales"/> - - <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES1"/> - <waitForPageLoad stepKey="waitForConfiguration1"/> - <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations1"/> - <waitForPageLoad stepKey="waitForSales1" time="5"/> - - <click selector="{{ConfigurationListSection.sales}}" stepKey="clickOnSales"/> - <waitForPageLoad stepKey="waitForPaymentMethods"/> - <click selector="{{AdminConfigureTaxSection.salesTax}}" stepKey="clickOnTax"/> - <waitForPageLoad stepKey="waitForTax"/> - <seeInCurrentUrl url="{{AdminTaxConfigurationPage.url}}" stepKey="adminTaxConfiguration"/> - <seeElement selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="taxClassSectionC"/> - <click selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="openTaxClassSection"/> - <click selector="{{AdminConfigureTaxSection.taxShippingClassSystem}}" stepKey="uncheckSystemValue"/> - <selectOption selector="{{AdminConfigureTaxSection.taxClassShipping}}" userInput="Taxable Goods" stepKey="setTaxClassForShipping"/> - - <scrollToTopOfPage stepKey="scrollToTop"/> - <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> - <waitForPageLoad stepKey="waitForTaxSaved"/> - <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> - </actionGroup> - - <actionGroup name="setDefaultShippingTaxClass"> - <annotations> - <description>Goes to the 'Configuration' page via the Admin Side Menu. Sets the 'Tax Class for Shipping' to the System Default. Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SetDefaultShippingTaxClassActionGroup` instead --> - <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES"/> - <waitForPageLoad stepKey="waitForConfiguration"/> - <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations"/> - <waitForPageLoad stepKey="waitForSales"/> - - <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES1"/> - <waitForPageLoad stepKey="waitForConfiguration1"/> - <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations1"/> - <waitForPageLoad stepKey="waitForSales1"/> - - <click selector="{{ConfigurationListSection.sales}}" stepKey="clickOnSales"/> - <waitForPageLoad stepKey="waitForPaymentMethods"/> - <click selector="{{AdminConfigureTaxSection.salesTax}}" stepKey="clickOnTax"/> - <waitForPageLoad stepKey="waitForTax"/> - <seeElement selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="taxClassSectionC"/> - <click selector="{{AdminConfigureTaxSection.taxShippingClassSystem}}" stepKey="checkSystemDefaultValue"/> - <click selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="closeTaxClassSection"/> - - <scrollToTopOfPage stepKey="scrollToTop"/> - <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> - <waitForPageLoad stepKey="waitForTaxSaved"/> - <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> - </actionGroup> - - <actionGroup name="addProductTaxClass"> - <annotations> - <description>Adds the provided Product Tax Class to a Tax Rule. Clicks on Save.</description> - </annotations> - <arguments> - <argument name="prodTaxClassName" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddProductTaxClassActionGroup` instead --> - <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> - <click stepKey="clickProdAddNewTaxClassBtn" selector="{{AdminTaxRulesSection.productAddNewTaxClass}}"/> - <fillField stepKey="fillProdNewTaxClass" selector="{{AdminTaxRulesSection.fieldProdNewTaxClass}}" userInput="{{prodTaxClassName}}"/> - <click stepKey="saveProdTaxRate" selector="{{AdminTaxRulesSection.saveProdNewTaxClass}}"/> - </actionGroup> - - <actionGroup name="addNewTaxRuleActionGroup"> - <annotations> - <description>Goes to the Admin Tax Rules grid page. Clicks on the Add New Tax Rule button.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AddNewTaxRuleActionGroup` instead --> - <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRulePage"/> - <waitForPageLoad stepKey="waitForTaxRatePage"/> - <click stepKey="addNewTaxRate" selector="{{AdminGridMainControls.add}}"/> - </actionGroup> - - <actionGroup name="deleteProductTaxClass"> - <annotations> - <description>Goes to the Admin Tax Rule creation page. Deletes the provided Tax Class.</description> - </annotations> - <arguments> - <argument name="taxClassName" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `DeleteProductTaxClassActionGroup` instead --> - <amOnPage url="{{AdminNewTaxRulePage.url}}" stepKey="goToNewTaxRulePage"/> - <waitForPageLoad stepKey="waitForTaxRatePage"/> - <click stepKey="clickAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> - <scrollTo stepKey="scrollToAdditionalSettings" selector="{{AdminTaxRulesSection.additionalSettings}}"/> - <moveMouseOver stepKey="hoverDeleteElement" selector="{{AdminTaxRulesSection.deleteTaxClassName(taxClassName)}}"/> - <click stepKey="deleteFirstTaxClass" selector="{{AdminTaxRulesSection.deleteTaxClass(taxClassName)}}"/> - <waitForElementVisible selector="{{AdminTaxRulesSection.popUpDialogOK}}" stepKey="waitForElementBecomeVisible"/> - <click stepKey="acceptPopUpDialog" selector="{{AdminTaxRulesSection.popUpDialogOK}}"/> - <waitForPageLoad stepKey="waitForProductTaxClassDeleted"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Ui/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Ui/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 48d6b90ddb8dc..0000000000000 --- a/app/code/Magento/Ui/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,98 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="searchAdminDataGridByKeyword"> - <annotations> - <description>Fills 'Search by keyword' on an Admin Grid page. Clicks on Submit Search.</description> - </annotations> - <arguments> - <argument name="keyword"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `SearchAdminDataGridByKeywordActionGroup` instead --> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> - <fillField selector="{{AdminDataGridHeaderSection.search}}" userInput="{{keyword}}" stepKey="fillKeywordSearchField"/> - <click selector="{{AdminDataGridHeaderSection.submitSearch}}" stepKey="clickKeywordSearch"/> - </actionGroup> - - <actionGroup name="resetAdminDataGridToDefaultView"> - <annotations> - <description>Resets an Admin Grid page to the 'Default View'.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ResetAdminDataGridToDefaultViewActionGroup` instead --> - <click selector="{{AdminDataGridHeaderSection.bookmarkToggle}}" stepKey="openViewBookmarks"/> - <click selector="{{AdminDataGridHeaderSection.bookmarkOption('Default View')}}" stepKey="selectDefaultGridView"/> - <see selector="{{AdminDataGridHeaderSection.bookmarkToggle}}" userInput="Default View" stepKey="seeDefaultViewSelected"/> - </actionGroup> - - <actionGroup name="clearFiltersAdminDataGrid"> - <annotations> - <description>Clicks on 'Clear Filters' on an Admin Grid page.</description> - </annotations> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `ClearFiltersAdminDataGridActionGroup` instead --> - <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingOrderFilters"/> - </actionGroup> - - <actionGroup name="adminDataGridSelectPerPage"> - <annotations> - <description>Sets the provided preset 'per page' display setting on an Admin Grid page.</description> - </annotations> - <arguments> - <argument name="perPage" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDataGridSelectPerPageActionGroup` instead --> - <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> - <click selector="{{AdminDataGridPaginationSection.perPageOption(perPage)}}" stepKey="selectCustomPerPage"/> - <waitForPageLoad stepKey="waitForGridLoad"/> - </actionGroup> - - <actionGroup name="adminDataGridSelectCustomPerPage"> - <annotations> - <description>Sets the provided custom 'per page' display setting on an Admin Grid page.</description> - </annotations> - <arguments> - <argument name="perPage"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDataGridSelectCustomPerPageActionGroup` instead --> - <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> - <click selector="{{AdminDataGridPaginationSection.perPageOption('Custom')}}" stepKey="selectCustomPerPage"/> - <waitForElementVisible selector="{{AdminDataGridPaginationSection.perPageInput}}" time="30" stepKey="waitForInputVisible"/> - <fillField selector="{{AdminDataGridPaginationSection.perPageInput}}" userInput="{{perPage}}" stepKey="fillCustomPerPage"/> - <click selector="{{AdminDataGridPaginationSection.perPageApplyInput}}" stepKey="applyCustomPerPage"/> - <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> - <seeInField selector="{{AdminDataGridPaginationSection.perPageDropDownValue}}" userInput="{{perPage}}" stepKey="seePerPageValueInDropDown"/> - </actionGroup> - - <actionGroup name="adminDataGridDeleteCustomPerPage"> - <annotations> - <description>Sets the provided custom 'per page' display setting on an Admin Grid page. Deletes the Items listed in a grid. Validates that the 'per page' count in NOT present.</description> - </annotations> - <arguments> - <argument name="perPage"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDataGridDeleteCustomPerPageActionGroup` instead --> - <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown1"/> - <click selector="{{AdminDataGridPaginationSection.perPageEditCustomValue(perPage)}}" stepKey="clickToEditCustomPerPage"/> - <waitForElementVisible selector="{{AdminDataGridPaginationSection.perPageDeleteCustomValue(perPage)}}" time="30" stepKey="waitForDeleteButtonVisible"/> - <click selector="{{AdminDataGridPaginationSection.perPageDeleteCustomValue(perPage)}}" stepKey="clickToDeleteCustomPerPage"/> - <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/> - <click selector="{{AdminDataGridPaginationSection.perPageDropdown}}" stepKey="clickPerPageDropdown"/> - <dontSeeElement selector="{{AdminDataGridPaginationSection.perPageDropDownItem(perPage)}}" stepKey="dontSeeDropDownItem"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index c990db8cc3cf8..0000000000000 --- a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,296 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminAddUrlRewrite"> - <annotations> - <description>Goes to the Admin Add URL Rewrite edit page. Fills in the provided URL details. Clicks on Save. Validates that the Success Message is present.</description> - </annotations> - <arguments> - <argument name="category" type="string"/> - <argument name="customUrlRewriteValue" type="string"/> - <argument name="storeValue" type="string"/> - <argument name="requestPath" type="string"/> - <argument name="redirectTypeValue" type="string"/> - <argument name="description" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddUrlRewriteActionGroup` instead --> - <amOnPage url="{{AdminUrlRewriteEditPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForElementVisible selector="{{AdminUrlRewriteEditSection.createCustomUrlRewrite}}" stepKey="waitForCreateUrlRewriteVisible"/> - <selectOption selector="{{AdminUrlRewriteEditSection.createCustomUrlRewrite}}" userInput="{{customUrlRewriteValue}}" stepKey="selectUrlRewriteTypeOption"/> - <waitForElementVisible selector="{{AdminUrlRewriteEditSection.categoryInTree(category)}}" stepKey="waitForCategoryInTreeVisible"/> - <click selector="{{AdminUrlRewriteEditSection.categoryInTree(category)}}" stepKey="clickOnCategoryInTree"/> - <waitForElementVisible selector="{{AdminUrlRewriteEditSection.store}}" stepKey="waitForStoreSelectVisible"/> - <selectOption selector="{{AdminUrlRewriteEditSection.store}}" userInput="{{storeValue}}" stepKey="selectStoreOption"/> - <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPathField"/> - <selectOption selector="{{AdminUrlRewriteEditSection.redirectType}}" userInput="{{redirectTypeValue}}" stepKey="selectRedirectType"/> - <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescriptionField"/> - <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveButton"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> - <see selector="{{AdminMessagesSection.success}}" userInput="The URL Rewrite has been saved." stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="AdminAddUrlRewriteForProduct"> - <annotations> - <description>Adds the provided URL Rewrite details for a Product.</description> - </annotations> - <arguments> - <argument name="storeValue" type="string"/> - <argument name="requestPath" type="string"/> - <argument name="redirectTypeValue" type="string"/> - <argument name="description" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddUrlRewriteForProductActionGroup` instead --> - <waitForElementVisible selector="{{AdminUrlRewriteProductSection.skipCategoryButton}}" stepKey="waitForSkipCategoryButton"/> - <click selector="{{AdminUrlRewriteProductSection.skipCategoryButton}}" stepKey="clickOnSkipCategoryButton"/> - <waitForPageLoad stepKey="waitForProductPageToLoad"/> - <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> - <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> - <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> - <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue('redirectTypeValue')}}" stepKey="clickOnRedirectTypeValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> - <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> - <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> - </actionGroup> - - <actionGroup name="AdminAddCustomUrlRewrite"> - <annotations> - <description>Goes to the Admin URL Rewrite edit page. Adds the provided Custom URL Rewrite details. Clicks on Save. Validates that the Success Message is present.</description> - </annotations> - <arguments> - <argument name="customUrlRewriteValue" type="string"/> - <argument name="storeValue" type="string"/> - <argument name="requestPath" type="string"/> - <argument name="targetPath" type="string"/> - <argument name="redirectTypeValue" type="string"/> - <argument name="description" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddCustomUrlRewriteActionGroup` instead --> - <amOnPage url="{{AdminUrlRewriteEditPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad" after="openUrlRewriteEditPage"/> - <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewrite}}" stepKey="clickOnCustonUrlRewrite"/> - <click selector="{{AdminUrlRewriteEditSection.createCustomUrlRewriteValue('customUrlRewriteValue')}}" stepKey="selectCustom"/> - <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> - <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> - <fillField selector="{{AdminUrlRewriteEditSection.targetPath}}" userInput="{{targetPath}}" stepKey="fillTargetPath"/> - <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> - <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue('redirectTypeValue')}}" stepKey="selectRedirectTypeValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> - <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> - <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> - </actionGroup> - - <actionGroup name="AdminUpdateUrlRewrite"> - <annotations> - <description>Updates the URL Rewrite fields with the provided details.</description> - </annotations> - <arguments> - <argument name="storeValue" type="string"/> - <argument name="requestPath" type="string"/> - <argument name="redirectTypeValue" type="string"/> - <argument name="description" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminUpdateUrlRewriteActionGroup` instead --> - <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> - <click selector="{{AdminUrlRewriteEditSection.storeValue(storeValue)}}" stepKey="clickOnStoreValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> - <click selector="{{AdminUrlRewriteEditSection.redirectType}}" stepKey="selectRedirectType"/> - <click selector="{{AdminUrlRewriteEditSection.redirectTypeValue(redirectTypeValue)}}" stepKey="selectRedirectTypeValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> - <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> - <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> - </actionGroup> - - <actionGroup name="AdminUpdateCustomUrlRewrite"> - <annotations> - <description>Updates the Custom URL Rewrite fields with the provided details.</description> - </annotations> - <arguments> - <argument name="storeValue" type="string"/> - <argument name="requestPath" type="string"/> - <argument name="targetPath" type="string"/> - <argument name="redirectTypeValue" type="string"/> - <argument name="description" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminUpdateCustomUrlRewriteActionGroup` instead --> - <click selector="{{AdminUrlRewriteEditSection.store}}" stepKey="clickOnStore"/> - <click selector="{{AdminUrlRewriteEditSection.storeValue('storeValue')}}" stepKey="clickOnStoreValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.requestPath}}" userInput="{{requestPath}}" stepKey="fillRequestPath"/> - <fillField selector="{{AdminUrlRewriteEditSection.targetPath}}" userInput="{{targetPath}}" stepKey="fillTargetPath"/> - <selectOption selector="{{AdminUrlRewriteEditSection.redirectType}}" userInput="{{redirectTypeValue}}" stepKey="selectRedirectTypeValue"/> - <fillField selector="{{AdminUrlRewriteEditSection.description}}" userInput="{{description}}" stepKey="fillDescription"/> - <click selector="{{AdminUrlRewriteEditSection.saveButton}}" stepKey="clickOnSaveButton"/> - <seeElement selector="{{AdminUrlRewriteIndexSection.successMessage}}" stepKey="seeSuccessSaveMessage"/> - </actionGroup> - <actionGroup name="AdminSearchByRequestPath"> - <annotations> - <description>Goes to the Admin URL Rewrite grid page. Searches the grid based on the provided Redirect Path. Validates that the provided Redirect Path, Type and Target Path are present and correct in the grid.</description> - </annotations> - <arguments> - <argument name="redirectPath" type="string"/> - <argument name="redirectType" type="string"/> - <argument name="targetPath" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminSearchByRequestPathActionGroup` instead --> - <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> - <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{redirectPath}}" stepKey="fillRedirectPathFilter"/> - <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> - <waitForPageLoad stepKey="waitForPageToLoad1"/> - <see selector="{{AdminUrlRewriteIndexSection.requestPathColumn('1')}}" userInput="{{redirectPath}}" stepKey="seeTheRedirectPathForOldUrl"/> - <see selector="{{AdminUrlRewriteIndexSection.targetPathColumn('1')}}" userInput="{{targetPath}}" stepKey="seeTheTargetPath"/> - <see selector="{{AdminUrlRewriteIndexSection.redirectTypeColumn('1')}}" userInput="{{redirectType}}" stepKey="seeTheRedirectTypeForOldUrl"/> - </actionGroup> - - <actionGroup name="AdminSearchUrlRewriteProductBySku"> - <annotations> - <description>Goes to the Admin URL Rewrite grid page. Searches the grid based on the provided Product SKU. Clicks on the 1st row in the grid.</description> - </annotations> - <arguments> - <argument name="productSku" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminSearchUrlRewriteProductBySkuActionGroup` instead --> - <amOnPage url="{{AdminUrlRewriteProductPage.url}}" stepKey="openUrlRewriteProductPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteProductPageToLoad"/> - <click selector="{{AdminUrlRewriteProductSection.resetFilter}}" stepKey="clickOnResetFilter"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminUrlRewriteProductSection.skuFilter}}" userInput="{{productSku}}" stepKey="fillProductSkuFilter"/> - <click selector="{{AdminUrlRewriteProductSection.searchFilter}}" stepKey="clickOnSearchFilter"/> - <waitForPageLoad stepKey="waitForProductToLoad"/> - <click selector="{{AdminUrlRewriteProductSection.productRow}}" stepKey="clickOnFirstRow"/> - <waitForPageLoad stepKey="waitForProductCategoryPageToLoad"/> - </actionGroup> - - <actionGroup name="AdminSearchDeletedUrlRewrite"> - <annotations> - <description>Goes to the Admin URL Rewrite grid page. Searches the grid for the provided Request Path. Validates that it does NOT appear in the grid.</description> - </annotations> - <arguments> - <argument name="requestPath" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminSearchDeletedUrlRewriteActionGroup` instead --> - <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> - <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> - <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> - <waitForPageLoad stepKey="waitForPageToLoad1"/> - <see selector="{{AdminUrlRewriteIndexSection.emptyRecords}}" userInput="We couldn't find any records." stepKey="seeEmptyRecordMessage"/> - </actionGroup> - - <actionGroup name="AdminDeleteUrlRewrite"> - <annotations> - <description>Goes to the Admin URL Rewrite grid page. Deletes the provided Request Path. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="requestPath" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminDeleteUrlRewriteActionGroup` instead --> - <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> - <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> - <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> - <waitForPageLoad stepKey="waitForPageToLoad1"/> - <click selector="{{AdminUrlRewriteIndexSection.editButton('1')}}" stepKey="clickOnEditButton"/> - <waitForPageLoad stepKey="waitForEditPageToLoad"/> - <click selector="{{AdminUrlRewriteEditSection.deleteButton}}" stepKey="clickOnDeleteButton"/> - <waitForPageLoad stepKey="waitForPageToLoad2"/> - <waitForElementVisible selector="{{AdminUrlRewriteEditSection.okButton}}" stepKey="waitForOkButtonToVisible"/> - <click selector="{{AdminUrlRewriteEditSection.okButton}}" stepKey="clickOnOkButton"/> - <waitForPageLoad stepKey="waitForPageToLoad3"/> - <see selector="{{AdminUrlRewriteIndexSection.successMessage}}" userInput="You deleted the URL rewrite." stepKey="seeSuccessMessage"/> - </actionGroup> - - <actionGroup name="AssertPageByUrlRewriteIsNotFound"> - <annotations> - <description>Validates that the provided Request Path does NOT exist on the Storefront. Validates that the 'Whoops' message is present and correct.</description> - </annotations> - <arguments> - <argument name="requestPath" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertPageByUrlRewriteIsNotFoundActionGroup` instead --> - <amOnPage url="{{requestPath}}" stepKey="amOnPage"/> - <waitForPageLoad stepKey="waitForStorefrontPageLoad"/> - <see userInput="Whoops, our bad..." stepKey="seeWhoops"/> - </actionGroup> - - <actionGroup name="AdminSearchAndSelectUrlRewriteInGrid"> - <annotations> - <description>Goes to the Admin URL Rewrite grid page. Searches the grid for the provided Request Path. Clicks on Edit.</description> - </annotations> - <arguments> - <argument name="requestPath" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminSearchAndSelectUrlRewriteInGridActionGroup` instead --> - <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteEditPage"/> - <waitForPageLoad stepKey="waitForUrlRewriteEditPageToLoad"/> - <click selector="{{AdminUrlRewriteIndexSection.resetButton}}" stepKey="clickOnResetButton"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> - <fillField selector="{{AdminUrlRewriteIndexSection.requestPathFilter}}" userInput="{{requestPath}}" stepKey="fillRedirectPathFilter"/> - <click selector="{{AdminUrlRewriteIndexSection.searchButton}}" stepKey="clickOnSearchButton"/> - <waitForPageLoad stepKey="waitForPageToLoad1"/> - <click selector="{{AdminUrlRewriteIndexSection.editButton('1')}}" stepKey="clickOnEditButton"/> - <waitForPageLoad stepKey="waitForEditPageToLoad"/> - </actionGroup> - - <actionGroup name="AssertStorefrontUrlRewriteRedirect"> - <annotations> - <description>Goes to the provided New URL. Validates that the redirect works and the provided Category is present.</description> - </annotations> - <arguments> - <argument name="category" type="string"/> - <argument name="newRequestPath" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStorefrontUrlRewriteRedirectActionGroup` instead --> - <amOnPage url="{{newRequestPath}}" stepKey="openCategoryInStorefront"/> - <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> - <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(category)}}" stepKey="seeCategoryOnStoreNavigationBar"/> - <seeElement selector="{{StorefrontCategoryMainSection.CategoryTitle(category)}}" stepKey="seeCategoryInTitle"/> - </actionGroup> - - <actionGroup name="AssertStorefrontProductRedirect"> - <annotations> - <description>Goes to the provided New Product URL. Validates that the redirect works and the provided Product is present and correct.</description> - </annotations> - <arguments> - <argument name="productName" type="string"/> - <argument name="productSku" type="string"/> - <argument name="productRequestPath" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AssertStorefrontProductRedirectActionGroup` instead --> - <amOnPage url="{{productRequestPath}}" stepKey="openCategoryInStorefront"/> - <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{productName}}" stepKey="seeProductNameInStoreFrontPage"/> - <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{productSku}}" stepKey="seeProductSkuInStoreFrontPage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index 0230f5b1c8e3e..0000000000000 --- a/app/code/Magento/User/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,69 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - - - <actionGroup name="AdminAddNewUserRoleWithCustomRoleScopes" extends="AdminAddNewUserRoleActionGroup"> - <arguments> - <argument name="customWebsiteName" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddNewUserRoleWithCustomRoleScopesActionGroup` instead --> - <checkOption selector="{{AdminCreateRoleSection.selectWebsite(customWebsiteName)}}" stepKey="checkWebsite" after="selectRoleResources"/> - </actionGroup> - <actionGroup name="AdminFillUserRoleRequiredData" extends="AdminCreateRoleActionGroup"> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminFillUserRoleRequiredDataActionGroup` instead --> - <remove keyForRemoval="clickRoleResourcesTab"/> - <remove keyForRemoval="waitForScopeSelection"/> - <remove keyForRemoval="selectResourceAccessCustom"/> - <remove keyForRemoval="waitForElementVisible"/> - <remove keyForRemoval="clickContentBlockCheckbox"/> - <remove keyForRemoval="clickSaveRoleButton"/> - <remove keyForRemoval="waitForPageLoad2"/> - </actionGroup> - <actionGroup name="AdminAddRestrictedRole" extends="AdminCreateRoleActionGroup"> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminAddRestrictedRoleActionGroup` instead --> - <remove keyForRemoval="navigateToNewRole"/> - <remove keyForRemoval="waitForPageLoad1"/> - <remove keyForRemoval="fillRoleName"/> - <remove keyForRemoval="enterPassword"/> - <remove keyForRemoval="clickRoleResourcesTab"/> - <remove keyForRemoval="waitForScopeSelection"/> - <remove keyForRemoval="clickSaveRoleButton"/> - <remove keyForRemoval="waitForPageLoad2"/> - <scrollTo selector="{{AdminEditRoleInfoSection.blockName('restrictedRole')}}" x="0" y="-100" stepKey="scrollToResourceElement" after="selectResourceAccessCustom"/> - </actionGroup> - <actionGroup name="AdminCreateRole"> - <annotations> - <description>Clicks on 'Add New Role'. Fills in the provided details (Role, Resource, Scope and Websites). Clicks on Save. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="role" type="string" defaultValue=""/> - <argument name="resource" type="string" defaultValue="All"/> - <argument name="scope" type="string" defaultValue="Custom"/> - <argument name="websites" type="string" defaultValue="Main Website"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `AdminCreateRoleActionGroup` instead --> - <click selector="{{AdminCreateRoleSection.create}}" stepKey="clickToAddNewRole"/> - <fillField selector="{{AdminCreateRoleSection.name}}" userInput="{{role.name}}" stepKey="setRoleName"/> - <fillField stepKey="setPassword" selector="{{AdminCreateRoleSection.password}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}"/> - <click selector="{{AdminCreateRoleSection.roleResources}}" stepKey="clickToOpenRoleResources"/> - <waitForPageLoad stepKey="waitForRoleResourcePage" time="5"/> - <click stepKey="checkSales" selector="//a[text()='Sales']"/> - <click selector="{{AdminCreateRoleSection.save}}" stepKey="clickToSaveRole"/> - <waitForPageLoad stepKey="waitForPageLoad" time="10"/> - <see userInput="You saved the role." stepKey="seeSuccessMessage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml deleted file mode 100644 index ca17b0275ed5b..0000000000000 --- a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/_Deprecated_ActionGroup.xml +++ /dev/null @@ -1,99 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<!-- -NOTICE: Action Groups in this file are DEPRECATED and SHOULD NOT BE USED anymore. - Please find the Comment with proper replacement for each of ActionGroups provided. ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - - <actionGroup name="StorefrontCustomerCheckProductInWishlist"> - <annotations> - <description>Validates that the provided Product details (Price and Name) are present in the Storefront Customer Dashboard Wish List.</description> - </annotations> - <arguments> - <argument name="productVar"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCustomerCheckProductInWishlistActionGroup` instead --> - <waitForElement selector="{{StorefrontCustomerWishlistProductSection.ProductTitleByName(productVar.name)}}" time="30" stepKey="assertWishlistProductName"/> - <see userInput="${{productVar.price}}.00" selector="{{StorefrontCustomerWishlistProductSection.ProductPriceByName(productVar.name)}}" stepKey="AssertWishlistProductPrice"/> - <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(productVar.name)}}" stepKey="wishlistMoveMouseOverProduct"/> - <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductAddToCartByName(productVar.name)}}" stepKey="AssertWishlistAddToCart"/> - <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductImageByName(productVar.name)}}" stepKey="AssertWishlistProductImage"/> - </actionGroup> - - <actionGroup name="StorefrontCustomerCheckProductInWishlistSidebar"> - <annotations> - <description>Validates that the provided Product details (Name) are present in the Wish List side bar menu.</description> - </annotations> - <arguments> - <argument name="productVar"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCustomerCheckProductInWishlistSidebarActionGroup` instead --> - <waitForElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductTitleByName(productVar.name)}}" time="30" stepKey="assertWishlistSidebarProductName"/> - <see userInput="${{productVar.price}}.00" selector="{{StorefrontCustomerWishlistSidebarSection.ProductPriceByName(productVar.name)}}" stepKey="AssertWishlistSidebarProductPrice"/> - <seeElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductAddToCartByName(productVar.name)}}" stepKey="AssertWishlistSidebarAddToCart"/> - <seeElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductImageByName(productVar.name)}}" stepKey="AssertWishlistSidebarProductImage"/> - </actionGroup> - - <actionGroup name="StorefrontCustomerRemoveProductFromWishlistUsingSidebar"> - <annotations> - <description>Removes the provided Product from the Wish List side bar menu. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCustomerRemoveProductFromWishlistUsingSidebarActionGroup` instead --> - <click selector="{{StorefrontCustomerWishlistSidebarSection.ProductRemoveByName(product.name)}}" stepKey="RemoveProductFromWishlistUsingSidebarClickRemoveItemFromWishlist"/> - <waitForElement selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="RemoveProductFromWishlistUsingSidebarWaitForSuccessMessage"/> - <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="{{product.name}} has been removed from your Wish List." stepKey="RemoveProductFromWishlistUsingSidebarSeeProductNameRemovedFromWishlist"/> - </actionGroup> - - <actionGroup name="StorefrontCustomerAddProductToCartFromWishlistUsingSidebar"> - <annotations> - <description>Add the provided Product to the Cart from the Wish List side bar menu. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCustomerAddProductToCartFromWishlistUsingSidebarActionGroup` instead --> - <click selector="{{StorefrontCustomerWishlistSidebarSection.ProductAddToCartByName(product.name)}}" stepKey="AddProductToCartFromWishlistUsingSidebarClickAddToCartFromWishlist"/> - <waitForElement selector="{{StorefrontCategoryMainSection.SuccessMsg}}" time="30" stepKey="AddProductToCartFromWishlistUsingSidebarWaitForSuccessMessage"/> - <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added {{product.name}} to your shopping cart." stepKey="AddProductToCartFromWishlistUsingSidebarSeeProductNameAddedToCartFromWishlist"/> - </actionGroup> - - <actionGroup name="StorefrontCustomerEditProductInWishlist"> - <annotations> - <description>Edits the provided Product on the Storefront Wish List page. Fills in the provided Description and Quantity. Validates that the Success Message is present and correct.</description> - </annotations> - <arguments> - <argument name="product"/> - <argument name="description" type="string"/> - <argument name="quantity" type="string"/> - </arguments> - - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontCustomerEditProductInWishlistActionGroup` instead --> - <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(product.name)}}" stepKey="mouseOverOnProduct"/> - <fillField selector="{{StorefrontCustomerWishlistProductSection.ProductDescription(product.name)}}" userInput="{{description}}" stepKey="fillDescription"/> - <fillField selector="{{StorefrontCustomerWishlistProductSection.ProductQuantity(product.name)}}" userInput="{{quantity}}" stepKey="fillQuantity"/> - <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductAddAllToCart}}" stepKey="mouseOver"/> - <click selector="{{StorefrontCustomerWishlistProductSection.ProductUpdateWishList}}" stepKey="submitUpdateWishlist"/> - <see selector="{{StorefrontCustomerWishlistProductSection.ProductSuccessUpdateMessage}}" userInput="{{product.name}} has been updated in your Wish List." stepKey="successMessage"/> - </actionGroup> - - <actionGroup name="StorefrontAssertCustomerWishlistIsEmpty"> - <!-- NOTICE: This ActionGroup is DEPRECATED! Use `StorefrontAssertCustomerWishlistIsEmptyActionGroup` instead --> - <dontSeeElement selector="{{StorefrontCustomerWishlistProductSection.pager}}" stepKey="checkThatPagerIsAbsent"/> - <see selector="{{StorefrontCustomerWishlistProductSection.wishlistEmpty}}" userInput="You have no items in your wish list." stepKey="checkNoItemsMessage"/> - </actionGroup> -</actionGroups> From 501f20d685d2a407e5c8f07b26977662b03fecdf Mon Sep 17 00:00:00 2001 From: Joan He <johe@magento.com> Date: Fri, 6 Dec 2019 16:07:25 -0600 Subject: [PATCH 420/595] B2B-299: Fix Skipped MFTF Tests From MC-17140: MC-15884, MC-16695 --- ...ithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml index a2a4f65860254..8e5b965b460b5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml @@ -28,8 +28,9 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> - <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> + <deleteData stepKey="deleteDefaultVirtualProduct" createDataKey="initialVirtualProduct"/> + <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <actionGroup ref="logout" stepKey="logout"/> </after> From fd723af73f30f684176a9aec28738fe129475dff Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Fri, 6 Dec 2019 16:07:58 -0600 Subject: [PATCH 421/595] Fix static --- .../Model/Config/Structure/Element/Dependency/Field.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php b/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php index 6171bdfca5584..f1434c70351af 100644 --- a/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php +++ b/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php @@ -6,11 +6,14 @@ namespace Magento\Config\Model\Config\Structure\Element\Dependency; /** - * Field - * * @api * @since 100.0.2 */ + +/** + * Class Field + * @package Magento\Config\Model\Config\Structure\Element\Dependency + */ class Field { /** From ade9147721e1182b7b166c0dd22dd85d634bc5ad Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Fri, 6 Dec 2019 16:09:46 -0600 Subject: [PATCH 422/595] Fix static --- app/code/Magento/PageCache/Model/Layout/LayoutPlugin.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/PageCache/Model/Layout/LayoutPlugin.php b/app/code/Magento/PageCache/Model/Layout/LayoutPlugin.php index 68cd0eb8cc1e9..a9054c7077d8b 100644 --- a/app/code/Magento/PageCache/Model/Layout/LayoutPlugin.php +++ b/app/code/Magento/PageCache/Model/Layout/LayoutPlugin.php @@ -7,6 +7,7 @@ /** * Class LayoutPlugin + * @package Magento\PageCache\Model\Layout */ class LayoutPlugin { From 9543ab82b20fbc68f425f712010bb0b6b73d23ae Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Fri, 6 Dec 2019 16:11:28 -0600 Subject: [PATCH 423/595] Fix static --- .../Observer/SwitchPageCacheOnMaintenance/PageCacheState.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/PageCache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php b/app/code/Magento/PageCache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php index 5c52aa055ef16..531722a42eae6 100644 --- a/app/code/Magento/PageCache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php +++ b/app/code/Magento/PageCache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php @@ -13,8 +13,8 @@ use Magento\Framework\App\Filesystem\DirectoryList; /** - * Page Cache state. - * + * Class PageCacheState + * @package Magento\PageCache\Observer\SwitchPageCacheOnMaintenance * @deprecated Originally used by now removed observer SwitchPageCacheOnMaintenance */ class PageCacheState From 4f7fcbf9ac78463a0e144fd1b701ba624da12a44 Mon Sep 17 00:00:00 2001 From: Joan He <johe@magento.com> Date: Fri, 6 Dec 2019 18:05:15 -0600 Subject: [PATCH 424/595] B2B-299: Fix Skipped MFTF Tests From MC-17140: MC-15884, MC-16695 --- ...WithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml index 8e5b965b460b5..67237785258bd 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml @@ -28,9 +28,9 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> - <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> <deleteData stepKey="deleteDefaultVirtualProduct" createDataKey="initialVirtualProduct"/> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> + <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> <actionGroup ref="logout" stepKey="logout"/> </after> From 183dd645b733a65d57b3bf6ad42daef6da75923a Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sat, 7 Dec 2019 09:57:34 +0700 Subject: [PATCH 425/595] Resolve Email address mismatch with text in iPad(768) view issue25935 --- .../Magento/blank/Magento_Customer/web/css/source/_module.less | 1 + .../Magento/luma/Magento_Customer/web/css/source/_module.less | 1 + 2 files changed, 2 insertions(+) diff --git a/app/design/frontend/Magento/blank/Magento_Customer/web/css/source/_module.less b/app/design/frontend/Magento/blank/Magento_Customer/web/css/source/_module.less index 213b8131815b3..0c2b1b4db83e6 100644 --- a/app/design/frontend/Magento/blank/Magento_Customer/web/css/source/_module.less +++ b/app/design/frontend/Magento/blank/Magento_Customer/web/css/source/_module.less @@ -85,6 +85,7 @@ .box-information, .box-newsletter { .box-content { + .lib-wrap-words(); line-height: 26px; } } diff --git a/app/design/frontend/Magento/luma/Magento_Customer/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Customer/web/css/source/_module.less index 6adf4b5b2f86b..6354cc35d32ed 100644 --- a/app/design/frontend/Magento/luma/Magento_Customer/web/css/source/_module.less +++ b/app/design/frontend/Magento/luma/Magento_Customer/web/css/source/_module.less @@ -126,6 +126,7 @@ .box-information, .box-newsletter { .box-content { + .lib-wrap-words(); &:extend(.abs-account-block-line-height all); } } From 93f070cbb0efbc8dbab6fea0b2d3dcc2211758b6 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Fri, 6 Dec 2019 22:38:59 -0600 Subject: [PATCH 426/595] Fix static --- .../Config/Model/Config/Structure/Element/Dependency/Field.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php b/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php index f1434c70351af..15f23c7737294 100644 --- a/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php +++ b/app/code/Magento/Config/Model/Config/Structure/Element/Dependency/Field.php @@ -12,7 +12,8 @@ /** * Class Field - * @package Magento\Config\Model\Config\Structure\Element\Dependency + * + * Fields are used to describe possible values for a type/interface. */ class Field { From 24a45a24bdf2668875d61f568bf75a2a0e325b9c Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Fri, 6 Dec 2019 22:40:15 -0600 Subject: [PATCH 427/595] Update LayoutPlugin.php --- app/code/Magento/PageCache/Model/Layout/LayoutPlugin.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/PageCache/Model/Layout/LayoutPlugin.php b/app/code/Magento/PageCache/Model/Layout/LayoutPlugin.php index a9054c7077d8b..88619673ad425 100644 --- a/app/code/Magento/PageCache/Model/Layout/LayoutPlugin.php +++ b/app/code/Magento/PageCache/Model/Layout/LayoutPlugin.php @@ -7,7 +7,8 @@ /** * Class LayoutPlugin - * @package Magento\PageCache\Model\Layout + * + * Plugin for Magento\Framework\View\Layout */ class LayoutPlugin { From 3e25ec441aaa287500164cdceb1bc5889209fac4 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Fri, 6 Dec 2019 22:43:13 -0600 Subject: [PATCH 428/595] Fix static --- .../Observer/SwitchPageCacheOnMaintenance/PageCacheState.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/PageCache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php b/app/code/Magento/PageCache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php index 531722a42eae6..da6a71a0c2655 100644 --- a/app/code/Magento/PageCache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php +++ b/app/code/Magento/PageCache/Observer/SwitchPageCacheOnMaintenance/PageCacheState.php @@ -14,7 +14,9 @@ /** * Class PageCacheState - * @package Magento\PageCache\Observer\SwitchPageCacheOnMaintenance + * + * Page Cache State Observer + * * @deprecated Originally used by now removed observer SwitchPageCacheOnMaintenance */ class PageCacheState From 2c93f7f49b3c12ad71ac69cd9f3ff7a38f76e547 Mon Sep 17 00:00:00 2001 From: Joan He <johe@magento.com> Date: Fri, 6 Dec 2019 23:16:14 -0600 Subject: [PATCH 429/595] B2B-299: Fix Skipped MFTF Tests From MC-17140: MC-15884, MC-16695 --- ...thRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml index 67237785258bd..fbe1e7b85a0ed 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml @@ -28,7 +28,9 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> - <deleteData stepKey="deleteDefaultVirtualProduct" createDataKey="initialVirtualProduct"/> + <actionGroup ref="deleteProductBySku" stepKey="deleteDefaultVirtualProduct"> + <argument name="sku" value="$$initialVirtualProduct.sku$$"/> + </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> <actionGroup ref="logout" stepKey="logout"/> From 18281bbb12f323c20764a5128f962912782b852a Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Sat, 7 Dec 2019 08:16:26 +0200 Subject: [PATCH 430/595] Fixing static tests --- .../Backend/Block/System/Account/Edit/Form.php | 2 +- app/code/Magento/User/Block/Role/Tab/Info.php | 14 +++++++++++++- .../Framework/Data/Form/Element/Password.php | 3 +++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Backend/Block/System/Account/Edit/Form.php b/app/code/Magento/Backend/Block/System/Account/Edit/Form.php index 49ec305ddd761..c075585a6e4eb 100644 --- a/app/code/Magento/Backend/Block/System/Account/Edit/Form.php +++ b/app/code/Magento/Backend/Block/System/Account/Edit/Form.php @@ -68,7 +68,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ protected function _prepareForm() { diff --git a/app/code/Magento/User/Block/Role/Tab/Info.php b/app/code/Magento/User/Block/Role/Tab/Info.php index f71b7eebd3c32..721271c87c67d 100644 --- a/app/code/Magento/User/Block/Role/Tab/Info.php +++ b/app/code/Magento/User/Block/Role/Tab/Info.php @@ -6,7 +6,7 @@ namespace Magento\User\Block\Role\Tab; /** - * implementing now + * Info * * @SuppressWarnings(PHPMD.DepthOfInheritance) */ @@ -18,6 +18,8 @@ class Info extends \Magento\Backend\Block\Widget\Form\Generic implements \Magent const IDENTITY_VERIFICATION_PASSWORD_FIELD = 'current_password'; /** + * Get tab label + * * @return \Magento\Framework\Phrase */ public function getTabLabel() @@ -26,6 +28,8 @@ public function getTabLabel() } /** + * Get tab title + * * @return string */ public function getTabTitle() @@ -34,6 +38,8 @@ public function getTabTitle() } /** + * Can show tab + * * @return bool */ public function canShowTab() @@ -42,6 +48,8 @@ public function canShowTab() } /** + * Is tab hidden + * * @return bool */ public function isHidden() @@ -50,6 +58,8 @@ public function isHidden() } /** + * Before html rendering + * * @return $this */ public function _beforeToHtml() @@ -60,6 +70,8 @@ public function _beforeToHtml() } /** + * Form initializatiion + * * @return void */ protected function _initForm() diff --git a/lib/internal/Magento/Framework/Data/Form/Element/Password.php b/lib/internal/Magento/Framework/Data/Form/Element/Password.php index c71048dabd1df..df95133b4abf2 100644 --- a/lib/internal/Magento/Framework/Data/Form/Element/Password.php +++ b/lib/internal/Magento/Framework/Data/Form/Element/Password.php @@ -38,11 +38,14 @@ public function __construct( } /** + * Get field html + * * @return mixed */ public function getHtml() { $this->addClass('input-text admin__control-text'); + return parent::getHtml(); } } From 8ea3d264ae8be701faa30bc597fd046b697d1582 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Sat, 7 Dec 2019 09:01:37 +0200 Subject: [PATCH 431/595] Fixing static tests --- app/code/Magento/User/Block/Role/Tab/Info.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/User/Block/Role/Tab/Info.php b/app/code/Magento/User/Block/Role/Tab/Info.php index 721271c87c67d..1b8b528aff774 100644 --- a/app/code/Magento/User/Block/Role/Tab/Info.php +++ b/app/code/Magento/User/Block/Role/Tab/Info.php @@ -8,6 +8,8 @@ /** * Info * + * User role tab info + * * @SuppressWarnings(PHPMD.DepthOfInheritance) */ class Info extends \Magento\Backend\Block\Widget\Form\Generic implements \Magento\Backend\Block\Widget\Tab\TabInterface From 41437b1de9a3e32c93b55256f30b4e0226a7eb17 Mon Sep 17 00:00:00 2001 From: Joan He <johe@magento.com> Date: Sat, 7 Dec 2019 08:28:39 -0600 Subject: [PATCH 432/595] B2B-299: Fix Skipped MFTF Tests From MC-17140: MC-15884, MC-16695 --- ...WithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml index fbe1e7b85a0ed..bbde98f8fc043 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml @@ -29,7 +29,7 @@ </before> <after> <actionGroup ref="deleteProductBySku" stepKey="deleteDefaultVirtualProduct"> - <argument name="sku" value="$$initialVirtualProduct.sku$$"/> + <argument name="sku" value="{{updateVirtualProductRegularPrice5OutOfStock.sku}}"/> </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> From fe935a668044bf02852b5b2ddcb01834090132a7 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sun, 8 Dec 2019 22:32:41 +0700 Subject: [PATCH 433/595] Resolve queue_consumer.xml doesn't allow numbers in handler class issue25731 --- .../Test/Unit/Consumer/Config/XsdTest.php | 12 ++++++------ .../Magento/Framework/MessageQueue/etc/consumer.xsd | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Consumer/Config/XsdTest.php b/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Consumer/Config/XsdTest.php index 448a8a3db7407..1eecf94558960 100644 --- a/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Consumer/Config/XsdTest.php +++ b/lib/internal/Magento/Framework/MessageQueue/Test/Unit/Consumer/Config/XsdTest.php @@ -84,17 +84,17 @@ public function exemplarXmlDataProvider() ], 'invalid handler format' => [ '<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/consumer.xsd"> - <consumer name="consumer1" queue="queue1" handler="handlerClass1::handlerMethodOne" consumerInstance="consumerClass1" connection="amqp" maxMessages="100"/> - <consumer name="consumer2" queue="queue2" handler="handlerClassTwo::handlerMethod2" consumerInstance="consumerClass2" connection="db"/> + <consumer name="consumer1" queue="queue1" handler="handlerClass_One1::handlerMethod1" consumerInstance="consumerClass1" connection="amqp" maxMessages="100"/> + <consumer name="consumer2" queue="queue2" handler="handlerClassOne2::handler_Method2" consumerInstance="consumerClass2" connection="db"/> <consumer name="consumer3" queue="queue3" handler="handlerClassThree::handlerMethodThree" consumerInstance="consumerClass3"/> <consumer name="consumer4" queue="queue4" handler="handlerClassFour::handlerMethodFour"/> <consumer name="consumer5" queue="queue4"/> </config>', [ - "Element 'consumer', attribute 'handler': [facet 'pattern'] The value 'handlerClass1::handlerMethodOne' is not accepted by the pattern '[a-zA-Z\\\\]+::[a-zA-Z]+'.", - "Element 'consumer', attribute 'handler': 'handlerClass1::handlerMethodOne' is not a valid value of the atomic type 'handlerType'.", - "Element 'consumer', attribute 'handler': [facet 'pattern'] The value 'handlerClassTwo::handlerMethod2' is not accepted by the pattern '[a-zA-Z\\\\]+::[a-zA-Z]+'.", - "Element 'consumer', attribute 'handler': 'handlerClassTwo::handlerMethod2' is not a valid value of the atomic type 'handlerType'.", + "Element 'consumer', attribute 'handler': [facet 'pattern'] The value 'handlerClass_One1::handlerMethod1' is not accepted by the pattern '[a-zA-Z0-9\\\\]+::[a-zA-Z0-9]+'.", + "Element 'consumer', attribute 'handler': 'handlerClass_One1::handlerMethod1' is not a valid value of the atomic type 'handlerType'.", + "Element 'consumer', attribute 'handler': [facet 'pattern'] The value 'handlerClassOne2::handler_Method2' is not accepted by the pattern '[a-zA-Z0-9\\\\]+::[a-zA-Z0-9]+'.", + "Element 'consumer', attribute 'handler': 'handlerClassOne2::handler_Method2' is not a valid value of the atomic type 'handlerType'.", ], ], 'invalid maxMessages format' => [ diff --git a/lib/internal/Magento/Framework/MessageQueue/etc/consumer.xsd b/lib/internal/Magento/Framework/MessageQueue/etc/consumer.xsd index 52bfc77bbb511..7e3d501aaa46e 100644 --- a/lib/internal/Magento/Framework/MessageQueue/etc/consumer.xsd +++ b/lib/internal/Magento/Framework/MessageQueue/etc/consumer.xsd @@ -32,7 +32,7 @@ </xs:documentation> </xs:annotation> <xs:restriction base="xs:string"> - <xs:pattern value="[a-zA-Z\\]+::[a-zA-Z]+" /> + <xs:pattern value="[a-zA-Z0-9\\]+::[a-zA-Z0-9]+" /> <xs:minLength value="5" /> </xs:restriction> </xs:simpleType> From 167e2ac04dcf3bcd6c9b7cf4aadb07ea67b1fd4a Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Sun, 8 Dec 2019 14:25:22 -0600 Subject: [PATCH 434/595] Change action groups name according to CE branch changes --- app/code/Magento/Bundle/Test/Mftf/Test/EndToEndB2CAdminTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/EndToEndB2CAdminTest.xml index 5f7a1827a6156..7e5db7643c2dd 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -31,7 +31,7 @@ <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"/> - <actionGroup ref="viewBundleProductInAdminGrid" stepKey="viewBundleProductInGrid" after="saveBundleProduct"> + <actionGroup ref="ViewBundleProductInAdminGridActionGroup" stepKey="viewBundleProductInGrid" after="saveBundleProduct"> <argument name="product" value="BundleProduct"/> </actionGroup> From 850db28b947c495c9a320a449568319f478ed784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Sun, 8 Dec 2019 22:24:05 +0100 Subject: [PATCH 435/595] Refactor: Add method hints to Tracking Status --- .../Shipping/Model/Tracking/Result/Status.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Shipping/Model/Tracking/Result/Status.php b/app/code/Magento/Shipping/Model/Tracking/Result/Status.php index cb24bd8ebb0e8..f3e4dcfe986f0 100644 --- a/app/code/Magento/Shipping/Model/Tracking/Result/Status.php +++ b/app/code/Magento/Shipping/Model/Tracking/Result/Status.php @@ -1,21 +1,25 @@ <?php +declare(strict_types=1); + /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Shipping\Model\Tracking\Result; /** - * Fields: - * - carrier: carrier code - * - carrierTitle: carrier title + * @method string getCarrier() + * @method Status setCarrier(string $carrierCode) + * @method string getCarrierTitle() + * @method Status setCarrierTitle(string $carrierTitle) */ -class Status extends \Magento\Shipping\Model\Tracking\Result\AbstractResult +class Status extends AbstractResult { /** * @return array */ - public function getAllData() + public function getAllData(): array { return $this->_data; } From ec9380ee1cbbf115534dba9a88ac1c1e87414cc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Sun, 8 Dec 2019 23:30:41 +0100 Subject: [PATCH 436/595] Refactor: Add method hints to Tracking Status --- app/code/Magento/Shipping/Model/Tracking/Result/Status.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/Shipping/Model/Tracking/Result/Status.php b/app/code/Magento/Shipping/Model/Tracking/Result/Status.php index f3e4dcfe986f0..04ff29139d926 100644 --- a/app/code/Magento/Shipping/Model/Tracking/Result/Status.php +++ b/app/code/Magento/Shipping/Model/Tracking/Result/Status.php @@ -9,6 +9,8 @@ namespace Magento\Shipping\Model\Tracking\Result; /** + * Tracking Status DataObject + * * @method string getCarrier() * @method Status setCarrier(string $carrierCode) * @method string getCarrierTitle() @@ -17,6 +19,8 @@ class Status extends AbstractResult { /** + * Returns all Status data + * * @return array */ public function getAllData(): array From aa3660e3f568dc791ce5df536bd47f4485a79120 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Sun, 8 Dec 2019 16:48:12 -0600 Subject: [PATCH 437/595] Change action groups name according to CE branch changes --- .../Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml index 97eceae962bfb..f5cd6720c07ad 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml @@ -47,7 +47,7 @@ <deleteData createDataKey="createBundleDynamicProduct" stepKey="deleteBundleProduct"/> </after> <!-- Add simple product to the cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="cartAddSimpleProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="cartAddSimpleProductToCart"> <argument name="product" value="$$createSimpleProduct$$"/> <argument name="productCount" value="1"/> </actionGroup> From 86c17d6a8fa0ff9a2637b81a985d4145414a6d09 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Sun, 8 Dec 2019 17:00:16 -0600 Subject: [PATCH 438/595] Fix static --- app/code/Magento/ProductAlert/Test/Unit/Helper/DataTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/ProductAlert/Test/Unit/Helper/DataTest.php b/app/code/Magento/ProductAlert/Test/Unit/Helper/DataTest.php index 1818da2289b58..5df1da7a194d0 100644 --- a/app/code/Magento/ProductAlert/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/ProductAlert/Test/Unit/Helper/DataTest.php @@ -132,7 +132,7 @@ public function testCreateBlockWithException() { $invalidBlock = $this->createMock(Product::class); $this->expectException(LocalizedException::class); - $this->expectExceptionMessage((string)__('Invalid block type: %1')); + $this->expectExceptionMessage((string)__('Invalid block type: %1')); // @codingStandardsIgnoreLine $this->helper->createBlock($invalidBlock); } From 2baf1ea4d195ca75d50555570a9a54f212014d03 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Sun, 8 Dec 2019 19:53:43 -0600 Subject: [PATCH 439/595] Change action groups name according to CE branch changes --- .../Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml index f5cd6720c07ad..7405a3100728f 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutDisabledBundleProductTest.xml @@ -56,7 +56,7 @@ <waitForPageLoad stepKey="waitForPageLoad"/> <!-- Add bundle product to the cart --> <click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickCustomizeAndAddToCart"/> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToCart"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addProductToCart"> <argument name="productName" value="$$createBundleDynamicProduct.name$$"/> </actionGroup> <!-- Login to admin panel --> From 927f9dc0eac20bd6f24a29a64083588ba080e7a5 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Sun, 8 Dec 2019 21:09:24 -0600 Subject: [PATCH 440/595] Change action groups name according to CE branch changes --- .../DeleteAllDuplicateProductUsingProductGridActionGroup.xml | 2 +- .../Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllDuplicateProductUsingProductGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllDuplicateProductUsingProductGridActionGroup.xml index 8dabf2037bf39..8f057052d3e2c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllDuplicateProductUsingProductGridActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteAllDuplicateProductUsingProductGridActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="DeleteAllDuplicateProductUsingProductGridActionGroup" extends="DeleteProductUsingProductGridActionGroup"> <annotations> - <description>EXTENDS: deleteProductUsingProductGrid. Removes 'seeProductSkuInGrid'.</description> + <description>EXTENDS: DeleteProductUsingProductGridActionGroup. Removes 'seeProductSkuInGrid'.</description> </annotations> <arguments> <argument name="product"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml index 2d0c4a05c1dec..85209595d620d 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml @@ -20,7 +20,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> <createData entity="ApiCategory" stepKey="createCategory"/> <!-- Create Configurable product --> - <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <actionGroup ref="CreateConfigurableProductActionGroup" stepKey="createProduct"> <argument name="product" value="_defaultProduct"/> <argument name="category" value="$$createCategory$$"/> </actionGroup> From 9044b1fa828343530793edd9b72f2938a97a8b24 Mon Sep 17 00:00:00 2001 From: Joan He <johe@magento.com> Date: Sun, 8 Dec 2019 21:57:47 -0600 Subject: [PATCH 441/595] B2B-299: Fix Skipped MFTF Tests From MC-17140: MC-15884, MC-16695 --- ...ductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml | 3 +++ ...roductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml | 3 +++ ...ctWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml | 3 +++ ...ithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml | 3 +++ 4 files changed, 12 insertions(+) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml index ffbad0752b73c..15e5be210b73a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml @@ -28,6 +28,9 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> + <actionGroup ref="deleteProductBySku" stepKey="deleteDefaultVirtualProduct"> + <argument name="sku" value="{{updateVirtualProductRegularPrice5OutOfStock.sku}}"/> + </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> <actionGroup ref="logout" stepKey="logout"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml index aa3184994daff..8b4518007ea29 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml @@ -27,6 +27,9 @@ </createData> </before> <after> + <actionGroup ref="deleteProductBySku" stepKey="deleteDefaultVirtualProduct"> + <argument name="sku" value="{{updateVirtualProductRegularPrice99OutOfStock.sku}}"/> + </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <actionGroup ref="logout" stepKey="logout"/> </after> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml index 3101c1e460322..984c296845113 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml @@ -28,6 +28,9 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> + <actionGroup ref="deleteProductBySku" stepKey="deleteDefaultVirtualProduct"> + <argument name="sku" value="{{updateVirtualProductSpecialPrice.sku}}"/> + </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> <actionGroup ref="logout" stepKey="logout"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml index 58978c31b5b40..1c590563d4cfc 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml @@ -28,6 +28,9 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> + <actionGroup ref="deleteProductBySku" stepKey="deleteDefaultVirtualProduct"> + <argument name="sku" value="{{updateVirtualProductSpecialPriceOutOfStock.sku}}"/> + </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> <deleteData stepKey="deleteSimpleSubCategory2" createDataKey="categoryEntity"/> <actionGroup ref="logout" stepKey="logout"/> From dcfbbdf04a226cf4e8290e16109dcfbe142e2e4c Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Mon, 9 Dec 2019 00:27:18 -0600 Subject: [PATCH 442/595] Change action groups name according to CE branch changes --- .../Test/Mftf/ActionGroup/DeleteProductByNameActionGroup.xml | 2 +- .../Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml | 2 +- .../Sales/Test/Mftf/ActionGroup/OpenOrderByIdActionGroup.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductByNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductByNameActionGroup.xml index 0541a5ba67d30..3a4af44158497 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductByNameActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductByNameActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="DeleteProductByNameActionGroup" extends="DeleteProductBySkuActionGroup"> <annotations> - <description>EXTENDS: deleteProductBySku. Deletes the provided Product Name.</description> + <description>EXTENDS: DeleteProductBySkuActionGroup. Deletes the provided Product Name.</description> </annotations> <arguments> <argument name="sku" type="string" defaultValue=""/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml index 85209595d620d..42bad3e4bb8bf 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoErrorForMiniCartItemEditTest.xml @@ -28,7 +28,7 @@ <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <!-- Delete the first simple product --> - <actionGroup stepKey="deleteProduct1" ref="deleteProductBySku"> + <actionGroup stepKey="deleteProduct1" ref="DeleteProductBySkuActionGroup"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/OpenOrderByIdActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/OpenOrderByIdActionGroup.xml index ca05041140f47..16dacff3ecf81 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/OpenOrderByIdActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/OpenOrderByIdActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="OpenOrderByIdActionGroup" extends="FilterOrderGridByIdActionGroup"> <annotations> - <description>EXTENDS: filterOrderGridById. Clicks on the 1st row of the Admin Orders grid.</description> + <description>EXTENDS: FilterOrderGridByIdActionGroup. Clicks on the 1st row of the Admin Orders grid.</description> </annotations> <click selector="{{AdminDataGridTableSection.firstRow}}" after="clickOrderApplyFilters" stepKey="openOrderViewPage"/> From 53323fa950c04bbfe5e1d168ae8bf612f1451d47 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Mon, 9 Dec 2019 00:35:41 -0600 Subject: [PATCH 443/595] Fix static --- .../frontend/templates/product/view/opengraph/general.phtml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/view/opengraph/general.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/view/opengraph/general.phtml index 4d4a34c6239d4..4bfdbb7bc24bc 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/view/opengraph/general.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/view/opengraph/general.phtml @@ -15,7 +15,10 @@ <meta property="og:description" content="<?= $block->escapeHtmlAttr($block->stripTags($block->getProduct()->getShortDescription())) ?>" /> <meta property="og:url" content="<?= $block->escapeUrl($block->getProduct()->getProductUrl()) ?>" /> -<?php if ($priceAmount = $block->getProduct()->getPriceInfo()->getPrice(\Magento\Catalog\Pricing\Price\FinalPrice::PRICE_CODE)->getAmount()) :?> +<?php if ($priceAmount = $block->getProduct() + ->getPriceInfo() + ->getPrice(\Magento\Catalog\Pricing\Price\FinalPrice::PRICE_CODE) + ->getAmount()):?> <meta property="product:price:amount" content="<?= $block->escapeHtmlAttr($priceAmount) ?>"/> <?= $block->getChildHtml('meta.currency') ?> <?php endif;?> From db316fd45927ce2dd3747c04e824e0a4165f58e4 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Mon, 9 Dec 2019 00:42:12 -0600 Subject: [PATCH 444/595] Fix static --- app/code/Magento/ProductAlert/Test/Unit/Helper/DataTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/ProductAlert/Test/Unit/Helper/DataTest.php b/app/code/Magento/ProductAlert/Test/Unit/Helper/DataTest.php index 5df1da7a194d0..122d785e79599 100644 --- a/app/code/Magento/ProductAlert/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/ProductAlert/Test/Unit/Helper/DataTest.php @@ -132,7 +132,6 @@ public function testCreateBlockWithException() { $invalidBlock = $this->createMock(Product::class); $this->expectException(LocalizedException::class); - $this->expectExceptionMessage((string)__('Invalid block type: %1')); // @codingStandardsIgnoreLine $this->helper->createBlock($invalidBlock); } From e64ce9d93b6b12f99f6d5b7c5e7b3d9a1de5547b Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Mon, 9 Dec 2019 01:07:24 -0600 Subject: [PATCH 445/595] Change action groups name according to CE branch changes --- .../AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml | 4 ++-- ...dminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml | 4 ++-- ...minUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml index 81dedfea7a35e..03027ce2ab7e9 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml @@ -29,7 +29,7 @@ <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"/> <!-- Open CMS Edit Page, Get the CMS ID and Modify Store View Option to All Store Views --> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage"> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> @@ -71,7 +71,7 @@ <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="storefrontSwitchToCustomStoreView"> <argument name="storeView" value="customStore"/> </actionGroup> - <actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFront"> + <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToTheStoreFront"> <argument name="page" value="newrequestpath"/> </actionGroup> <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage"> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml index f073794896c2c..9159b6536e486 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml @@ -29,7 +29,7 @@ <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"/> <!-- Open CMS Edit Page, Get the CMS ID and Modify Store View Option to All Store Views --> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage"> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> @@ -67,7 +67,7 @@ </actionGroup> <!-- Assert Url Rewrite Cms Page Redirect --> - <actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFront"> + <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToTheStoreFront"> <argument name="page" value="permanentrequestpath.htm"/> </actionGroup> <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage"> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml index 8f04fe7cf9ab9..9e509808427bb 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml @@ -29,7 +29,7 @@ <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"/> <!-- Open CMS Edit Page, Get the CMS ID and Modify Store View Option to All Store Views --> - <actionGroup ref="navigateToCreatedCMSPage" stepKey="navigateToCreatedCMSPage"> + <actionGroup ref="NavigateToCreatedCMSPageActionGroup" stepKey="navigateToCreatedCMSPage"> <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> @@ -67,7 +67,7 @@ </actionGroup> <!-- Assert Url Rewrite Cms Page Redirect --> - <actionGroup ref="navigateToStorefrontForCreatedPage" stepKey="navigateToTheStoreFront"> + <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToTheStoreFront"> <argument name="page" value="temporaryrequestpath.html"/> </actionGroup> <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage"> From fced55289bc6ce2ee6c7652bfa4b8cb5e80e2441 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Mon, 9 Dec 2019 01:42:18 -0600 Subject: [PATCH 446/595] Change action groups name according to CE branch changes --- ...minUpdateCmsPageRewriteEntityWithNoRedirectTest.xml | 10 +++++----- ...ateCmsPageRewriteEntityWithPermanentReirectTest.xml | 10 +++++----- ...teCmsPageRewriteEntityWithTemporaryRedirectTest.xml | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml index 03027ce2ab7e9..98c1839f99859 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml @@ -33,13 +33,13 @@ <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> - <actionGroup ref="AddStoreViewToCmsPage" stepKey="updateStoreViewForCmsPage"> + <actionGroup ref="AddStoreViewToCmsPageActionGroup" stepKey="updateStoreViewForCmsPage"> <argument name="CMSPage" value="$$createCMSPage$$"/> <argument name="storeViewName" value="All Store Views"/> </actionGroup> <!--Create CMS Page URL Redirect--> - <actionGroup ref="AdminAddCustomUrlRewrite" stepKey="addCustomUrlRewrite"> + <actionGroup ref="AdminAddCustomUrlRewriteActionGroup" stepKey="addCustomUrlRewrite"> <argument name="customUrlRewriteValue" value="Custom"/> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="created-new-cms-page"/> @@ -49,7 +49,7 @@ </actionGroup> <!--Search created CMS page url rewrite in grid--> - <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="searchUrlRewrite"> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGridActionGroup" stepKey="searchUrlRewrite"> <argument name="requestPath" value="created-new-cms-page"/> </actionGroup> @@ -74,13 +74,13 @@ <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToTheStoreFront"> <argument name="page" value="newrequestpath"/> </actionGroup> - <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage"> + <actionGroup ref="AssertStoreFrontCMSPageActionGroup" stepKey="assertCMSPage"> <argument name="cmsTitle" value="$$createCMSPage.title$$"/> <argument name="cmsContent" value="$$createCMSPage.content$$"/> <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> </actionGroup> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="newrequestpath"/> </actionGroup> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteCustomStoreView"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml index 9159b6536e486..c99cdb95758e5 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml @@ -33,13 +33,13 @@ <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> - <actionGroup ref="AddStoreViewToCmsPage" stepKey="updateStoreViewForCmsPage"> + <actionGroup ref="AddStoreViewToCmsPageActionGroup" stepKey="updateStoreViewForCmsPage"> <argument name="CMSPage" value="$$createCMSPage$$"/> <argument name="storeViewName" value="All Store Views"/> </actionGroup> <!--Create CMS Page URL Redirect--> - <actionGroup ref="AdminAddCustomUrlRewrite" stepKey="addCustomUrlRewrite"> + <actionGroup ref="AdminAddCustomUrlRewriteActionGroup" stepKey="addCustomUrlRewrite"> <argument name="customUrlRewriteValue" value="Custom"/> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="created-new-cms-page"/> @@ -49,7 +49,7 @@ </actionGroup> <!--Search created CMS page url rewrite in grid--> - <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="searchUrlRewrite"> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGridActionGroup" stepKey="searchUrlRewrite"> <argument name="requestPath" value="created-new-cms-page"/> </actionGroup> @@ -70,13 +70,13 @@ <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToTheStoreFront"> <argument name="page" value="permanentrequestpath.htm"/> </actionGroup> - <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage"> + <actionGroup ref="AssertStoreFrontCMSPageActionGroup" stepKey="assertCMSPage"> <argument name="cmsTitle" value="$$createCMSPage.title$$"/> <argument name="cmsContent" value="$$createCMSPage.content$$"/> <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> </actionGroup> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="permanentrequestpath.htm"/> </actionGroup> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteCustomStoreView"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml index 9e509808427bb..644f495856f07 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml @@ -33,13 +33,13 @@ <argument name="CMSPage" value="$$createCMSPage$$"/> </actionGroup> <grabFromCurrentUrl stepKey="cmsId" regex="#\/([0-9]*)?\/$#"/> - <actionGroup ref="AddStoreViewToCmsPage" stepKey="updateStoreViewForCmsPage"> + <actionGroup ref="AddStoreViewToCmsPageActionGroup" stepKey="updateStoreViewForCmsPage"> <argument name="CMSPage" value="$$createCMSPage$$"/> <argument name="storeViewName" value="All Store Views"/> </actionGroup> <!--Create CMS Page URL Redirect--> - <actionGroup ref="AdminAddCustomUrlRewrite" stepKey="addCustomUrlRewrite"> + <actionGroup ref="AdminAddCustomUrlRewriteActionGroup" stepKey="addCustomUrlRewrite"> <argument name="customUrlRewriteValue" value="Custom"/> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="created-new-cms-page"/> @@ -49,7 +49,7 @@ </actionGroup> <!--Search created CMS page url rewrite in grid--> - <actionGroup ref="AdminSearchAndSelectUrlRewriteInGrid" stepKey="searchUrlRewrite"> + <actionGroup ref="AdminSearchAndSelectUrlRewriteInGridActionGroup" stepKey="searchUrlRewrite"> <argument name="requestPath" value="created-new-cms-page"/> </actionGroup> @@ -70,13 +70,13 @@ <actionGroup ref="NavigateToStorefrontForCreatedPageActionGroup" stepKey="navigateToTheStoreFront"> <argument name="page" value="temporaryrequestpath.html"/> </actionGroup> - <actionGroup ref="AssertStoreFrontCMSPage" stepKey="assertCMSPage"> + <actionGroup ref="AssertStoreFrontCMSPageActionGroup" stepKey="assertCMSPage"> <argument name="cmsTitle" value="$$createCMSPage.title$$"/> <argument name="cmsContent" value="$$createCMSPage.content$$"/> <argument name="cmsContentHeading" value="$$createCMSPage.content_heading$$"/> </actionGroup> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="temporaryrequestpath.html"/> </actionGroup> <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteCustomStoreView"/> From 3e65b3732aeee0e87fc66b2b66eb06cfed2acd52 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Mon, 9 Dec 2019 10:18:54 +0200 Subject: [PATCH 447/595] Cover case with unit test --- .../Framework/Data/Test/Unit/Form/Element/PasswordTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/PasswordTest.php b/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/PasswordTest.php index d8de658d6813a..8ceac46c6404b 100644 --- a/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/PasswordTest.php +++ b/lib/internal/Magento/Framework/Data/Test/Unit/Form/Element/PasswordTest.php @@ -53,6 +53,6 @@ public function testGetHtml() { $html = $this->_model->getHtml(); $this->assertContains('type="password"', $html); - $this->assertTrue(preg_match('/class=\".*input-text.*\"/i', $html) > 0); + $this->assertTrue(preg_match('/class=\"* input-text admin__control-text.*\"/i', $html) > 0); } } From 2d0c917f48e5aa0d4b9e461834f9d4d147e53000 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Mon, 9 Dec 2019 15:46:34 +0700 Subject: [PATCH 448/595] Integration Test for issue 25931 --- .../Adminhtml/Report/Statistics/IndexTest.php | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Reports/Controller/Adminhtml/Report/Statistics/IndexTest.php diff --git a/dev/tests/integration/testsuite/Magento/Reports/Controller/Adminhtml/Report/Statistics/IndexTest.php b/dev/tests/integration/testsuite/Magento/Reports/Controller/Adminhtml/Report/Statistics/IndexTest.php new file mode 100644 index 0000000000000..e7d74159e48fc --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Reports/Controller/Adminhtml/Report/Statistics/IndexTest.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Reports\Controller\Adminhtml\Report\Statistics; + +/** + * @magentoAppArea adminhtml + */ +class IndexTest extends \Magento\TestFramework\TestCase\AbstractBackendController +{ + /** + * Test load page + */ + public function testExecute() + { + $this->dispatch('backend/reports/report_statistics'); + $actual = $this->getResponse()->getBody(); + $this->assertContains('Never', $actual); + } +} From 206f2dd8928ef5f2198c2c199f80bc568e59debf Mon Sep 17 00:00:00 2001 From: Lukasz Bajsarowicz <lukasz.bajsarowicz@gmail.com> Date: Mon, 9 Dec 2019 11:00:18 +0100 Subject: [PATCH 449/595] Update app/code/Magento/Shipping/Model/Tracking/Result/Status.php Co-Authored-By: Ihor Sviziev <ihor-sviziev@users.noreply.github.com> --- app/code/Magento/Shipping/Model/Tracking/Result/Status.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Shipping/Model/Tracking/Result/Status.php b/app/code/Magento/Shipping/Model/Tracking/Result/Status.php index 04ff29139d926..5f80c31120ec1 100644 --- a/app/code/Magento/Shipping/Model/Tracking/Result/Status.php +++ b/app/code/Magento/Shipping/Model/Tracking/Result/Status.php @@ -13,7 +13,7 @@ * * @method string getCarrier() * @method Status setCarrier(string $carrierCode) - * @method string getCarrierTitle() + * @method string|null getCarrierTitle() * @method Status setCarrierTitle(string $carrierTitle) */ class Status extends AbstractResult From 9a40b1656a6568963c540bd234889d736dbbf492 Mon Sep 17 00:00:00 2001 From: Lukasz Bajsarowicz <lukasz.bajsarowicz@gmail.com> Date: Mon, 9 Dec 2019 11:00:29 +0100 Subject: [PATCH 450/595] Update app/code/Magento/Shipping/Model/Tracking/Result/Status.php Co-Authored-By: Ihor Sviziev <ihor-sviziev@users.noreply.github.com> --- app/code/Magento/Shipping/Model/Tracking/Result/Status.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Shipping/Model/Tracking/Result/Status.php b/app/code/Magento/Shipping/Model/Tracking/Result/Status.php index 5f80c31120ec1..784b806fa3f86 100644 --- a/app/code/Magento/Shipping/Model/Tracking/Result/Status.php +++ b/app/code/Magento/Shipping/Model/Tracking/Result/Status.php @@ -11,7 +11,7 @@ /** * Tracking Status DataObject * - * @method string getCarrier() + * @method string|null getCarrier() * @method Status setCarrier(string $carrierCode) * @method string|null getCarrierTitle() * @method Status setCarrierTitle(string $carrierTitle) From 1a285eac193762b3c11123ac9600d22ec1ac300a Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Mon, 9 Dec 2019 12:07:23 +0200 Subject: [PATCH 451/595] Cover changes with mftf test --- .../Test/Mftf/Section/AdminThemeSection.xml | 5 ++- .../Mftf/Test/AdminContentThemeSortTest.xml | 40 +++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemeSortTest.xml diff --git a/app/code/Magento/Theme/Test/Mftf/Section/AdminThemeSection.xml b/app/code/Magento/Theme/Test/Mftf/Section/AdminThemeSection.xml index 219ca7420361c..1a0bb738bc9ca 100644 --- a/app/code/Magento/Theme/Test/Mftf/Section/AdminThemeSection.xml +++ b/app/code/Magento/Theme/Test/Mftf/Section/AdminThemeSection.xml @@ -15,7 +15,8 @@ <element name="rowsInThemeTitleColumn" type="text" selector="//tbody/tr/td[contains(@class, 'parent_theme')]/preceding-sibling::td"/> <element name="rowsInColumn" type="text" selector="//tbody/tr/td[contains(@class, '{{column}}')]" parameterized="true"/> <!--Specific cell e.g. {{Section.gridCell('Name')}}--> - <element name="gridCell" type="text" selector="//table[@id='theme_grid_table']//td[contains(text(), '{{gridCellText}}')]" parameterized="true"/> + <element name="gridCell" type="text" selector="//table//div[contains(text(), '{{gridCellText}}')]" parameterized="true"/> + <element name="gridCellUpdated" type="text" selector="//tbody//tr//div[contains(text(), '{{gridCellText}}')]" parameterized="true"/> <element name="columnHeader" type="text" selector="//thead/tr/th[contains(@class, 'data-grid-th')]/span[text() = '{{label}}']" parameterized="true" timeout="30"/> </section> -</sections> \ No newline at end of file +</sections> diff --git a/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemeSortTest.xml b/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemeSortTest.xml new file mode 100644 index 0000000000000..5e251e452e263 --- /dev/null +++ b/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemeSortTest.xml @@ -0,0 +1,40 @@ +<?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="AdminContentThemesSortTest"> + <annotations> + <features value="Theme"/> + <stories value="Menu Navigation"/> + <title value="Admin content themes sort themes test"/> + <description value="Admin should be able to sort Themes"/> + <severity value="CRITICAL"/> + <testCaseId value="https://github.com/magento/magento2/pull/25926"/> + <group value="menu"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + </before> + <after> + <actionGroup ref="logout" stepKey="logout"/> + </after> + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToContentThemesPage"> + <argument name="menuUiId" value="{{AdminMenuContent.dataUiId}}"/> + <argument name="submenuUiId" value="{{AdminMenuContentDesignThemes.dataUiId}}"/> + </actionGroup> + <actionGroup ref="AdminAssertPageTitleActionGroup" stepKey="seePageTitle"> + <argument name="title" value="{{AdminMenuContentDesignThemes.pageTitle}}"/> + </actionGroup> + <click selector="{{AdminThemeSection.columnHeader('Theme Title')}}" stepKey="clickSortByTitle"/> + <click selector="{{AdminThemeSection.columnHeader('Theme Title')}}" stepKey="clickSortByTitleSecondTime"/> + <seeNumberOfElements selector="{{AdminThemeSection.rowsInColumn('theme_path')}}" userInput="2" stepKey="see2RowsOnTheGrid"/> + <seeElement selector="{{AdminThemeSection.gridCellUpdated('Magento Luma')}}" stepKey="seeLumaThemeInTitleColumn"/> + <seeElement selector="{{AdminThemeSection.gridCellUpdated('Magento Blank')}}" stepKey="seeBlankThemeInTitleColumn"/> + </test> +</tests> From 7cd10625d1208c4599e711bbbba4b50edca4f953 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Mon, 9 Dec 2019 12:09:42 +0200 Subject: [PATCH 452/595] fix typo --- .../Theme/Test/Mftf/Test/AdminContentThemeSortTest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemeSortTest.xml b/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemeSortTest.xml index 5e251e452e263..d27ed90f80520 100644 --- a/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemeSortTest.xml +++ b/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemeSortTest.xml @@ -31,8 +31,8 @@ <actionGroup ref="AdminAssertPageTitleActionGroup" stepKey="seePageTitle"> <argument name="title" value="{{AdminMenuContentDesignThemes.pageTitle}}"/> </actionGroup> - <click selector="{{AdminThemeSection.columnHeader('Theme Title')}}" stepKey="clickSortByTitle"/> - <click selector="{{AdminThemeSection.columnHeader('Theme Title')}}" stepKey="clickSortByTitleSecondTime"/> + <click selector="{{AdminThemeSection.columnHeader('Theme Title')}}" stepKey="clickSortByTitle"/> + <click selector="{{AdminThemeSection.columnHeader('Theme Title')}}" stepKey="clickSortByTitleSecondTime"/> <seeNumberOfElements selector="{{AdminThemeSection.rowsInColumn('theme_path')}}" userInput="2" stepKey="see2RowsOnTheGrid"/> <seeElement selector="{{AdminThemeSection.gridCellUpdated('Magento Luma')}}" stepKey="seeLumaThemeInTitleColumn"/> <seeElement selector="{{AdminThemeSection.gridCellUpdated('Magento Blank')}}" stepKey="seeBlankThemeInTitleColumn"/> From 05c84c29df8a2054a7aa04471696a884861acc21 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Mon, 9 Dec 2019 12:24:18 +0200 Subject: [PATCH 453/595] refactorign --- .../Magento/Theme/Test/Mftf/Test/AdminContentThemeSortTest.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemeSortTest.xml b/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemeSortTest.xml index d27ed90f80520..9facab57e9a09 100644 --- a/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemeSortTest.xml +++ b/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemeSortTest.xml @@ -34,7 +34,6 @@ <click selector="{{AdminThemeSection.columnHeader('Theme Title')}}" stepKey="clickSortByTitle"/> <click selector="{{AdminThemeSection.columnHeader('Theme Title')}}" stepKey="clickSortByTitleSecondTime"/> <seeNumberOfElements selector="{{AdminThemeSection.rowsInColumn('theme_path')}}" userInput="2" stepKey="see2RowsOnTheGrid"/> - <seeElement selector="{{AdminThemeSection.gridCellUpdated('Magento Luma')}}" stepKey="seeLumaThemeInTitleColumn"/> - <seeElement selector="{{AdminThemeSection.gridCellUpdated('Magento Blank')}}" stepKey="seeBlankThemeInTitleColumn"/> + <seeNumberOfElements selector="{{AdminThemeSection.gridCellUpdated('Magento Luma')}}" userInput="1" stepKey="seeLumaThemeInTitleColumn"/> </test> </tests> From 799b72a666c42120961a7b147c1a34a687b27265 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Mon, 9 Dec 2019 10:29:01 -0600 Subject: [PATCH 454/595] Change action groups name according to CE branch changes --- .../Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml | 2 +- .../AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml | 2 +- ...AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml index 98c1839f99859..6467a5051631d 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithNoRedirectTest.xml @@ -54,7 +54,7 @@ </actionGroup> <!-- Update URL Rewrite for CMS Page --> - <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateUrlRewriteFirstAttempt"> + <actionGroup ref="AdminUpdateUrlRewriteActionGroup" stepKey="updateUrlRewriteFirstAttempt"> <argument name="storeValue" value="{{customStore.name}}"/> <argument name="requestPath" value="newrequestpath"/> <argument name="redirectTypeValue" value="No"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml index c99cdb95758e5..3bf278db8410a 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithPermanentReirectTest.xml @@ -54,7 +54,7 @@ </actionGroup> <!-- Update URL Rewrite for CMS Page --> - <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateUrlRewrite"> + <actionGroup ref="AdminUpdateUrlRewriteActionGroup" stepKey="updateUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="permanentrequestpath.htm"/> <argument name="redirectTypeValue" value="Permanent (301)"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml index 644f495856f07..a7cadcdf753c3 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUpdateCmsPageRewriteEntityWithTemporaryRedirectTest.xml @@ -54,7 +54,7 @@ </actionGroup> <!-- Update URL Rewrite for CMS Page --> - <actionGroup ref="AdminUpdateUrlRewrite" stepKey="updateUrlRewrite"> + <actionGroup ref="AdminUpdateUrlRewriteActionGroup" stepKey="updateUrlRewrite"> <argument name="storeValue" value="Default Store View"/> <argument name="requestPath" value="temporaryrequestpath.html"/> <argument name="redirectTypeValue" value="Temporary (302)"/> From 46ebfa5b535ead3bc8a63769ce6922016a3b18f4 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Mon, 9 Dec 2019 15:07:58 -0600 Subject: [PATCH 455/595] Change action groups name according to CE branch changes --- .../ActionGroup/GoToSpecifiedCreateProductPageActionGroup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSpecifiedCreateProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSpecifiedCreateProductPageActionGroup.xml index 26041974dbc80..acbe990ad4c8c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSpecifiedCreateProductPageActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/GoToSpecifiedCreateProductPageActionGroup.xml @@ -16,7 +16,7 @@ <argument type="string" name="productType" defaultValue="simple"/> </arguments> - <comment userInput="actionGroup:GoToSpecifiedCreateProductPage" stepKey="actionGroupComment"/> + <comment userInput="actionGroup:GoToSpecifiedCreateProductPageActionGroup" stepKey="actionGroupComment"/> <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> <click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/> <click selector="{{AdminProductGridActionSection.addTypeProduct(productType)}}" stepKey="clickAddProduct"/> From 46bfa6a6d301569d1f75160bea8655f5cdb1d16e Mon Sep 17 00:00:00 2001 From: Tom Reece <treece@adobe.com> Date: Mon, 9 Dec 2019 14:25:11 -0600 Subject: [PATCH 456/595] MQE-1878: Stabilize community PR 742 --- .../StorefrontCustomerWishlistActionGroup.xml | 43 +++++++++++++++++++ ...eProductFromShoppingCartToWishlistTest.xml | 25 ++++++----- ...eProductFromShoppingCartToWishlistTest.xml | 25 ++++++----- ...eProductFromShoppingCartToWishlistTest.xml | 25 ++++++----- ...lProductFromShoppingCartToWishlistTest.xml | 16 +++---- 5 files changed, 86 insertions(+), 48 deletions(-) diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerWishlistActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerWishlistActionGroup.xml index 4c1c088c102cd..5568f255304a7 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerWishlistActionGroup.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerWishlistActionGroup.xml @@ -135,4 +135,47 @@ <dontSeeElement selector="{{StorefrontCustomerWishlistProductSection.pager}}" stepKey="checkThatPagerIsAbsent"/> <see selector="{{StorefrontCustomerWishlistProductSection.wishlistEmpty}}" userInput="You have no items in your wish list." stepKey="checkNoItemsMessage"/> </actionGroup> + + <actionGroup name="AssertMoveProductToWishListSuccessMessage"> + <annotations> + <description>Moves a product from the cart to the wishlist.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + <click selector="{{CheckoutCartProductSection.moveToWishlistByProductName(productName)}}" stepKey="moveToWishlist"/> + <waitForPageLoad stepKey="waitForMove"/> + <see userInput="{{productName}} has been moved to your wish list." selector="{{CheckoutCartMessageSection.successMessage}}" stepKey="assertSuccess"/> + </actionGroup> + + <actionGroup name="AssertProductIsPresentInWishList"> + <annotations> + <description>Go to storefront customer wishlist page and assert product name and price is present.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="productPrice" type="string"/> + </arguments> + <amOnPage url="{{StorefrontCustomerWishlistPage.url}}" stepKey="goToWishList"/> + <waitForPageLoad stepKey="waitForWishList"/> + <waitForElement selector="{{StorefrontCustomerWishlistProductSection.ProductTitleByName(productName)}}" time="30" stepKey="assertProductName"/> + <see userInput="{{productPrice}}" selector="{{StorefrontCustomerWishlistProductSection.ProductPriceByName(productName)}}" stepKey="assertProductPrice"/> + </actionGroup> + + <actionGroup name="AssertProductDetailsInWishlist"> + <annotations> + <description>Assert product name and price in wishlist on hover.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="label" type="string"/> + <argument name="labelValue" type="string"/> + </arguments> + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(productName)}}" stepKey="moveMouseOverProductInfo"/> + <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductAddToCartByName(productName)}}" stepKey="seeAddToCart"/> + <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductImageByName(productName)}}" stepKey="seeImage"/> + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsByName(productName)}}" stepKey="moveMouseOverProductDetails"/> + <see userInput="{{label}}" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsLabelByName(productName)}}" stepKey="seeLabel"/> + <see userInput="{{labelValue}}" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsValueByName(productName)}}" stepKey="seeLabelValue"/> + </actionGroup> </actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml index 317f937def3f1..49cd78ec1884f 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml @@ -141,23 +141,22 @@ <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> <!-- Assert move product to wishlist success message --> - <click selector="{{CheckoutCartProductSection.moveToWishlistByProductName($$createConfigProduct.name$$)}}" stepKey="moveToWishlist"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <see userInput="$$createConfigProduct.name$$ has been moved to your wish list." selector="{{CheckoutCartMessageSection.successMessage}}" stepKey="assertMoveProductToWishlistSuccessMessage"/> + <actionGroup ref="AssertMoveProductToWishListSuccessMessage" stepKey="moveToWishlist"> + <argument name="productName" value="$$createConfigProduct.name$$"/> + </actionGroup> <!-- Assert product is present in wishlist --> - <amOnPage url="{{StorefrontCustomerWishlistPage.url}}" stepKey="goToWishlistPage"/> - <waitForPageLoad stepKey="waitForWishlistPage"/> - <waitForElement selector="{{StorefrontCustomerWishlistProductSection.ProductTitleByName($$createConfigProduct.name$$)}}" time="30" stepKey="assertWishlistProductName"/> - <see userInput="$20.00" selector="{{StorefrontCustomerWishlistProductSection.ProductPriceByName($$createConfigProduct.name$$)}}" stepKey="AssertWishlistProductPrice"/> + <actionGroup ref="AssertProductIsPresentInWishList" stepKey="assertProductPresent"> + <argument name="productName" value="$$createConfigProduct.name$$"/> + <argument name="productPrice" value="$20.00"/> + </actionGroup> <!-- Assert product details in Wishlist --> - <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName($$createConfigProduct.name$$)}}" stepKey="wishlistMoveMouseOverProduct"/> - <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductAddToCartByName($$createConfigProduct.name$$)}}" stepKey="AssertWishlistAddToCart"/> - <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductImageByName($$createConfigProduct.name$$)}}" stepKey="AssertWishlistProductImage"/> - <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsByName($$createConfigProduct.name$$)}}" stepKey="seeDetailsMoveMouseOverProduct"/> - <see userInput="$$createConfigProductAttribute.default_value$$" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsLabelByName($$createConfigProduct.name$$)}}" stepKey="seeAttribute"/> - <see userInput="$$getConfigAttributeOption2.label$$" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsValueByName($$createConfigProduct.name$$)}}" stepKey="seeOption"/> + <actionGroup ref="AssertProductDetailsInWishlist" stepKey="assertProductDetails"> + <argument name="productName" value="$$createConfigProduct.name$$"/> + <argument name="label" value="$$createConfigProductAttribute.default_value$$"/> + <argument name="labelValue" value="$$getConfigAttributeOption2.label$$"/> + </actionGroup> <actionGroup ref="AssertShoppingCartIsEmptyActionGroup" stepKey="assertCartIsEmpty"/> </test> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml index dcd69a61e596f..856ebdb7bb73a 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml @@ -87,23 +87,22 @@ <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> <!-- Assert move product to wishlist success message --> - <click selector="{{CheckoutCartProductSection.moveToWishlistByProductName($$createBundleProduct.name$$)}}" stepKey="moveToWishlist"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <see userInput="$$createBundleProduct.name$$ has been moved to your wish list." selector="{{CheckoutCartMessageSection.successMessage}}" stepKey="assertMoveProductToWishlistSuccessMessage"/> + <actionGroup ref="AssertMoveProductToWishListSuccessMessage" stepKey="moveToWishlist"> + <argument name="productName" value="$$createBundleProduct.name$$"/> + </actionGroup> <!-- Assert product is present in wishlist --> - <amOnPage url="{{StorefrontCustomerWishlistPage.url}}" stepKey="goToWishlistPage"/> - <waitForPageLoad stepKey="waitForWishlistPage"/> - <waitForElement selector="{{StorefrontCustomerWishlistProductSection.ProductTitleByName($$createBundleProduct.name$$)}}" time="30" stepKey="assertWishlistProductName"/> - <see userInput="$100.00" selector="{{StorefrontCustomerWishlistProductSection.ProductPriceByName($$createBundleProduct.name$$)}}" stepKey="AssertWishlistProductPrice"/> + <actionGroup ref="AssertProductIsPresentInWishList" stepKey="assertProductPresent"> + <argument name="productName" value="$$createBundleProduct.name$$"/> + <argument name="productPrice" value="$100.00"/> + </actionGroup> <!-- Assert product details in Wishlist --> - <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName($$createBundleProduct.name$$)}}" stepKey="wishlistMoveMouseOverProduct"/> - <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductAddToCartByName($$createBundleProduct.name$$)}}" stepKey="AssertWishlistAddToCart"/> - <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductImageByName($$createBundleProduct.name$$)}}" stepKey="AssertWishlistProductImage"/> - <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsByName($$createBundleProduct.name$$)}}" stepKey="seeDetailsMoveMouseOverProduct"/> - <see userInput="$$createBundleOption1_1.title$$" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsLabelByName($$createBundleProduct.name$$)}}" stepKey="seeBundleOption"/> - <see userInput="$$simpleProduct1.sku$$ $100.00" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsValueByName($$createBundleProduct.name$$)}}" stepKey="seeProduct"/> + <actionGroup ref="AssertProductDetailsInWishlist" stepKey="assertProductDetails"> + <argument name="productName" value="$$createBundleProduct.name$$"/> + <argument name="label" value="$$createBundleOption1_1.title$$"/> + <argument name="labelValue" value="$$simpleProduct1.sku$$ $100.00"/> + </actionGroup> <actionGroup ref="AssertShoppingCartIsEmptyActionGroup" stepKey="assertCartIsEmpty"/> </test> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml index 4d99b05e9aa6a..9c3984d0287ec 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml @@ -78,23 +78,22 @@ <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> <!-- Assert move product to wishlist success message --> - <click selector="{{CheckoutCartProductSection.moveToWishlistByProductName($$createBundleProduct.name$$)}}" stepKey="moveToWishlist"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <see userInput="$$createBundleProduct.name$$ has been moved to your wish list." selector="{{CheckoutCartMessageSection.successMessage}}" stepKey="assertMoveProductToWishlistSuccessMessage"/> + <actionGroup ref="AssertMoveProductToWishListSuccessMessage" stepKey="moveToWishlist"> + <argument name="productName" value="$$createBundleProduct.name$$"/> + </actionGroup> <!-- Assert product is present in wishlist --> - <amOnPage url="{{StorefrontCustomerWishlistPage.url}}" stepKey="goToWishlistPage"/> - <waitForPageLoad stepKey="waitForWishlistPage"/> - <waitForElement selector="{{StorefrontCustomerWishlistProductSection.ProductTitleByName($$createBundleProduct.name$$)}}" time="30" stepKey="assertWishlistProductName"/> - <see userInput="$101.23" selector="{{StorefrontCustomerWishlistProductSection.ProductPriceByName($$createBundleProduct.name$$)}}" stepKey="AssertWishlistProductPrice"/> + <actionGroup ref="AssertProductIsPresentInWishList" stepKey="assertProductPresent"> + <argument name="productName" value="$$createBundleProduct.name$$"/> + <argument name="productPrice" value="$101.23"/> + </actionGroup> <!-- Assert product details in Wishlist --> - <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName($$createBundleProduct.name$$)}}" stepKey="wishlistMoveMouseOverProduct"/> - <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductAddToCartByName($$createBundleProduct.name$$)}}" stepKey="AssertWishlistAddToCart"/> - <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductImageByName($$createBundleProduct.name$$)}}" stepKey="AssertWishlistProductImage"/> - <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsByName($$createBundleProduct.name$$)}}" stepKey="seeDetailsMoveMouseOverProduct"/> - <see userInput="$$createBundleOption1_1.title$$" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsLabelByName($$createBundleProduct.name$$)}}" stepKey="seeBundleOption"/> - <see userInput="$$simpleProduct1.sku$$ $100.00" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsValueByName($$createBundleProduct.name$$)}}" stepKey="seeProduct"/> + <actionGroup ref="AssertProductDetailsInWishlist" stepKey="assertProductDetails"> + <argument name="productName" value="$$createBundleProduct.name$$"/> + <argument name="label" value="$$createBundleOption1_1.title$$"/> + <argument name="labelValue" value="$$simpleProduct1.sku$$ $100.00"/> + </actionGroup> <actionGroup ref="AssertShoppingCartIsEmptyActionGroup" stepKey="assertCartIsEmpty"/> </test> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml index baaae80f7d081..20ac78dfbf731 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml @@ -53,16 +53,14 @@ <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> <!-- Assert move product to wishlist success message --> - <click selector="{{CheckoutCartProductSection.moveToWishlistByProductName($$createProduct.name$$)}}" stepKey="moveToWishlist"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <see userInput="$$createProduct.name$$ has been moved to your wish list." selector="{{CheckoutCartMessageSection.successMessage}}" stepKey="assertMoveProductToWishlistSuccessMessage"/> - - <!-- Assert product is present in wishlist --> - <amOnPage url="{{StorefrontCustomerWishlistPage.url}}" stepKey="goToWishlistPage"/> - <waitForPageLoad stepKey="waitForWishlistPage"/> + <actionGroup ref="AssertMoveProductToWishListSuccessMessage" stepKey="moveToWishlist"> + <argument name="productName" value="$$createProduct.name$$"/> + </actionGroup> - <actionGroup ref="StorefrontCustomerCheckProductInWishlist" stepKey="assertProductIsPresentInWishlist"> - <argument name="productVar" value="$$createProduct$$"/> + <!-- Assert product is present in wishlist --> + <actionGroup ref="AssertProductIsPresentInWishList" stepKey="assertProductPresent"> + <argument name="productName" value="$$createProduct.name$$"/> + <argument name="productPrice" value="$$createProduct.price$$"/> </actionGroup> <!-- Assert cart is empty --> From d19de1ac568f7d0e54a53adca686926c6df38d6c Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Mon, 9 Dec 2019 15:46:49 -0600 Subject: [PATCH 457/595] Change action groups name according to CE branch changes --- .../Test/Mftf/ActionGroup/AddUpSellProductBySkuActionGroup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddUpSellProductBySkuActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddUpSellProductBySkuActionGroup.xml index b107aab956beb..0ba6b479885e3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddUpSellProductBySkuActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddUpSellProductBySkuActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AddUpSellProductBySkuActionGroup" extends="AddRelatedProductBySkuActionGroup"> <annotations> - <description>EXTENDS: addRelatedProductBySku. Add the provided Product as an Up Sell Product.</description> + <description>EXTENDS: AddRelatedProductBySkuActionGroup. Add the provided Product as an Up Sell Product.</description> </annotations> <click selector="{{AdminProductFormRelatedUpSellCrossSellSection.AddUpSellProductsButton}}" stepKey="clickAddRelatedProductButton"/> From 41aad64a1aedc6be608ab624069e15860bb8c734 Mon Sep 17 00:00:00 2001 From: Dan Wallis <mrdanwallis@gmail.com> Date: Mon, 9 Dec 2019 22:19:40 +0000 Subject: [PATCH 458/595] Update values to make linter happy --- .../adminhtml/Magento/backend/web/css/source/_actions.less | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/_actions.less b/app/design/adminhtml/Magento/backend/web/css/source/_actions.less index 28912d873ae00..c86e9cdbf0866 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/_actions.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/_actions.less @@ -446,12 +446,12 @@ button { } &::after { - border-color: transparent transparent transparent #000; + border-color: transparent transparent transparent @color-black; border-style: solid; - border-width: 0.4rem 0 0.4rem 0.5rem; + border-width: .4rem 0 .4rem .5rem; content: ''; height: 0; - margin-top: -0.2rem; + margin-top: -.2rem; position: absolute; right: 1rem; top: 50%; From 8039f7498e4e1edca652fab745a52f1816d69584 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy <dpoperechnyy@magento.com> Date: Mon, 9 Dec 2019 19:04:18 -0600 Subject: [PATCH 459/595] MC-23411: Random failure of PAT builds --- setup/src/Magento/Setup/Fixtures/_files/dictionary.csv | 2 +- .../Setup/Model/Address/AddressDataGenerator.php | 2 +- setup/src/Magento/Setup/Model/DataGenerator.php | 10 +++++----- .../Setup/Model/Description/DescriptionGenerator.php | 2 +- .../Description/DescriptionParagraphGenerator.php | 2 +- .../Model/Description/DescriptionSentenceGenerator.php | 2 +- .../Setup/Model/Description/Mixin/BoldMixin.php | 2 +- .../Description/Mixin/Helper/RandomWordSelector.php | 2 +- .../Setup/Model/Description/Mixin/ItalicMixin.php | 2 +- .../Setup/Model/Description/Mixin/SpanMixin.php | 2 +- setup/src/Magento/Setup/Model/Dictionary.php | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/setup/src/Magento/Setup/Fixtures/_files/dictionary.csv b/setup/src/Magento/Setup/Fixtures/_files/dictionary.csv index c839b7c46f51c..ba188534a3e24 100644 --- a/setup/src/Magento/Setup/Fixtures/_files/dictionary.csv +++ b/setup/src/Magento/Setup/Fixtures/_files/dictionary.csv @@ -7370,4 +7370,4 @@ Gregory pine borrowed bow -disturbing \ No newline at end of file +disturbing diff --git a/setup/src/Magento/Setup/Model/Address/AddressDataGenerator.php b/setup/src/Magento/Setup/Model/Address/AddressDataGenerator.php index 1bbd152f2ba4e..2d450a4374c5e 100644 --- a/setup/src/Magento/Setup/Model/Address/AddressDataGenerator.php +++ b/setup/src/Magento/Setup/Model/Address/AddressDataGenerator.php @@ -18,7 +18,7 @@ class AddressDataGenerator public function generateAddress() { return [ - 'postcode' => random_int(10000, 99999) + 'postcode' => mt_rand(10000, 99999) ]; } } diff --git a/setup/src/Magento/Setup/Model/DataGenerator.php b/setup/src/Magento/Setup/Model/DataGenerator.php index 540433e5aa3ec..c7c975f2d993d 100644 --- a/setup/src/Magento/Setup/Model/DataGenerator.php +++ b/setup/src/Magento/Setup/Model/DataGenerator.php @@ -4,11 +4,11 @@ * See COPYING.txt for license details. */ -/** - * A custom adapter that allows generating arbitrary descriptions - */ namespace Magento\Setup\Model; +/** + * A custom adapter that allows generating arbitrary descriptions. + */ class DataGenerator { /** @@ -67,12 +67,12 @@ protected function readData() */ public function generate($minAmountOfWords, $maxAmountOfWords, $key = null) { - $numberOfWords = random_int($minAmountOfWords, $maxAmountOfWords); + $numberOfWords = mt_rand($minAmountOfWords, $maxAmountOfWords); $result = ''; if ($key === null || !array_key_exists($key, $this->generatedValues)) { for ($i = 0; $i < $numberOfWords; $i++) { - $result .= ' ' . $this->dictionaryData[random_int(0, count($this->dictionaryData) - 1)]; + $result .= ' ' . $this->dictionaryData[mt_rand(0, count($this->dictionaryData) - 1)]; } $result = trim($result); diff --git a/setup/src/Magento/Setup/Model/Description/DescriptionGenerator.php b/setup/src/Magento/Setup/Model/Description/DescriptionGenerator.php index a790bfdbe608d..807e1fde7d90d 100644 --- a/setup/src/Magento/Setup/Model/Description/DescriptionGenerator.php +++ b/setup/src/Magento/Setup/Model/Description/DescriptionGenerator.php @@ -63,7 +63,7 @@ public function generate() */ private function generateRawDescription() { - $paragraphsCount = random_int( + $paragraphsCount = mt_rand( $this->descriptionConfig['paragraphs']['count-min'], $this->descriptionConfig['paragraphs']['count-max'] ); diff --git a/setup/src/Magento/Setup/Model/Description/DescriptionParagraphGenerator.php b/setup/src/Magento/Setup/Model/Description/DescriptionParagraphGenerator.php index 57ece1f9558c3..50544e6ea9726 100644 --- a/setup/src/Magento/Setup/Model/Description/DescriptionParagraphGenerator.php +++ b/setup/src/Magento/Setup/Model/Description/DescriptionParagraphGenerator.php @@ -39,7 +39,7 @@ public function __construct( */ public function generate() { - $sentencesCount = random_int( + $sentencesCount = mt_rand( $this->paragraphConfig['sentences']['count-min'], $this->paragraphConfig['sentences']['count-max'] ); diff --git a/setup/src/Magento/Setup/Model/Description/DescriptionSentenceGenerator.php b/setup/src/Magento/Setup/Model/Description/DescriptionSentenceGenerator.php index 10b07e7e1c7a2..299b4b50bed0f 100644 --- a/setup/src/Magento/Setup/Model/Description/DescriptionSentenceGenerator.php +++ b/setup/src/Magento/Setup/Model/Description/DescriptionSentenceGenerator.php @@ -39,7 +39,7 @@ public function __construct( */ public function generate() { - $sentenceWordsCount = random_int( + $sentenceWordsCount = mt_rand( $this->sentenceConfig['words']['count-min'], $this->sentenceConfig['words']['count-max'] ); diff --git a/setup/src/Magento/Setup/Model/Description/Mixin/BoldMixin.php b/setup/src/Magento/Setup/Model/Description/Mixin/BoldMixin.php index 927759c4bfa7c..db208adc67de8 100644 --- a/setup/src/Magento/Setup/Model/Description/Mixin/BoldMixin.php +++ b/setup/src/Magento/Setup/Model/Description/Mixin/BoldMixin.php @@ -48,7 +48,7 @@ public function apply($text) return $this->wordWrapper->wrapWords( $text, - $this->randomWordSelector->getRandomWords($rawText, random_int(5, 8)), + $this->randomWordSelector->getRandomWords($rawText, mt_rand(5, 8)), '<b>%s</b>' ); } diff --git a/setup/src/Magento/Setup/Model/Description/Mixin/Helper/RandomWordSelector.php b/setup/src/Magento/Setup/Model/Description/Mixin/Helper/RandomWordSelector.php index c7efcc7f12e0f..0598db218728f 100644 --- a/setup/src/Magento/Setup/Model/Description/Mixin/Helper/RandomWordSelector.php +++ b/setup/src/Magento/Setup/Model/Description/Mixin/Helper/RandomWordSelector.php @@ -27,7 +27,7 @@ public function getRandomWords($source, $count) $randWords = []; $wordsSize = count($words); while ($count) { - $randWords[] = $words[random_int(0, $wordsSize - 1)]; + $randWords[] = $words[mt_rand(0, $wordsSize - 1)]; $count--; } diff --git a/setup/src/Magento/Setup/Model/Description/Mixin/ItalicMixin.php b/setup/src/Magento/Setup/Model/Description/Mixin/ItalicMixin.php index 7621bccf08773..87e033be330cf 100644 --- a/setup/src/Magento/Setup/Model/Description/Mixin/ItalicMixin.php +++ b/setup/src/Magento/Setup/Model/Description/Mixin/ItalicMixin.php @@ -48,7 +48,7 @@ public function apply($text) return $this->wordWrapper->wrapWords( $text, - $this->randomWordSelector->getRandomWords($rawText, random_int(5, 8)), + $this->randomWordSelector->getRandomWords($rawText, mt_rand(5, 8)), '<i>%s</i>' ); } diff --git a/setup/src/Magento/Setup/Model/Description/Mixin/SpanMixin.php b/setup/src/Magento/Setup/Model/Description/Mixin/SpanMixin.php index fe53ebef535a8..ed5a836129460 100644 --- a/setup/src/Magento/Setup/Model/Description/Mixin/SpanMixin.php +++ b/setup/src/Magento/Setup/Model/Description/Mixin/SpanMixin.php @@ -48,7 +48,7 @@ public function apply($text) return $this->wordWrapper->wrapWords( $text, - $this->randomWordSelector->getRandomWords($rawText, random_int(5, 8)), + $this->randomWordSelector->getRandomWords($rawText, mt_rand(5, 8)), '<span>%s</span>' ); } diff --git a/setup/src/Magento/Setup/Model/Dictionary.php b/setup/src/Magento/Setup/Model/Dictionary.php index 52f7cc1bb5148..630d35092d0fc 100644 --- a/setup/src/Magento/Setup/Model/Dictionary.php +++ b/setup/src/Magento/Setup/Model/Dictionary.php @@ -40,7 +40,7 @@ public function getRandWord() $this->readDictionary(); } - $randIndex = random_int(0, count($this->dictionary) - 1); + $randIndex = mt_rand(0, count($this->dictionary) - 1); return trim($this->dictionary[$randIndex]); } From 08f3f7fb14fcd3a4ee97253e7c3091b029d0ccb2 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Mon, 9 Dec 2019 22:42:03 -0600 Subject: [PATCH 460/595] Change action groups name according to CE branch changes --- ...igateToNewOrderPageExistingCustomerAndStoreActionGroup.xml | 4 ++-- .../Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerAndStoreActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerAndStoreActionGroup.xml index 08f70f69013f3..883f1047feb79 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerAndStoreActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/NavigateToNewOrderPageExistingCustomerAndStoreActionGroup.xml @@ -8,9 +8,9 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="NavigateToNewOrderPageExistingCustomerAndStoreActionGroup" extends="navigateToNewOrderPageExistingCustomer"> + <actionGroup name="NavigateToNewOrderPageExistingCustomerAndStoreActionGroup" extends="NavigateToNewOrderPageExistingCustomerActionGroup"> <annotations> - <description>EXTENDS: navigateToNewOrderPageExistingCustomer. Clicks on the provided Store View.</description> + <description>EXTENDS: NavigateToNewOrderPageExistingCustomerActionGroup. Clicks on the provided Store View.</description> </annotations> <arguments> <argument name="storeView" defaultValue="_defaultStore"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml index 8cd6fc03a402a..e7964a2dd29eb 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/CheckCreditMemoTotalsTest.xml @@ -112,7 +112,7 @@ <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> <waitForPageLoad stepKey="waitForPageLoad3"/> <!--Set shipping method--> - <actionGroup stepKey="orderSelectFlatRateShipping" ref="OrderSelectFlatRateShippingActionGroup"/> + <actionGroup stepKey="OrderSelectFlatRateShippingActionGroup" ref="OrderSelectFlatRateShippingActionGroup"/> <!--Submit order--> <click stepKey="SubmitOrder" selector="{{AdminOrderFormActionSection.SubmitOrder}}"/> <waitForPageLoad stepKey="waitForPageLoad4"/> From 393ef91131c4649784a887abe42cb242921d94e8 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Tue, 10 Dec 2019 10:11:19 +0200 Subject: [PATCH 461/595] MC-5233: DateTime product attributes support --- .../Unit/Ui/Component/ColumnFactoryTest.php | 3 ++- .../Product/Form/Modifier/EavTest.php | 3 ++- .../Catalog/Ui/Component/ColumnFactory.php | 2 +- .../Product/Form/Modifier/Eav.php | 2 +- .../catalog/product/attribute/js.phtml | 24 ++++++++++++------- .../Test/Unit/Model/Entity/AttributeTest.php | 23 +++++++++++------- .../Component/Form/Element/DataType/Date.php | 2 +- .../Unit/Component/Filters/Type/DateTest.php | 2 +- 8 files changed, 38 insertions(+), 23 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php index 78e241100dc3b..b3acaa4b8bbed 100644 --- a/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Ui/Component/ColumnFactoryTest.php @@ -19,7 +19,7 @@ use PHPUnit\Framework\TestCase; /** - * ColumnFactory test. + * Test to Create columns factory on product grid page */ class ColumnFactoryTest extends TestCase { @@ -206,6 +206,7 @@ public function testCreateDateColumn( 'component' => 'Magento_Ui/js/grid/columns/date', 'timezone' => $expectedTimezone, 'dateFormat' => $expectedDateFormat, + '__disableTmpl' => ['label' => true], 'options' => [ 'showsTime' => $showsTime ] diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php index 6221704d51112..91e22407acc43 100644 --- a/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php @@ -41,7 +41,7 @@ use PHPUnit\Framework\MockObject\MockObject; /** - * Class EavTest + * Class to test Data provider for eav attributes on product page * * @method Eav getModel * @SuppressWarnings(PHPMD.TooManyFields) @@ -692,6 +692,7 @@ public function setupAttributeMetaDataProvider() 'scopeLabel' => '', 'globalScope' => false, 'sortOrder' => 0, + '__disableTmpl' => ['label' => true, 'code' => true] ], 'locked' => false, 'frontendInput' => 'datetime', diff --git a/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php b/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php index 61bc518756ba6..b902e741c006c 100644 --- a/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php +++ b/app/code/Magento/Catalog/Ui/Component/ColumnFactory.php @@ -15,7 +15,7 @@ use Magento\Ui\Component\Listing\Columns\ColumnInterface; /** - * Column Factory + * Create columns factory on product grid page * * @api * @since 100.0.2 diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php index bc5bee64912c7..25e816f79639a 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php @@ -40,7 +40,7 @@ use Magento\Eav\Model\ResourceModel\Entity\Attribute\CollectionFactory as AttributeCollectionFactory; /** - * Class Eav + * Data provider for eav attributes on product page * * @api * diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml index 212a345f4bcbc..64384ac391a8d 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +use Magento\Catalog\Helper\Data; // phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis ?> @@ -63,7 +64,12 @@ function bindAttributeInputType() { checkOptionsPanelVisibility(); switchDefaultValueField(); - if($('frontend_input') && ($('frontend_input').value=='boolean' || $('frontend_input').value=='select' || $('frontend_input').value=='multiselect' || $('frontend_input').value=='price')){ + if ($('frontend_input') + && ($('frontend_input').value=='boolean' + || $('frontend_input').value=='select' + || $('frontend_input').value=='multiselect' + || $('frontend_input').value=='price') + ){ if($('is_filterable') && !$('is_filterable').getAttribute('readonly')){ $('is_filterable').disabled = false; } @@ -75,8 +81,7 @@ function bindAttributeInputType() if($('backend_type').options[i].value=='int') $('backend_type').selectedIndex = i; } } - } - else { + } else { if($('is_filterable')){ $('is_filterable').selectedIndex=0; $('is_filterable').disabled = true; @@ -203,21 +208,22 @@ function switchDefaultValueField() setRowVisibility('frontend_class', false); break; - <?php foreach ($this->helper(Magento\Catalog\Helper\Data::class)->getAttributeHiddenFields() as $type => $fields) :?> + <?php // phpcs:ignore Magento2.Templates.ThisInTemplate ?> + <?php foreach ($this->helper(Data::class)->getAttributeHiddenFields() as $type => $fields): ?> case '<?= $block->escapeJs($type) ?>': var isFrontTabHidden = false; - <?php foreach ($fields as $one) :?> - <?php if ($one == '_front_fieldset') :?> + <?php foreach ($fields as $one): ?> + <?php if ($one == '_front_fieldset'): ?> getFrontTab().hide(); isFrontTabHidden = true; - <?php elseif ($one == '_default_value') :?> + <?php elseif ($one == '_default_value'): ?> defaultValueTextVisibility = defaultValueTextareaVisibility = defaultValueDateVisibility = defaultValueYesnoVisibility = false; - <?php elseif ($one == '_scope') :?> + <?php elseif ($one == '_scope'): ?> scopeVisibility = false; - <?php else :?> + <?php else: ?> setRowVisibility('<?= $block->escapeJs($one) ?>', false); <?php endif; ?> <?php endforeach; ?> diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/AttributeTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/AttributeTest.php index 7aa5bca00f0b6..ae4ae7ee707e3 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/AttributeTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/AttributeTest.php @@ -5,14 +5,21 @@ */ namespace Magento\Eav\Test\Unit\Model\Entity; +use Magento\Eav\Model\Entity\Attribute; +use Magento\Eav\Model\Entity\Attribute\FrontendLabel; +use Magento\Eav\Model\Entity\Attribute\FrontendLabelFactory; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + /** - * Class AttributeTest. + * Test for EAV Entity attribute model */ -class AttributeTest extends \PHPUnit\Framework\TestCase +class AttributeTest extends TestCase { /** * Attribute model to be tested - * @var \Magento\Eav\Model\Entity\Attribute|\PHPUnit_Framework_MockObject_MockObject + * @var Attribute|MockObject */ protected $_model; @@ -21,7 +28,7 @@ class AttributeTest extends \PHPUnit\Framework\TestCase */ protected function setUp() { - $this->_model = $this->createPartialMock(\Magento\Eav\Model\Entity\Attribute::class, ['__wakeup']); + $this->_model = $this->createPartialMock(Attribute::class, ['__wakeup']); } /** @@ -132,7 +139,7 @@ public function testGetFrontendLabels() { $attributeId = 1; $storeLabels = ['test_attribute_store1']; - $frontendLabelFactory = $this->getMockBuilder(\Magento\Eav\Model\Entity\Attribute\FrontendLabelFactory::class) + $frontendLabelFactory = $this->getMockBuilder(FrontendLabelFactory::class) ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); @@ -144,15 +151,15 @@ public function testGetFrontendLabels() '_resource' => $resource, 'frontendLabelFactory' => $frontendLabelFactory, ]; - $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $this->_model = $objectManager->getObject(\Magento\Eav\Model\Entity\Attribute::class, $arguments); + $objectManager = new ObjectManager($this); + $this->_model = $objectManager->getObject(Attribute::class, $arguments); $this->_model->setAttributeId($attributeId); $resource->expects($this->once()) ->method('getStoreLabelsByAttributeId') ->with($attributeId) ->willReturn($storeLabels); - $frontendLabel = $this->getMockBuilder(\Magento\Eav\Model\Entity\Attribute\FrontendLabel::class) + $frontendLabel = $this->getMockBuilder(FrontendLabel::class) ->setMethods(['setStoreId', 'setLabel']) ->disableOriginalConstructor() ->getMock(); diff --git a/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php b/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php index 6bf1eacd161cc..ef2df77e7daff 100644 --- a/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php +++ b/app/code/Magento/Ui/Component/Form/Element/DataType/Date.php @@ -11,7 +11,7 @@ use Magento\Framework\View\Element\UiComponent\ContextInterface; /** - * Class Date + * UI component date type */ class Date extends AbstractDataType { diff --git a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php index 31d7ca92c5985..20af2627fbb04 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php @@ -16,7 +16,7 @@ use PHPUnit\Framework\MockObject\MockObject; /** - * Class DateTest + * Test for Date grid filter functionality */ class DateTest extends \PHPUnit\Framework\TestCase { From 271a2862d39da787ed82175e15334deb00688ba4 Mon Sep 17 00:00:00 2001 From: Nikita Shcherbatykh <nikita.shcherbatykh@transoftgroup.com> Date: Tue, 10 Dec 2019 11:40:45 +0200 Subject: [PATCH 462/595] MC-29273: [Magento Cloud] - When admin URL is different to front-base URL admin redirects to storefront --- .../Adminhtml/System/Currencysymbol/Save.php | 51 ++++++-- .../System/Currencysymbol/SaveTest.php | 116 +++++++++--------- 2 files changed, 101 insertions(+), 66 deletions(-) diff --git a/app/code/Magento/CurrencySymbol/Controller/Adminhtml/System/Currencysymbol/Save.php b/app/code/Magento/CurrencySymbol/Controller/Adminhtml/System/Currencysymbol/Save.php index f77976cc9e2f2..07c7c553ac792 100644 --- a/app/code/Magento/CurrencySymbol/Controller/Adminhtml/System/Currencysymbol/Save.php +++ b/app/code/Magento/CurrencySymbol/Controller/Adminhtml/System/Currencysymbol/Save.php @@ -5,37 +5,68 @@ */ namespace Magento\CurrencySymbol\Controller\Adminhtml\System\Currencysymbol; -use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; +use Magento\Backend\App\Action; +use Magento\Backend\Model\View\Result\Redirect; +use Magento\CurrencySymbol\Controller\Adminhtml\System\Currencysymbol as CurrencysymbolController; +use Magento\CurrencySymbol\Model\System\CurrencysymbolFactory; +use Magento\Framework\App\Action\HttpPostActionInterface; +use Magento\Framework\Controller\ResultInterface; +use Magento\Framework\Filter\FilterManager; /** - * Class Save + * Controller to save currency symbol */ -class Save extends \Magento\CurrencySymbol\Controller\Adminhtml\System\Currencysymbol implements HttpPostActionInterface +class Save extends CurrencysymbolController implements HttpPostActionInterface { + /** + * @var FilterManager + */ + private $filterManager; + + /** + * @var CurrencysymbolFactory + */ + private $currencySymbolFactory; + + /** + * @param Action\Context $context + * @param FilterManager $filterManager + * @param CurrencysymbolFactory $currencySymbolFactory + */ + public function __construct( + Action\Context $context, + FilterManager $filterManager, + CurrencysymbolFactory $currencySymbolFactory + ) { + parent::__construct($context); + $this->filterManager = $filterManager; + $this->currencySymbolFactory = $currencySymbolFactory; + } + /** * Save custom Currency symbol * - * @return void + * @return ResultInterface */ public function execute() { + /** @var Redirect $resultRedirect */ + $resultRedirect = $this->resultRedirectFactory->create(); $symbolsDataArray = $this->getRequest()->getParam('custom_currency_symbol', null); if (is_array($symbolsDataArray)) { foreach ($symbolsDataArray as &$symbolsData) { - /** @var $filterManager \Magento\Framework\Filter\FilterManager */ - $filterManager = $this->_objectManager->get(\Magento\Framework\Filter\FilterManager::class); - $symbolsData = $filterManager->stripTags($symbolsData); + $symbolsData = $this->filterManager->stripTags($symbolsData); } } try { - $this->_objectManager->create(\Magento\CurrencySymbol\Model\System\Currencysymbol::class) - ->setCurrencySymbolsData($symbolsDataArray); + $currencySymbol = $this->currencySymbolFactory->create(); + $currencySymbol->setCurrencySymbolsData($symbolsDataArray); $this->messageManager->addSuccessMessage(__('You applied the custom currency symbols.')); } catch (\Exception $e) { $this->messageManager->addErrorMessage($e->getMessage()); } - $this->getResponse()->setRedirect($this->_redirect->getRedirectUrl($this->getUrl('*'))); + return $resultRedirect->setPath('*'); } } diff --git a/app/code/Magento/CurrencySymbol/Test/Unit/Controller/Adminhtml/System/Currencysymbol/SaveTest.php b/app/code/Magento/CurrencySymbol/Test/Unit/Controller/Adminhtml/System/Currencysymbol/SaveTest.php index 06f4294ce6397..b3c69c352ac7d 100644 --- a/app/code/Magento/CurrencySymbol/Test/Unit/Controller/Adminhtml/System/Currencysymbol/SaveTest.php +++ b/app/code/Magento/CurrencySymbol/Test/Unit/Controller/Adminhtml/System/Currencysymbol/SaveTest.php @@ -5,132 +5,136 @@ */ namespace Magento\CurrencySymbol\Test\Unit\Controller\Adminhtml\System\Currencysymbol; +use Magento\Backend\Helper\Data; +use Magento\Backend\Model\View\Result\Redirect; +use Magento\Backend\Model\View\Result\RedirectFactory; +use Magento\CurrencySymbol\Controller\Adminhtml\System\Currencysymbol\Save; +use Magento\CurrencySymbol\Model\System\Currencysymbol; +use Magento\CurrencySymbol\Model\System\CurrencysymbolFactory; +use Magento\Framework\App\RequestInterface; +use Magento\Framework\App\Response\RedirectInterface; +use Magento\Framework\App\ResponseInterface; +use Magento\Framework\Filter\FilterManager; +use Magento\Framework\Message\ManagerInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\MockObject\MockObject; /** - * Class SaveTest + * Test ot to save currency symbol controller */ -class SaveTest extends \PHPUnit\Framework\TestCase +class SaveTest extends TestCase { /** - * @var \Magento\CurrencySymbol\Controller\Adminhtml\System\Currencysymbol\Save + * @var Save */ protected $action; /** - * @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject + * @var RedirectFactory|MockObject + */ + private $resultRedirectFactory; + + /** + * @var RequestInterface|MockObject */ protected $requestMock; /** - * @var \Magento\Framework\App\ResponseInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ResponseInterface|MockObject */ protected $responseMock; /** - * @var \Magento\Framework\ObjectManagerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ManagerInterface|MockObject */ - protected $objectManagerMock; + protected $messageManagerMock; /** - * @var \Magento\CurrencySymbol\Model\System\Currencysymbol|\PHPUnit_Framework_MockObject_MockObject + * @var RedirectInterface|MockObject */ - protected $currencySymbolMock; + protected $redirectMock; /** - * @var \Magento\Framework\Message\ManagerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var Data|MockObject */ - protected $messageManagerMock; + protected $helperMock; /** - * @var \Magento\Framework\App\Response\RedirectInterface|\PHPUnit_Framework_MockObject_MockObject + * @var FilterManager|MockObject */ - protected $redirectMock; + private $filterManager; /** - * @var \Magento\Backend\Helper\Data|\PHPUnit_Framework_MockObject_MockObject + * @var CurrencysymbolFactory|MockObject */ - protected $helperMock; + private $currencySymbolFactory; /** - * @var \Magento\Framework\Filter\FilterManager|\PHPUnit_Framework_MockObject_MockObject + * @inheritdoc */ - protected $filterManagerMock; - protected function setUp() { $objectManager = new ObjectManager($this); - - $this->requestMock = $this->createMock(\Magento\Framework\App\RequestInterface::class); - - $this->helperMock = $this->createMock(\Magento\Backend\Helper\Data::class); - - $this->redirectMock = $this->createMock(\Magento\Framework\App\Response\RedirectInterface::class); - + $this->requestMock = $this->createMock(RequestInterface::class); + $this->helperMock = $this->createMock(Data::class); + $this->redirectMock = $this->createMock(RedirectInterface::class); $this->responseMock = $this->createPartialMock( - \Magento\Framework\App\ResponseInterface::class, + ResponseInterface::class, ['setRedirect', 'sendResponse'] ); - - $this->currencySymbolMock = $this->createMock(\Magento\CurrencySymbol\Model\System\Currencysymbol::class); - - $this->filterManagerMock = $this->createPartialMock( - \Magento\Framework\Filter\FilterManager::class, + $this->messageManagerMock = $this->createMock(ManagerInterface::class); + $this->resultRedirectFactory = $this->createMock(RedirectFactory::class); + $this->filterManager = $this->createPartialMock( + FilterManager::class, ['stripTags'] ); + $this->currencySymbolFactory = $this->createMock(CurrencysymbolFactory::class); - $this->objectManagerMock = $this->createMock(\Magento\Framework\ObjectManagerInterface::class); - - $this->messageManagerMock = $this->createMock(\Magento\Framework\Message\ManagerInterface::class); $this->action = $objectManager->getObject( - \Magento\CurrencySymbol\Controller\Adminhtml\System\Currencysymbol\Save::class, + Save::class, [ 'request' => $this->requestMock, 'response' => $this->responseMock, - 'objectManager' => $this->objectManagerMock, 'redirect' => $this->redirectMock, 'helper' => $this->helperMock, - 'messageManager' => $this->messageManagerMock + 'messageManager' => $this->messageManagerMock, + 'resultRedirectFactory' => $this->resultRedirectFactory, + 'filterManager' => $this->filterManager, + 'currencySymbolFactory' => $this->currencySymbolFactory, ] ); } + /** + * Test to Save custom Currency symbol + */ public function testExecute() { $firstElement = 'firstElement'; $symbolsDataArray = [$firstElement]; - $redirectUrl = 'redirectUrl'; $this->requestMock->expects($this->once()) ->method('getParam') ->with('custom_currency_symbol') ->willReturn($symbolsDataArray); - $this->helperMock->expects($this->once())->method('getUrl')->with('*'); - $this->redirectMock->expects($this->once())->method('getRedirectUrl')->willReturn($redirectUrl); - - $this->currencySymbolMock->expects($this->once())->method('setCurrencySymbolsData')->with($symbolsDataArray); - $this->responseMock->expects($this->once())->method('setRedirect'); - - $this->filterManagerMock->expects($this->once()) + $currencySymbol = $this->createMock(Currencysymbol::class); + $currencySymbol->expects($this->once())->method('setCurrencySymbolsData')->with($symbolsDataArray); + $this->currencySymbolFactory->method('create')->willReturn($currencySymbol); + $this->filterManager->expects($this->once()) ->method('stripTags') ->with($firstElement) ->willReturn($firstElement); - $this->objectManagerMock->expects($this->once()) - ->method('create') - ->with(\Magento\CurrencySymbol\Model\System\Currencysymbol::class) - ->willReturn($this->currencySymbolMock); - - $this->objectManagerMock->expects($this->once()) - ->method('get') - ->with(\Magento\Framework\Filter\FilterManager::class) - ->willReturn($this->filterManagerMock); - $this->messageManagerMock->expects($this->once()) ->method('addSuccessMessage') ->with(__('You applied the custom currency symbols.')); - $this->action->execute(); + $redirect = $this->createMock(Redirect::class); + $redirect->expects($this->once())->method('setPath')->with('*')->willReturnSelf(); + $this->resultRedirectFactory->method('create')->willReturn($redirect); + + $this->assertEquals($redirect, $this->action->execute()); } } From 672df31da48164562c28694685c22971bde58548 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Tue, 10 Dec 2019 15:25:31 +0530 Subject: [PATCH 463/595] Kept original class for backward compatibility --- app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php b/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php index 330d1e0d3fbdf..88a799f9505d4 100644 --- a/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php +++ b/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php @@ -10,6 +10,7 @@ use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\ObjectManager; use Magento\Framework\DataObject; +use Magento\Framework\Serialize\Serializer\Json; use Magento\Framework\Serialize\Serializer\JsonHexTag; use Magento\Framework\View\Element\Block\ArgumentInterface; use Magento\Framework\Escaper; @@ -44,6 +45,7 @@ class Breadcrumbs extends DataObject implements ArgumentInterface /** * @param Data $catalogData * @param ScopeConfigInterface $scopeConfig + * @param Json|null $json * @param JsonHexTag $jsonSerializer * @param Escaper|null $escaper * @SuppressWarnings(PHPMD.UnusedFormalParameter) @@ -51,6 +53,7 @@ class Breadcrumbs extends DataObject implements ArgumentInterface public function __construct( Data $catalogData, ScopeConfigInterface $scopeConfig, + Json $json = null, JsonHexTag $jsonSerializer, Escaper $escaper = null ) { @@ -114,7 +117,7 @@ public function getJsonConfigurationHtmlEscaped() : string 'useCategoryPathInUrl' => (int)$this->isCategoryUsedInProductUrl(), 'product' => $this->escaper->escapeHtml($this->getProductName()) ] - ] + ] ); } From 5ae32934cda53256c35eabcce27d92cb516a7411 Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Tue, 10 Dec 2019 13:30:03 +0200 Subject: [PATCH 464/595] MC-29362: Sitemap grid does not use base URL --- app/code/Magento/Sitemap/Model/Sitemap.php | 43 ++++++++- .../Sitemap/Test/Unit/Model/SitemapTest.php | 95 +++++++++++++++---- 2 files changed, 116 insertions(+), 22 deletions(-) diff --git a/app/code/Magento/Sitemap/Model/Sitemap.php b/app/code/Magento/Sitemap/Model/Sitemap.php index 2baa6ff2c71a7..ea5659cf909ff 100644 --- a/app/code/Magento/Sitemap/Model/Sitemap.php +++ b/app/code/Magento/Sitemap/Model/Sitemap.php @@ -739,8 +739,11 @@ protected function _getFormattedLastmodDate($date) */ protected function _getDocumentRoot() { - return $this->filesystem->getDirectoryRead($this->documentRoot->getPath()) - ->getAbsolutePath(); + if (PHP_SAPI === 'cli') { + return $this->getDocumentRootFromBaseDir() ?? ''; + } + // phpcs:ignore Magento2.Functions.DiscouragedFunction + return realpath($this->_request->getServer('DOCUMENT_ROOT')); } /** @@ -754,10 +757,14 @@ protected function _getStoreBaseDomain() $storeParsedUrl = parse_url($this->_getStoreBaseUrl()); $url = $storeParsedUrl['scheme'] . '://' . $storeParsedUrl['host']; - $documentRoot = trim(str_replace('\\', '/', $this->_getDocumentRoot()), '/'); - $baseDir = trim(str_replace('\\', '/', $this->_getBaseDir()), '/'); + // Set document root to false if we were unable to get it + $documentRoot = $this->_getDocumentRoot() ?: false; + if ($documentRoot) { + $documentRoot = trim(str_replace(DIRECTORY_SEPARATOR, '/', $documentRoot), '/'); + } + $baseDir = trim(str_replace(DIRECTORY_SEPARATOR, '/', $this->_getBaseDir()), '/'); - if (strpos($baseDir, (string) $documentRoot) === 0) { + if ($documentRoot !== false && strpos($baseDir, (string) $documentRoot) === 0) { //case when basedir is in document root $installationFolder = trim(str_replace($documentRoot, '', $baseDir), '/'); $storeDomain = rtrim($url . '/' . $installationFolder, '/'); @@ -878,4 +885,30 @@ public function getIdentities() Value::CACHE_TAG . '_' . $this->getStoreId(), ]; } + + /** + * Get document root using base directory (root directory) and base path (base url path) + * + * Document root is determined using formula: BaseDir = DocumentRoot + BasePath. + * Returns <b>NULL</b> if BaseDir does not end with BasePath (e.g document root contains a symlink to BaseDir). + * + * @return string|null + */ + private function getDocumentRootFromBaseDir(): ?string + { + // phpcs:ignore Magento2.Functions.DiscouragedFunction + $basePath = rtrim(parse_url($this->_getStoreBaseUrl(UrlInterface::URL_TYPE_WEB), PHP_URL_PATH) ?: '', '/'); + $basePath = str_replace('/', DIRECTORY_SEPARATOR, $basePath); + $basePath = rtrim($basePath, DIRECTORY_SEPARATOR); + $baseDir = rtrim($this->_getBaseDir(), DIRECTORY_SEPARATOR); + $length = strlen($basePath); + if (!$length) { + $documentRoot = $baseDir; + } elseif (substr($baseDir, -$length) === $basePath) { + $documentRoot = rtrim(substr($baseDir, 0, strlen($baseDir) - $length), DIRECTORY_SEPARATOR); + } else { + $documentRoot = null; + } + return $documentRoot; + } } diff --git a/app/code/Magento/Sitemap/Test/Unit/Model/SitemapTest.php b/app/code/Magento/Sitemap/Test/Unit/Model/SitemapTest.php index a5e40bf3fcff7..16d506c1cdfa3 100644 --- a/app/code/Magento/Sitemap/Test/Unit/Model/SitemapTest.php +++ b/app/code/Magento/Sitemap/Test/Unit/Model/SitemapTest.php @@ -5,6 +5,7 @@ */ namespace Magento\Sitemap\Test\Unit\Model; +use Magento\Framework\App\Request\Http; use Magento\Framework\DataObject; use Magento\Framework\Filesystem; use Magento\Framework\Filesystem\Directory\Write as DirectoryWrite; @@ -86,6 +87,15 @@ class SitemapTest extends \PHPUnit\Framework\TestCase */ private $configReaderMock; + /** + * @var Http|\PHPUnit_Framework_MockObject_MockObject + */ + private $request; + /** + * @var Store|\PHPUnit_Framework_MockObject_MockObject + */ + private $store; + /** * @inheritdoc */ @@ -143,6 +153,12 @@ protected function setUp() $this->configReaderMock = $this->getMockForAbstractClass(SitemapConfigReaderInterface::class); $this->itemProviderMock = $this->getMockForAbstractClass(ItemProviderInterface::class); + $this->request = $this->createMock(Http::class); + $this->store = $this->createPartialMock(Store::class, ['isFrontUrlSecure', 'getBaseUrl']); + $this->storeManagerMock = $this->createMock(StoreManagerInterface::class); + $this->storeManagerMock->expects($this->any()) + ->method('getStore') + ->willReturn($this->store); } /** @@ -476,25 +492,15 @@ function ($from, $to) { $model = $this->getModelMock(true); - $storeMock = $this->getMockBuilder(Store::class) - ->setMethods(['isFrontUrlSecure', 'getBaseUrl']) - ->disableOriginalConstructor() - ->getMock(); - - $storeMock->expects($this->atLeastOnce()) + $this->store->expects($this->atLeastOnce()) ->method('isFrontUrlSecure') ->willReturn(false); - $storeMock->expects($this->atLeastOnce()) + $this->store->expects($this->atLeastOnce()) ->method('getBaseUrl') ->with($this->isType('string'), false) ->willReturn('http://store.com/'); - $this->storeManagerMock->expects($this->atLeastOnce()) - ->method('getStore') - ->with(1) - ->willReturn($storeMock); - return $model; } @@ -599,10 +605,6 @@ private function getModelConstructorArgs() ->disableOriginalConstructor() ->getMock(); - $this->storeManagerMock = $this->getMockBuilder(StoreManagerInterface::class) - ->setMethods(['getStore']) - ->getMockForAbstractClass(); - $objectManager = new ObjectManager($this); $escaper = $objectManager->getObject(\Magento\Framework\Escaper::class); @@ -617,7 +619,8 @@ private function getModelConstructorArgs() 'filesystem' => $this->filesystemMock, 'itemProvider' => $this->itemProviderMock, 'configReader' => $this->configReaderMock, - 'escaper' => $escaper + 'escaper' => $escaper, + 'request' => $this->request, ] ); $constructArguments['resource'] = null; @@ -732,4 +735,62 @@ public static function siteUrlDataProvider() ] ]; } + + /** + * Check site URL getter + * + * @param string $storeBaseUrl + * @param string $baseDir + * @param string $documentRoot + * @dataProvider getDocumentRootFromBaseDirUrlDataProvider + */ + public function testGetDocumentRootFromBaseDir( + string $storeBaseUrl, + string $baseDir, + ?string $documentRoot + ) { + $this->store->setCode('store'); + $this->store->method('getBaseUrl')->willReturn($storeBaseUrl); + $this->directoryMock->method('getAbsolutePath')->willReturn($baseDir); + /** @var $model Sitemap */ + $model = $this->getMockBuilder(Sitemap::class) + ->setMethods(['_construct']) + ->setConstructorArgs($this->getModelConstructorArgs()) + ->getMock(); + + $method = new \ReflectionMethod($model, 'getDocumentRootFromBaseDir'); + $method->setAccessible(true); + $this->assertSame($documentRoot, $method->invoke($model)); + } + + /** + * Provides test cases for document root testing + * + * @return array + */ + public function getDocumentRootFromBaseDirUrlDataProvider(): array + { + return [ + [ + 'http://magento.com/', + '/var/www', + '/var/www', + ], + [ + 'http://magento.com/usa', + '/var/www/usa', + '/var/www', + ], + [ + 'http://magento.com/usa/tx', + '/var/www/usa/tx', + '/var/www', + ], + 'symlink <document root>/usa/txt -> /var/www/html' => [ + 'http://magento.com/usa/tx', + '/var/www/html', + null, + ], + ]; + } } From 200f51853bf8b5b10090d6ecd9abc46269ca364b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chitesh=40wagento=2Ecom=E2=80=9D?= <hitesh@wagento.com> Date: Tue, 10 Dec 2019 17:05:01 +0530 Subject: [PATCH 465/595] [Removed spacing in submenu on hover desktop] --- lib/web/css/source/lib/_navigation.less | 2 +- lib/web/css/source/lib/variables/_navigation.less | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/web/css/source/lib/_navigation.less b/lib/web/css/source/lib/_navigation.less index 9b13c28227eb9..38cd042591722 100644 --- a/lib/web/css/source/lib/_navigation.less +++ b/lib/web/css/source/lib/_navigation.less @@ -459,7 +459,7 @@ } .submenu { - top: 0 !important; + top: -1px !important; left: 100% !important; } diff --git a/lib/web/css/source/lib/variables/_navigation.less b/lib/web/css/source/lib/variables/_navigation.less index 3ef1742547426..4801b8874abcc 100644 --- a/lib/web/css/source/lib/variables/_navigation.less +++ b/lib/web/css/source/lib/variables/_navigation.less @@ -91,7 +91,7 @@ @submenu-desktop__font-size: ''; @submenu-desktop__font-weight: @font-weight__bold; @submenu-desktop__min-width: 230px; -@submenu-desktop__padding: 15px 0; +@submenu-desktop__padding: 0; @submenu-desktop-arrow: true; // [true|false] @submenu-desktop-arrow__size: 10px; From 04f6ac08242db072a832350faf17cc2f90ad7aee Mon Sep 17 00:00:00 2001 From: Nikita Shcherbatykh <nikita.shcherbatykh@transoftgroup.com> Date: Tue, 10 Dec 2019 13:42:52 +0200 Subject: [PATCH 466/595] MC-29388: Performance issue. The same item from change log table can be processed several times --- .../Framework/Mview/Test/Unit/ViewTest.php | 256 ++++++++++++++---- lib/internal/Magento/Framework/Mview/View.php | 35 ++- 2 files changed, 235 insertions(+), 56 deletions(-) diff --git a/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php b/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php index 54f6351e9651c..ebd9896e62558 100644 --- a/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php +++ b/lib/internal/Magento/Framework/Mview/Test/Unit/ViewTest.php @@ -5,44 +5,60 @@ */ namespace Magento\Framework\Mview\Test\Unit; +use Magento\Framework\Mview\ActionFactory; +use Magento\Framework\Mview\ActionInterface; +use Magento\Framework\Mview\ConfigInterface; use \Magento\Framework\Mview\View; +use Magento\Framework\Mview\View\Changelog; +use Magento\Framework\Mview\View\StateInterface; +use Magento\Framework\Mview\View\Subscription; +use Magento\Framework\Mview\View\SubscriptionFactory; +use Magento\Indexer\Model\Mview\View\State; +use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\MockObject\MockObject; -class ViewTest extends \PHPUnit\Framework\TestCase +/** + * Class to test Mview functionality + */ +class ViewTest extends TestCase { /** - * @var \Magento\Framework\Mview\View + * @var View */ protected $model; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Mview\ConfigInterface + * @var MockObject|ConfigInterface */ protected $configMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Mview\ActionFactory + * @var MockObject|ActionFactory */ protected $actionFactoryMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Indexer\Model\Mview\View\State + * @var MockObject|State */ protected $stateMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Mview\View\Changelog + * @var MockObject|Changelog */ protected $changelogMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Mview\View\SubscriptionFactory + * @var MockObject|SubscriptionFactory */ protected $subscriptionFactoryMock; + /** + * @inheritdoc + */ protected function setUp() { $this->configMock = $this->getMockForAbstractClass( - \Magento\Framework\Mview\ConfigInterface::class, + ConfigInterface::class, [], '', false, @@ -50,9 +66,9 @@ protected function setUp() true, ['getView'] ); - $this->actionFactoryMock = $this->createPartialMock(\Magento\Framework\Mview\ActionFactory::class, ['get']); + $this->actionFactoryMock = $this->createPartialMock(ActionFactory::class, ['get']); $this->stateMock = $this->createPartialMock( - \Magento\Indexer\Model\Mview\View\State::class, + State::class, [ 'getViewId', 'loadByView', @@ -68,11 +84,11 @@ protected function setUp() ] ); $this->changelogMock = $this->createPartialMock( - \Magento\Framework\Mview\View\Changelog::class, + Changelog::class, ['getViewId', 'setViewId', 'create', 'drop', 'getVersion', 'getList', 'clear'] ); $this->subscriptionFactoryMock = $this->createPartialMock( - \Magento\Framework\Mview\View\SubscriptionFactory::class, + SubscriptionFactory::class, ['create'] ); $this->model = new View( @@ -84,24 +100,36 @@ protected function setUp() ); } + /** + * Test to Return view action class + */ public function testGetActionClass() { $this->model->setData('action_class', 'actionClass'); $this->assertEquals('actionClass', $this->model->getActionClass()); } + /** + * Test to Return view group + */ public function testGetGroup() { $this->model->setData('group', 'some_group'); $this->assertEquals('some_group', $this->model->getGroup()); } + /** + * Test to Return view subscriptions + */ public function testGetSubscriptions() { $this->model->setData('subscriptions', ['subscription']); $this->assertEquals(['subscription'], $this->model->getSubscriptions()); } + /** + * Test to Fill view data from config + */ public function testLoad() { $viewId = 'view_test'; @@ -114,10 +142,12 @@ public function testLoad() )->will( $this->returnValue($this->getViewData()) ); - $this->assertInstanceOf(\Magento\Framework\Mview\View::class, $this->model->load($viewId)); + $this->assertInstanceOf(View::class, $this->model->load($viewId)); } /** + * Test to Fill view data from config + * * @expectedException \InvalidArgumentException * @expectedExceptionMessage view_id view does not exist. */ @@ -136,18 +166,21 @@ public function testLoadWithException() $this->model->load($viewId); } + /** + * Test to Create subscriptions + */ public function testSubscribe() { $this->stateMock->expects($this->once()) ->method('getMode') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::MODE_DISABLED)); + ->will($this->returnValue(StateInterface::MODE_DISABLED)); $this->stateMock->expects($this->once()) ->method('setMode') - ->with(\Magento\Framework\Mview\View\StateInterface::MODE_ENABLED) + ->with(StateInterface::MODE_ENABLED) ->will($this->returnSelf()); $this->changelogMock->expects($this->once()) ->method('create'); - $subscriptionMock = $this->createPartialMock(\Magento\Framework\Mview\View\Subscription::class, ['create']); + $subscriptionMock = $this->createPartialMock(Subscription::class, ['create']); $subscriptionMock->expects($this->exactly(1))->method('create'); $this->subscriptionFactoryMock->expects( $this->exactly(1) @@ -160,11 +193,14 @@ public function testSubscribe() $this->model->subscribe(); } + /** + * Test to Create subscriptions + */ public function testSubscribeEnabled() { $this->stateMock->expects($this->once()) ->method('getMode') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::MODE_ENABLED)); + ->will($this->returnValue(StateInterface::MODE_ENABLED)); $this->stateMock->expects($this->never()) ->method('setMode'); $this->changelogMock->expects($this->never()) @@ -182,7 +218,7 @@ public function testSubscribeWithException() { $this->stateMock->expects($this->once()) ->method('getMode') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::MODE_DISABLED)); + ->will($this->returnValue(StateInterface::MODE_DISABLED)); $this->changelogMock->expects($this->once()) ->method('create') @@ -196,18 +232,21 @@ function () { $this->model->subscribe(); } + /** + * Test to Remove subscriptions + */ public function testUnsubscribe() { $this->stateMock->expects($this->once()) ->method('getMode') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::MODE_ENABLED)); + ->will($this->returnValue(StateInterface::MODE_ENABLED)); $this->stateMock->expects($this->once()) ->method('setMode') - ->with(\Magento\Framework\Mview\View\StateInterface::MODE_DISABLED) + ->with(StateInterface::MODE_DISABLED) ->will($this->returnSelf()); $this->changelogMock->expects($this->never()) ->method('drop'); - $subscriptionMock = $this->createPartialMock(\Magento\Framework\Mview\View\Subscription::class, ['remove']); + $subscriptionMock = $this->createPartialMock(Subscription::class, ['remove']); $subscriptionMock->expects($this->exactly(1))->method('remove'); $this->subscriptionFactoryMock->expects( $this->exactly(1) @@ -220,11 +259,14 @@ public function testUnsubscribe() $this->model->unsubscribe(); } + /** + * Test to Remove subscriptions + */ public function testUnsubscribeDisabled() { $this->stateMock->expects($this->once()) ->method('getMode') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::MODE_DISABLED)); + ->will($this->returnValue(StateInterface::MODE_DISABLED)); $this->stateMock->expects($this->never()) ->method('setVersionId'); $this->stateMock->expects($this->never()) @@ -244,9 +286,9 @@ public function testUnsubscribeWithException() { $this->stateMock->expects($this->once()) ->method('getMode') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::MODE_ENABLED)); + ->will($this->returnValue(StateInterface::MODE_ENABLED)); - $subscriptionMock = $this->createPartialMock(\Magento\Framework\Mview\View\Subscription::class, ['remove']); + $subscriptionMock = $this->createPartialMock(Subscription::class, ['remove']); $subscriptionMock->expects($this->exactly(1)) ->method('remove') ->willReturnCallback( @@ -262,6 +304,9 @@ function () { $this->model->unsubscribe(); } + /** + * Test to Materialize view by IDs in changelog + */ public function testUpdate() { $currentVersionId = 3; @@ -279,10 +324,10 @@ public function testUpdate() ->will($this->returnSelf()); $this->stateMock->expects($this->atLeastOnce()) ->method('getMode') - ->willReturn(\Magento\Framework\Mview\View\StateInterface::MODE_ENABLED); + ->willReturn(StateInterface::MODE_ENABLED); $this->stateMock->expects($this->exactly(2)) ->method('getStatus') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::STATUS_IDLE)); + ->will($this->returnValue(StateInterface::STATUS_IDLE)); $this->stateMock->expects($this->exactly(2)) ->method('setStatus') ->will($this->returnSelf()); @@ -308,7 +353,7 @@ public function testUpdate() $this->returnValue($listId) ); - $actionMock = $this->createMock(\Magento\Framework\Mview\ActionInterface::class); + $actionMock = $this->createMock(ActionInterface::class); $actionMock->expects($this->once())->method('execute')->with($listId)->will($this->returnSelf()); $this->actionFactoryMock->expects( $this->once() @@ -325,6 +370,83 @@ public function testUpdate() } /** + * Test to Materialize view by IDs in changelog + */ + public function testUpdateEx(): void + { + $currentVersionId = 200100; + $lastVersionId = 1; + $listIdBatchOne = $this->generateChangeLog(100000, 1, 100); + $listIdBatchTwo = $this->generateChangeLog(100000, 1, 50); + $listIdBatchThree = $this->generateChangeLog(100, 100, 150); + + $this->stateMock->method('getViewId')->willReturn(1); + $this->stateMock->method('getVersionId')->willReturn($lastVersionId); + $this->stateMock->method('setVersionId')->willReturnSelf(); + $this->stateMock->expects($this->atLeastOnce()) + ->method('getMode') + ->willReturn(StateInterface::MODE_ENABLED); + $this->stateMock->expects($this->exactly(2)) + ->method('getStatus') + ->willReturn(StateInterface::STATUS_IDLE); + $this->stateMock->expects($this->exactly(2)) + ->method('setStatus') + ->willReturnSelf(); + $this->stateMock->expects($this->exactly(2)) + ->method('save') + ->willReturnSelf(); + $this->changelogMock + ->expects($this->once()) + ->method('getVersion') + ->willReturn($currentVersionId); + + $this->changelogMock->method('getList') + ->willReturnMap( + [ + [$lastVersionId, 100001, $listIdBatchOne], + [100001, 200001, $listIdBatchTwo], + [200001, $currentVersionId, $listIdBatchThree], + ] + ); + + $actionMock = $this->createMock(ActionInterface::class); + $actionMock->expects($this->once()) + ->method('execute') + ->with($this->generateChangeLog(150, 1, 150)) + ->willReturnSelf(); + $this->actionFactoryMock->method('get')->willReturn($actionMock); + $this->loadView(); + $this->model->update(); + } + + /** + * Generate change log + * + * @param int $count + * @param int $idFrom + * @param int $idTo + * @return array + */ + private function generateChangeLog(int $count, int $idFrom, int $idTo): array + { + $res = []; + $i = 0; + $id = $idFrom; + while ($i < $count) { + if ($id > $idTo) { + $id = $idFrom; + } + $res[] = $id; + $id++; + $i++; + } + + return $res; + } + + /** + * Test to Materialize view by IDs in changelog + * * @expectedException \Exception * @expectedExceptionMessage Test exception */ @@ -344,10 +466,10 @@ public function testUpdateWithException() ->method('setVersionId'); $this->stateMock->expects($this->atLeastOnce()) ->method('getMode') - ->willReturn(\Magento\Framework\Mview\View\StateInterface::MODE_ENABLED); + ->willReturn(StateInterface::MODE_ENABLED); $this->stateMock->expects($this->exactly(2)) ->method('getStatus') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::STATUS_IDLE)); + ->will($this->returnValue(StateInterface::STATUS_IDLE)); $this->stateMock->expects($this->exactly(2)) ->method('setStatus') ->will($this->returnSelf()); @@ -373,7 +495,7 @@ public function testUpdateWithException() $this->returnValue($listId) ); - $actionMock = $this->createPartialMock(\Magento\Framework\Mview\ActionInterface::class, ['execute']); + $actionMock = $this->createPartialMock(ActionInterface::class, ['execute']); $actionMock->expects($this->once())->method('execute')->with($listId)->will( $this->returnCallback( function () { @@ -395,18 +517,21 @@ function () { $this->model->update(); } + /** + * Test to Suspend view updates and set version ID to changelog's end + */ public function testSuspend() { $this->stateMock->expects($this->once()) ->method('getMode') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::MODE_ENABLED)); + ->will($this->returnValue(StateInterface::MODE_ENABLED)); $this->stateMock->expects($this->once()) ->method('setVersionId') ->with(11) ->will($this->returnSelf()); $this->stateMock->expects($this->once()) ->method('setStatus') - ->with(\Magento\Framework\Mview\View\StateInterface::STATUS_SUSPENDED) + ->with(StateInterface::STATUS_SUSPENDED) ->will($this->returnSelf()); $this->stateMock->expects($this->once()) ->method('save') @@ -420,11 +545,14 @@ public function testSuspend() $this->model->suspend(); } + /** + * Suspend view updates and set version ID to changelog's end + */ public function testSuspendDisabled() { $this->stateMock->expects($this->once()) ->method('getMode') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::MODE_DISABLED)); + ->will($this->returnValue(StateInterface::MODE_DISABLED)); $this->stateMock->expects($this->never()) ->method('setVersionId'); $this->stateMock->expects($this->never()) @@ -439,14 +567,17 @@ public function testSuspendDisabled() $this->model->suspend(); } + /** + * Test to Resume view updates + */ public function testResume() { $this->stateMock->expects($this->once()) ->method('getStatus') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::STATUS_SUSPENDED)); + ->will($this->returnValue(StateInterface::STATUS_SUSPENDED)); $this->stateMock->expects($this->once()) ->method('setStatus') - ->with(\Magento\Framework\Mview\View\StateInterface::STATUS_IDLE) + ->with(StateInterface::STATUS_IDLE) ->will($this->returnSelf()); $this->stateMock->expects($this->once()) ->method('save') @@ -457,6 +588,8 @@ public function testResume() } /** + * Test to Resume view updates + * * @param string $status * @dataProvider dataProviderResumeNotSuspended */ @@ -480,16 +613,19 @@ public function testResumeNotSuspended($status) public function dataProviderResumeNotSuspended() { return [ - [\Magento\Framework\Mview\View\StateInterface::STATUS_IDLE], - [\Magento\Framework\Mview\View\StateInterface::STATUS_WORKING], + [StateInterface::STATUS_IDLE], + [StateInterface::STATUS_WORKING], ]; } + /** + * Test to Clear precessed changelog entries + */ public function testClearChangelog() { $this->stateMock->expects($this->once()) ->method('getMode') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::MODE_ENABLED)); + ->will($this->returnValue(StateInterface::MODE_ENABLED)); $this->stateMock->expects($this->once()) ->method('getVersionId') ->will($this->returnValue(11)); @@ -501,11 +637,14 @@ public function testClearChangelog() $this->model->clearChangelog(); } + /** + * Test to Clear precessed changelog entries + */ public function testClearChangelogDisabled() { $this->stateMock->expects($this->once()) ->method('getMode') - ->will($this->returnValue(\Magento\Framework\Mview\View\StateInterface::MODE_DISABLED)); + ->will($this->returnValue(StateInterface::MODE_DISABLED)); $this->stateMock->expects($this->never()) ->method('getVersionId'); $this->changelogMock->expects($this->never()) @@ -514,6 +653,9 @@ public function testClearChangelogDisabled() $this->model->clearChangelog(); } + /** + * Test to Return related state object + */ public function testSetState() { $this->model->setState($this->stateMock); @@ -521,6 +663,8 @@ public function testSetState() } /** + * Test to Check whether view is enabled + * * @param string $mode * @param bool $result * @dataProvider dataProviderIsEnabled @@ -539,12 +683,14 @@ public function testIsEnabled($mode, $result) public function dataProviderIsEnabled() { return [ - [\Magento\Framework\Mview\View\StateInterface::MODE_ENABLED, true], - [\Magento\Framework\Mview\View\StateInterface::MODE_DISABLED, false], + [StateInterface::MODE_ENABLED, true], + [StateInterface::MODE_DISABLED, false], ]; } /** + * Test to Check whether view is idle + * * @param string $status * @param bool $result * @dataProvider dataProviderIsIdle @@ -563,13 +709,15 @@ public function testIsIdle($status, $result) public function dataProviderIsIdle() { return [ - [\Magento\Framework\Mview\View\StateInterface::STATUS_IDLE, true], - [\Magento\Framework\Mview\View\StateInterface::STATUS_WORKING, false], - [\Magento\Framework\Mview\View\StateInterface::STATUS_SUSPENDED, false], + [StateInterface::STATUS_IDLE, true], + [StateInterface::STATUS_WORKING, false], + [StateInterface::STATUS_SUSPENDED, false], ]; } /** + * Test to Check whether view is working + * * @param string $status * @param bool $result * @dataProvider dataProviderIsWorking @@ -588,13 +736,15 @@ public function testIsWorking($status, $result) public function dataProviderIsWorking() { return [ - [\Magento\Framework\Mview\View\StateInterface::STATUS_IDLE, false], - [\Magento\Framework\Mview\View\StateInterface::STATUS_WORKING, true], - [\Magento\Framework\Mview\View\StateInterface::STATUS_SUSPENDED, false], + [StateInterface::STATUS_IDLE, false], + [StateInterface::STATUS_WORKING, true], + [StateInterface::STATUS_SUSPENDED, false], ]; } /** + * Test to Check whether view is suspended + * * @param string $status * @param bool $result * @dataProvider dataProviderIsSuspended @@ -613,12 +763,15 @@ public function testIsSuspended($status, $result) public function dataProviderIsSuspended() { return [ - [\Magento\Framework\Mview\View\StateInterface::STATUS_IDLE, false], - [\Magento\Framework\Mview\View\StateInterface::STATUS_WORKING, false], - [\Magento\Framework\Mview\View\StateInterface::STATUS_SUSPENDED, true], + [StateInterface::STATUS_IDLE, false], + [StateInterface::STATUS_WORKING, false], + [StateInterface::STATUS_SUSPENDED, true], ]; } + /** + * Test to Return view updated datetime + */ public function testGetUpdated() { $this->stateMock->expects($this->once()) @@ -627,6 +780,9 @@ public function testGetUpdated() $this->assertEquals('some datetime', $this->model->getUpdated()); } + /** + * Fill view data from config + */ protected function loadView() { $viewId = 'view_test'; diff --git a/lib/internal/Magento/Framework/Mview/View.php b/lib/internal/Magento/Framework/Mview/View.php index b2372eaaafaad..dade475a20482 100644 --- a/lib/internal/Magento/Framework/Mview/View.php +++ b/lib/internal/Magento/Framework/Mview/View.php @@ -291,16 +291,13 @@ public function update() */ private function executeAction(ActionInterface $action, int $lastVersionId, int $currentVersionId) { - $versionBatchSize = self::$maxVersionQueryBatch; $batchSize = isset($this->changelogBatchSize[$this->getChangelog()->getViewId()]) ? (int) $this->changelogBatchSize[$this->getChangelog()->getViewId()] : self::DEFAULT_BATCH_SIZE; - for ($vsFrom = $lastVersionId; $vsFrom < $currentVersionId; $vsFrom += $versionBatchSize) { - // Don't go past the current version for atomicity. - $versionTo = min($currentVersionId, $vsFrom + $versionBatchSize); - $ids = $this->getChangelog()->getList($vsFrom, $versionTo); - + $vsFrom = $lastVersionId; + while ($vsFrom < $currentVersionId) { + $ids = $this->getBatchOfIds($vsFrom, $currentVersionId); // We run the actual indexer in batches. // Chunked AFTER loading to avoid duplicates in separate chunks. $chunks = array_chunk($ids, $batchSize); @@ -310,6 +307,32 @@ private function executeAction(ActionInterface $action, int $lastVersionId, int } } + /** + * Get batch of entity ids + * + * @param int $lastVersionId + * @param int $currentVersionId + * @return array + */ + private function getBatchOfIds(int &$lastVersionId, int $currentVersionId): array + { + $ids = []; + $versionBatchSize = self::$maxVersionQueryBatch; + $idsBatchSize = self::$maxVersionQueryBatch; + for ($vsFrom = $lastVersionId; $vsFrom < $currentVersionId; $vsFrom += $versionBatchSize) { + // Don't go past the current version for atomicity. + $versionTo = min($currentVersionId, $vsFrom + $versionBatchSize); + /** To avoid duplicate ids need to flip and merge the array */ + $ids += array_flip($this->getChangelog()->getList($vsFrom, $versionTo)); + $lastVersionId = $versionTo; + if (count($ids) >= $idsBatchSize) { + break; + } + } + + return array_keys($ids); + } + /** * Suspend view updates and set version ID to changelog's end * From c63286e7ab569cbe2a18a69edd140a7779b6d75d Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Tue, 10 Dec 2019 18:12:27 +0530 Subject: [PATCH 467/595] Updated the jsonSerializer as optional parameters --- .../Catalog/ViewModel/Product/Breadcrumbs.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php b/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php index 88a799f9505d4..1aad46fc1e2f5 100644 --- a/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php +++ b/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php @@ -33,36 +33,36 @@ class Breadcrumbs extends DataObject implements ArgumentInterface private $scopeConfig; /** - * @var JsonHexTag + * @var Escaper */ - private $jsonSerializer; + private $escaper; /** - * @var Escaper + * @var JsonHexTag */ - private $escaper; + private $jsonSerializer; /** * @param Data $catalogData * @param ScopeConfigInterface $scopeConfig * @param Json|null $json - * @param JsonHexTag $jsonSerializer * @param Escaper|null $escaper + * @param JsonHexTag|null $jsonSerializer * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function __construct( Data $catalogData, ScopeConfigInterface $scopeConfig, Json $json = null, - JsonHexTag $jsonSerializer, - Escaper $escaper = null + Escaper $escaper = null, + JsonHexTag $jsonSerializer = null ) { parent::__construct(); $this->catalogData = $catalogData; $this->scopeConfig = $scopeConfig; - $this->jsonSerializer = $jsonSerializer; $this->escaper = $escaper ?: ObjectManager::getInstance()->get(Escaper::class); + $this->jsonSerializer = $jsonSerializer ?: ObjectManager::getInstance()->get(JsonHexTag::class); } /** From 96f502e107bdb6f127207060055020b9d0a9c3ad Mon Sep 17 00:00:00 2001 From: maslii <maslii@users.noreply.github.com> Date: Tue, 10 Dec 2019 14:48:43 +0200 Subject: [PATCH 468/595] phpdoc fix return type --- app/code/Magento/Customer/Controller/Account/CreatePost.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Customer/Controller/Account/CreatePost.php b/app/code/Magento/Customer/Controller/Account/CreatePost.php index a006cfe6725f3..e2a7c085a0b44 100644 --- a/app/code/Magento/Customer/Controller/Account/CreatePost.php +++ b/app/code/Magento/Customer/Controller/Account/CreatePost.php @@ -327,7 +327,7 @@ public function validateForCsrf(RequestInterface $request): ?bool /** * Create customer account action * - * @return void + * @return \Magento\Framework\Controller\Result\Redirect * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) */ From ab4fa339c24d0868fa7471d347ac98ad22f4d3fe Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Tue, 10 Dec 2019 20:28:28 +0700 Subject: [PATCH 469/595] Refactor and unit test for issue 25893 --- .../Adminhtml/Wysiwyg/Directive.php | 76 ++++++++++++++----- .../Adminhtml/Wysiwyg/DirectiveTest.php | 25 +++--- 2 files changed, 67 insertions(+), 34 deletions(-) diff --git a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php index db53c6a415ddd..97d0b35a2354f 100644 --- a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php +++ b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php @@ -13,6 +13,14 @@ use Magento\Cms\Model\Template\Filter; use Magento\Cms\Model\Wysiwyg\Config; use Magento\Framework\App\Action\HttpGetActionInterface; +use Magento\Framework\Image\Adapter\AdapterInterface; +use Magento\Framework\Image\AdapterFactory; +use Psr\Log\LoggerInterface; +use Magento\Framework\Url\DecoderInterface; +use Magento\Framework\Controller\Result\Raw; +use Magento\Framework\Controller\Result\RawFactory; +use Magento\Backend\App\Action\Context; +use Magento\Framework\App\ObjectManager; /** * Process template text for wysiwyg editor. @@ -30,34 +38,68 @@ class Directive extends Action implements HttpGetActionInterface const ADMIN_RESOURCE = 'Magento_Cms::media_gallery'; /** - * @var \Magento\Framework\Url\DecoderInterface + * @var DecoderInterface */ protected $urlDecoder; /** - * @var \Magento\Framework\Controller\Result\RawFactory + * @var RawFactory */ protected $resultRawFactory; /** - * @param Action\Context $context - * @param \Magento\Framework\Url\DecoderInterface $urlDecoder - * @param \Magento\Framework\Controller\Result\RawFactory $resultRawFactory + * @var LoggerInterface + */ + private $logger; + + /** + * @var AdapterFactory + */ + private $adapterFactory; + + /** + * @var Config + */ + private $config; + + /** + * @var Filter + */ + private $filter; + + /** + * Constructor + * + * @param Context $context + * @param DecoderInterface $urlDecoder + * @param RawFactory $resultRawFactory + * @param AdapterFactory|null $adapterFactory + * @param LoggerInterface|null $logger + * @param Config|null $config + * @param Filter|null $filter */ public function __construct( - Action\Context $context, - \Magento\Framework\Url\DecoderInterface $urlDecoder, - \Magento\Framework\Controller\Result\RawFactory $resultRawFactory + Context $context, + DecoderInterface $urlDecoder, + RawFactory $resultRawFactory, + AdapterFactory $adapterFactory = null, + LoggerInterface $logger = null, + Config $config = null, + Filter $filter = null ) { parent::__construct($context); $this->urlDecoder = $urlDecoder; $this->resultRawFactory = $resultRawFactory; + $this->adapterFactory = $adapterFactory ?: ObjectManager::getInstance()->get(AdapterFactory::class); + $this->logger = $logger ?: ObjectManager::getInstance()->get(LoggerInterface::class); + $this->config = $config ?: ObjectManager::getInstance()->get(Config::class); + $this->filter = $filter ?: ObjectManager::getInstance()->get(Filter::class); } /** * Template directives callback * - * @return \Magento\Framework\Controller\Result\Raw + * @return Raw */ public function execute() { @@ -65,26 +107,24 @@ public function execute() $directive = $this->urlDecoder->decode($directive); try { /** @var Filter $filter */ - $filter = $this->_objectManager->create(Filter::class); - $imagePath = $filter->filter($directive); - /** @var \Magento\Framework\Image\Adapter\AdapterInterface $image */ - $image = $this->_objectManager->get(\Magento\Framework\Image\AdapterFactory::class)->create(); - /** @var \Magento\Framework\Controller\Result\Raw $resultRaw */ + $imagePath = $this->filter->filter($directive); + /** @var AdapterInterface $image */ + $image = $this->adapterFactory->create(); + /** @var Raw $resultRaw */ $resultRaw = $this->resultRawFactory->create(); $image->open($imagePath); $resultRaw->setHeader('Content-Type', $image->getMimeType()); $resultRaw->setContents($image->getImage()); } catch (\Exception $e) { /** @var Config $config */ - $config = $this->_objectManager->get(Config::class); - $imagePath = $config->getSkinImagePlaceholderPath(); + $imagePath = $this->config->getSkinImagePlaceholderPath(); try { $image->open($imagePath); $resultRaw->setHeader('Content-Type', $image->getMimeType()); $resultRaw->setContents($image->getImage()); - $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e); + $this->logger->warning($e); } catch (\Exception $e) { - $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e); + $this->logger->warning($e); } } return $resultRaw; diff --git a/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php b/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php index cede3a80cb98b..5fea276225622 100644 --- a/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php +++ b/app/code/Magento/Cms/Test/Unit/Controller/Adminhtml/Wysiwyg/DirectiveTest.php @@ -151,7 +151,11 @@ protected function setUp() [ 'context' => $this->actionContextMock, 'urlDecoder' => $this->urlDecoderMock, - 'resultRawFactory' => $this->rawFactoryMock + 'resultRawFactory' => $this->rawFactoryMock, + 'adapterFactory' => $this->imageAdapterFactoryMock, + 'logger' => $this->loggerMock, + 'config' => $this->wysiwygConfigMock, + 'filter' => $this->templateFilterMock ] ); } @@ -228,7 +232,7 @@ public function testExecuteException() ->method('getImage') ->willReturn($imageBody); $this->loggerMock->expects($this->once()) - ->method('critical') + ->method('warning') ->with($exception); $this->rawFactoryMock->expects($this->any()) ->method('create') @@ -253,23 +257,12 @@ protected function prepareExecuteTest() ->method('decode') ->with($directiveParam) ->willReturn($directive); - $this->objectManagerMock->expects($this->once()) - ->method('create') - ->with(\Magento\Cms\Model\Template\Filter::class) - ->willReturn($this->templateFilterMock); + $this->templateFilterMock->expects($this->once()) ->method('filter') ->with($directive) ->willReturn(self::IMAGE_PATH); - $this->objectManagerMock->expects($this->any()) - ->method('get') - ->willReturnMap( - [ - [\Magento\Framework\Image\AdapterFactory::class, $this->imageAdapterFactoryMock], - [\Magento\Cms\Model\Wysiwyg\Config::class, $this->wysiwygConfigMock], - [\Psr\Log\LoggerInterface::class, $this->loggerMock] - ] - ); + $this->imageAdapterFactoryMock->expects($this->once()) ->method('create') ->willReturn($this->imageAdapterMock); @@ -301,7 +294,7 @@ public function testExecuteWithDeletedImage() ->willThrowException($exception); $this->loggerMock->expects($this->once()) - ->method('critical') + ->method('warning') ->with($exception); $this->wysiwygDirective->execute(); From e8eb43a84cb861cedda424aaf8be83aa1c6c1c29 Mon Sep 17 00:00:00 2001 From: Mastiuhin Olexandr <mastiuhin.olexandr@transoftgroup.com> Date: Tue, 10 Dec 2019 16:08:13 +0200 Subject: [PATCH 470/595] MC-25036: Marketing Email preview doesn't work with enabled js minification --- app/code/Magento/Email/composer.json | 1 + .../view/adminhtml/layout/adminhtml_email_template_preview.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/app/code/Magento/Email/composer.json b/app/code/Magento/Email/composer.json index 548d9a422c132..9070fbac7c653 100644 --- a/app/code/Magento/Email/composer.json +++ b/app/code/Magento/Email/composer.json @@ -12,6 +12,7 @@ "magento/module-config": "*", "magento/module-store": "*", "magento/module-theme": "*", + "magento/module-require-js": "*", "magento/module-media-storage": "*", "magento/module-variable": "*" }, diff --git a/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_preview.xml b/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_preview.xml index e7cbc675ce386..886a76b3af6f8 100644 --- a/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_preview.xml +++ b/app/code/Magento/Email/view/adminhtml/layout/adminhtml_email_template_preview.xml @@ -17,6 +17,7 @@ <argument name="preview_form_view_model" xsi:type="object">Magento\Email\ViewModel\Template\Preview\Form</argument> </arguments> </block> + <block class="Magento\RequireJs\Block\Html\Head\Config" name="requirejs-config"/> </referenceContainer> </body> </page> From 25eb81ce660014deb8461be19babff66d6d4fda6 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Tue, 10 Dec 2019 20:16:29 +0530 Subject: [PATCH 471/595] Updated the jsonSerializer position in unit test --- .../Test/Unit/ViewModel/Product/BreadcrumbsTest.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/BreadcrumbsTest.php b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/BreadcrumbsTest.php index 38b5f35634ad7..a442041660893 100644 --- a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/BreadcrumbsTest.php +++ b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/BreadcrumbsTest.php @@ -12,6 +12,7 @@ use Magento\Catalog\ViewModel\Product\Breadcrumbs; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Framework\Serialize\Serializer\JsonHexTag; /** * Unit test for Magento\Catalog\ViewModel\Product\Breadcrumbs. @@ -38,6 +39,11 @@ class BreadcrumbsTest extends \PHPUnit\Framework\TestCase */ private $objectManager; + /** + * @var JsonHexTag|\PHPUnit_Framework_MockObject_MockObject + */ + private $serializer; + /** * @inheritdoc */ @@ -54,15 +60,16 @@ protected function setUp() : void ->getMockForAbstractClass(); $escaper = $this->getObjectManager()->getObject(\Magento\Framework\Escaper::class); - $this->serializer = $this->createMock(\Magento\Framework\Serialize\Serializer\JsonHexTag::class); + + $this->serializer = $this->createMock(JsonHexTag::class); $this->viewModel = $this->getObjectManager()->getObject( Breadcrumbs::class, [ 'catalogData' => $this->catalogHelper, 'scopeConfig' => $this->scopeConfig, - 'jsonSerializer' => $this->serializer, - 'escaper' => $escaper + 'escaper' => $escaper, + 'jsonSerializer' => $this->serializer ] ); } From 721f8cedc063e405074c0ceaea200f0c44f905eb Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Tue, 10 Dec 2019 21:53:06 +0700 Subject: [PATCH 472/595] Update .csv for issue 25896 --- app/code/Magento/Cms/i18n/en_US.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Cms/i18n/en_US.csv b/app/code/Magento/Cms/i18n/en_US.csv index 2947c567d75ff..6a623f947cbc2 100644 --- a/app/code/Magento/Cms/i18n/en_US.csv +++ b/app/code/Magento/Cms/i18n/en_US.csv @@ -75,7 +75,7 @@ Pages,Pages "A block identifier with the same properties already exists in the selected store.","A block identifier with the same properties already exists in the selected store." "The page URL key contains capital letters or disallowed symbols.","The page URL key contains capital letters or disallowed symbols." "The page URL key cannot be made of only numbers.","The page URL key cannot be made of only numbers." -"Please rename the folder using only letters, numbers, underscores and dashes.","Please rename the folder using only letters, numbers, underscores and dashes." +"Please rename the folder using only Latin letters, numbers, underscores and dashes.","Please rename the folder using only Latin letters, numbers, underscores and dashes." "We found a directory with the same name. Please try another folder name.","We found a directory with the same name. Please try another folder name." "We cannot create a new directory.","We cannot create a new directory." "We cannot delete directory %1.","We cannot delete directory %1." From 37c85d61103eeecc5b6de303fe717bbd453949da Mon Sep 17 00:00:00 2001 From: Tom Reece <treece@adobe.com> Date: Tue, 10 Dec 2019 09:55:10 -0600 Subject: [PATCH 473/595] MQE-1878: Stabilize community PR 742 --- ...ontMoveConfigurableProductFromShoppingCartToWishlistTest.xml | 2 +- ...ntMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml | 2 +- ...rontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml | 2 +- ...orefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml index 49cd78ec1884f..46ea3497941fd 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml @@ -14,7 +14,7 @@ <title value="Move Configurable Product from Shopping Cart to Wishlist"/> <description value="Move Configurable Product from Shopping Cart to Wishlist"/> <severity value="CRITICAL"/> - <testCaseId value="MAGETWO-29545"/> + <testCaseId value="MC-14211"/> <group value="wishlist"/> <group value="mtf_migrated"/> </annotations> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml index 856ebdb7bb73a..6faf4c1002c1a 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml @@ -14,7 +14,7 @@ <title value="Move Dynamic Bundle Product from Shopping Cart to Wishlist"/> <description value="Move Dynamic Bundle Product from Shopping Cart to Wishlist"/> <severity value="CRITICAL"/> - <testCaseId value="MAGETWO-29545"/> + <testCaseId value="MC-14212"/> <group value="wishlist"/> <group value="mtf_migrated"/> </annotations> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml index 9c3984d0287ec..3906767d04cc1 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml @@ -14,7 +14,7 @@ <title value="Move Fixed Bundle Product from Shopping Cart to Wishlist"/> <description value="Move Fixed Bundle Product from Shopping Cart to Wishlist"/> <severity value="CRITICAL"/> - <testCaseId value="MAGETWO-29545"/> + <testCaseId value="MC-14213"/> <group value="wishlist"/> <group value="mtf_migrated"/> </annotations> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml index 20ac78dfbf731..dc1580797e5be 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml @@ -14,7 +14,7 @@ <title value="Move Virtual Product from Shopping Cart to Wishlist"/> <description value="Move Virtual Product from Shopping Cart to Wishlist"/> <severity value="CRITICAL"/> - <testCaseId value="MAGETWO-29545"/> + <testCaseId value="MC-14210"/> <group value="wishlist"/> <group value="mtf_migrated"/> </annotations> From 17a575a1ed64b6c74d969051877f01e25621ef58 Mon Sep 17 00:00:00 2001 From: Dmytro Cheshun <d.cheshun@atwix.com> Date: Tue, 10 Dec 2019 18:23:11 +0200 Subject: [PATCH 474/595] Restore the translatable phrase for backward compatibility --- app/code/Magento/Cms/i18n/en_US.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Cms/i18n/en_US.csv b/app/code/Magento/Cms/i18n/en_US.csv index 6a623f947cbc2..b860a8fb1041e 100644 --- a/app/code/Magento/Cms/i18n/en_US.csv +++ b/app/code/Magento/Cms/i18n/en_US.csv @@ -75,6 +75,7 @@ Pages,Pages "A block identifier with the same properties already exists in the selected store.","A block identifier with the same properties already exists in the selected store." "The page URL key contains capital letters or disallowed symbols.","The page URL key contains capital letters or disallowed symbols." "The page URL key cannot be made of only numbers.","The page URL key cannot be made of only numbers." +"Please rename the folder using only letters, numbers, underscores and dashes.","Please rename the folder using only letters, numbers, underscores and dashes." "Please rename the folder using only Latin letters, numbers, underscores and dashes.","Please rename the folder using only Latin letters, numbers, underscores and dashes." "We found a directory with the same name. Please try another folder name.","We found a directory with the same name. Please try another folder name." "We cannot create a new directory.","We cannot create a new directory." From d97d7f6e322f91f9d28fb19ccd77395f5ab3dbce Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Tue, 10 Dec 2019 11:28:53 -0600 Subject: [PATCH 475/595] Change action groups name according to CE branch changes --- ...WithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml | 2 +- ...oductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml | 2 +- ...ProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml | 2 +- ...uctWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml | 2 +- ...WithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml index bbde98f8fc043..021ed5593c738 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml @@ -28,7 +28,7 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> - <actionGroup ref="deleteProductBySku" stepKey="deleteDefaultVirtualProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteDefaultVirtualProduct"> <argument name="sku" value="{{updateVirtualProductRegularPrice5OutOfStock.sku}}"/> </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml index 15e5be210b73a..d74a6ce508b88 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml @@ -28,7 +28,7 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> - <actionGroup ref="deleteProductBySku" stepKey="deleteDefaultVirtualProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteDefaultVirtualProduct"> <argument name="sku" value="{{updateVirtualProductRegularPrice5OutOfStock.sku}}"/> </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml index 8b4518007ea29..aa90d018f7710 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml @@ -27,7 +27,7 @@ </createData> </before> <after> - <actionGroup ref="deleteProductBySku" stepKey="deleteDefaultVirtualProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteDefaultVirtualProduct"> <argument name="sku" value="{{updateVirtualProductRegularPrice99OutOfStock.sku}}"/> </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml index 984c296845113..94ddb3dc5e5da 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml @@ -28,7 +28,7 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> - <actionGroup ref="deleteProductBySku" stepKey="deleteDefaultVirtualProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteDefaultVirtualProduct"> <argument name="sku" value="{{updateVirtualProductSpecialPrice.sku}}"/> </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml index 1c590563d4cfc..a6a629b35091e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml @@ -28,7 +28,7 @@ <createData entity="SimpleSubCategory" stepKey="categoryEntity"/> </before> <after> - <actionGroup ref="deleteProductBySku" stepKey="deleteDefaultVirtualProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteDefaultVirtualProduct"> <argument name="sku" value="{{updateVirtualProductSpecialPriceOutOfStock.sku}}"/> </actionGroup> <deleteData stepKey="deleteSimpleSubCategory" createDataKey="initialCategoryEntity"/> From 1022e6ea7812028f50bb802b9a1e14420d994e0e Mon Sep 17 00:00:00 2001 From: Tom Reece <treece@adobe.com> Date: Tue, 10 Dec 2019 13:14:36 -0600 Subject: [PATCH 476/595] MQE-1878: Stabilize community PR 742 --- ...ntMoveConfigurableProductFromShoppingCartToWishlistTest.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml index 46ea3497941fd..70268f4e14e8f 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml @@ -106,6 +106,9 @@ <requiredEntity createDataKey="createConfigProduct"/> <requiredEntity createDataKey="createConfigChildProduct3"/> </createData> + + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <!-- Delete data --> From e853bf692bbff2a4b3811bb14f8d3d09b24e9386 Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Tue, 10 Dec 2019 13:23:05 -0600 Subject: [PATCH 477/595] MC-17629: Control over search results min terms to match - Fix static tests --- .../Model/Config/Backend/MinimumShouldMatch.php | 5 ++++- .../Test/Unit/Model/Client/ElasticsearchTest.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Elasticsearch/Model/Config/Backend/MinimumShouldMatch.php b/app/code/Magento/Elasticsearch/Model/Config/Backend/MinimumShouldMatch.php index 434270c62d3d9..ea64ccd772682 100644 --- a/app/code/Magento/Elasticsearch/Model/Config/Backend/MinimumShouldMatch.php +++ b/app/code/Magento/Elasticsearch/Model/Config/Backend/MinimumShouldMatch.php @@ -34,7 +34,10 @@ public function validateValue(): void { if (strlen($this->getValue()) && !preg_match('/^((\d+<)?-?\d+%?\s?)+$/', $this->getValue())) { throw new LocalizedException( - __('Value for the field "%1" was not saved because of the incorrect format.', __('Minimum Terms to Match')) + __( + 'Value for the field "%1" was not saved because of the incorrect format.', + __('Minimum Terms to Match') + ) ); } } diff --git a/app/code/Magento/Elasticsearch6/Test/Unit/Model/Client/ElasticsearchTest.php b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Client/ElasticsearchTest.php index 8bb27d366ae26..607624d7b5e8e 100644 --- a/app/code/Magento/Elasticsearch6/Test/Unit/Model/Client/ElasticsearchTest.php +++ b/app/code/Magento/Elasticsearch6/Test/Unit/Model/Client/ElasticsearchTest.php @@ -12,7 +12,7 @@ use Magento\Elasticsearch6\Model\Client\Elasticsearch; /** - * Class ElasticsearchTest + * Test elasticsearch client methods */ class ElasticsearchTest extends \PHPUnit\Framework\TestCase { From 8f3b2823fa6f2f7f1800bcab7c00961536b6685e Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Tue, 10 Dec 2019 13:53:45 -0600 Subject: [PATCH 478/595] Change action groups name according to CE branch changes --- .../Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml index cea026577f98f..d0502b41e2856 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminReorderWithCatalogPriceTest.xml @@ -41,7 +41,7 @@ <after> <deleteData createDataKey="createSimpleProductApi" stepKey="deleteSimpleProductApi"/> <!-- Delete the rule --> - <actionGroup ref="RemoveCatalogPriceRule" stepKey="deletePriceRule"> + <actionGroup ref="RemoveCatalogPriceRuleActionGroup" stepKey="deletePriceRule"> <argument name="ruleName" value="{{CatalogRuleToPercent.name}}" /> </actionGroup> <!--Clear all filters in grid--> From fa095edbfafe4d99248ca7ea9e99bec3be415fcf Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Tue, 10 Dec 2019 14:02:38 -0600 Subject: [PATCH 479/595] MC-22572: Shuffle related, up-sale and cross-sale products either by priority and weight - Fix static tests --- .../templates/product/list/items.phtml | 50 ++++++++++--------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml index 8f1fe3fa6874c..fc4d85044a8d6 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml @@ -6,6 +6,8 @@ // phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis // phpcs:disable Generic.WhiteSpace.ScopeIndent.Incorrect +// phpcs:disable Generic.Files.LineLength +// phpcs:disable Magento2.Templates.ThisInTemplate.FoundHelper /* @var $block \Magento\Catalog\Block\Product\AbstractProduct */ ?> @@ -156,22 +158,22 @@ switch ($type = $block->getType()) { } ?> -<?php if ($exist) :?> +<?php if ($exist):?> -<?php if ($type == 'related' || $type == 'upsell') :?> -<?php if ($type == 'related') :?> +<?php if ($type == 'related' || $type == 'upsell'):?> +<?php if ($type == 'related'):?> <div class="block <?= $block->escapeHtmlAttr($class) ?>" data-mage-init='{"relatedProducts":{"relatedCheckbox":".related.checkbox"}}' data-limit="<?= $block->escapeHtmlAttr($limit) ?>" data-shuffle="<?= /* @noEscape */ $shuffle ?>" data-shuffle-weighted="<?= /* @noEscape */ $isWeightedRandom ?>"> - <?php else :?> + <?php else:?> <div class="block <?= $block->escapeHtmlAttr($class) ?>" data-mage-init='{"upsellProducts":{}}' data-limit="<?= $block->escapeHtmlAttr($limit) ?>" data-shuffle="<?= /* @noEscape */ $shuffle ?>" data-shuffle-weighted="<?= /* @noEscape */ $isWeightedRandom ?>"> <?php endif; ?> - <?php else :?> + <?php else:?> <div class="block <?= $block->escapeHtmlAttr($class) ?>"> <?php endif; ?> <div class="block-title title"> <strong id="block-<?= $block->escapeHtmlAttr($class) ?>-heading" role="heading" aria-level="2"><?= $block->escapeHtml($title) ?></strong> </div> <div class="block-content content" aria-labelledby="block-<?= $block->escapeHtmlAttr($class) ?>-heading"> - <?php if ($type == 'related' && $canItemsAddToCart) :?> + <?php if ($type == 'related' && $canItemsAddToCart):?> <div class="block-actions"> <?= $block->escapeHtml(__('Check items to add to the cart or')) ?> <button type="button" class="action select" data-role="select-all"><span><?= $block->escapeHtml(__('select all')) ?></span></button> @@ -179,16 +181,16 @@ switch ($type = $block->getType()) { <?php endif; ?> <div class="products wrapper grid products-grid products-<?= $block->escapeHtmlAttr($type) ?>"> <ol class="products list items product-items"> - <?php foreach ($items as $_item) :?> + <?php foreach ($items as $_item):?> <?php $available = ''; ?> - <?php if (!$_item->isComposite() && $_item->isSaleable() && $type == 'related') :?> - <?php if (!$_item->getRequiredOptions()) :?> + <?php if (!$_item->isComposite() && $_item->isSaleable() && $type == 'related'):?> + <?php if (!$_item->getRequiredOptions()):?> <?php $available = 'related-available'; ?> <?php endif; ?> <?php endif; ?> - <?php if ($type == 'related' || $type == 'upsell') :?> + <?php if ($type == 'related' || $type == 'upsell'):?> <li class="item product product-item" style="display: none;" data-shuffle-group="<?= $block->escapeHtmlAttr($_item->getPriority()) ?>" > - <?php else :?> + <?php else:?> <li class="item product product-item"> <?php endif; ?> <div class="product-item-info <?= /* @noEscape */ $available ?>"> @@ -203,12 +205,12 @@ switch ($type = $block->getType()) { <?= /* @noEscape */ $block->getProductPrice($_item) ?> - <?php if ($templateType) :?> + <?php if ($templateType):?> <?= $block->getReviewsSummaryHtml($_item, $templateType) ?> <?php endif; ?> - <?php if ($canItemsAddToCart && !$_item->isComposite() && $_item->isSaleable() && $type == 'related') :?> - <?php if (!$_item->getRequiredOptions()) :?> + <?php if ($canItemsAddToCart && !$_item->isComposite() && $_item->isSaleable() && $type == 'related'):?> + <?php if (!$_item->getRequiredOptions()):?> <div class="field choice related"> <input type="checkbox" class="checkbox related" id="related-checkbox<?= $block->escapeHtmlAttr($_item->getId()) ?>" name="related_products[]" value="<?= $block->escapeHtmlAttr($_item->getId()) ?>" /> <label class="label" for="related-checkbox<?= $block->escapeHtmlAttr($_item->getId()) ?>"><span><?= $block->escapeHtml(__('Add to Cart')) ?></span></label> @@ -216,16 +218,16 @@ switch ($type = $block->getType()) { <?php endif; ?> <?php endif; ?> - <?php if ($showAddTo || $showCart) :?> + <?php if ($showAddTo || $showCart):?> <div class="product actions product-item-actions"> - <?php if ($showCart) :?> + <?php if ($showCart):?> <div class="actions-primary"> - <?php if ($_item->isSaleable()) :?> - <?php if ($_item->getTypeInstance()->hasRequiredOptions($_item)) :?> + <?php if ($_item->isSaleable()):?> + <?php if ($_item->getTypeInstance()->hasRequiredOptions($_item)):?> <button class="action tocart primary" data-mage-init='{"redirectUrl": {"url": "<?= $block->escapeUrl($block->getAddToCartUrl($_item)) ?>"}}' type="button" title="<?= $block->escapeHtmlAttr(__('Add to Cart')) ?>"> <span><?= $block->escapeHtml(__('Add to Cart')) ?></span> </button> - <?php else :?> + <?php else:?> <?php $postDataHelper = $this->helper(Magento\Framework\Data\Helper\PostHelper::class); $postData = $postDataHelper->getPostData($block->escapeUrl($block->getAddToCartUrl($_item)), ['product' => $_item->getEntityId()]) ?> @@ -235,19 +237,19 @@ switch ($type = $block->getType()) { <span><?= $block->escapeHtml(__('Add to Cart')) ?></span> </button> <?php endif; ?> - <?php else :?> - <?php if ($_item->getIsSalable()) :?> + <?php else:?> + <?php if ($_item->getIsSalable()):?> <div class="stock available"><span><?= $block->escapeHtml(__('In stock')) ?></span></div> - <?php else :?> + <?php else:?> <div class="stock unavailable"><span><?= $block->escapeHtml(__('Out of stock')) ?></span></div> <?php endif; ?> <?php endif; ?> </div> <?php endif; ?> - <?php if ($showAddTo) :?> + <?php if ($showAddTo):?> <div class="secondary-addto-links actions-secondary" data-role="add-to-links"> - <?php if ($addToBlock = $block->getChildBlock('addto')) :?> + <?php if ($addToBlock = $block->getChildBlock('addto')):?> <?= $addToBlock->setProduct($_item)->getChildHtml() ?> <?php endif; ?> </div> From dcd38bbd474acdd8b1ad02527dfc5ac90e65ba1f Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Tue, 10 Dec 2019 17:18:32 -0600 Subject: [PATCH 480/595] Change action groups name according to CE branch changes --- ...uctToWishListSuccessMessageActionGroup.xml | 22 +++++++++++++++++ ...ertProductDetailsInWishlistActionGroup.xml | 24 +++++++++++++++++++ ...tProductIsPresentInWishListActionGroup.xml | 15 ++++++++---- ...eProductFromShoppingCartToWishlistTest.xml | 6 ++--- ...eProductFromShoppingCartToWishlistTest.xml | 6 ++--- ...eProductFromShoppingCartToWishlistTest.xml | 6 ++--- ...lProductFromShoppingCartToWishlistTest.xml | 4 ++-- 7 files changed, 67 insertions(+), 16 deletions(-) diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertMoveProductToWishListSuccessMessageActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertMoveProductToWishListSuccessMessageActionGroup.xml index e69de29bb2d1d..37d26f984b3eb 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertMoveProductToWishListSuccessMessageActionGroup.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertMoveProductToWishListSuccessMessageActionGroup.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="AssertMoveProductToWishListSuccessMessageActionGroup"> + <annotations> + <description>Moves a product from the cart to the wishlist.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + <click selector="{{CheckoutCartProductSection.moveToWishlistByProductName(productName)}}" stepKey="moveToWishlist"/> + <waitForPageLoad stepKey="waitForMove"/> + <see userInput="{{productName}} has been moved to your wish list." selector="{{CheckoutCartMessageSection.successMessage}}" stepKey="assertSuccess"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertProductDetailsInWishlistActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertProductDetailsInWishlistActionGroup.xml index e69de29bb2d1d..4498882a206d1 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertProductDetailsInWishlistActionGroup.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertProductDetailsInWishlistActionGroup.xml @@ -0,0 +1,24 @@ +<?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="AssertProductIsPresentInWishListActionGroup"> + <annotations> + <description>Go to storefront customer wishlist page and assert product name and price is present.</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + <argument name="productPrice" type="string"/> + </arguments> + <amOnPage url="{{StorefrontCustomerWishlistPage.url}}" stepKey="goToWishList"/> + <waitForPageLoad stepKey="waitForWishList"/> + <waitForElement selector="{{StorefrontCustomerWishlistProductSection.ProductTitleByName(productName)}}" time="30" stepKey="assertProductName"/> + <see userInput="{{productPrice}}" selector="{{StorefrontCustomerWishlistProductSection.ProductPriceByName(productName)}}" stepKey="assertProductPrice"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertProductIsPresentInWishListActionGroup.xml b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertProductIsPresentInWishListActionGroup.xml index 37d26f984b3eb..85c91e1a0f14c 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertProductIsPresentInWishListActionGroup.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/ActionGroup/AssertProductIsPresentInWishListActionGroup.xml @@ -8,15 +8,20 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AssertMoveProductToWishListSuccessMessageActionGroup"> + <actionGroup name="AssertProductDetailsInWishlistActionGroup"> <annotations> - <description>Moves a product from the cart to the wishlist.</description> + <description>Assert product name and price in wishlist on hover.</description> </annotations> <arguments> <argument name="productName" type="string"/> + <argument name="label" type="string"/> + <argument name="labelValue" type="string"/> </arguments> - <click selector="{{CheckoutCartProductSection.moveToWishlistByProductName(productName)}}" stepKey="moveToWishlist"/> - <waitForPageLoad stepKey="waitForMove"/> - <see userInput="{{productName}} has been moved to your wish list." selector="{{CheckoutCartMessageSection.successMessage}}" stepKey="assertSuccess"/> + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(productName)}}" stepKey="moveMouseOverProductInfo"/> + <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductAddToCartByName(productName)}}" stepKey="seeAddToCart"/> + <seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductImageByName(productName)}}" stepKey="seeImage"/> + <moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsByName(productName)}}" stepKey="moveMouseOverProductDetails"/> + <see userInput="{{label}}" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsLabelByName(productName)}}" stepKey="seeLabel"/> + <see userInput="{{labelValue}}" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsValueByName(productName)}}" stepKey="seeLabelValue"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml index 70268f4e14e8f..c7e1be33c963a 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml @@ -144,18 +144,18 @@ <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> <!-- Assert move product to wishlist success message --> - <actionGroup ref="AssertMoveProductToWishListSuccessMessage" stepKey="moveToWishlist"> + <actionGroup ref="AssertMoveProductToWishListSuccessMessageActionGroup" stepKey="moveToWishlist"> <argument name="productName" value="$$createConfigProduct.name$$"/> </actionGroup> <!-- Assert product is present in wishlist --> - <actionGroup ref="AssertProductIsPresentInWishList" stepKey="assertProductPresent"> + <actionGroup ref="AssertProductIsPresentInWishListActionGroup" stepKey="assertProductPresent"> <argument name="productName" value="$$createConfigProduct.name$$"/> <argument name="productPrice" value="$20.00"/> </actionGroup> <!-- Assert product details in Wishlist --> - <actionGroup ref="AssertProductDetailsInWishlist" stepKey="assertProductDetails"> + <actionGroup ref="AssertProductDetailsInWishlistActionGroup" stepKey="assertProductDetails"> <argument name="productName" value="$$createConfigProduct.name$$"/> <argument name="label" value="$$createConfigProductAttribute.default_value$$"/> <argument name="labelValue" value="$$getConfigAttributeOption2.label$$"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml index 6faf4c1002c1a..d527056ca89fd 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml @@ -87,18 +87,18 @@ <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> <!-- Assert move product to wishlist success message --> - <actionGroup ref="AssertMoveProductToWishListSuccessMessage" stepKey="moveToWishlist"> + <actionGroup ref="AssertMoveProductToWishListSuccessMessageActionGroup" stepKey="moveToWishlist"> <argument name="productName" value="$$createBundleProduct.name$$"/> </actionGroup> <!-- Assert product is present in wishlist --> - <actionGroup ref="AssertProductIsPresentInWishList" stepKey="assertProductPresent"> + <actionGroup ref="AssertProductIsPresentInWishListActionGroup" stepKey="assertProductPresent"> <argument name="productName" value="$$createBundleProduct.name$$"/> <argument name="productPrice" value="$100.00"/> </actionGroup> <!-- Assert product details in Wishlist --> - <actionGroup ref="AssertProductDetailsInWishlist" stepKey="assertProductDetails"> + <actionGroup ref="AssertProductDetailsInWishlistActionGroup" stepKey="assertProductDetails"> <argument name="productName" value="$$createBundleProduct.name$$"/> <argument name="label" value="$$createBundleOption1_1.title$$"/> <argument name="labelValue" value="$$simpleProduct1.sku$$ $100.00"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml index 3906767d04cc1..4d7371854dfef 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml @@ -78,18 +78,18 @@ <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> <!-- Assert move product to wishlist success message --> - <actionGroup ref="AssertMoveProductToWishListSuccessMessage" stepKey="moveToWishlist"> + <actionGroup ref="AssertMoveProductToWishListSuccessMessageActionGroup" stepKey="moveToWishlist"> <argument name="productName" value="$$createBundleProduct.name$$"/> </actionGroup> <!-- Assert product is present in wishlist --> - <actionGroup ref="AssertProductIsPresentInWishList" stepKey="assertProductPresent"> + <actionGroup ref="AssertProductIsPresentInWishListActionGroup" stepKey="assertProductPresent"> <argument name="productName" value="$$createBundleProduct.name$$"/> <argument name="productPrice" value="$101.23"/> </actionGroup> <!-- Assert product details in Wishlist --> - <actionGroup ref="AssertProductDetailsInWishlist" stepKey="assertProductDetails"> + <actionGroup ref="AssertProductDetailsInWishlistActionGroup" stepKey="assertProductDetails"> <argument name="productName" value="$$createBundleProduct.name$$"/> <argument name="label" value="$$createBundleOption1_1.title$$"/> <argument name="labelValue" value="$$simpleProduct1.sku$$ $100.00"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml index dc1580797e5be..adf1e4953badc 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml @@ -53,12 +53,12 @@ <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> <!-- Assert move product to wishlist success message --> - <actionGroup ref="AssertMoveProductToWishListSuccessMessage" stepKey="moveToWishlist"> + <actionGroup ref="AssertMoveProductToWishListSuccessMessageActionGroup" stepKey="moveToWishlist"> <argument name="productName" value="$$createProduct.name$$"/> </actionGroup> <!-- Assert product is present in wishlist --> - <actionGroup ref="AssertProductIsPresentInWishList" stepKey="assertProductPresent"> + <actionGroup ref="AssertProductIsPresentInWishListActionGroup" stepKey="assertProductPresent"> <argument name="productName" value="$$createProduct.name$$"/> <argument name="productPrice" value="$$createProduct.price$$"/> </actionGroup> From 9c32f0ad5fe4116abcbf0b1051027963d63bb045 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Tue, 10 Dec 2019 18:55:49 -0600 Subject: [PATCH 481/595] Change action groups name according to CE branch changes --- .../AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml | 2 +- .../Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml | 2 +- ...tMoveConfigurableProductFromShoppingCartToWishlistTest.xml | 4 ++-- ...MoveDynamicBundleProductFromShoppingCartToWishlistTest.xml | 4 ++-- ...ntMoveFixedBundleProductFromShoppingCartToWishlistTest.xml | 4 ++-- ...efrontMoveVirtualProductFromShoppingCartToWishlistTest.xml | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml index 5a05dab7aa707..97e1f16016045 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml @@ -28,7 +28,7 @@ </after> <!--Create the Category Url Rewrite--> - <actionGroup ref="AdminAddUrlRewrite" stepKey="addUrlRewrite"> + <actionGroup ref="AdminAddUrlRewriteActionGroup" stepKey="addUrlRewrite"> <argument name="category" value="$$category.name$$"/> <argument name="customUrlRewriteValue" value="For Category"/> <argument name="storeValue" value="Default Store View"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml index e94e10767c632..18c3e1abe59c4 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml @@ -28,7 +28,7 @@ </after> <!--Create the Category Url Rewrite--> - <actionGroup ref="AdminAddUrlRewrite" stepKey="addUrlRewriteSecondTime"> + <actionGroup ref="AdminAddUrlRewriteActionGroup" stepKey="addUrlRewriteSecondTime"> <argument name="category" value="$$category.name$$"/> <argument name="customUrlRewriteValue" value="For Category"/> <argument name="storeValue" value="Default Store View"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml index c7e1be33c963a..0f94a08328c95 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest.xml @@ -136,12 +136,12 @@ <scrollTo selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" y="-200" stepKey="scroll"/> <!-- Add product to the cart and Assert add product to cart success message--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartVirtualProductFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartVirtualProductFromStorefrontProductPage"> <argument name="productName" value="$$createConfigProduct.name$$"/> </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!-- Assert move product to wishlist success message --> <actionGroup ref="AssertMoveProductToWishListSuccessMessageActionGroup" stepKey="moveToWishlist"> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml index d527056ca89fd..76e1240b0df77 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml @@ -79,12 +79,12 @@ <fillField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity($$createBundleOption1_1.title$$)}}" userInput="1" stepKey="fillQuantity00"/> <!-- Add product to the cart and Assert add product to cart success message--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartVirtualProductFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartVirtualProductFromStorefrontProductPage"> <argument name="productName" value="$$createBundleProduct.name$$"/> </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!-- Assert move product to wishlist success message --> <actionGroup ref="AssertMoveProductToWishListSuccessMessageActionGroup" stepKey="moveToWishlist"> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml index 4d7371854dfef..2d83043f81318 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveFixedBundleProductFromShoppingCartToWishlistTest.xml @@ -70,12 +70,12 @@ <fillField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity($$createBundleOption1_1.title$$)}}" userInput="1" stepKey="fillQuantity00"/> <!-- Add product to the cart and Assert add product to cart success message--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartVirtualProductFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartVirtualProductFromStorefrontProductPage"> <argument name="productName" value="$$createBundleProduct.name$$"/> </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!-- Assert move product to wishlist success message --> <actionGroup ref="AssertMoveProductToWishListSuccessMessageActionGroup" stepKey="moveToWishlist"> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml index adf1e4953badc..ad10b8d01bbbd 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveVirtualProductFromShoppingCartToWishlistTest.xml @@ -45,12 +45,12 @@ <waitForPageLoad stepKey="waitForPageToLoad"/> <!-- Add Virtual product to the cart and Assert add product to cart success message--> - <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartVirtualProductFromStorefrontProductPage"> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartVirtualProductFromStorefrontProductPage"> <argument name="productName" value="$$createProduct.name$$"/> </actionGroup> <!-- Select Mini Cart and select 'View And Edit Cart' --> - <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="selectViewAndEditCart"/> <!-- Assert move product to wishlist success message --> <actionGroup ref="AssertMoveProductToWishListSuccessMessageActionGroup" stepKey="moveToWishlist"> From 802126ceaf0aba31101b83c0c7f934c8c0520ff4 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Tue, 10 Dec 2019 20:42:07 -0600 Subject: [PATCH 482/595] Change action groups name according to CE branch changes --- .../CreateNewPageWithAllValuesAndContentActionGroup.xml | 2 +- .../AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml | 4 ++-- .../Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml | 4 ++-- ...MoveDynamicBundleProductFromShoppingCartToWishlistTest.xml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesAndContentActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesAndContentActionGroup.xml index 201e78fff6dbe..f231cdbbbfe37 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesAndContentActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithAllValuesAndContentActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="CreateNewPageWithAllValuesAndContentActionGroup" extends="CreateNewPageWithAllValues"> + <actionGroup name="CreateNewPageWithAllValuesAndContentActionGroup" extends="CreateNewPageWithAllValuesActionGroup"> <arguments> <argument name="pageContent" type="string"/> </arguments> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml index 97e1f16016045..1c1f7af5a5cd5 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml @@ -38,7 +38,7 @@ </actionGroup> <!--Delete the Category Url Rewrite--> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AssertPageByUrlRewriteIsNotFoundActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="-"/> </actionGroup> <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> @@ -46,7 +46,7 @@ </actionGroup> <!--Verify AssertPageByUrlRewriteIsNotFound--> - <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="checkUrlOnFrontend"> + <actionGroup ref="AssertPageByUrlRewriteIsNotFoundActionGroup" stepKey="checkUrlOnFrontend"> <argument name="requestPath" value="-"/> </actionGroup> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml index 18c3e1abe59c4..7c4023c6d0f75 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteWithRequestPathTest.xml @@ -38,7 +38,7 @@ </actionGroup> <!--Delete the Category Url Rewrite--> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewriteSecondTime"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewriteSecondTime"> <argument name="requestPath" value="newrequestpath.html"/> </actionGroup> <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessageSecondTime"> @@ -46,7 +46,7 @@ </actionGroup> <!--Verify AssertPageByUrlRewriteIsNotFound--> - <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="checkUrlOnFrontendSecondTime"> + <actionGroup ref="AssertPageByUrlRewriteIsNotFoundActionGroup" stepKey="checkUrlOnFrontendSecondTime"> <argument name="requestPath" value="newrequestpath.html"/> </actionGroup> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml index 76e1240b0df77..3a823efbcdf61 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest.xml @@ -46,12 +46,12 @@ <requiredEntity createDataKey="simpleProduct2"/> </createData> <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> - <actionGroup ref="goToProductPageViaID" stepKey="goToProduct"> + <actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="goToProduct"> <argument name="productId" value="$$createBundleProduct.id$$"/> </actionGroup> <scrollTo selector="{{AdminProductFormBundleSection.contentDropDown}}" stepKey="scrollToBundleSection"/> <selectOption userInput="Separately" selector="{{AdminProductFormBundleSection.shipmentType}}" stepKey="selectSeparately"/> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <magentoCLI stepKey="reindex" command="indexer:reindex"/> <magentoCLI stepKey="flushCache" command="cache:flush"/> </before> From d37620eff93dd5e92381c1cad8c91a6229ffb1e1 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Wed, 11 Dec 2019 10:52:51 +0700 Subject: [PATCH 483/595] [Catalog] Cover Price Validation Result class by Unit Test --- .../Product/Price/Validation/ResultTest.php | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 app/code/Magento/Catalog/Test/Unit/Model/Product/Price/Validation/ResultTest.php diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Price/Validation/ResultTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Price/Validation/ResultTest.php new file mode 100644 index 0000000000000..7ed32d564ca19 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Price/Validation/ResultTest.php @@ -0,0 +1,91 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Catalog\Test\Unit\Model\Product\Price\Validation; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Catalog\Model\Product\Price\Validation\Result; +use PHPUnit\Framework\TestCase; +use Magento\Catalog\Api\Data\PriceUpdateResultInterface; +use Magento\Catalog\Api\Data\PriceUpdateResultInterfaceFactory; + +class ResultTest extends TestCase +{ + /** + * @var Result + */ + private $model; + + /** + * @var PriceUpdateResultInterfaceFactory|PHPUnit_Framework_MockObject_MockObject + */ + private $priceUpdateResultFactory; + + /** + * @var ObjectManagerHelper|PHPUnit_Framework_MockObject_MockObject + */ + private $objectManager; + + /** + * Setup environment for test + */ + protected function setUp() + { + $this->priceUpdateResultFactory = $this->getMockBuilder(PriceUpdateResultInterfaceFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + + $this->objectManager = new ObjectManagerHelper($this); + $this->model = $this->objectManager->getObject( + Result::class, + [ + 'priceUpdateResultFactory' => $this->priceUpdateResultFactory + ] + ); + + $this->model->addFailedItem(1, 'Invalid attribute color = 1', ['SKU' => 'ABC', 'storeId' => 1]); + $this->model->addFailedItem(2, 'Invalid attribute size = M', ['SKU' => 'DEF', 'storeId' => 1]); + } + + /** + * Test getFailedRowIds() function + */ + public function testGetFailedRowIds() + { + $this->assertEquals([1, 2], $this->model->getFailedRowIds()); + } + + /** + * Test getFailedItems() function + */ + public function testGetFailedItems() + { + $priceUpdateResult1 = $this->createMock(PriceUpdateResultInterface::class); + $priceUpdateResult2 = $this->createMock(PriceUpdateResultInterface::class); + + $this->priceUpdateResultFactory->expects($this->at(0)) + ->method('create') + ->willReturn($priceUpdateResult1); + $this->priceUpdateResultFactory->expects($this->at(1)) + ->method('create') + ->willReturn($priceUpdateResult2); + + $priceUpdateResult1->expects($this->once())->method('setMessage') + ->with('Invalid attribute color = 1'); + $priceUpdateResult1->expects($this->once())->method('setParameters') + ->with(['SKU' => 'ABC', 'storeId' => 1]); + + $priceUpdateResult2->expects($this->once())->method('setMessage') + ->with('Invalid attribute size = M'); + $priceUpdateResult2->expects($this->once())->method('setParameters') + ->with(['SKU' => 'DEF', 'storeId' => 1]); + + $this->assertEquals([$priceUpdateResult1, $priceUpdateResult2], $this->model->getFailedItems()); + } +} From c3a97c015461c39e58f58c41a8c818d2da909571 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Wed, 11 Dec 2019 15:06:30 +0700 Subject: [PATCH 484/595] [Customer] Cover CustomerData\Customer and CustomerData\JsLayoutDataProviderPool by Unit Test --- .../Test/Unit/CustomerData/CustomerTest.php | 90 +++++++++++++++++++ .../JsLayoutDataProviderPoolTest.php | 84 +++++++++++++++++ 2 files changed, 174 insertions(+) create mode 100644 app/code/Magento/Customer/Test/Unit/CustomerData/CustomerTest.php create mode 100644 app/code/Magento/Customer/Test/Unit/CustomerData/JsLayoutDataProviderPoolTest.php diff --git a/app/code/Magento/Customer/Test/Unit/CustomerData/CustomerTest.php b/app/code/Magento/Customer/Test/Unit/CustomerData/CustomerTest.php new file mode 100644 index 0000000000000..735c526878b6b --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/CustomerData/CustomerTest.php @@ -0,0 +1,90 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Customer\Test\Unit\CustomerData; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Customer\CustomerData\Customer as CustomerData; +use Magento\Customer\Helper\Session\CurrentCustomer; +use Magento\Customer\Helper\View; +use Magento\Customer\Api\Data\CustomerInterface; +use PHPUnit\Framework\TestCase; + +class CustomerTest extends TestCase +{ + /** + * @var ObjectManagerHelper + */ + private $objectManagerHelper; + + /** + * @var CustomerData + */ + private $customerData; + + /** + * @var CurrentCustomer + */ + private $currentCustomerMock; + + /** + * @var View + */ + private $customerViewHelperMock; + + /** + * Setup environment to test + */ + protected function setUp() + { + $this->currentCustomerMock = $this->createMock(CurrentCustomer::class); + $this->customerViewHelperMock = $this->createMock(View::class); + $this->objectManagerHelper = new ObjectManagerHelper($this); + + $this->customerData = $this->objectManagerHelper->getObject( + CustomerData::class, + [ + 'currentCustomer' => $this->currentCustomerMock, + 'customerViewHelper' => $this->customerViewHelperMock + ] + ); + } + + /** + * Test getSectionData() without customer Id + */ + public function testGetSectionDataWithoutCustomerId() + { + $this->currentCustomerMock->expects($this->any())->method('getCustomerId')->willReturn(null); + $this->assertEquals([], $this->customerData->getSectionData()); + } + + /** + * Test getSectionData() with customer + */ + public function testGetSectionDataWithCustomer() + { + $this->currentCustomerMock->expects($this->any())->method('getCustomerId')->willReturn(1); + $customerMock = $this->createMock(CustomerInterface::class); + $customerMock->expects($this->any())->method('getFirstname')->willReturn('John'); + $customerMock->expects($this->any())->method('getWebsiteId')->willReturn(1); + $this->currentCustomerMock->expects($this->any())->method('getCustomer')->willReturn($customerMock); + $this->customerViewHelperMock->expects($this->any())->method('getCustomerName') + ->with($customerMock) + ->willReturn('John Adam'); + + $this->assertEquals( + [ + 'fullname' => 'John Adam', + 'firstname' => 'John', + 'websiteId' => 1, + ], + $this->customerData->getSectionData() + ); + } +} diff --git a/app/code/Magento/Customer/Test/Unit/CustomerData/JsLayoutDataProviderPoolTest.php b/app/code/Magento/Customer/Test/Unit/CustomerData/JsLayoutDataProviderPoolTest.php new file mode 100644 index 0000000000000..7b7f6ec9f841b --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/CustomerData/JsLayoutDataProviderPoolTest.php @@ -0,0 +1,84 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Customer\Test\Unit\CustomerData; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Tax\CustomerData\CheckoutTotalsJsLayoutDataProvider as CheckoutTotalsJs; +use Magento\Customer\CustomerData\JsLayoutDataProviderPool; +use PHPUnit\Framework\TestCase; + +class JsLayoutDataProviderPoolTest extends TestCase +{ + /** + * @var ObjectManagerHelper + */ + private $objectManagerHelper; + + /** + * @var CheckoutTotalsJs + */ + private $checkoutTotalsJsLayoutDataProviderMock; + + /** + * @var JsLayoutDataProviderPool + */ + private $jsLayoutDataProviderPool; + + /** + * Setup environment to test + */ + protected function setUp() + { + $this->checkoutTotalsJsLayoutDataProviderMock = $this->createMock(CheckoutTotalsJs::class); + $this->objectManagerHelper = new ObjectManagerHelper($this); + + $this->jsLayoutDataProviderPool = $this->objectManagerHelper->getObject( + JsLayoutDataProviderPool::class, + [ + 'jsLayoutDataProviders' => [ + 'checkout_totals' => $this->checkoutTotalsJsLayoutDataProviderMock + ] + ] + ); + } + + /** + * Test getData() function + */ + public function testGetData() + { + $checkoutTotalsJsData = [ + 'components' => [ + 'minicart_content' => [ + 'children' => [ + 'subtotal.container' => [ + 'children' => [ + 'subtotal' => [ + 'children' => [ + 'subtotal.totals' => [ + 'config' => [ + 'display_cart_subtotal_incl_tax' => 1, + 'display_cart_subtotal_excl_tax' => 1 + ] + ], + ], + ], + ], + ], + ], + ], + ] + ]; + $this->checkoutTotalsJsLayoutDataProviderMock->expects($this->any()) + ->method('getData') + ->willReturn($checkoutTotalsJsData); + + $this->assertEquals($checkoutTotalsJsData, $this->jsLayoutDataProviderPool->getData()); + } +} From bad9717027a4b4a54eb427ed5915b9315f045034 Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Wed, 11 Dec 2019 13:43:45 +0200 Subject: [PATCH 485/595] MC-29417: hide_from_product_page not working for import using store views --- .../Model/Import/Product.php | 51 ++++++++------ .../Import/Product/MediaGalleryProcessor.php | 20 +++--- .../Model/Import/ProductTest.php | 70 +++++++++++++++++-- ...mport_change_image_label_for_storeview.csv | 2 + .../import_hide_image_for_storeview.csv | 2 + 5 files changed, 111 insertions(+), 34 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_change_image_label_for_storeview.csv create mode 100644 dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_hide_image_for_storeview.csv diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index 8f70ea88f4ba7..7ebc397cbe650 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -1569,6 +1569,13 @@ protected function _saveProducts() continue; } + $storeId = !empty($rowData[self::COL_STORE]) + ? $this->getStoreIdByCode($rowData[self::COL_STORE]) + : Store::DEFAULT_STORE_ID; + $rowExistingImages = $existingImages[$storeId][$rowSku] ?? []; + $rowStoreMediaGalleryValues = $rowExistingImages; + $rowExistingImages += $existingImages[Store::DEFAULT_STORE_ID][$rowSku] ?? []; + if (self::SCOPE_STORE == $rowScope) { // set necessary data from SCOPE_DEFAULT row $rowData[self::COL_TYPE] = $this->skuProcessor->getNewSku($rowSku)['type_id']; @@ -1672,19 +1679,16 @@ protected function _saveProducts() // 5. Media gallery phase list($rowImages, $rowLabels) = $this->getImagesFromRow($rowData); - $storeId = !empty($rowData[self::COL_STORE]) - ? $this->getStoreIdByCode($rowData[self::COL_STORE]) - : Store::DEFAULT_STORE_ID; $imageHiddenStates = $this->getImagesHiddenStates($rowData); foreach (array_keys($imageHiddenStates) as $image) { - if (array_key_exists($rowSku, $existingImages) - && array_key_exists($image, $existingImages[$rowSku]) - ) { - $rowImages[self::COL_MEDIA_IMAGE][] = $image; + //Mark image as uploaded if it exists + if (array_key_exists($image, $rowExistingImages)) { $uploadedImages[$image] = $image; } - - if (empty($rowImages)) { + //Add image to hide to images list if it does not exist + if (empty($rowImages[self::COL_MEDIA_IMAGE]) + || !in_array($image, $rowImages[self::COL_MEDIA_IMAGE]) + ) { $rowImages[self::COL_MEDIA_IMAGE][] = $image; } } @@ -1725,24 +1729,29 @@ protected function _saveProducts() continue; } - if (isset($existingImages[$rowSku][$uploadedFile])) { - $currentFileData = $existingImages[$rowSku][$uploadedFile]; + if (isset($rowExistingImages[$uploadedFile])) { + $currentFileData = $rowExistingImages[$uploadedFile]; + $currentFileData['store_id'] = $storeId; + $storeMediaGalleryValueExists = isset($rowStoreMediaGalleryValues[$uploadedFile]); + if (array_key_exists($uploadedFile, $imageHiddenStates) + && $currentFileData['disabled'] != $imageHiddenStates[$uploadedFile] + ) { + $imagesForChangeVisibility[] = [ + 'disabled' => $imageHiddenStates[$uploadedFile], + 'imageData' => $currentFileData, + 'exists' => $storeMediaGalleryValueExists + ]; + $storeMediaGalleryValueExists = true; + } + if (isset($rowLabels[$column][$columnImageKey]) && $rowLabels[$column][$columnImageKey] != $currentFileData['label'] ) { $labelsForUpdate[] = [ 'label' => $rowLabels[$column][$columnImageKey], - 'imageData' => $currentFileData - ]; - } - - if (array_key_exists($uploadedFile, $imageHiddenStates) - && $currentFileData['disabled'] != $imageHiddenStates[$uploadedFile] - ) { - $imagesForChangeVisibility[] = [ - 'disabled' => $imageHiddenStates[$uploadedFile], - 'imageData' => $currentFileData + 'imageData' => $currentFileData, + 'exists' => $storeMediaGalleryValueExists ]; } } else { diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product/MediaGalleryProcessor.php b/app/code/Magento/CatalogImportExport/Model/Import/Product/MediaGalleryProcessor.php index 00e6da0ebe077..bd8523a4e396e 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product/MediaGalleryProcessor.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product/MediaGalleryProcessor.php @@ -12,7 +12,6 @@ use Magento\Framework\App\ResourceConnection; use Magento\Framework\EntityManager\MetadataPool; use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface; -use Magento\Store\Model\Store; /** * Process and saves images during import. @@ -179,13 +178,15 @@ private function updateMediaGalleryField(array $data, $field) $insertData = []; foreach ($data as $datum) { $imageData = $datum['imageData']; + $exists = $datum['exists'] ?? true; - if ($imageData[$field] === null) { + if (!$exists) { $insertData[] = [ $field => $datum[$field], $this->getProductEntityLinkField() => $imageData[$this->getProductEntityLinkField()], 'value_id' => $imageData['value_id'], - 'store_id' => Store::DEFAULT_STORE_ID, + 'store_id' => $imageData['store_id'], + 'position' => $imageData['position'], ]; } else { $this->connection->update( @@ -196,7 +197,7 @@ private function updateMediaGalleryField(array $data, $field) [ $this->getProductEntityLinkField() . ' = ?' => $imageData[$this->getProductEntityLinkField()], 'value_id = ?' => $imageData['value_id'], - 'store_id = ?' => Store::DEFAULT_STORE_ID, + 'store_id = ?' => $imageData['store_id'], ] ); } @@ -240,14 +241,15 @@ public function getExistingImages(array $bunch) )->joinLeft( ['mgv' => $this->mediaGalleryValueTableName], sprintf( - '(mg.value_id = mgv.value_id AND mgv.%s = mgvte.%s AND mgv.store_id = %d)', + '(mgv.%s = mgvte.%s AND mg.value_id = mgv.value_id)', $this->getProductEntityLinkField(), - $this->getProductEntityLinkField(), - Store::DEFAULT_STORE_ID + $this->getProductEntityLinkField() ), [ + 'store_id' => 'mgv.store_id', 'label' => 'mgv.label', 'disabled' => 'mgv.disabled', + 'position' => 'mgv.position', ] )->joinInner( ['pe' => $this->productEntityTableName], @@ -259,7 +261,9 @@ public function getExistingImages(array $bunch) ); foreach ($this->connection->fetchAll($select) as $image) { - $result[$image['sku']][$image['value']] = $image; + $storeId = $image['store_id']; + unset($image['store_id']); + $result[$storeId][$image['sku']][$image['value']] = $image; } return $result; diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php index 3a039217d61fc..c47a4f340f983 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php @@ -29,6 +29,7 @@ use Magento\ImportExport\Model\Import; use Magento\ImportExport\Model\Import\Source\Csv; use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManagerInterface; use Magento\UrlRewrite\Model\ResourceModel\UrlRewriteCollection; use Psr\Log\LoggerInterface; use Magento\TestFramework\Helper\Bootstrap as BootstrapHelper; @@ -386,14 +387,14 @@ public function testSaveCustomOptions(string $importFile, string $sku, int $expe public function testSaveCustomOptionsWithMultipleStoreViews() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var \Magento\Store\Model\StoreManagerInterface $storeManager */ - $storeManager = $objectManager->get(\Magento\Store\Model\StoreManagerInterface::class); + /** @var StoreManagerInterface $storeManager */ + $storeManager = $objectManager->get(StoreManagerInterface::class); $storeCodes = [ 'admin', 'default', 'secondstore', ]; - /** @var \Magento\Store\Model\StoreManagerInterface $storeManager */ + /** @var StoreManagerInterface $storeManager */ $importFile = 'product_with_custom_options_and_multiple_store_views.csv'; $sku = 'simple'; $pathToFile = __DIR__ . '/_files/' . $importFile; @@ -1187,7 +1188,7 @@ public function testProductsWithMultipleStores() $product->load($id); $this->assertEquals('1', $product->getHasOptions()); - $objectManager->get(\Magento\Store\Model\StoreManagerInterface::class)->setCurrentStore('fixturestore'); + $objectManager->get(StoreManagerInterface::class)->setCurrentStore('fixturestore'); /** @var \Magento\Catalog\Model\Product $simpleProduct */ $simpleProduct = $objectManager->create(\Magento\Catalog\Model\Product::class); @@ -2246,13 +2247,20 @@ function ($output, $error) { * Load product by given product sku * * @param string $sku + * @param mixed $store * @return \Magento\Catalog\Model\Product */ - private function getProductBySku($sku) + private function getProductBySku($sku, $store = null) { $resource = $this->objectManager->get(\Magento\Catalog\Model\ResourceModel\Product::class); $productId = $resource->getIdBySku($sku); $product = $this->objectManager->create(\Magento\Catalog\Model\Product::class); + if ($store) { + /** @var StoreManagerInterface $storeManager */ + $storeManager = $this->objectManager->get(StoreManagerInterface::class); + $store = $storeManager->getStore($store); + $product->setStoreId($store->getId()); + } $product->load($productId); return $product; @@ -2773,4 +2781,56 @@ public function testProductBaseImageAfterImport() $productAfterImport = $this->getProductBySku('simple_new'); $this->assertNotEquals('/no/exists/image/magento_image.jpg', $productAfterImport->getData('image')); } + + /** + * Tests that images are hidden only for a store view in "store_view_code". + * + * @magentoDataFixture mediaImportImageFixture + * @magentoDataFixture Magento/Store/_files/core_fixturestore.php + * @magentoDataFixture Magento/Catalog/_files/product_with_image.php + */ + public function testHideImageForStoreView() + { + $expectedImageFile = '/m/a/magento_image.jpg'; + $secondStoreCode = 'fixturestore'; + $productSku = 'simple'; + $this->importDataForMediaTest('import_hide_image_for_storeview.csv'); + $product = $this->getProductBySku($productSku); + $imageItems = $product->getMediaGalleryImages()->getItems(); + $this->assertCount(1, $imageItems); + $imageItem = array_shift($imageItems); + $this->assertEquals($expectedImageFile, $imageItem->getFile()); + $product = $this->getProductBySku($productSku, $secondStoreCode); + $imageItems = $product->getMediaGalleryImages()->getItems(); + $this->assertCount(0, $imageItems); + } + + /** + * Test that images labels are updated only for a store view in "store_view_code". + * + * @magentoDataFixture mediaImportImageFixture + * @magentoDataFixture Magento/Store/_files/core_fixturestore.php + * @magentoDataFixture Magento/Catalog/_files/product_with_image.php + */ + public function testChangeImageLabelForStoreView() + { + $expectedImageFile = '/m/a/magento_image.jpg'; + $expectedLabelForDefaultStoreView = 'Image Alt Text'; + $expectedLabelForSecondStoreView = 'Magento Logo'; + $secondStoreCode = 'fixturestore'; + $productSku = 'simple'; + $this->importDataForMediaTest('import_change_image_label_for_storeview.csv'); + $product = $this->getProductBySku($productSku); + $imageItems = $product->getMediaGalleryImages()->getItems(); + $this->assertCount(1, $imageItems); + $imageItem = array_shift($imageItems); + $this->assertEquals($expectedImageFile, $imageItem->getFile()); + $this->assertEquals($expectedLabelForDefaultStoreView, $imageItem->getLabel()); + $product = $this->getProductBySku($productSku, $secondStoreCode); + $imageItems = $product->getMediaGalleryImages()->getItems(); + $this->assertCount(1, $imageItems); + $imageItem = array_shift($imageItems); + $this->assertEquals($expectedImageFile, $imageItem->getFile()); + $this->assertEquals($expectedLabelForSecondStoreView, $imageItem->getLabel()); + } } diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_change_image_label_for_storeview.csv b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_change_image_label_for_storeview.csv new file mode 100644 index 0000000000000..95321df2b6b01 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_change_image_label_for_storeview.csv @@ -0,0 +1,2 @@ +"sku","store_view_code","base_image", "base_image_label" +"simple","fixturestore","/m/a/magento_image.jpg", "Magento Logo" diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_hide_image_for_storeview.csv b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_hide_image_for_storeview.csv new file mode 100644 index 0000000000000..8400dc17d2a29 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/import_hide_image_for_storeview.csv @@ -0,0 +1,2 @@ +"sku","store_view_code","hide_from_product_page" +"simple","fixturestore","/m/a/magento_image.jpg" From d407e0106d0311c064af7cd988396a852a1e152d Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Wed, 11 Dec 2019 14:46:00 +0200 Subject: [PATCH 486/595] Cover magento/magento2#25556 with jasmine test --- .../js/jasmine/tests/lib/mage/browser.test.js | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 dev/tests/js/jasmine/tests/lib/mage/browser.test.js diff --git a/dev/tests/js/jasmine/tests/lib/mage/browser.test.js b/dev/tests/js/jasmine/tests/lib/mage/browser.test.js new file mode 100644 index 0000000000000..2c60497ce1bcc --- /dev/null +++ b/dev/tests/js/jasmine/tests/lib/mage/browser.test.js @@ -0,0 +1,62 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'mage/adminhtml/browser', + 'jquery' +], function (browser, $) { + 'use strict'; + + var obj; + + beforeEach(function () { + + /** + * Dummy constructor to use for instantiation + * @constructor + */ + var Constr = function () {}; + + Constr.prototype = browser; + + obj = new Constr(); + }); + + describe('"openDialog" method', function () { + it('Opens dialog with provided targetElementId', function () { + var options = { + 'targetElementId': 1 + }; + + spyOn($, 'ajax').and.callFake( + function () { + return { + done: function (data) { + obj.targetElementId = 1; + } + } + }); + obj.openDialog('instance/url', 100, 100, 'title', options); + obj.openDialog('instance/url', 100, 100, 'title', options); + expect($.ajax.calls.count()).toBe(1); + + }); + + it('Opens dialog with provided url param', function () { + spyOn($, 'ajax').and.callFake( + function () { + return { + done: function (data) { + obj.targetElementId = 'instance/url'; + obj.modalLoaded = true; + } + } + }); + obj.openDialog('instance/url', 100, 100, 'title', undefined); + obj.openDialog('instance/url', 100, 100, 'title', undefined); + expect($.ajax.calls.count()).toBe(1); + }); + }); +}); From 47e3ada764fc943fc63d88671ce10b2877fe57d0 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Mon, 25 Nov 2019 12:57:40 +0200 Subject: [PATCH 487/595] MC-4242: Newsletter subscriptions per website --- .../Mftf/Test/SearchEntityResultsTest.xml | 3 + .../Customer/Block/Account/Dashboard.php | 47 +- .../Customer/Block/Account/Dashboard/Info.php | 51 +- .../Block/Adminhtml/Edit/Tab/Newsletter.php | 371 +++++++--- .../Adminhtml/Edit/Tab/Newsletter/Grid.php | 105 ++- .../Form/Element/Newsletter/Subscriptions.php | 161 +++++ .../Adminhtml/Index/MassSubscribe.php | 18 +- .../Adminhtml/Index/MassUnsubscribe.php | 17 +- .../Controller/Adminhtml/Index/Save.php | 158 +++-- ...CustomerSubscribeNewsletterActionGroup.xml | 34 + ...CustomerSubscribeNewsletterActionGroup.xml | 36 + .../AdminEditCustomerNewsletterSection.xml | 4 +- ...stomerOnStorefrontSignupNewsletterTest.xml | 2 +- ...tomerSubscribeNewsletterPerWebsiteTest.xml | 101 +++ .../Adminhtml/Edit/Tab/NewsletterTest.php | 346 +++++++--- .../Element/Newsletter/SubscriptionsTest.php | 185 +++++ .../Adminhtml/Index/MassSubscribeTest.php | 118 ++-- .../Adminhtml/Index/MassUnsubscribeTest.php | 118 ++-- .../Controller/Adminhtml/Index/SaveTest.php | 348 +++++----- .../adminhtml/templates/tab/newsletter.phtml | 1 + .../Customer/ChangeSubscriptionStatus.php | 48 -- .../Model/Customer/CreateCustomerAccount.php | 25 +- .../Model/Customer/UpdateCustomerAccount.php | 23 +- .../Newsletter/Controller/Manage/Save.php | 29 +- .../Controller/Subscriber/NewAction.php | 54 +- .../Model/Plugin/CustomerPlugin.php | 281 ++++++-- .../Model/ResourceModel/Queue/Collection.php | 25 + .../Model/ResourceModel/Subscriber.php | 144 ++-- .../Magento/Newsletter/Model/Subscriber.php | 634 +++++++---------- .../Newsletter/Model/SubscriptionManager.php | 314 +++++++++ .../Model/SubscriptionManagerInterface.php | 51 ++ .../Unit/Model/Plugin/CustomerPluginTest.php | 389 ++++++----- .../Test/Unit/Model/SubscriberTest.php | 517 +++++++------- .../Unit/Model/SubscriptionManagerTest.php | 651 ++++++++++++++++++ app/code/Magento/Newsletter/etc/di.xml | 7 + app/code/Magento/Store/Model/System/Store.php | 62 +- .../web/css/source/_module.less | 30 + .../Adminhtml/Edit/Tab/NewsletterTest.php | 3 +- .../Controller/Adminhtml/IndexTest.php | 3 +- 39 files changed, 3817 insertions(+), 1697 deletions(-) create mode 100644 app/code/Magento/Customer/Block/Adminhtml/Form/Element/Newsletter/Subscriptions.php create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminAssertCustomerSubscribeNewsletterActionGroup.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerSubscribeNewsletterActionGroup.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/AdminCustomerSubscribeNewsletterPerWebsiteTest.xml create mode 100644 app/code/Magento/Customer/Test/Unit/Block/Adminhtml/From/Element/Newsletter/SubscriptionsTest.php delete mode 100644 app/code/Magento/CustomerGraphQl/Model/Customer/ChangeSubscriptionStatus.php create mode 100644 app/code/Magento/Newsletter/Model/SubscriptionManager.php create mode 100644 app/code/Magento/Newsletter/Model/SubscriptionManagerInterface.php create mode 100644 app/code/Magento/Newsletter/Test/Unit/Model/SubscriptionManagerTest.php diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml index 3b60e4b09de28..40a02d2ce24f3 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml @@ -308,6 +308,9 @@ <createData entity="_defaultProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> </createData> + <!-- Perform reindex and flush cache --> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" arguments="full_page" stepKey="flushCache"/> </before> <after> <deleteData stepKey="deleteProduct" createDataKey="createSimpleProduct"/> diff --git a/app/code/Magento/Customer/Block/Account/Dashboard.php b/app/code/Magento/Customer/Block/Account/Dashboard.php index 8e0f79d45770a..547074d0bcd81 100644 --- a/app/code/Magento/Customer/Block/Account/Dashboard.php +++ b/app/code/Magento/Customer/Block/Account/Dashboard.php @@ -7,6 +7,14 @@ use Magento\Customer\Api\AccountManagementInterface; use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\AddressInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Model\Session; +use Magento\Framework\Phrase; +use Magento\Framework\View\Element\Template; +use Magento\Framework\View\Element\Template\Context; +use Magento\Newsletter\Model\Subscriber; +use Magento\Newsletter\Model\SubscriberFactory; /** * Customer dashboard block @@ -14,20 +22,20 @@ * @api * @since 100.0.2 */ -class Dashboard extends \Magento\Framework\View\Element\Template +class Dashboard extends Template { /** - * @var \Magento\Newsletter\Model\Subscriber + * @var Subscriber */ protected $subscription; /** - * @var \Magento\Customer\Model\Session + * @var Session */ protected $customerSession; /** - * @var \Magento\Newsletter\Model\SubscriberFactory + * @var SubscriberFactory */ protected $subscriberFactory; @@ -42,19 +50,17 @@ class Dashboard extends \Magento\Framework\View\Element\Template protected $customerAccountManagement; /** - * Constructor - * - * @param \Magento\Framework\View\Element\Template\Context $context - * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory + * @param Context $context + * @param Session $customerSession + * @param SubscriberFactory $subscriberFactory * @param CustomerRepositoryInterface $customerRepository * @param AccountManagementInterface $customerAccountManagement * @param array $data */ public function __construct( - \Magento\Framework\View\Element\Template\Context $context, - \Magento\Customer\Model\Session $customerSession, - \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, + Context $context, + Session $customerSession, + SubscriberFactory $subscriberFactory, CustomerRepositoryInterface $customerRepository, AccountManagementInterface $customerAccountManagement, array $data = [] @@ -69,7 +75,7 @@ public function __construct( /** * Return the Customer given the customer Id stored in the session. * - * @return \Magento\Customer\Api\Data\CustomerInterface + * @return CustomerInterface */ public function getCustomer() { @@ -99,7 +105,7 @@ public function getAddressesUrl() /** * Retrieve the Url for editing the specified address. * - * @param \Magento\Customer\Api\Data\AddressInterface $address + * @param AddressInterface $address * @return string */ public function getAddressEditUrl($address) @@ -146,13 +152,14 @@ public function getWishlistUrl() /** * Retrieve the subscription object (i.e. the subscriber). * - * @return \Magento\Newsletter\Model\Subscriber + * @return Subscriber */ public function getSubscriptionObject() { if ($this->subscription === null) { - $this->subscription = - $this->_createSubscriber()->loadByCustomerId($this->customerSession->getCustomerId()); + $websiteId = (int)$this->_storeManager->getWebsite()->getId(); + $this->subscription = $this->_createSubscriber(); + $this->subscription->loadByCustomer((int)$this->getCustomer()->getId(), $websiteId); } return $this->subscription; @@ -171,7 +178,7 @@ public function getManageNewsletterUrl() /** * Retrieve subscription text, either subscribed or not. * - * @return \Magento\Framework\Phrase + * @return Phrase */ public function getSubscriptionText() { @@ -185,7 +192,7 @@ public function getSubscriptionText() /** * Retrieve the customer's primary addresses (i.e. default billing and shipping). * - * @return \Magento\Customer\Api\Data\AddressInterface[]|bool + * @return AddressInterface[]|bool */ public function getPrimaryAddresses() { @@ -230,7 +237,7 @@ public function getBackUrl() /** * Create an instance of a subscriber. * - * @return \Magento\Newsletter\Model\Subscriber + * @return Subscriber */ protected function _createSubscriber() { diff --git a/app/code/Magento/Customer/Block/Account/Dashboard/Info.php b/app/code/Magento/Customer/Block/Account/Dashboard/Info.php index 87132c3afb8bc..a48c706124c92 100644 --- a/app/code/Magento/Customer/Block/Account/Dashboard/Info.php +++ b/app/code/Magento/Customer/Block/Account/Dashboard/Info.php @@ -5,7 +5,15 @@ */ namespace Magento\Customer\Block\Account\Dashboard; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Block\Form\Register; +use Magento\Customer\Helper\Session\CurrentCustomer; +use Magento\Customer\Helper\View; use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\View\Element\Template; +use Magento\Framework\View\Element\Template\Context; +use Magento\Newsletter\Model\Subscriber; +use Magento\Newsletter\Model\SubscriberFactory; /** * Dashboard Customer Info @@ -13,44 +21,44 @@ * @api * @since 100.0.2 */ -class Info extends \Magento\Framework\View\Element\Template +class Info extends Template { /** * Cached subscription object * - * @var \Magento\Newsletter\Model\Subscriber + * @var Subscriber */ protected $_subscription; /** - * @var \Magento\Newsletter\Model\SubscriberFactory + * @var SubscriberFactory */ protected $_subscriberFactory; /** - * @var \Magento\Customer\Helper\View + * @var View */ protected $_helperView; /** - * @var \Magento\Customer\Helper\Session\CurrentCustomer + * @var CurrentCustomer */ protected $currentCustomer; /** * Constructor * - * @param \Magento\Framework\View\Element\Template\Context $context - * @param \Magento\Customer\Helper\Session\CurrentCustomer $currentCustomer - * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory - * @param \Magento\Customer\Helper\View $helperView + * @param Context $context + * @param CurrentCustomer $currentCustomer + * @param SubscriberFactory $subscriberFactory + * @param View $helperView * @param array $data */ public function __construct( - \Magento\Framework\View\Element\Template\Context $context, - \Magento\Customer\Helper\Session\CurrentCustomer $currentCustomer, - \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, - \Magento\Customer\Helper\View $helperView, + Context $context, + CurrentCustomer $currentCustomer, + SubscriberFactory $subscriberFactory, + View $helperView, array $data = [] ) { $this->currentCustomer = $currentCustomer; @@ -62,7 +70,7 @@ public function __construct( /** * Returns the Magento Customer Model for this block * - * @return \Magento\Customer\Api\Data\CustomerInterface|null + * @return CustomerInterface|null */ public function getCustomer() { @@ -84,6 +92,8 @@ public function getName() } /** + * Get the url to change password + * * @return string */ public function getChangePasswordUrl() @@ -94,7 +104,7 @@ public function getChangePasswordUrl() /** * Get Customer Subscription Object Information * - * @return \Magento\Newsletter\Model\Subscriber + * @return Subscriber */ public function getSubscriptionObject() { @@ -102,7 +112,8 @@ public function getSubscriptionObject() $this->_subscription = $this->_createSubscriber(); $customer = $this->getCustomer(); if ($customer) { - $this->_subscription->loadByCustomerId($customer->getId()); + $websiteId = (int)$this->_storeManager->getWebsite()->getId(); + $this->_subscription->loadByCustomer((int)$customer->getId(), $websiteId); } } return $this->_subscription; @@ -128,12 +139,14 @@ public function getIsSubscribed() public function isNewsletterEnabled() { return $this->getLayout() - ->getBlockSingleton(\Magento\Customer\Block\Form\Register::class) + ->getBlockSingleton(Register::class) ->isNewsletterEnabled(); } /** - * @return \Magento\Newsletter\Model\Subscriber + * Create new instance of Subscriber + * + * @return Subscriber */ protected function _createSubscriber() { @@ -141,7 +154,7 @@ protected function _createSubscriber() } /** - * @return string + * @inheritdoc */ protected function _toHtml() { diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php index 46a8dcfb28f1b..0d94a01698b31 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php @@ -5,14 +5,30 @@ */ namespace Magento\Customer\Block\Adminhtml\Edit\Tab; +use Magento\Backend\Block\Template\Context; +use Magento\Backend\Block\Widget\Form\Generic; use Magento\Customer\Api\AccountManagementInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Block\Adminhtml\Form\Element\Newsletter\Subscriptions as SubscriptionsElement; use Magento\Customer\Controller\RegistryConstants; +use Magento\Customer\Model\Config\Share; +use Magento\Framework\Data\Form; +use Magento\Framework\Data\Form\Element\Fieldset; +use Magento\Framework\Data\FormFactory; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Registry; +use Magento\Newsletter\Model\Subscriber; +use Magento\Newsletter\Model\SubscriberFactory; +use Magento\Store\Model\System\Store as SystemStore; use Magento\Ui\Component\Layout\Tabs\TabInterface; /** * Customer account form block + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Newsletter extends \Magento\Backend\Block\Widget\Form\Generic implements TabInterface +class Newsletter extends Generic implements TabInterface { /** * @var string @@ -20,7 +36,7 @@ class Newsletter extends \Magento\Backend\Block\Widget\Form\Generic implements T protected $_template = 'Magento_Customer::tab/newsletter.phtml'; /** - * @var \Magento\Newsletter\Model\SubscriberFactory + * @var SubscriberFactory */ protected $_subscriberFactory; @@ -32,37 +48,57 @@ class Newsletter extends \Magento\Backend\Block\Widget\Form\Generic implements T /** * Core registry * - * @var \Magento\Framework\Registry + * @var Registry */ protected $_coreRegistry = null; /** - * Constructor - * - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Framework\Registry $registry - * @param \Magento\Framework\Data\FormFactory $formFactory - * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory + * @var SystemStore + */ + private $systemStore; + + /** + * @var CustomerRepositoryInterface + */ + private $customerRepository; + + /** + * @var Share + */ + private $shareConfig; + + /** + * @param Context $context + * @param Registry $registry + * @param FormFactory $formFactory + * @param SubscriberFactory $subscriberFactory * @param AccountManagementInterface $customerAccountManagement + * @param SystemStore $systemStore + * @param CustomerRepositoryInterface $customerRepository + * @param Share $shareConfig * @param array $data */ public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Framework\Registry $registry, - \Magento\Framework\Data\FormFactory $formFactory, - \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, + Context $context, + Registry $registry, + FormFactory $formFactory, + SubscriberFactory $subscriberFactory, AccountManagementInterface $customerAccountManagement, + SystemStore $systemStore, + CustomerRepositoryInterface $customerRepository, + Share $shareConfig, array $data = [] ) { $this->_subscriberFactory = $subscriberFactory; $this->customerAccountManagement = $customerAccountManagement; parent::__construct($context, $registry, $formFactory, $data); + $this->systemStore = $systemStore; + $this->customerRepository = $customerRepository; + $this->shareConfig = $shareConfig; } /** - * Return Tab label - * - * @return \Magento\Framework\Phrase + * @inheritdoc */ public function getTabLabel() { @@ -70,9 +106,7 @@ public function getTabLabel() } /** - * Return Tab title - * - * @return \Magento\Framework\Phrase + * @inheritdoc */ public function getTabTitle() { @@ -80,9 +114,7 @@ public function getTabTitle() } /** - * Tab class getter - * - * @return string + * @inheritdoc */ public function getTabClass() { @@ -90,9 +122,7 @@ public function getTabClass() } /** - * Return URL link to Tab content - * - * @return string + * @inheritdoc */ public function getTabUrl() { @@ -100,9 +130,7 @@ public function getTabUrl() } /** - * Tab should be loaded trough Ajax call - * - * @return bool + * @inheritdoc */ public function isAjaxLoaded() { @@ -110,19 +138,15 @@ public function isAjaxLoaded() } /** - * Can show tab in tabs - * - * @return boolean + * @inheritdoc */ public function canShowTab() { - return $this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID); + return (bool)$this->getCurrentCustomerId(); } /** - * Tab is hidden - * - * @return boolean + * @inheritdoc */ public function isHidden() { @@ -130,77 +154,256 @@ public function isHidden() } /** - * Initialize the form. + * @inheritdoc + */ + protected function _prepareForm() + { + $this->initForm(); + + return $this; + } + + /** + * Init form values * * @return $this - * @SuppressWarnings(PHPMD.NPathComplexity) */ public function initForm() { if (!$this->canShowTab()) { return $this; } - /**@var \Magento\Framework\Data\Form $form */ + $form = $this->_formFactory->create(); $form->setHtmlIdPrefix('_newsletter'); - $customerId = $this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID); - $subscriber = $this->_subscriberFactory->create()->loadByCustomerId($customerId); - $this->_coreRegistry->register('subscriber', $subscriber, true); + $this->setForm($form); + $fieldset = $form->addFieldset( + 'base_fieldset', + [ + 'legend' => __('Newsletter Information'), + 'class' => 'customer-newsletter-fieldset' . (!$this->isSingleWebsiteMode() ? ' multi-website' : ''), + ] + ); - $fieldset = $form->addFieldset('base_fieldset', ['legend' => __('Newsletter Information')]); + $customerSubscriptions = $this->getCustomerSubscriptionsOnWebsites(); + if (empty($customerSubscriptions)) { + return $this; + } - $fieldset->addField( - 'subscription', + if ($this->isSingleWebsiteMode()) { + $this->prepareFormSingleWebsite($fieldset, $customerSubscriptions); + $this->updateFromSession($form, $this->getCurrentCustomerId()); + } else { + $this->prepareFormMultiplyWebsite($fieldset, $customerSubscriptions); + } + + if ($this->customerAccountManagement->isReadonly($this->getCurrentCustomerId())) { + $fieldset->setReadonly(true, true); + } + + return $this; + } + + /** + * Prepare form fields for single website mode + * + * @param Fieldset $fieldset + * @param array $subscriptions + * @return void + */ + private function prepareFormSingleWebsite(Fieldset $fieldset, array $subscriptions): void + { + $customer = $this->getCurrentCustomer(); + $websiteId = (int)$this->_storeManager->getStore($customer->getStoreId())->getWebsiteId(); + $customerSubscription = $subscriptions[$websiteId] ?? $this->retrieveSubscriberData($customer, $websiteId); + + $checkboxElement = $fieldset->addField( + 'subscription_status_' . $websiteId, 'checkbox', [ 'label' => __('Subscribed to Newsletter'), - 'name' => 'subscription', + 'name' => "subscription_status[$websiteId]", 'data-form-part' => $this->getData('target_form'), - 'onchange' => 'this.value = this.checked;' + 'value' => $customerSubscription['status'], + 'onchange' => 'this.value = this.checked;', ] ); - - if ($this->customerAccountManagement->isReadonly($customerId)) { - $form->getElement('subscription')->setReadonly(true, true); + $checkboxElement->setIsChecked($customerSubscription['status']); + if (!$this->isSingleStoreMode()) { + $fieldset->addField( + 'subscription_store_' . $websiteId, + 'select', + [ + 'label' => __('Subscribed on Store View'), + 'name' => "subscription_store[$websiteId]", + 'data-form-part' => $this->getData('target_form'), + 'values' => $customerSubscription['store_options'], + 'value' => $customerSubscription['store_id'] ?? null, + ] + ); } - $isSubscribed = $subscriber->isSubscribed(); - $form->setValues(['subscription' => $isSubscribed ? 'true' : 'false']); - $form->getElement('subscription')->setIsChecked($isSubscribed); - - $this->updateFromSession($form, $customerId); - - $changedDate = $this->getStatusChangedDate(); - if ($changedDate) { + if (!empty($customerSubscription['last_updated'])) { + $text = $customerSubscription['status'] ? __('Last Date Subscribed') : __('Last Date Unsubscribed'); $fieldset->addField( - 'change_status_date', + 'change_status_date_' . $websiteId, 'label', [ - 'label' => $isSubscribed ? __('Last Date Subscribed') : __('Last Date Unsubscribed'), - 'value' => $changedDate, + 'label' => $text, + 'value' => $customerSubscription['last_updated'], 'bold' => true ] ); } + } - $this->setForm($form); - return $this; + /** + * Prepare form fields for multiply website mode + * + * @param Fieldset $fieldset + * @param array $subscriptions + * @return void + */ + private function prepareFormMultiplyWebsite(Fieldset $fieldset, array $subscriptions): void + { + $fieldset->addType('customer_subscription', SubscriptionsElement::class); + $fieldset->addField( + 'subscription', + 'customer_subscription', + [ + 'label' => __('Subscribed to Newsletter'), + 'name' => 'subscription', + 'subscriptions' => $subscriptions, + 'target_form' => $this->getData('target_form'), + 'class' => 'newsletter-subscriptions', + 'customer_id' => $this->getCurrentCustomerId(), + ] + ); + } + + /** + * Get current customer id + * + * @return int + */ + private function getCurrentCustomerId(): int + { + return (int)$this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID); + } + + /** + * Get current customer model + * + * @return CustomerInterface|null + */ + private function getCurrentCustomer(): ?CustomerInterface + { + $customerId = $this->getCurrentCustomerId(); + try { + $customer = $this->customerRepository->getById($customerId); + } catch (NoSuchEntityException $e) { + return null; + } + + return $customer; + } + + /** + * Get Customer Subscriptions on Websites + * + * @return array + */ + private function getCustomerSubscriptionsOnWebsites(): array + { + $customer = $this->getCurrentCustomer(); + if ($customer === null) { + return []; + } + + $subscriptions = []; + foreach ($this->_storeManager->getWebsites() as $website) { + /** Skip websites without stores */ + if ($website->getStoresCount() === 0) { + continue; + } + $websiteId = (int)$website->getId(); + $subscriptions[$websiteId] = $this->retrieveSubscriberData($customer, $websiteId); + } + + return $subscriptions; + } + + /** + * Retrieve subscriber data + * + * @param CustomerInterface $customer + * @param int $websiteId + * @return array + */ + private function retrieveSubscriberData(CustomerInterface $customer, int $websiteId): array + { + $subscriber = $this->_subscriberFactory->create()->loadByCustomer((int)$customer->getId(), $websiteId); + $storeOptions = $this->systemStore->getStoreOptionsTree(false, [], [], [$websiteId]); + $subscriberData = $subscriber->getData(); + $subscriberData['last_updated'] = $this->getSubscriberStatusChangeDate($subscriber); + $subscriberData['website_id'] = $websiteId; + $subscriberData['website_name'] = $this->systemStore->getWebsiteName($websiteId); + $subscriberData['status'] = $subscriber->isSubscribed(); + $subscriberData['store_options'] = $storeOptions; + + return $subscriberData; + } + + /** + * Is single systemStore mode + * + * @return bool + */ + private function isSingleStoreMode(): bool + { + return $this->_storeManager->isSingleStoreMode(); + } + + /** + * Is single website mode + * + * @return bool + */ + private function isSingleWebsiteMode(): bool + { + return $this->isSingleStoreMode() + || !$this->shareConfig->isGlobalScope() + || count($this->_storeManager->getWebsites()) === 1; } /** * Update form elements from session data * - * @param \Magento\Framework\Data\Form $form + * @param Form $form * @param int $customerId * @return void */ - protected function updateFromSession(\Magento\Framework\Data\Form $form, $customerId) + protected function updateFromSession(Form $form, $customerId) { + if (!$this->isSingleWebsiteMode()) { + return; + } $data = $this->_backendSession->getCustomerFormData(); - if (!empty($data)) { - $dataCustomerId = isset($data['customer']['entity_id']) ? $data['customer']['entity_id'] : null; - if (isset($data['subscription']) && $dataCustomerId == $customerId) { - $form->getElement('subscription')->setIsChecked($data['subscription']); - } + $sessionCustomerId = $data['customer']['entity_id'] ?? null; + if ($sessionCustomerId === null || (int)$sessionCustomerId !== (int)$customerId) { + return; + } + + $websiteId = (int)$this->getCurrentCustomer()->getWebsiteId(); + $statusSessionValue = $data['subscription_status'][$websiteId] ?? null; + if ($statusSessionValue !== null) { + $subscribeElement = $form->getElement('subscription_status_' . $websiteId); + $subscribeElement->setValue($statusSessionValue); + $subscribeElement->setChecked($statusSessionValue); + } + $storeSessionValue = $data['subscription_store'][$websiteId] ?? null; + $storeElement = $form->getElement('subscription_store_' . $websiteId); + if ($storeSessionValue !== null && $storeElement !== null) { + $storeElement->setValue($storeSessionValue); } } @@ -211,28 +414,32 @@ protected function updateFromSession(\Magento\Framework\Data\Form $form, $custom */ public function getStatusChangedDate() { - $subscriber = $this->_coreRegistry->registry('subscriber'); - if ($subscriber->getChangeStatusAt()) { - return $this->formatDate( - $subscriber->getChangeStatusAt(), - \IntlDateFormatter::MEDIUM, - true - ); + $customer = $this->getCurrentCustomerId(); + if ($customer === null) { + return ''; } + $customerId = (int)$customer->getId(); + $subscriber = $this->_subscriberFactory->create()->loadByCustomer($customerId, (int)$customer->getWebsiteId()); - return null; + return $this->getSubscriberStatusChangeDate($subscriber); } /** + * Retrieve the date when the subscriber status changed + * + * @param Subscriber $subscriber * @return string */ - protected function _toHtml() + private function getSubscriberStatusChangeDate(Subscriber $subscriber): string { - if ($this->canShowTab()) { - $this->initForm(); - return parent::_toHtml(); - } else { + if (empty($subscriber->getChangeStatusAt())) { return ''; } + + return $this->formatDate( + $subscriber->getChangeStatusAt(), + \IntlDateFormatter::MEDIUM, + true + ); } } diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter/Grid.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter/Grid.php index 4f49c3ba1db9b..97582fbdb19b2 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter/Grid.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter/Grid.php @@ -5,47 +5,75 @@ */ namespace Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter; +use Magento\Backend\Block\Template\Context; +use Magento\Backend\Block\Widget\Grid\Extended; +use Magento\Backend\Helper\Data; +use Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter\Grid\Renderer\Action; +use Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter\Grid\Renderer\Status; +use Magento\Customer\Controller\RegistryConstants; +use Magento\Customer\Model\Config\Share; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\Registry; +use Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory; +use Magento\Store\Model\System\Store as SystemStore; + /** * Adminhtml newsletter queue grid block * * @api * @since 100.0.2 */ -class Grid extends \Magento\Backend\Block\Widget\Grid\Extended +class Grid extends Extended { /** * Core registry * - * @var \Magento\Framework\Registry|null + * @var Registry|null */ protected $_coreRegistry = null; /** - * @var \Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory + * @var CollectionFactory */ protected $_collectionFactory; /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Backend\Helper\Data $backendHelper - * @param \Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory $collectionFactory - * @param \Magento\Framework\Registry $coreRegistry + * @var Share + */ + private $shareConfig; + + /** + * @var SystemStore + */ + private $systemStore; + + /** + * @param Context $context + * @param Data $backendHelper + * @param CollectionFactory $collectionFactory + * @param Registry $coreRegistry * @param array $data + * @param Share|null $shareConfig + * @param SystemStore|null $systemStore */ public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Backend\Helper\Data $backendHelper, - \Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory $collectionFactory, - \Magento\Framework\Registry $coreRegistry, - array $data = [] + Context $context, + Data $backendHelper, + CollectionFactory $collectionFactory, + Registry $coreRegistry, + array $data = [], + Share $shareConfig = null, + SystemStore $systemStore = null ) { $this->_coreRegistry = $coreRegistry; $this->_collectionFactory = $collectionFactory; parent::__construct($context, $backendHelper, $data); + $this->shareConfig = $shareConfig ?? ObjectManager::getInstance()->get(Share::class); + $this->systemStore = $systemStore ?? ObjectManager::getInstance()->get(SystemStore::class); } /** - * @return void + * @inheritdoc */ protected function _construct() { @@ -60,7 +88,7 @@ protected function _construct() } /** - * @return string + * @inheritdoc */ public function getGridUrl() { @@ -68,22 +96,19 @@ public function getGridUrl() } /** - * @return $this + * @inheritdoc */ protected function _prepareCollection() { - /** @var $collection \Magento\Newsletter\Model\ResourceModel\Queue\Collection */ - $collection = $this->_collectionFactory->create()->addTemplateInfo()->addSubscriberFilter( - $this->_coreRegistry->registry('subscriber')->getId() - ); - + $customerId = $this->getCurrentCustomerId(); + $collection = $this->_collectionFactory->create()->addTemplateInfo()->addCustomerFilter($customerId); $this->setCollection($collection); return parent::_prepareCollection(); } /** - * @return $this + * @inheritdoc */ protected function _prepareColumns() { @@ -132,6 +157,19 @@ protected function _prepareColumns() ['header' => __('Subject'), 'align' => 'center', 'index' => 'template_subject'] ); + if ($this->isMultiplyWebsiteMode()) { + $this->addColumn( + 'store_view', + [ + 'header' => __('Store View'), + 'align' => 'center', + 'index' => 'subscriber_store_id', + 'type' => 'options', + 'option_groups' => $this->systemStore->getStoreValuesForForm(), + ] + ); + } + $this->addColumn( 'status', [ @@ -139,7 +177,7 @@ protected function _prepareColumns() 'align' => 'center', 'filter' => \Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter\Grid\Filter\Status::class, 'index' => 'queue_status', - 'renderer' => \Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter\Grid\Renderer\Status::class + 'renderer' => Status::class ] ); @@ -150,10 +188,31 @@ protected function _prepareColumns() 'align' => 'center', 'filter' => false, 'sortable' => false, - 'renderer' => \Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter\Grid\Renderer\Action::class + 'renderer' => Action::class ] ); return parent::_prepareColumns(); } + + /** + * Get current customer id + * + * @return int + */ + private function getCurrentCustomerId(): int + { + return (int)$this->_coreRegistry->registry(RegistryConstants::CURRENT_CUSTOMER_ID); + } + + /** + * Is multiply website mode + * + * @return bool + */ + private function isMultiplyWebsiteMode(): bool + { + return $this->shareConfig->isGlobalScope() + && count($this->_storeManager->getWebsites()) > 1; + } } diff --git a/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Newsletter/Subscriptions.php b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Newsletter/Subscriptions.php new file mode 100644 index 0000000000000..e9686daa3e3ab --- /dev/null +++ b/app/code/Magento/Customer/Block/Adminhtml/Form/Element/Newsletter/Subscriptions.php @@ -0,0 +1,161 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Customer\Block\Adminhtml\Form\Element\Newsletter; + +use Magento\Framework\App\Request\DataPersistorInterface; +use Magento\Framework\Data\Form\Element\AbstractElement; +use Magento\Framework\Data\Form\Element\CollectionFactory; +use Magento\Framework\Data\Form\Element\Factory; +use Magento\Framework\Escaper; + +/** + * Customer Newsletter Subscriptions Element + */ +class Subscriptions extends AbstractElement +{ + /** + * @var DataPersistorInterface + */ + private $dataPersistor; + + /** + * @param Factory $factoryElement + * @param CollectionFactory $factoryCollection + * @param Escaper $escaper + * @param DataPersistorInterface $dataPersistor + * @param array $data + */ + public function __construct( + Factory $factoryElement, + CollectionFactory $factoryCollection, + Escaper $escaper, + DataPersistorInterface $dataPersistor, + $data = [] + ) { + $this->dataPersistor = $dataPersistor; + parent::__construct($factoryElement, $factoryCollection, $escaper, $data); + } + + /** + * @inheritdoc + */ + public function getElementHtml() + { + $websiteHeader = $this->_escape(__('Website')); + $subscribedHeader = $this->_escape(__('Subscribed')); + $storeHeader = $this->_escape(__('Store View')); + $lastUpdatedHeader = $this->_escape(__('Last Updated At')); + $bodyHtml = ''; + foreach ($this->getData('subscriptions') as $subscriptions) { + $storeId = !empty($subscriptions['store_id']) ? (int)$subscriptions['store_id'] : null; + $websiteId = (int)$subscriptions['website_id']; + $websiteName = $this->_escape($subscriptions['website_name']); + $subscribed = (bool)$subscriptions['status']; + $options = (array)$subscriptions['store_options']; + $statusElement = $this->getSubscriptionStatusElementHtml($websiteId, $subscribed); + $storeSelectElement = $this->getStoreSelectElementHtml($websiteId, $options, $storeId); + $lastUpdated = !empty($subscriptions['last_updated']) ? $subscriptions['last_updated'] : ''; + + $bodyHtml .= "<tr><td>{$websiteName}</td><td class=\"subscriber-status\">$statusElement</td>" + . "<td>$storeSelectElement</td><td>$lastUpdated</td></tr>"; + } + $html = '<table class="admin__table-secondary">' + . "<tr><th>{$websiteHeader}</th><th class=\"subscriber-status\">{$subscribedHeader}</th>" + . "<th>{$storeHeader}</th><th>{$lastUpdatedHeader}</th></tr>" + . $bodyHtml + . '</table>'; + + return $html; + } + + /** + * Get store select element html + * + * @param int $websiteId + * @param array $options + * @param int|null $value + * @return string + */ + private function getStoreSelectElementHtml(int $websiteId, array $options, ?int $value): string + { + $name = $this->getData('name'); + $value = $this->getSessionFormValue("{$name}_store", $websiteId) ?? $value; + $elementId = $name . '_store_' . $websiteId; + $element = $this->_factoryElement->create( + 'select', + [ + 'data' => [ + 'name' => "{$name}_store[$websiteId]", + 'data-form-part' => $this->getData('target_form'), + 'values' => $options, + 'value' => $value, + 'required' => true, + ], + ] + ); + $element->setId($elementId); + $element->setForm($this->getForm()); + if ($this->getReadonly()) { + $element->setReadonly($this->getReadonly(), $this->getDisabled()); + } + + return $element->toHtml(); + } + + /** + * Get subscription status element html + * + * @param int $websiteId + * @param bool $value + * @return string + */ + private function getSubscriptionStatusElementHtml(int $websiteId, bool $value): string + { + $name = $this->getData('name'); + $value = $this->getSessionFormValue("{$name}_status", $websiteId) ?? $value; + $elementId = $name . '_status_' . $websiteId; + $element = $this->_factoryElement->create( + 'checkbox', + [ + 'data' => [ + 'name' => "{$name}_status[$websiteId]", + 'data-form-part' => $this->getData('target_form'), + 'value' => $value, + 'onchange' => 'this.value = this.checked;', + ], + ] + ); + $element->setId($elementId); + $element->setForm($this->getForm()); + $element->setIsChecked($value); + if ($this->getReadonly()) { + $element->setReadonly($this->getReadonly(), $this->getDisabled()); + } + + return $element->toHtml(); + } + + /** + * Get form data value from current session + * + * @param string $name + * @param int $arrayKey + * @return string|null + */ + private function getSessionFormValue(string $name, int $arrayKey): ?string + { + $data = $this->dataPersistor->get('customer_form'); + $currentCustomerId = $this->getData('customer_id'); + $sessionCustomerId = $data['customer']['entity_id'] ?? null; + if ($sessionCustomerId === null || $currentCustomerId !== (int)$sessionCustomerId) { + return null; + } + + return $data[$name][$arrayKey] ?? null; + } +} diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassSubscribe.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassSubscribe.php index 29a66bf1ff933..881c5caebcbee 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassSubscribe.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassSubscribe.php @@ -7,10 +7,10 @@ use Magento\Backend\App\Action\Context; use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; +use Magento\Newsletter\Model\SubscriptionManagerInterface; use Magento\Ui\Component\MassAction\Filter; use Magento\Customer\Model\ResourceModel\Customer\CollectionFactory; use Magento\Customer\Api\CustomerRepositoryInterface; -use Magento\Newsletter\Model\SubscriberFactory; use Magento\Eav\Model\Entity\Collection\AbstractCollection; use Magento\Framework\Controller\ResultFactory; @@ -25,27 +25,27 @@ class MassSubscribe extends AbstractMassAction implements HttpPostActionInterfac protected $customerRepository; /** - * @var SubscriberFactory + * @var SubscriptionManagerInterface */ - protected $subscriberFactory; + private $subscriptionManager; /** * @param Context $context * @param Filter $filter * @param CollectionFactory $collectionFactory * @param CustomerRepositoryInterface $customerRepository - * @param SubscriberFactory $subscriberFactory + * @param SubscriptionManagerInterface $subscriptionManager */ public function __construct( Context $context, Filter $filter, CollectionFactory $collectionFactory, CustomerRepositoryInterface $customerRepository, - SubscriberFactory $subscriberFactory + SubscriptionManagerInterface $subscriptionManager ) { parent::__construct($context, $filter, $collectionFactory); $this->customerRepository = $customerRepository; - $this->subscriberFactory = $subscriberFactory; + $this->subscriptionManager = $subscriptionManager; } /** @@ -58,9 +58,9 @@ protected function massAction(AbstractCollection $collection) { $customersUpdated = 0; foreach ($collection->getAllIds() as $customerId) { - // Verify customer exists - $this->customerRepository->getById($customerId); - $this->subscriberFactory->create()->subscribeCustomerById($customerId); + $customer = $this->customerRepository->getById($customerId); + $storeId = (int)$customer->getStoreId(); + $this->subscriptionManager->subscribeCustomer($customerId, $storeId); $customersUpdated++; } diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php index fddf18489b9a5..17f420d864df0 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php @@ -9,7 +9,7 @@ use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; use Magento\Framework\Controller\ResultFactory; use Magento\Backend\App\Action\Context; -use Magento\Newsletter\Model\SubscriberFactory; +use Magento\Newsletter\Model\SubscriptionManagerInterface; use Magento\Ui\Component\MassAction\Filter; use Magento\Customer\Model\ResourceModel\Customer\CollectionFactory; use Magento\Eav\Model\Entity\Collection\AbstractCollection; @@ -25,27 +25,27 @@ class MassUnsubscribe extends AbstractMassAction implements HttpPostActionInterf protected $customerRepository; /** - * @var SubscriberFactory + * @var SubscriptionManagerInterface */ - protected $subscriberFactory; + private $subscriptionManager; /** * @param Context $context * @param Filter $filter * @param CollectionFactory $collectionFactory * @param CustomerRepositoryInterface $customerRepository - * @param SubscriberFactory $subscriberFactory + * @param SubscriptionManagerInterface $subscriptionManager */ public function __construct( Context $context, Filter $filter, CollectionFactory $collectionFactory, CustomerRepositoryInterface $customerRepository, - SubscriberFactory $subscriberFactory + SubscriptionManagerInterface $subscriptionManager ) { parent::__construct($context, $filter, $collectionFactory); $this->customerRepository = $customerRepository; - $this->subscriberFactory = $subscriberFactory; + $this->subscriptionManager = $subscriptionManager; } /** @@ -59,8 +59,9 @@ protected function massAction(AbstractCollection $collection) $customersUpdated = 0; foreach ($collection->getAllIds() as $customerId) { // Verify customer exists - $this->customerRepository->getById($customerId); - $this->subscriberFactory->create()->unsubscribeCustomerById($customerId); + $customer = $this->customerRepository->getById($customerId); + $storeId = (int)$customer->getStoreId(); + $this->subscriptionManager->unsubscribeCustomer($customerId, $storeId); $customersUpdated++; } diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php index 3ee33af9ec073..b85b735ea9c4f 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php @@ -5,25 +5,45 @@ */ namespace Magento\Customer\Controller\Adminhtml\Index; +use Magento\Backend\App\Action\Context; +use Magento\Backend\Model\View\Result\ForwardFactory; +use Magento\Backend\Model\View\Result\Redirect; use Magento\Customer\Api\AccountManagementInterface; +use Magento\Customer\Api\AddressMetadataInterface; use Magento\Customer\Api\AddressRepositoryInterface; +use Magento\Customer\Api\CustomerMetadataInterface; use Magento\Customer\Api\CustomerRepositoryInterface; -use Magento\Customer\Model\Address\Mapper; -use Magento\Customer\Model\AddressRegistry; -use Magento\Framework\Api\DataObjectHelper; use Magento\Customer\Api\Data\AddressInterfaceFactory; -use Magento\Customer\Api\Data\CustomerInterfaceFactory; -use Magento\Framework\DataObjectFactory as ObjectFactory; -use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; -use Magento\Customer\Api\AddressMetadataInterface; -use Magento\Customer\Api\CustomerMetadataInterface; +use Magento\Customer\Api\Data\AttributeMetadataInterface; use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Api\Data\CustomerInterfaceFactory; use Magento\Customer\Controller\RegistryConstants; +use Magento\Customer\Helper\View; +use Magento\Customer\Model\Address\Mapper; +use Magento\Customer\Model\AddressFactory; +use Magento\Customer\Model\AddressRegistry; +use Magento\Customer\Model\CustomerFactory; use Magento\Customer\Model\EmailNotificationInterface; use Magento\Customer\Model\Metadata\Form; +use Magento\Customer\Model\Metadata\FormFactory; +use Magento\Framework\Api\DataObjectHelper; +use Magento\Framework\Api\ExtensibleDataObjectConverter; +use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\App\Response\Http\FileFactory; +use Magento\Framework\Controller\Result\JsonFactory; +use Magento\Framework\DataObject; +use Magento\Framework\DataObjectFactory as ObjectFactory; +use Magento\Framework\Exception\AbstractAggregateException; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Framework\App\ObjectManager; +use Magento\Framework\Math\Random; +use Magento\Framework\Reflection\DataObjectProcessor; +use Magento\Framework\Registry; +use Magento\Framework\View\Result\LayoutFactory; +use Magento\Framework\View\Result\PageFactory; +use Magento\Newsletter\Model\SubscriberFactory; +use Magento\Newsletter\Model\SubscriptionManagerInterface; /** * Save customer action. @@ -37,6 +57,11 @@ class Save extends \Magento\Customer\Controller\Adminhtml\Index implements HttpP */ private $emailNotification; + /** + * @var SubscriptionManagerInterface + */ + private $subscriptionManager; + /** * @var AddressRegistry */ @@ -45,60 +70,62 @@ class Save extends \Magento\Customer\Controller\Adminhtml\Index implements HttpP /** * Constructor * - * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Framework\Registry $coreRegistry - * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory - * @param \Magento\Customer\Model\CustomerFactory $customerFactory - * @param \Magento\Customer\Model\AddressFactory $addressFactory - * @param \Magento\Customer\Model\Metadata\FormFactory $formFactory - * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory - * @param \Magento\Customer\Helper\View $viewHelper - * @param \Magento\Framework\Math\Random $random + * @param Context $context + * @param Registry $coreRegistry + * @param FileFactory $fileFactory + * @param CustomerFactory $customerFactory + * @param AddressFactory $addressFactory + * @param FormFactory $formFactory + * @param SubscriberFactory $subscriberFactory + * @param View $viewHelper + * @param Random $random * @param CustomerRepositoryInterface $customerRepository - * @param \Magento\Framework\Api\ExtensibleDataObjectConverter $extensibleDataObjectConverter + * @param ExtensibleDataObjectConverter $extensibleDataObjectConverter * @param Mapper $addressMapper * @param AccountManagementInterface $customerAccountManagement * @param AddressRepositoryInterface $addressRepository * @param CustomerInterfaceFactory $customerDataFactory * @param AddressInterfaceFactory $addressDataFactory * @param \Magento\Customer\Model\Customer\Mapper $customerMapper - * @param \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor + * @param DataObjectProcessor $dataObjectProcessor * @param DataObjectHelper $dataObjectHelper * @param ObjectFactory $objectFactory * @param \Magento\Framework\View\LayoutFactory $layoutFactory - * @param \Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory - * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory - * @param \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory - * @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory + * @param LayoutFactory $resultLayoutFactory + * @param PageFactory $resultPageFactory + * @param ForwardFactory $resultForwardFactory + * @param JsonFactory $resultJsonFactory + * @param SubscriptionManagerInterface $subscriptionManager * @param AddressRegistry|null $addressRegistry * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Backend\App\Action\Context $context, - \Magento\Framework\Registry $coreRegistry, - \Magento\Framework\App\Response\Http\FileFactory $fileFactory, - \Magento\Customer\Model\CustomerFactory $customerFactory, - \Magento\Customer\Model\AddressFactory $addressFactory, - \Magento\Customer\Model\Metadata\FormFactory $formFactory, - \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, - \Magento\Customer\Helper\View $viewHelper, - \Magento\Framework\Math\Random $random, + Context $context, + Registry $coreRegistry, + FileFactory $fileFactory, + CustomerFactory $customerFactory, + AddressFactory $addressFactory, + FormFactory $formFactory, + SubscriberFactory $subscriberFactory, + View $viewHelper, + Random $random, CustomerRepositoryInterface $customerRepository, - \Magento\Framework\Api\ExtensibleDataObjectConverter $extensibleDataObjectConverter, + ExtensibleDataObjectConverter $extensibleDataObjectConverter, Mapper $addressMapper, AccountManagementInterface $customerAccountManagement, AddressRepositoryInterface $addressRepository, CustomerInterfaceFactory $customerDataFactory, AddressInterfaceFactory $addressDataFactory, \Magento\Customer\Model\Customer\Mapper $customerMapper, - \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor, + DataObjectProcessor $dataObjectProcessor, DataObjectHelper $dataObjectHelper, ObjectFactory $objectFactory, \Magento\Framework\View\LayoutFactory $layoutFactory, - \Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory, - \Magento\Framework\View\Result\PageFactory $resultPageFactory, - \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory, - \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory, + LayoutFactory $resultLayoutFactory, + PageFactory $resultPageFactory, + ForwardFactory $resultForwardFactory, + JsonFactory $resultJsonFactory, + SubscriptionManagerInterface $subscriptionManager, AddressRegistry $addressRegistry = null ) { parent::__construct( @@ -128,6 +155,7 @@ public function __construct( $resultForwardFactory, $resultJsonFactory ); + $this->subscriptionManager = $subscriptionManager; $this->addressRegistry = $addressRegistry ?: ObjectManager::getInstance()->get(AddressRegistry::class); } @@ -186,7 +214,7 @@ protected function _extractData( $formData = $metadataForm->compactData($formData); // Initialize additional attributes - /** @var \Magento\Framework\DataObject $object */ + /** @var DataObject $object */ $object = $this->_objectFactory->create(['data' => $this->getRequest()->getPostValue()]); $requestData = $object->getData($scope); foreach ($additionalAttributes as $attributeCode) { @@ -196,7 +224,7 @@ protected function _extractData( // Unset unused attributes $formAttributes = $metadataForm->getAttributes(); foreach ($formAttributes as $attribute) { - /** @var \Magento\Customer\Api\Data\AttributeMetadataInterface $attribute */ + /** @var AttributeMetadataInterface $attribute */ $attributeCode = $attribute->getAttributeCode(); if ($attribute->getFrontendInput() != 'boolean' && $formData[$attributeCode] === false @@ -281,7 +309,7 @@ protected function _extractCustomerAddressData(array & $extractedCustomerData) /** * Save customer action * - * @return \Magento\Backend\Model\View\Result\Redirect + * @return Redirect * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.ExcessiveMethodLength) * @SuppressWarnings(PHPMD.NPathComplexity) @@ -312,7 +340,7 @@ public function execute() $this->dataObjectHelper->populateWithArray( $customer, $customerData, - \Magento\Customer\Api\Data\CustomerInterface::class + CustomerInterface::class ); $this->_eventManager->dispatch( @@ -334,17 +362,7 @@ public function execute() $customerId = $customer->getId(); } - $isSubscribed = null; - if ($this->_authorization->isAllowed(null)) { - $isSubscribed = $this->getRequest()->getPost('subscription'); - } - if ($isSubscribed !== null) { - if ($isSubscribed !== '0') { - $this->_subscriberFactory->create()->subscribeCustomerById($customerId); - } else { - $this->_subscriberFactory->create()->unsubscribeCustomerById($customerId); - } - } + $this->updateSubscriptions($customer); // After save $this->_eventManager->dispatch( @@ -364,7 +382,7 @@ public function execute() $this->_addSessionErrorMessages($messages); $this->_getSession()->setCustomerFormData($this->retrieveFormattedFormData()); $returnToEdit = true; - } catch (\Magento\Framework\Exception\AbstractAggregateException $exception) { + } catch (AbstractAggregateException $exception) { $errors = $exception->getErrors(); $messages = []; foreach ($errors as $error) { @@ -406,6 +424,34 @@ public function execute() return $resultRedirect; } + /** + * Update customer website subscriptions + * + * @param CustomerInterface $customer + * @return void + */ + private function updateSubscriptions(CustomerInterface $customer): void + { + if (!$this->_authorization->isAllowed(null)) { + return; + } + + $subscriptionStatus = (array)$this->getRequest()->getParam('subscription_status'); + $subscriptionStore = (array)$this->getRequest()->getParam('subscription_store'); + if (empty($subscriptionStatus)) { + return; + } + + foreach ($subscriptionStatus as $websiteId => $status) { + $storeId = $subscriptionStore[$websiteId] ?? $customer->getStoreId(); + if ($status) { + $this->subscriptionManager->subscribeCustomer((int)$customer->getId(), $storeId); + } else { + $this->subscriptionManager->unsubscribeCustomer((int)$customer->getId(), $storeId); + } + } + } + /** * Get email notification * @@ -415,7 +461,7 @@ public function execute() private function getEmailNotification() { if (!($this->emailNotification instanceof EmailNotificationInterface)) { - return \Magento\Framework\App\ObjectManager::getInstance()->get( + return ObjectManager::getInstance()->get( EmailNotificationInterface::class ); } else { diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminAssertCustomerSubscribeNewsletterActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminAssertCustomerSubscribeNewsletterActionGroup.xml new file mode 100644 index 0000000000000..49373bb7bebf9 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminAssertCustomerSubscribeNewsletterActionGroup.xml @@ -0,0 +1,34 @@ +<?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="AdminAssertCustomerIsSubscribedToNewsletters"> + <annotations> + <description>Verify that check box "Newsletter subscribed" is checked on "Newsletter" tab on customer edit page.</description> + </annotations> + <arguments> + <argument name="websiteId" type="string" defaultValue="1"/> + </arguments> + + <click selector="{{AdminEditCustomerInformationSection.newsLetter}}" stepKey="clickToNewsletterTabHeader"/> + <waitForPageLoad stepKey="waitForShowNewsletterTab"/> + <seeCheckboxIsChecked selector="{{AdminEditCustomerNewsletterSection.subscribedStatus(websiteId)}}" stepKey="assertSubscribedToNewsletter"/> + </actionGroup> + + <actionGroup name="AdminAssertCustomerIsSubscribedToNewslettersAndSelectedStoreView" extends="AdminAssertCustomerIsSubscribedToNewsletters"> + <annotations> + <description>Verify that check box "Newsletter subscribed" is checked and Store View is selected on "Newsletter" tab on customer edit page.</description> + </annotations> + <arguments> + <argument name="storeView"/> + </arguments> + + <seeOptionIsSelected selector="{{AdminEditCustomerNewsletterSection.subscribedStore(websiteId)}}" userInput="{{storeView.name}}" stepKey="assertSubscribedStoreView" after="assertSubscribedToNewsletter"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerSubscribeNewsletterActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerSubscribeNewsletterActionGroup.xml new file mode 100644 index 0000000000000..49ea772569cc0 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerSubscribeNewsletterActionGroup.xml @@ -0,0 +1,36 @@ +<?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="AdminSubscribeCustomerToNewsletters"> + <annotations> + <description>Set checkbox "Newsletter subscribed" on "Newsletter" tab on customer edit page.</description> + </annotations> + <arguments> + <argument name="websiteId" type="string" defaultValue="1"/> + </arguments> + + <click selector="{{AdminEditCustomerInformationSection.newsLetter}}" stepKey="clickToNewsletterTabHeader"/> + <waitForPageLoad stepKey="waitForShowNewsletterTab"/> + <checkOption selector="{{AdminEditCustomerNewsletterSection.subscribedStatus(websiteId)}}" stepKey="subscribeToNewsletter"/> + <click selector="{{AdminCustomerMainActionsSection.saveAndContinue}}" stepKey="saveAndContinue"/> + <waitForPageLoad stepKey="waitForSaving"/> + <see userInput="You saved the customer." stepKey="seeSuccessMessage"/> + </actionGroup> + + <actionGroup name="AdminSubscribeCustomerToNewslettersAndSelectStoreView" extends="AdminSubscribeCustomerToNewsletters"> + <annotations> + <description>Set checkbox "Newsletter subscribed" and select Store View on "Newsletter" tab on customer edit page.</description> + </annotations> + <arguments> + <argument name="storeView"/> + </arguments> + <selectOption selector="{{AdminEditCustomerNewsletterSection.subscribedStore(websiteId)}}" userInput="{{storeView.name}}" stepKey="selectSubscribeStoreView" after="subscribeToNewsletter"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerNewsletterSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerNewsletterSection.xml index 51b4b54c5c8b6..e6bdf2819e2a5 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerNewsletterSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerNewsletterSection.xml @@ -9,6 +9,8 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminEditCustomerNewsletterSection"> - <element name="subscribedToNewsletter" type="checkbox" selector="//div[@class='admin__field-control control']/input[@name='subscription']"/> + <element name="subscribedStatus" type="checkbox" selector="//div[@class='admin__field-control control']//input[@name='subscription_status[{{websiteId}}]']" parameterized="true"/> + <element name="subscribedStore" type="select" selector="//div[@class='admin__field-control control']//select[@name='subscription_store[{{websiteId}}]']" parameterized="true"/> + <element name="subscribedLastUpdatedDate" type="text" selector="//div[@class='admin__field-control control']//div[@class='field-change_status_date_{{websiteId}}']//div[@class='control-value']" parameterized="true"/> </section> </sections> \ No newline at end of file diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontSignupNewsletterTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontSignupNewsletterTest.xml index 22ad60ff5de34..5d09f819bcbc0 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontSignupNewsletterTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontSignupNewsletterTest.xml @@ -49,6 +49,6 @@ <waitForPageLoad stepKey="waitForEditLinkLoad"/> <click selector="{{AdminEditCustomerInformationSection.newsLetter}}" stepKey="clickNewsLetter"/> <waitForPageLoad stepKey="waitForNewsletterTabToOpen"/> - <seeCheckboxIsChecked selector="{{AdminEditCustomerNewsletterSection.subscribedToNewsletter}}" stepKey="seeAssertSubscribedToNewsletterCheckboxIsChecked"/> + <seeCheckboxIsChecked selector="{{AdminEditCustomerNewsletterSection.subscribedStatus('1')}}" stepKey="seeAssertSubscribedToNewsletterCheckboxIsChecked"/> </test> </tests> \ No newline at end of file diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomerSubscribeNewsletterPerWebsiteTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomerSubscribeNewsletterPerWebsiteTest.xml new file mode 100644 index 0000000000000..6c1a27c395917 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomerSubscribeNewsletterPerWebsiteTest.xml @@ -0,0 +1,101 @@ +<?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="AdminCustomerSubscribeNewsletterPerWebsiteTest"> + <annotations> + <features value="Customer"/> + <stories value="Customer Subscriptions"/> + <title value="Newsletter subscriptions per website"/> + <description value="Admin should be able to subscribe customer to newsletters on each website separately"/> + <testCaseId value="MC-22173"/> + <severity value="MAJOR"/> + <group value="customer"/> + </annotations> + <before> + <createData entity="CustomerAccountSharingGlobal" stepKey="setConfigCustomerAccountToGlobal"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView"> + <argument name="customStore" value="NewStoreViewData"/> + </actionGroup> + <actionGroup ref="DeleteCustomerByEmailActionGroup" stepKey="deleteCustomer"> + <argument name="email" value="{{CustomerEntityOne.email}}"/> + </actionGroup> + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> + <argument name="websiteName" value="{{secondCustomWebsite.name}}"/> + </actionGroup> + <actionGroup ref="logout" stepKey="logout"/> + <createData entity="CustomerAccountSharingDefault" stepKey="setConfigCustomerAccountDefault"/> + </after> + + <!-- Create a new Store View --> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView"> + <argument name="customStore" value="NewStoreViewData"/> + </actionGroup> + <!-- Switch to the new Store View on storefront --> + <amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnHomePage"/> + <waitForPageLoad stepKey="waitForNavigateHomePage"/> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToCustomStoreView"> + <argument name="storeView" value="NewStoreViewData"/> + </actionGroup> + <!-- Create a new customer and sign up newsletter on the new Store View --> + <actionGroup ref="StorefrontCreateCustomerSignedUpNewsletterActionGroup" stepKey="createCustomer"> + <argument name="customer" value="CustomerEntityOne" /> + </actionGroup> + <!-- Go to the customer edit page on admin area --> + <actionGroup ref="AdminFilterCustomerByEmail" stepKey="filterCustomerGrid"> + <argument name="email" value="{{CustomerEntityOne.email}}"/> + </actionGroup> + <click selector="{{AdminCustomerGridSection.firstRowEditLink}}" stepKey="clickToEditCustomerPage"/> + <waitForPageLoad stepKey="waitForOpenCustomerPage"/> + <grabFromCurrentUrl regex="~(\d+)/~" stepKey="grabCustomerId"/> + <!-- Assert that created customer is subscribed to newsletter on the new Store View --> + <actionGroup ref="AdminAssertCustomerIsSubscribedToNewslettersAndSelectedStoreView" stepKey="assertSubscribedToNewsletter"> + <argument name="storeView" value="NewStoreViewData"/> + </actionGroup> + <!-- Create second website --> + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createSecondWebsite"> + <argument name="newWebsiteName" value="{{secondCustomWebsite.name}}"/> + <argument name="websiteCode" value="{{secondCustomWebsite.code}}"/> + </actionGroup> + <!-- Create second store --> + <actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createSecondStoreGroup"> + <argument name="website" value="{{secondCustomWebsite.name}}"/> + <argument name="storeGroupName" value="{{SecondStoreGroupUnique.name}}"/> + <argument name="storeGroupCode" value="{{SecondStoreGroupUnique.code}}"/> + </actionGroup> + <!-- Create second store view --> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createSecondStoreView"> + <argument name="StoreGroup" value="SecondStoreGroupUnique"/> + <argument name="customStore" value="SecondStoreUnique"/> + </actionGroup> + <!-- Grab second website id into $grabFromCurrentUrlGetSecondWebsiteId --> + <actionGroup ref="AdminGetWebsiteIdActionGroup" stepKey="getSecondWebsiteId"> + <argument name="website" value="secondCustomWebsite"/> + </actionGroup> + <!-- Go to the customer edit page on admin area --> + <actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="openCustomerEditPage"> + <argument name="customerId" value="$grabCustomerId"/> + </actionGroup> + <!-- Assert that customer still subscribed to newsletter on default website --> + <actionGroup ref="AdminAssertCustomerIsSubscribedToNewsletters" stepKey="assertStillSubscribedToNewsletter"/> + <!-- Subscribe to newsletters customer on the second website --> + <actionGroup ref="AdminSubscribeCustomerToNewslettersAndSelectStoreView" stepKey="subscribeToNewsletterSecondWebsite"> + <argument name="websiteId" value="$grabFromCurrentUrlGetSecondWebsiteId"/> + <argument name="storeView" value="SecondStoreUnique"/> + </actionGroup> + <!-- Assert that created customer is subscribed to newsletter on second website --> + <actionGroup ref="AdminAssertCustomerIsSubscribedToNewslettersAndSelectedStoreView" stepKey="assertSubscribedToNewsletterSecondWebsite"> + <argument name="websiteId" value="$grabFromCurrentUrlGetSecondWebsiteId"/> + <argument name="storeView" value="SecondStoreUnique"/> + </actionGroup> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php index 1c252bfc75a53..22a22742cdb8d 100644 --- a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php +++ b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php @@ -3,192 +3,322 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - namespace Magento\Customer\Test\Unit\Block\Adminhtml\Edit\Tab; +use Magento\Backend\Block\Template\Context; use Magento\Backend\Model\Session; +use Magento\Customer\Api\AccountManagementInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter; use Magento\Customer\Controller\RegistryConstants; +use Magento\Customer\Model\Config\Share; +use Magento\Framework\Data\Form; +use Magento\Framework\Data\Form\Element\Checkbox; +use Magento\Framework\Data\Form\Element\Fieldset; +use \Magento\Framework\Data\Form\Element\Select; +use Magento\Framework\Data\FormFactory; +use Magento\Framework\Registry; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Framework\UrlInterface; +use Magento\Newsletter\Model\Subscriber; +use Magento\Newsletter\Model\SubscriberFactory; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManagerInterface; +use Magento\Store\Model\System\Store as SystemStore; +use Magento\Store\Model\Website; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; /** + * Test Customer account form block + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class NewsletterTest extends \PHPUnit\Framework\TestCase +class NewsletterTest extends TestCase { /** - * @var \Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter + * @var Newsletter + */ + private $model; + + /** + * @var Context|MockObject + */ + private $contextMock; + + /** + * Store manager + * + * @var StoreManagerInterface|MockObject + */ + private $storeManager; + + /** + * @var Registry|MockObject */ - protected $model; + private $registryMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var FormFactory|MockObject */ - protected $contextMock; + private $formFactoryMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var SubscriberFactory|MockObject */ - protected $registryMock; + private $subscriberFactoryMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var AccountManagementInterface|MockObject */ - protected $formFactoryMock; + private $accountManagementMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var UrlInterface|MockObject */ - protected $subscriberFactoryMock; + private $urlBuilderMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var Session|MockObject */ - protected $accountManagementMock; + private $backendSessionMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var SystemStore|MockObject */ - protected $urlBuilderMock; + private $systemStore; /** - * @var Session|\PHPUnit_Framework_MockObject_MockObject + * @var CustomerRepositoryInterface|MockObject */ - protected $backendSessionMock; + private $customerRepository; + /** + * @var Share|MockObject + */ + private $shareConfig; + + /** + * @inheritdoc + */ public function setUp() { - $this->contextMock = $this->createMock(\Magento\Backend\Block\Template\Context::class); - $this->registryMock = $this->createMock(\Magento\Framework\Registry::class); - $this->formFactoryMock = $this->createMock(\Magento\Framework\Data\FormFactory::class); + $this->contextMock = $this->createMock(Context::class); + $this->registryMock = $this->createMock(Registry::class); + $this->formFactoryMock = $this->createMock(FormFactory::class); $this->subscriberFactoryMock = $this->createPartialMock( - \Magento\Newsletter\Model\SubscriberFactory::class, + SubscriberFactory::class, ['create'] ); - $this->accountManagementMock = $this->createMock(\Magento\Customer\Api\AccountManagementInterface::class); - $this->urlBuilderMock = $this->createMock(\Magento\Framework\UrlInterface::class); - $this->backendSessionMock = $this->getMockBuilder(\Magento\Backend\Model\Session::class) + $this->accountManagementMock = $this->createMock(AccountManagementInterface::class); + $this->urlBuilderMock = $this->createMock(UrlInterface::class); + $this->storeManager = $this->createMock(StoreManagerInterface::class); + $this->backendSessionMock = $this->getMockBuilder(Session::class) ->setMethods(['getCustomerFormData']) ->disableOriginalConstructor() ->getMock(); - $this->contextMock->expects($this->once())->method('getUrlBuilder')->willReturn($this->urlBuilderMock); - $this->contextMock->expects($this->once())->method('getBackendSession')->willReturn($this->backendSessionMock); - - $this->model = new \Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter( - $this->contextMock, - $this->registryMock, - $this->formFactoryMock, - $this->subscriberFactoryMock, - $this->accountManagementMock + $this->contextMock->expects($this->once()) + ->method('getUrlBuilder') + ->willReturn($this->urlBuilderMock); + $this->contextMock->expects($this->once()) + ->method('getBackendSession') + ->willReturn($this->backendSessionMock); + $this->contextMock->method('getStoreManager') + ->willReturn($this->storeManager); + $this->systemStore = $this->createMock(SystemStore::class); + $this->customerRepository = $this->createMock(CustomerRepositoryInterface::class); + $this->shareConfig = $this->createMock(Share::class); + + $objectManager = new ObjectManager($this); + $this->model = $objectManager->getObject( + Newsletter::class, + [ + 'context' => $this->contextMock, + 'registry' => $this->registryMock, + 'formFactory' => $this->formFactoryMock, + 'subscriberFactory' => $this->subscriberFactoryMock, + 'customerAccountManagement' => $this->accountManagementMock, + 'systemStore' => $this->systemStore, + 'customerRepository' => $this->customerRepository, + 'shareConfig' => $this->shareConfig, + ] ); } + /** + * Test to initialize the form without current customer + */ public function testInitFormCanNotShowTab() { - $this->registryMock->expects($this->once())->method('registry')->with(RegistryConstants::CURRENT_CUSTOMER_ID) + $this->registryMock->expects($this->once()) + ->method('registry') + ->with(RegistryConstants::CURRENT_CUSTOMER_ID) ->willReturn(false); + $this->assertSame($this->model, $this->model->initForm()); } + /** + * Test to initialize the form + */ public function testInitForm() { $customerId = 1; + $websiteId = 1; + $storeId = 2; + $websiteName = 'Website Name'; + $isSubscribed = true; - $subscriberMock = $this->createMock(\Magento\Newsletter\Model\Subscriber::class); - $fieldsetMock = $this->createMock(\Magento\Framework\Data\Form\Element\Fieldset::class); - $elementMock = $this->createPartialMock(\Magento\Framework\Data\Form\Element\Checkbox::class, ['setIsChecked']); - $formMock = $this->createPartialMock( - \Magento\Framework\Data\Form::class, - ['setHtmlIdPrefix', 'addFieldset', 'setValues', 'getElement', 'setForm', 'setParent', 'setBaseUrl'] - ); - $this->registryMock->expects($this->exactly(3)) - ->method('registry') - ->willReturnMap( - [ - [RegistryConstants::CURRENT_CUSTOMER_ID, $customerId], - ['subscriber', $subscriberMock], - ] - ); - $this->formFactoryMock->expects($this->once())->method('create')->willReturn($formMock); - $formMock->expects($this->once())->method('setHtmlIdPrefix')->with('_newsletter'); + $this->registryMock->method('registry')->with(RegistryConstants::CURRENT_CUSTOMER_ID) + ->willReturn($customerId); + + $customer = $this->createMock(CustomerInterface::class); + $customer->method('getWebsiteId')->willReturn($websiteId); + $customer->method('getStoreId')->willReturn($storeId); + $customer->method('getId')->willReturn($customerId); + $this->customerRepository->method('getById')->with($customerId)->willReturn($customer); + $subscriberMock = $this->createMock(Subscriber::class); + $subscriberMock->method('loadByCustomer')->with($customerId, $websiteId)->willReturnSelf(); + $subscriberMock->method('isSubscribed')->willReturn($isSubscribed); + $subscriberMock->method('getData')->willReturn([]); $this->subscriberFactoryMock->expects($this->once())->method('create')->willReturn($subscriberMock); - $subscriberMock->expects($this->once())->method('loadByCustomerId')->with($customerId)->willReturnSelf(); - $this->registryMock->expects($this->once())->method('register')->with('subscriber', $subscriberMock); - $formMock->expects($this->once())->method('addFieldset')->willReturn($fieldsetMock); - $fieldsetMock->expects($this->once())->method('addField')->willReturn($elementMock); - $this->accountManagementMock->expects($this->once())->method('isReadOnly')->with($customerId) - ->willReturn(false); - $subscriberMock->expects($this->once())->method('isSubscribed')->willReturn(true); - $this->urlBuilderMock->expects($this->once())->method('getBaseUrl')->willReturn('domain.com'); - $this->backendSessionMock->expects($this->once())->method('getCustomerFormData')->willReturn(null); + $website = $this->createMock(Website::class); + $website->method('getStoresCount')->willReturn(1); + $website->method('getId')->willReturn($websiteId); + $store = $this->createMock(Store::class); + $store->method('getWebsiteId')->willReturn($websiteId); + $this->storeManager->method('getStore')->with($storeId)->willReturn($store); + $this->storeManager->method('getWebsites')->willReturn([$website]); + $this->storeManager->method('isSingleStoreMode')->willReturn(true); + $this->systemStore->method('getStoreOptionsTree')->willReturn([]); + $this->systemStore->method('getWebsiteName')->with($websiteId)->willReturn($websiteName); - $formMock->expects($this->once()) - ->method('getElement') - ->willReturnMap( + $statusElementMock = $this->createMock(Checkbox::class); + $statusElementMock->expects($this->once()) + ->method('setIsChecked') + ->with($isSubscribed); + $fieldsetMock = $this->createMock(Fieldset::class); + $fieldsetMock->expects($this->once()) + ->method('addField') + ->with( + 'subscription_status_' . $websiteId, + 'checkbox', [ - ['subscription', $elementMock], + 'label' => __('Subscribed to Newsletter'), + 'name' => "subscription_status[$websiteId]", + 'data-form-part' => null, + 'value' => $isSubscribed, + 'onchange' => 'this.value = this.checked;' ] - ); - - $elementMock->expects($this->once()) - ->method('setIsChecked') - ->with(true); + ) + ->willReturn($statusElementMock); + $fieldsetMock->expects($this->once())->method('setReadonly')->with(true, true); + $formMock = $this->createPartialMock( + Form::class, + ['setHtmlIdPrefix', 'addFieldset', 'setValues', 'getElement', 'setForm', 'setParent', 'setBaseUrl'] + ); + $formMock->expects($this->once())->method('setHtmlIdPrefix')->with('_newsletter'); + $formMock->expects($this->once())->method('addFieldset')->willReturn($fieldsetMock); + $this->formFactoryMock->expects($this->once())->method('create')->willReturn($formMock); + $this->accountManagementMock->expects($this->once()) + ->method('isReadOnly') + ->with($customerId) + ->willReturn(true); + $this->backendSessionMock->expects($this->once()) + ->method('getCustomerFormData') + ->willReturn(null); $this->assertSame($this->model, $this->model->initForm()); } + /** + * Test to initialize the form with session form data + */ public function testInitFormWithCustomerFormData() { $customerId = 1; + $websiteId = 1; + $storeId = 2; + $websiteName = 'Website Name'; + $isSubscribed = true; + $isSubscribedCustomerSession = false; - $subscriberMock = $this->createMock(\Magento\Newsletter\Model\Subscriber::class); - $fieldsetMock = $this->createMock(\Magento\Framework\Data\Form\Element\Fieldset::class); - $elementMock = $this->createPartialMock(\Magento\Framework\Data\Form\Element\Checkbox::class, ['setIsChecked']); + $this->registryMock->method('registry')->with(RegistryConstants::CURRENT_CUSTOMER_ID) + ->willReturn($customerId); + $customer = $this->createMock(CustomerInterface::class); + $customer->method('getWebsiteId')->willReturn($websiteId); + $customer->method('getStoreId')->willReturn($storeId); + $customer->method('getId')->willReturn($customerId); + $this->customerRepository->method('getById')->with($customerId)->willReturn($customer); + $subscriberMock = $this->createMock(Subscriber::class); + $subscriberMock->method('loadByCustomer')->with($customerId, $websiteId)->willReturnSelf(); + $subscriberMock->method('isSubscribed')->willReturn($isSubscribed); + $subscriberMock->method('getData')->willReturn([]); + $this->subscriberFactoryMock->expects($this->once())->method('create')->willReturn($subscriberMock); + $website = $this->createMock(Website::class); + $website->method('getStoresCount')->willReturn(1); + $website->method('getId')->willReturn($websiteId); + $store = $this->createMock(Store::class); + $store->method('getWebsiteId')->willReturn($websiteId); + $this->storeManager->method('getStore')->with($storeId)->willReturn($store); + $this->storeManager->method('getWebsites')->willReturn([$website]); + $this->storeManager->method('isSingleStoreMode')->willReturn(true); + $this->systemStore->method('getStoreOptionsTree')->willReturn([]); + $this->systemStore->method('getWebsiteName')->with($websiteId)->willReturn($websiteName); + $statusElementMock = $this->createMock(Checkbox::class); + $statusElementMock->expects($this->once()) + ->method('setIsChecked') + ->with($isSubscribed); + $fieldsetMock = $this->createMock(Fieldset::class); + $fieldsetMock->expects($this->once()) + ->method('addField') + ->with( + 'subscription_status_' . $websiteId, + 'checkbox', + [ + 'label' => __('Subscribed to Newsletter'), + 'name' => "subscription_status[$websiteId]", + 'data-form-part' => null, + 'value' => $isSubscribed, + 'onchange' => 'this.value = this.checked;' + ] + ) + ->willReturn($statusElementMock); + $fieldsetMock->expects($this->once())->method('setReadonly')->with(true, true); + $statusElementForm = $this->createPartialMock(Checkbox::class, ['setChecked', 'setValue']); + $statusElementForm->method('setValue') + ->with($isSubscribedCustomerSession); + $statusElementForm->method('setChecked') + ->with($isSubscribedCustomerSession); + $storeElementForm = $this->createPartialMock(Select::class, ['setValue']); + $storeElementForm->method('setValue') + ->with(Store::DEFAULT_STORE_ID); $formMock = $this->createPartialMock( - \Magento\Framework\Data\Form::class, + Form::class, ['setHtmlIdPrefix', 'addFieldset', 'setValues', 'getElement', 'setForm', 'setParent', 'setBaseUrl'] ); - $this->registryMock->expects($this->exactly(3)) - ->method('registry') + $formMock->expects($this->once())->method('setHtmlIdPrefix')->with('_newsletter'); + $formMock->expects($this->once())->method('addFieldset')->willReturn($fieldsetMock); + $formMock->method('getElement') ->willReturnMap( [ - [RegistryConstants::CURRENT_CUSTOMER_ID, $customerId], - ['subscriber', $subscriberMock], + ['subscription_status_' . $websiteId, $statusElementForm], + ['subscription_store_' . $websiteId, $storeElementForm], ] ); $this->formFactoryMock->expects($this->once())->method('create')->willReturn($formMock); - $formMock->expects($this->once())->method('setHtmlIdPrefix')->with('_newsletter'); - $this->subscriberFactoryMock->expects($this->once())->method('create')->willReturn($subscriberMock); - $subscriberMock->expects($this->once())->method('loadByCustomerId')->with($customerId)->willReturnSelf(); - $formMock->expects($this->once())->method('addFieldset')->willReturn($fieldsetMock); - $fieldsetMock->expects($this->once())->method('addField')->willReturn($elementMock); - $this->accountManagementMock->expects($this->once())->method('isReadOnly')->with($customerId) - ->willReturn(false); - $subscriberMock->expects($this->once())->method('isSubscribed')->willReturn(false); - $this->urlBuilderMock->expects($this->once())->method('getBaseUrl')->willReturn('domain.com'); - + $this->accountManagementMock->expects($this->once()) + ->method('isReadOnly') + ->with($customerId) + ->willReturn(true); $this->backendSessionMock->expects($this->once()) ->method('getCustomerFormData') - ->willReturn([ - 'customer' => [ - 'entity_id' => $customerId, - ], - 'subscription' => true, - ]); - - $formMock->expects($this->exactly(2)) - ->method('getElement') - ->willReturnMap( - [ - ['subscription', $elementMock], - ] - ); - - $elementMock->expects($this->exactly(2)) - ->method('setIsChecked') - ->willReturnMap( + ->willReturn( [ - [false], - [true], + 'customer' => ['entity_id' => $customerId], + 'subscription_status' => [$websiteId => $isSubscribedCustomerSession] ] ); diff --git a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/From/Element/Newsletter/SubscriptionsTest.php b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/From/Element/Newsletter/SubscriptionsTest.php new file mode 100644 index 0000000000000..f6d6777654c5b --- /dev/null +++ b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/From/Element/Newsletter/SubscriptionsTest.php @@ -0,0 +1,185 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Customer\Test\Unit\Block\Adminhtml\From\Element\Newsletter; + +use Magento\Customer\Block\Adminhtml\Form\Element\Newsletter\Subscriptions; +use Magento\Framework\App\Request\DataPersistorInterface; +use Magento\Framework\Data\Form\Element\AbstractElement; +use Magento\Framework\Data\Form\Element\CollectionFactory; +use Magento\Framework\Data\Form\Element\Factory; +use Magento\Framework\Escaper; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Test class for Customer Newsletter Subscriptions Element + */ +class SubscriptionsTest extends TestCase +{ + /** + * @var Factory|MockObject + */ + private $factoryElement; + + /** + * @var CollectionFactory|MockObject + */ + private $factoryCollection; + + /** + * @var Escaper|MockObject + */ + private $escaper; + + /** + * @var DataPersistorInterface|MockObject + */ + private $dataPersistor; + + /** + * @var Subscriptions + */ + private $element; + + /** + * @inheritdoc + */ + public function setUp() + { + $this->factoryElement = $this->createMock(Factory::class); + $this->factoryCollection = $this->createMock(CollectionFactory::class); + $this->escaper = $this->createMock(Escaper::class); + $this->dataPersistor = $this->createMock(DataPersistorInterface::class); + + $objectManager = new ObjectManager($this); + $this->element = $objectManager->getObject( + Subscriptions::class, + [ + 'factoryElement' => $this->factoryElement, + 'factoryCollection' => $this->factoryCollection, + 'escaper' => $this->escaper, + 'dataPersistor' => $this->dataPersistor, + 'data' => [] + ] + ); + } + + /** + * Test to Get the Html for the element + * + * @param array $data + * @param array $elementsHtml + * @param string $expectedHtml + * @return void + * @dataProvider getElementHtmlDataProvider + */ + public function testGetElementHtml(array $data, array $elementsHtml, string $expectedHtml): void + { + $this->escaper->method('escapeHtml')->withAnyParameters()->willReturnArgument(0); + $selectElementId = $data['name'] . '_store_' . $data['subscriptions'][0]['website_id']; + $selectElement = $this->createMock(AbstractElement::class); + $selectElement->expects($this->once())->method('setId')->with($selectElementId); + $selectElement->expects($this->once())->method('setForm')->willReturnSelf(); + $selectElement->method('toHtml')->willReturn($elementsHtml['store']); + $statusElementId = $data['name'] . '_status_' . $data['subscriptions'][0]['website_id']; + $statusElement = $this->createMock(AbstractElement::class); + $statusElement->expects($this->once())->method('setId')->with($statusElementId); + $statusElement->expects($this->once())->method('setForm')->willReturnSelf(); + $statusElement->method('toHtml')->willReturn($elementsHtml['status']); + $this->factoryElement->method('create')->willReturnMap( + [ + [ + 'select', + [ + 'data' => [ + 'name' => "{$data['name']}_store[{$data['subscriptions'][0]['website_id']}]", + 'data-form-part' => $data['target_form'], + 'values' => $data['subscriptions'][0]['store_options'], + 'value' => $data['subscriptions'][0]['store_id'], + 'required' => true, + ] + ], + $selectElement + ], + [ + 'checkbox', + [ + 'data' => [ + 'name' => "{$data['name']}_status[{$data['subscriptions'][0]['website_id']}]", + 'data-form-part' => $data['target_form'], + 'value' => $data['subscriptions'][0]['status'], + 'onchange' => 'this.value = this.checked;', + ] + ], + $statusElement + ] + ] + ); + $this->dataPersistor->method('get')->willReturn([]); + $this->element->setData($data); + + $this->assertEquals($expectedHtml, $this->element->getElementHtml()); + } + + /** + * Data provider for test to get the html + * + * @return array + */ + public function getElementHtmlDataProvider(): array + { + $customerId = 33; + $elementName = 'element_name'; + $targetForm = 'target_form'; + $websiteId = 1; + $websiteName = 'Website 1'; + $storeId = 2; + $status = true; + $storeOptions = ['array_of_store_options']; + $lastUpdated = 'last updated'; + $storeElementHtml = 'storeElementHtml'; + $statusElementHtml = 'statusElementHtml'; + $outputHtmlTemplate = "<table class=\"admin__table-secondary\">" + . "<tr><th>%s</th><th class=\"subscriber-status\">%s</th><th>%s</th><th>%s</th></tr>" + . "<tr><td>%s</td><td class=\"subscriber-status\">%s</td><td>%s</td><td>%s</td></tr></table>"; + + return [ + [ + 'data' => [ + 'customer_id' => $customerId, + 'name' => $elementName, + 'target_form' => $targetForm, + 'subscriptions' => [ + [ + 'store_id' => $storeId, + 'website_id' => $websiteId, + 'website_name' => $websiteName, + 'status' => $status, + 'store_options' => $storeOptions, + 'last_updated' => $lastUpdated, + ], + ], + ], + 'elementsHtml' => [ + 'status' => $statusElementHtml, + 'store' => $storeElementHtml, + ], + 'expectedHtml' => sprintf( + $outputHtmlTemplate, + 'Website', + 'Subscribed', + 'Store View', + 'Last Updated At', + $websiteName, + $statusElementHtml, + $storeElementHtml, + $lastUpdated + ) + ], + ]; + } +} diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php index 33e578224400b..8f672fbfb4da6 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php @@ -6,119 +6,130 @@ namespace Magento\Customer\Test\Unit\Controller\Adminhtml\Index; +use Magento\Backend\Model\View\Result\Redirect; +use Magento\Backend\Model\View\Result\RedirectFactory; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Controller\Adminhtml\Index\MassSubscribe; +use Magento\Customer\Model\ResourceModel\Customer\Collection; +use Magento\Customer\Model\ResourceModel\Customer\CollectionFactory; use Magento\Framework\App\Action\Context; +use Magento\Framework\App\Request\Http; +use Magento\Framework\App\ResponseInterface; +use Magento\Framework\Controller\ResultFactory; +use Magento\Framework\Message\Manager; +use Magento\Framework\ObjectManager\ObjectManager; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Newsletter\Model\SubscriptionManagerInterface; +use Magento\Ui\Component\MassAction\Filter; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; /** * Class MassSubscribeTest * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class MassSubscribeTest extends \PHPUnit\Framework\TestCase +class MassSubscribeTest extends TestCase { /** - * @var \Magento\Customer\Controller\Adminhtml\Index\MassSubscribe + * @var MassSubscribe */ protected $massAction; /** - * @var Context|\PHPUnit_Framework_MockObject_MockObject + * @var Context|MockObject */ protected $contextMock; /** - * @var \Magento\Backend\Model\View\Result\Redirect|\PHPUnit_Framework_MockObject_MockObject + * @var Redirect|MockObject */ protected $resultRedirectMock; /** - * @var \Magento\Framework\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject + * @var Http|MockObject */ protected $requestMock; /** - * @var \Magento\Framework\App\ResponseInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ResponseInterface|MockObject */ protected $responseMock; /** - * @var \Magento\Framework\Message\Manager|\PHPUnit_Framework_MockObject_MockObject + * @var Manager|MockObject */ protected $messageManagerMock; /** - * @var \Magento\Framework\ObjectManager\ObjectManager|\PHPUnit_Framework_MockObject_MockObject + * @var ObjectManager|MockObject */ protected $objectManagerMock; /** - * @var \Magento\Customer\Model\ResourceModel\Customer\Collection|\PHPUnit_Framework_MockObject_MockObject + * @var Collection|MockObject */ protected $customerCollectionMock; /** - * @var \Magento\Customer\Model\ResourceModel\Customer\CollectionFactory|\PHPUnit_Framework_MockObject_MockObject + * @var CollectionFactory|MockObject */ protected $customerCollectionFactoryMock; /** - * @var \Magento\Ui\Component\MassAction\Filter|\PHPUnit_Framework_MockObject_MockObject + * @var Filter|MockObject */ protected $filterMock; /** - * @var \Magento\Customer\Api\CustomerRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + * @var CustomerRepositoryInterface|MockObject */ protected $customerRepositoryMock; /** - * @var \Magento\Newsletter\Model\Subscriber|\PHPUnit_Framework_MockObject_MockObject + * @var SubscriptionManagerInterface|MockObject */ - protected $subscriberMock; + private $subscriptionManager; + /** + * @inheritdoc + */ protected function setUp() { $objectManagerHelper = new ObjectManagerHelper($this); $this->contextMock = $this->createMock(\Magento\Backend\App\Action\Context::class); - $resultRedirectFactory = $this->createMock(\Magento\Backend\Model\View\Result\RedirectFactory::class); - $this->responseMock = $this->createMock(\Magento\Framework\App\ResponseInterface::class); - $this->requestMock = $this->getMockBuilder(\Magento\Framework\App\Request\Http::class) + $resultRedirectFactory = $this->createMock(RedirectFactory::class); + $this->responseMock = $this->createMock(ResponseInterface::class); + $this->requestMock = $this->getMockBuilder(Http::class) ->disableOriginalConstructor()->getMock(); $this->objectManagerMock = $this->createPartialMock( - \Magento\Framework\ObjectManager\ObjectManager::class, + ObjectManager::class, ['create'] ); - $this->messageManagerMock = $this->createMock(\Magento\Framework\Message\Manager::class); + $this->messageManagerMock = $this->createMock(Manager::class); $this->customerCollectionMock = - $this->getMockBuilder(\Magento\Customer\Model\ResourceModel\Customer\Collection::class) + $this->getMockBuilder(Collection::class) ->disableOriginalConstructor() ->getMock(); $this->customerCollectionFactoryMock = - $this->getMockBuilder(\Magento\Customer\Model\ResourceModel\Customer\CollectionFactory::class) + $this->getMockBuilder(CollectionFactory::class) ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $redirectMock = $this->getMockBuilder(\Magento\Backend\Model\View\Result\Redirect::class) + $redirectMock = $this->getMockBuilder(Redirect::class) ->disableOriginalConstructor() ->getMock(); - $resultFactoryMock = $this->getMockBuilder(\Magento\Framework\Controller\ResultFactory::class) + $resultFactoryMock = $this->getMockBuilder(ResultFactory::class) ->disableOriginalConstructor() ->getMock(); $resultFactoryMock->expects($this->any()) ->method('create') - ->with(\Magento\Framework\Controller\ResultFactory::TYPE_REDIRECT) + ->with(ResultFactory::TYPE_REDIRECT) ->willReturn($redirectMock); - $this->subscriberMock = $this->createMock(\Magento\Newsletter\Model\Subscriber::class); - $subscriberFactoryMock = $this->getMockBuilder(\Magento\Newsletter\Model\SubscriberFactory::class) - ->setMethods(['create']) - ->disableOriginalConstructor() - ->getMock(); - $subscriberFactoryMock->expects($this->any()) - ->method('create') - ->willReturn($this->subscriberMock); - - $this->resultRedirectMock = $this->createMock(\Magento\Backend\Model\View\Result\Redirect::class); + $this->subscriptionManager = $this->createMock(SubscriptionManagerInterface::class); + $this->resultRedirectMock = $this->createMock(Redirect::class); $resultRedirectFactory->expects($this->any())->method('create')->willReturn($this->resultRedirectMock); $this->contextMock->expects($this->once())->method('getMessageManager')->willReturn($this->messageManagerMock); @@ -132,7 +143,7 @@ protected function setUp() ->method('getResultFactory') ->willReturn($resultFactoryMock); - $this->filterMock = $this->createMock(\Magento\Ui\Component\MassAction\Filter::class); + $this->filterMock = $this->createMock(Filter::class); $this->filterMock->expects($this->once()) ->method('getCollection') ->with($this->customerCollectionMock) @@ -140,35 +151,37 @@ protected function setUp() $this->customerCollectionFactoryMock->expects($this->once()) ->method('create') ->willReturn($this->customerCollectionMock); - $this->customerRepositoryMock = $this->getMockBuilder(\Magento\Customer\Api\CustomerRepositoryInterface::class) + $this->customerRepositoryMock = $this->getMockBuilder(CustomerRepositoryInterface::class) ->getMockForAbstractClass(); $this->massAction = $objectManagerHelper->getObject( - \Magento\Customer\Controller\Adminhtml\Index\MassSubscribe::class, + MassSubscribe::class, [ 'context' => $this->contextMock, 'filter' => $this->filterMock, 'collectionFactory' => $this->customerCollectionFactoryMock, 'customerRepository' => $this->customerRepositoryMock, - 'subscriberFactory' => $subscriberFactoryMock, + 'subscriptionManager' => $this->subscriptionManager, ] ); } + /** + * Test to mass subscribe customers to newsletters + */ public function testExecute() { - $customersIds = [10, 11, 12]; - - $this->customerCollectionMock->expects($this->any()) - ->method('getAllIds') - ->willReturn($customersIds); - - $this->customerRepositoryMock->expects($this->any()) - ->method('getById') - ->willReturnMap([[10, true], [11, true], [12, true]]); - - $this->subscriberMock->expects($this->any()) - ->method('subscribeCustomerById') - ->willReturnMap([[10, true], [11, true], [12, true]]); + $storeId = 2; + $customerId = 10; + $customersIds = [$customerId, $customerId, $customerId]; + + $this->customerCollectionMock->method('getAllIds')->willReturn($customersIds); + $customer = $this->createMock(CustomerInterface::class); + $customer->method('getStoreId')->willReturn($storeId); + $customer->method('getId')->willReturn($customerId); + $this->customerRepositoryMock->method('getById')->with($customerId)->willReturn($customer); + $this->subscriptionManager->expects($this->exactly(3)) + ->method('subscribeCustomer') + ->with($customerId, $storeId); $this->messageManagerMock->expects($this->once()) ->method('addSuccessMessage') @@ -182,6 +195,9 @@ public function testExecute() $this->massAction->execute(); } + /** + * Test to mass subscribe customers to newsletters with throws exception + */ public function testExecuteWithException() { $customersIds = [10, 11, 12]; diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php index 971efc0e490bc..303a11989236f 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php @@ -6,119 +6,130 @@ namespace Magento\Customer\Test\Unit\Controller\Adminhtml\Index; +use Magento\Backend\Model\View\Result\Redirect; +use Magento\Backend\Model\View\Result\RedirectFactory; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Controller\Adminhtml\Index\MassUnsubscribe; +use Magento\Customer\Model\ResourceModel\Customer\Collection; +use Magento\Customer\Model\ResourceModel\Customer\CollectionFactory; use Magento\Framework\App\Action\Context; +use Magento\Framework\App\Request\Http; +use Magento\Framework\App\ResponseInterface; +use Magento\Framework\Controller\ResultFactory; +use Magento\Framework\Message\Manager; +use Magento\Framework\ObjectManager\ObjectManager; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Newsletter\Model\SubscriptionManagerInterface; +use Magento\Ui\Component\MassAction\Filter; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; /** * Class MassUnsubscribeTest * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class MassUnsubscribeTest extends \PHPUnit\Framework\TestCase +class MassUnsubscribeTest extends TestCase { /** - * @var \Magento\Customer\Controller\Adminhtml\Index\MassUnsubscribe + * @var MassUnsubscribe */ protected $massAction; /** - * @var Context|\PHPUnit_Framework_MockObject_MockObject + * @var Context|MockObject */ protected $contextMock; /** - * @var \Magento\Backend\Model\View\Result\Redirect|\PHPUnit_Framework_MockObject_MockObject + * @var Redirect|MockObject */ protected $resultRedirectMock; /** - * @var \Magento\Framework\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject + * @var Http|MockObject */ protected $requestMock; /** - * @var \Magento\Framework\App\ResponseInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ResponseInterface|MockObject */ protected $responseMock; /** - * @var \Magento\Framework\Message\Manager|\PHPUnit_Framework_MockObject_MockObject + * @var Manager|MockObject */ protected $messageManagerMock; /** - * @var \Magento\Framework\ObjectManager\ObjectManager|\PHPUnit_Framework_MockObject_MockObject + * @var ObjectManager|MockObject */ protected $objectManagerMock; /** - * @var \Magento\Customer\Model\ResourceModel\Customer\Collection|\PHPUnit_Framework_MockObject_MockObject + * @var Collection|MockObject */ protected $customerCollectionMock; /** - * @var \Magento\Customer\Model\ResourceModel\Customer\CollectionFactory|\PHPUnit_Framework_MockObject_MockObject + * @var CollectionFactory|MockObject */ protected $customerCollectionFactoryMock; /** - * @var \Magento\Ui\Component\MassAction\Filter|\PHPUnit_Framework_MockObject_MockObject + * @var Filter|MockObject */ protected $filterMock; /** - * @var \Magento\Customer\Api\CustomerRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + * @var CustomerRepositoryInterface|MockObject */ protected $customerRepositoryMock; /** - * @var \Magento\Newsletter\Model\Subscriber|\PHPUnit_Framework_MockObject_MockObject + * @var SubscriptionManagerInterface|MockObject */ - protected $subscriberMock; + private $subscriptionManager; + /** + * @inheritdoc + */ protected function setUp() { $objectManagerHelper = new ObjectManagerHelper($this); $this->contextMock = $this->createMock(\Magento\Backend\App\Action\Context::class); - $resultRedirectFactory = $this->createMock(\Magento\Backend\Model\View\Result\RedirectFactory::class); - $this->responseMock = $this->createMock(\Magento\Framework\App\ResponseInterface::class); - $this->requestMock = $this->getMockBuilder(\Magento\Framework\App\Request\Http::class) + $resultRedirectFactory = $this->createMock(RedirectFactory::class); + $this->responseMock = $this->createMock(ResponseInterface::class); + $this->requestMock = $this->getMockBuilder(Http::class) ->disableOriginalConstructor()->getMock(); $this->objectManagerMock = $this->createPartialMock( - \Magento\Framework\ObjectManager\ObjectManager::class, + ObjectManager::class, ['create'] ); - $this->messageManagerMock = $this->createMock(\Magento\Framework\Message\Manager::class); + $this->messageManagerMock = $this->createMock(Manager::class); $this->customerCollectionMock = - $this->getMockBuilder(\Magento\Customer\Model\ResourceModel\Customer\Collection::class) + $this->getMockBuilder(Collection::class) ->disableOriginalConstructor() ->getMock(); $this->customerCollectionFactoryMock = - $this->getMockBuilder(\Magento\Customer\Model\ResourceModel\Customer\CollectionFactory::class) + $this->getMockBuilder(CollectionFactory::class) ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $redirectMock = $this->getMockBuilder(\Magento\Backend\Model\View\Result\Redirect::class) + $redirectMock = $this->getMockBuilder(Redirect::class) ->disableOriginalConstructor() ->getMock(); - $resultFactoryMock = $this->getMockBuilder(\Magento\Framework\Controller\ResultFactory::class) + $resultFactoryMock = $this->getMockBuilder(ResultFactory::class) ->disableOriginalConstructor() ->getMock(); $resultFactoryMock->expects($this->any()) ->method('create') - ->with(\Magento\Framework\Controller\ResultFactory::TYPE_REDIRECT) + ->with(ResultFactory::TYPE_REDIRECT) ->willReturn($redirectMock); - $this->subscriberMock = $this->createMock(\Magento\Newsletter\Model\Subscriber::class); - $subscriberFactoryMock = $this->getMockBuilder(\Magento\Newsletter\Model\SubscriberFactory::class) - ->setMethods(['create']) - ->disableOriginalConstructor() - ->getMock(); - $subscriberFactoryMock->expects($this->any()) - ->method('create') - ->willReturn($this->subscriberMock); - - $this->resultRedirectMock = $this->createMock(\Magento\Backend\Model\View\Result\Redirect::class); + $this->subscriptionManager = $this->createMock(SubscriptionManagerInterface::class); + $this->resultRedirectMock = $this->createMock(Redirect::class); $resultRedirectFactory->expects($this->any())->method('create')->willReturn($this->resultRedirectMock); $this->contextMock->expects($this->once())->method('getMessageManager')->willReturn($this->messageManagerMock); @@ -132,7 +143,7 @@ protected function setUp() ->method('getResultFactory') ->willReturn($resultFactoryMock); - $this->filterMock = $this->createMock(\Magento\Ui\Component\MassAction\Filter::class); + $this->filterMock = $this->createMock(Filter::class); $this->filterMock->expects($this->once()) ->method('getCollection') ->with($this->customerCollectionMock) @@ -140,35 +151,37 @@ protected function setUp() $this->customerCollectionFactoryMock->expects($this->once()) ->method('create') ->willReturn($this->customerCollectionMock); - $this->customerRepositoryMock = $this->getMockBuilder(\Magento\Customer\Api\CustomerRepositoryInterface::class) + $this->customerRepositoryMock = $this->getMockBuilder(CustomerRepositoryInterface::class) ->getMockForAbstractClass(); $this->massAction = $objectManagerHelper->getObject( - \Magento\Customer\Controller\Adminhtml\Index\MassUnsubscribe::class, + MassUnsubscribe::class, [ 'context' => $this->contextMock, 'filter' => $this->filterMock, 'collectionFactory' => $this->customerCollectionFactoryMock, 'customerRepository' => $this->customerRepositoryMock, - 'subscriberFactory' => $subscriberFactoryMock, + 'subscriptionManager' => $this->subscriptionManager, ] ); } + /** + * Test to mass unsubscribe customers from newsletters + */ public function testExecute() { - $customersIds = [10, 11, 12]; - - $this->customerCollectionMock->expects($this->any()) - ->method('getAllIds') - ->willReturn($customersIds); - - $this->customerRepositoryMock->expects($this->any()) - ->method('getById') - ->willReturnMap([[10, true], [11, true], [12, true]]); - - $this->subscriberMock->expects($this->any()) - ->method('unsubscribeCustomerById') - ->willReturnMap([[10, true], [11, true], [12, true]]); + $storeId = 2; + $customerId = 10; + $customersIds = [$customerId, $customerId, $customerId]; + + $this->customerCollectionMock->method('getAllIds')->willReturn($customersIds); + $customer = $this->createMock(CustomerInterface::class); + $customer->method('getStoreId')->willReturn($storeId); + $customer->method('getId')->willReturn($customerId); + $this->customerRepositoryMock->method('getById')->with($customerId)->willReturn($customer); + $this->subscriptionManager->expects($this->exactly(3)) + ->method('unsubscribeCustomer') + ->with($customerId, $storeId); $this->messageManagerMock->expects($this->once()) ->method('addSuccessMessage') @@ -182,6 +195,9 @@ public function testExecute() $this->massAction->execute(); } + /** + * Test to mass unsubscribe customers to newsletters with throws exception + */ public function testExecuteWithException() { $customersIds = [10, 11, 12]; diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/SaveTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/SaveTest.php index 9724ac13dde8c..2e729873961c0 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/SaveTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/SaveTest.php @@ -5,13 +5,45 @@ */ namespace Magento\Customer\Test\Unit\Controller\Adminhtml\Index; +use Magento\Backend\App\Action\Context; +use Magento\Backend\Model\Session; +use Magento\Backend\Model\View\Result\Forward; +use Magento\Backend\Model\View\Result\ForwardFactory; +use Magento\Backend\Model\View\Result\RedirectFactory; +use Magento\Customer\Api\AddressRepositoryInterface; use Magento\Customer\Api\CustomerMetadataInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\AddressInterfaceFactory; use Magento\Customer\Api\Data\AttributeMetadataInterface; use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Api\Data\CustomerInterfaceFactory; +use Magento\Customer\Controller\Adminhtml\Index\Save; use Magento\Customer\Controller\RegistryConstants; +use Magento\Customer\Model\AccountManagement; +use Magento\Customer\Model\Address\Mapper; use Magento\Customer\Model\EmailNotificationInterface; use Magento\Customer\Model\Metadata\Form; +use Magento\Customer\Model\Metadata\FormFactory; +use Magento\Framework\Api\DataObjectHelper; +use Magento\Framework\App\Request\Http; +use Magento\Framework\App\RequestInterface; +use Magento\Framework\AuthorizationInterface; use Magento\Framework\Controller\Result\Redirect; +use Magento\Framework\DataObject; +use Magento\Framework\DataObjectFactory; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Message\Error; +use Magento\Framework\Message\ManagerInterface; +use Magento\Framework\Registry; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Framework\View\Page\Config; +use Magento\Framework\View\Page\Title; +use Magento\Framework\View\Result\Page; +use Magento\Framework\View\Result\PageFactory; +use Magento\Newsletter\Model\SubscriberFactory; +use Magento\Newsletter\Model\SubscriptionManagerInterface; +use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\MockObject\MockObject; /** * Testing Save Customer use case from admin page @@ -20,220 +52,226 @@ * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @covers \Magento\Customer\Controller\Adminhtml\Index\Save */ -class SaveTest extends \PHPUnit\Framework\TestCase +class SaveTest extends TestCase { /** - * @var \Magento\Customer\Controller\Adminhtml\Index\Save + * @var Save */ protected $model; /** - * @var \Magento\Backend\App\Action\Context + * @var Context */ protected $context; /** - * @var \Magento\Framework\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject + * @var RequestInterface|MockObject */ protected $requestMock; /** - * @var \Magento\Backend\Model\View\Result\ForwardFactory|\PHPUnit_Framework_MockObject_MockObject + * @var ForwardFactory|MockObject */ protected $resultForwardFactoryMock; /** - * @var \Magento\Backend\Model\View\Result\Forward|\PHPUnit_Framework_MockObject_MockObject + * @var Forward|MockObject */ protected $resultForwardMock; /** - * @var \Magento\Framework\View\Result\PageFactory|\PHPUnit_Framework_MockObject_MockObject + * @var PageFactory|MockObject */ protected $resultPageFactoryMock; /** - * @var \Magento\Framework\View\Result\Page|\PHPUnit_Framework_MockObject_MockObject + * @var Page|MockObject */ protected $resultPageMock; /** - * @var \Magento\Framework\View\Page\Config|\PHPUnit_Framework_MockObject_MockObject + * @var Config|MockObject */ protected $pageConfigMock; /** - * @var \Magento\Framework\View\Page\Title|\PHPUnit_Framework_MockObject_MockObject + * @var Title|MockObject */ protected $pageTitleMock; /** - * @var \Magento\Backend\Model\Session|\PHPUnit_Framework_MockObject_MockObject + * @var Session|MockObject */ protected $sessionMock; /** - * @var \Magento\Customer\Model\Metadata\FormFactory|\PHPUnit_Framework_MockObject_MockObject + * @var FormFactory|MockObject */ protected $formFactoryMock; /** - * @var \Magento\Framework\DataObjectFactory|\PHPUnit_Framework_MockObject_MockObject + * @var DataObjectFactory|MockObject */ protected $objectFactoryMock; /** - * @var \Magento\Customer\Api\Data\CustomerInterfaceFactory|\PHPUnit_Framework_MockObject_MockObject + * @var CustomerInterfaceFactory|MockObject */ protected $customerDataFactoryMock; /** - * @var \Magento\Customer\Api\CustomerRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + * @var CustomerRepositoryInterface|MockObject */ protected $customerRepositoryMock; /** - * @var \Magento\Customer\Model\Customer\Mapper|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Customer\Model\Customer\Mapper|MockObject */ protected $customerMapperMock; /** - * @var \Magento\Framework\Api\DataObjectHelper|\PHPUnit_Framework_MockObject_MockObject + * @var DataObjectHelper|MockObject */ protected $dataHelperMock; /** - * @var \Magento\Framework\AuthorizationInterface|\PHPUnit_Framework_MockObject_MockObject + * @var AuthorizationInterface|MockObject */ protected $authorizationMock; /** - * @var \Magento\Newsletter\Model\SubscriberFactory|\PHPUnit_Framework_MockObject_MockObject + * @var SubscriberFactory|MockObject */ protected $subscriberFactoryMock; /** - * @var \Magento\Framework\Registry|\PHPUnit_Framework_MockObject_MockObject + * @var Registry|MockObject */ protected $registryMock; /** - * @var \Magento\Framework\Message\ManagerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ManagerInterface|MockObject */ protected $messageManagerMock; /** - * @var \Magento\Backend\Model\View\Result\RedirectFactory|\PHPUnit_Framework_MockObject_MockObject + * @var RedirectFactory|MockObject */ protected $redirectFactoryMock; /** - * @var \Magento\Customer\Model\AccountManagement|\PHPUnit_Framework_MockObject_MockObject + * @var AccountManagement|MockObject */ protected $managementMock; /** - * @var \Magento\Customer\Api\Data\AddressInterfaceFactory|\PHPUnit_Framework_MockObject_MockObject + * @var AddressInterfaceFactory|MockObject */ protected $addressDataFactoryMock; /** - * @var EmailNotificationInterface|\PHPUnit_Framework_MockObject_MockObject + * @var EmailNotificationInterface|MockObject */ protected $emailNotificationMock; /** - * @var \Magento\Customer\Model\Address\Mapper|\PHPUnit_Framework_MockObject_MockObject + * @var Mapper|MockObject */ protected $customerAddressMapperMock; /** - * @var \Magento\Customer\Api\AddressRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + * @var AddressRepositoryInterface|MockObject */ protected $customerAddressRepositoryMock; + /** + * @var SubscriptionManagerInterface|MockObject + */ + private $subscriptionManager; + /** * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ protected function setUp() { - $this->requestMock = $this->getMockBuilder(\Magento\Framework\App\Request\Http::class) + $this->requestMock = $this->getMockBuilder(Http::class) ->disableOriginalConstructor() ->getMock(); $this->resultForwardFactoryMock = $this->getMockBuilder( - \Magento\Backend\Model\View\Result\ForwardFactory::class + ForwardFactory::class )->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $this->resultForwardMock = $this->getMockBuilder(\Magento\Backend\Model\View\Result\Forward::class) + $this->resultForwardMock = $this->getMockBuilder(Forward::class) ->disableOriginalConstructor() ->getMock(); - $this->resultPageFactoryMock = $this->getMockBuilder(\Magento\Framework\View\Result\PageFactory::class) + $this->resultPageFactoryMock = $this->getMockBuilder(PageFactory::class) ->disableOriginalConstructor() ->getMock(); - $this->resultPageMock = $this->getMockBuilder(\Magento\Framework\View\Result\Page::class) + $this->resultPageMock = $this->getMockBuilder(Page::class) ->disableOriginalConstructor() ->setMethods(['setActiveMenu', 'getConfig', 'addBreadcrumb']) ->getMock(); - $this->pageConfigMock = $this->getMockBuilder(\Magento\Framework\View\Page\Config::class) + $this->pageConfigMock = $this->getMockBuilder(Config::class) ->disableOriginalConstructor() ->getMock(); - $this->pageTitleMock = $this->getMockBuilder(\Magento\Framework\View\Page\Title::class) + $this->pageTitleMock = $this->getMockBuilder(Title::class) ->disableOriginalConstructor() ->getMock(); - $this->sessionMock = $this->getMockBuilder(\Magento\Backend\Model\Session::class) + $this->sessionMock = $this->getMockBuilder(Session::class) ->disableOriginalConstructor() ->setMethods(['unsCustomerFormData', 'setCustomerFormData']) ->getMock(); - $this->formFactoryMock = $this->getMockBuilder(\Magento\Customer\Model\Metadata\FormFactory::class) + $this->formFactoryMock = $this->getMockBuilder(FormFactory::class) ->disableOriginalConstructor() ->getMock(); - $this->objectFactoryMock = $this->getMockBuilder(\Magento\Framework\DataObjectFactory::class) + $this->objectFactoryMock = $this->getMockBuilder(DataObjectFactory::class) ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); $this->customerDataFactoryMock = $this->getMockBuilder( - \Magento\Customer\Api\Data\CustomerInterfaceFactory::class + CustomerInterfaceFactory::class )->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $this->customerRepositoryMock = $this->getMockBuilder(\Magento\Customer\Api\CustomerRepositoryInterface::class) + $this->customerRepositoryMock = $this->getMockBuilder(CustomerRepositoryInterface::class) ->disableOriginalConstructor() ->getMock(); $this->customerAddressRepositoryMock = $this->getMockBuilder( - \Magento\Customer\Api\AddressRepositoryInterface::class + AddressRepositoryInterface::class )->disableOriginalConstructor()->getMock(); $this->customerMapperMock = $this->getMockBuilder( \Magento\Customer\Model\Customer\Mapper::class )->disableOriginalConstructor()->getMock(); $this->customerAddressMapperMock = $this->getMockBuilder( - \Magento\Customer\Model\Address\Mapper::class + Mapper::class )->disableOriginalConstructor()->getMock(); $this->dataHelperMock = $this->getMockBuilder( - \Magento\Framework\Api\DataObjectHelper::class + DataObjectHelper::class )->disableOriginalConstructor()->getMock(); - $this->authorizationMock = $this->getMockBuilder(\Magento\Framework\AuthorizationInterface::class) + $this->authorizationMock = $this->getMockBuilder(AuthorizationInterface::class) ->disableOriginalConstructor() ->getMock(); - $this->subscriberFactoryMock = $this->getMockBuilder(\Magento\Newsletter\Model\SubscriberFactory::class) + $this->subscriberFactoryMock = $this->getMockBuilder(SubscriberFactory::class) ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $this->registryMock = $this->getMockBuilder(\Magento\Framework\Registry::class) + $this->subscriptionManager = $this->createMock(SubscriptionManagerInterface::class); + $this->registryMock = $this->getMockBuilder(Registry::class) ->disableOriginalConstructor() ->getMock(); - $this->messageManagerMock = $this->getMockBuilder(\Magento\Framework\Message\ManagerInterface::class) + $this->messageManagerMock = $this->getMockBuilder(ManagerInterface::class) ->disableOriginalConstructor() ->getMock(); - $this->redirectFactoryMock = $this->getMockBuilder(\Magento\Backend\Model\View\Result\RedirectFactory::class) + $this->redirectFactoryMock = $this->getMockBuilder(RedirectFactory::class) ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); - $this->managementMock = $this->getMockBuilder(\Magento\Customer\Model\AccountManagement::class) + $this->managementMock = $this->getMockBuilder(AccountManagement::class) ->disableOriginalConstructor() ->setMethods(['createAccount']) ->getMock(); - $this->addressDataFactoryMock = $this->getMockBuilder(\Magento\Customer\Api\Data\AddressInterfaceFactory::class) + $this->addressDataFactoryMock = $this->getMockBuilder(AddressInterfaceFactory::class) ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); @@ -241,10 +279,10 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); - $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $objectManager = new ObjectManager($this); $this->model = $objectManager->getObject( - \Magento\Customer\Controller\Adminhtml\Index\Save::class, + Save::class, [ 'resultForwardFactory' => $this->resultForwardFactoryMock, 'resultPageFactory' => $this->resultPageFactoryMock, @@ -265,6 +303,7 @@ protected function setUp() 'resultRedirectFactory' => $this->redirectFactoryMock, 'addressRepository' => $this->customerAddressRepositoryMock, 'addressMapper' => $this->customerAddressMapperMock, + 'subscriptionManager' => $this->subscriptionManager, ] ); @@ -282,7 +321,10 @@ protected function setUp() public function testExecuteWithExistentCustomer() { $customerId = 22; - $subscription = 'true'; + $customerEmail = 'customer@email.com'; + $subscriptionWebsite = 1; + $subscriptionStatus = true; + $subscriptionStore = 3; $postValue = [ 'customer' => [ 'entity_id' => $customerId, @@ -290,7 +332,8 @@ public function testExecuteWithExistentCustomer() 'coolness' => false, 'disable_auto_group_change' => 'false', ], - 'subscription' => $subscription, + 'subscription_status' => [$subscriptionWebsite => $subscriptionStatus], + 'subscription_store' => [$subscriptionWebsite => $subscriptionStore], ]; $extractedData = [ 'entity_id' => $customerId, @@ -324,9 +367,9 @@ public function testExecuteWithExistentCustomer() 'id' => $customerId, ]; - /** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $customerFormMock */ + /** @var AttributeMetadataInterface|MockObject $customerFormMock */ $attributeMock = $this->getMockBuilder( - \Magento\Customer\Api\Data\AttributeMetadataInterface::class + AttributeMetadataInterface::class )->disableOriginalConstructor()->getMock(); $attributeMock->expects($this->atLeastOnce()) ->method('getAttributeCode') @@ -346,15 +389,20 @@ public function testExecuteWithExistentCustomer() ); $this->requestMock->expects($this->atLeastOnce()) ->method('getPost') + ->with('customer') + ->willReturn($postValue['customer']); + $this->requestMock->expects($this->atLeastOnce()) + ->method('getParam') ->willReturnMap( [ - ['customer', null, $postValue['customer']], - ['subscription', null, $subscription], + ['subscription_status', null, [$subscriptionWebsite => $subscriptionStatus]], + ['subscription_store', null, [$subscriptionWebsite => $subscriptionStore]], + ['back', false, true], ] ); - /** @var \Magento\Framework\DataObject|\PHPUnit_Framework_MockObject_MockObject $objectMock */ - $objectMock = $this->getMockBuilder(\Magento\Framework\DataObject::class) + /** @var DataObject|MockObject $objectMock */ + $objectMock = $this->getMockBuilder(DataObject::class) ->disableOriginalConstructor() ->getMock(); $objectMock->expects($this->atLeastOnce()) @@ -371,7 +419,7 @@ public function testExecuteWithExistentCustomer() ->willReturn($objectMock); $customerFormMock = $this->getMockBuilder( - \Magento\Customer\Model\Metadata\Form::class + Form::class )->disableOriginalConstructor()->getMock(); $customerFormMock->expects($this->once()) ->method('extractData') @@ -400,32 +448,26 @@ public function testExecuteWithExistentCustomer() ] ); - /** @var CustomerInterface|\PHPUnit_Framework_MockObject_MockObject $customerMock */ - $customerMock = $this->getMockBuilder( - \Magento\Customer\Api\Data\CustomerInterface::class - )->disableOriginalConstructor()->getMock(); - + /** @var CustomerInterface|MockObject $customerMock */ + $customerMock = $this->createMock(CustomerInterface::class); + $customerMock->method('getId')->willReturn($customerId); $this->customerDataFactoryMock->expects($this->once()) ->method('create') ->willReturn($customerMock); - - $this->customerRepositoryMock->expects($this->exactly(2)) - ->method('getById') + $this->customerRepositoryMock->method('getById') ->with($customerId) ->willReturn($customerMock); - $this->customerMapperMock->expects($this->exactly(2)) ->method('toFlatArray') ->with($customerMock) ->willReturn($savedData); - $this->dataHelperMock->expects($this->atLeastOnce()) ->method('populateWithArray') ->willReturnMap( [ [ $customerMock, - $mergedData, \Magento\Customer\Api\Data\CustomerInterface::class, + $mergedData, CustomerInterface::class, $this->dataHelperMock ], ] @@ -435,10 +477,7 @@ public function testExecuteWithExistentCustomer() ->method('save') ->with($customerMock) ->willReturnSelf(); - - $customerEmail = 'customer@email.com'; $customerMock->expects($this->once())->method('getEmail')->willReturn($customerEmail); - $customerMock->expects($this->once()) ->method('getAddresses') ->willReturn([]); @@ -453,25 +492,12 @@ public function testExecuteWithExistentCustomer() ->with(null) ->willReturn(true); - /** @var \Magento\Newsletter\Model\Subscriber|\PHPUnit_Framework_MockObject_MockObject $subscriberMock */ - $subscriberMock = $this->getMockBuilder(\Magento\Newsletter\Model\Subscriber::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->subscriberFactoryMock->expects($this->once()) - ->method('create') - ->with() - ->willReturn($subscriberMock); - - $subscriberMock->expects($this->once()) - ->method('subscribeCustomerById') - ->with($customerId); - $subscriberMock->expects($this->never()) - ->method('unsubscribeCustomerById'); + $this->subscriptionManager->expects($this->once()) + ->method($subscriptionStatus ? 'subscribeCustomer' : 'unsubscribeCustomer') + ->with($customerId, $subscriptionStore); $this->sessionMock->expects($this->once()) ->method('unsCustomerFormData'); - $this->registryMock->expects($this->once()) ->method('register') ->with(RegistryConstants::CURRENT_CUSTOMER_ID, $customerId); @@ -481,13 +507,8 @@ public function testExecuteWithExistentCustomer() ->with(__('You saved the customer.')) ->willReturnSelf(); - $this->requestMock->expects($this->once()) - ->method('getParam') - ->with('back', false) - ->willReturn(true); - - /** @var Redirect|\PHPUnit_Framework_MockObject_MockObject $redirectMock */ - $redirectMock = $this->getMockBuilder(\Magento\Framework\Controller\Result\Redirect::class) + /** @var Redirect|MockObject $redirectMock */ + $redirectMock = $this->getMockBuilder(Redirect::class) ->disableOriginalConstructor() ->getMock(); @@ -511,14 +532,17 @@ public function testExecuteWithExistentCustomer() public function testExecuteWithNewCustomer() { $customerId = 22; + $subscriptionWebsite = 1; + $subscriptionStatus = false; + $subscriptionStore = 3; - $subscription = '0'; $postValue = [ 'customer' => [ 'coolness' => false, 'disable_auto_group_change' => 'false', ], - 'subscription' => $subscription, + 'subscription_status' => [$subscriptionWebsite => $subscriptionStatus], + 'subscription_store' => [$subscriptionWebsite => $subscriptionStore], ]; $extractedData = [ 'coolness' => false, @@ -530,9 +554,9 @@ public function testExecuteWithNewCustomer() CustomerInterface::DEFAULT_SHIPPING => null, 'confirmation' => false, ]; - /** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $customerFormMock */ + /** @var AttributeMetadataInterface|MockObject $customerFormMock */ $attributeMock = $this->getMockBuilder( - \Magento\Customer\Api\Data\AttributeMetadataInterface::class + AttributeMetadataInterface::class )->disableOriginalConstructor()->getMock(); $attributeMock->expects($this->atLeastOnce()) ->method('getAttributeCode') @@ -552,15 +576,20 @@ public function testExecuteWithNewCustomer() ); $this->requestMock->expects($this->atLeastOnce()) ->method('getPost') + ->with('customer') + ->willReturn($postValue['customer']); + $this->requestMock->expects($this->atLeastOnce()) + ->method('getParam') ->willReturnMap( [ - ['customer', null, $postValue['customer']], - ['subscription', null, $subscription], + ['subscription_status', null, [$subscriptionWebsite => $subscriptionStatus]], + ['subscription_store', null, [$subscriptionWebsite => $subscriptionStore]], + ['back', false, false], ] ); - /** @var \Magento\Framework\DataObject|\PHPUnit_Framework_MockObject_MockObject $objectMock */ - $objectMock = $this->getMockBuilder(\Magento\Framework\DataObject::class) + /** @var DataObject|MockObject $objectMock */ + $objectMock = $this->getMockBuilder(DataObject::class) ->disableOriginalConstructor() ->getMock(); $objectMock->expects($this->atLeastOnce()) @@ -577,7 +606,7 @@ public function testExecuteWithNewCustomer() ->willReturn($objectMock); $customerFormMock = $this->getMockBuilder( - \Magento\Customer\Model\Metadata\Form::class + Form::class )->disableOriginalConstructor()->getMock(); $customerFormMock->expects($this->once()) ->method('extractData') @@ -607,60 +636,36 @@ public function testExecuteWithNewCustomer() ] ); - /** @var CustomerInterface|\PHPUnit_Framework_MockObject_MockObject $customerMock */ - $customerMock = $this->getMockBuilder( - \Magento\Customer\Api\Data\CustomerInterface::class - )->disableOriginalConstructor()->getMock(); - + /** @var CustomerInterface|MockObject $customerMock */ + $customerMock = $this->createMock(CustomerInterface::class); + $customerMock->method('getId')->willReturn($customerId); $this->customerDataFactoryMock->expects($this->once()) ->method('create') ->willReturn($customerMock); - $this->dataHelperMock->expects($this->atLeastOnce()) ->method('populateWithArray') ->willReturnMap( [ [ $customerMock, - $mergedData, \Magento\Customer\Api\Data\CustomerInterface::class, + $mergedData, CustomerInterface::class, $this->dataHelperMock ], ] ); - $this->managementMock->expects($this->once()) ->method('createAccount') ->with($customerMock, null, '') ->willReturn($customerMock); - - $customerMock->expects($this->once()) - ->method('getId') - ->willReturn($customerId); - $this->authorizationMock->expects($this->once()) ->method('isAllowed') ->with(null) ->willReturn(true); - - /** @var \Magento\Newsletter\Model\Subscriber|\PHPUnit_Framework_MockObject_MockObject $subscriberMock */ - $subscriberMock = $this->getMockBuilder(\Magento\Newsletter\Model\Subscriber::class) - ->disableOriginalConstructor() - ->getMock(); - - $this->subscriberFactoryMock->expects($this->once()) - ->method('create') - ->with() - ->willReturn($subscriberMock); - - $subscriberMock->expects($this->once()) - ->method('unsubscribeCustomerById') - ->with($customerId); - $subscriberMock->expects($this->never()) - ->method('subscribeCustomerById'); - + $this->subscriptionManager->expects($this->once()) + ->method($subscriptionStatus ? 'subscribeCustomer' : 'unsubscribeCustomer') + ->with($customerId, $subscriptionStore); $this->sessionMock->expects($this->once()) ->method('unsCustomerFormData'); - $this->registryMock->expects($this->once()) ->method('register') ->with(RegistryConstants::CURRENT_CUSTOMER_ID, $customerId); @@ -670,13 +675,8 @@ public function testExecuteWithNewCustomer() ->with(__('You saved the customer.')) ->willReturnSelf(); - $this->requestMock->expects($this->once()) - ->method('getParam') - ->with('back', false) - ->willReturn(false); - - /** @var Redirect|\PHPUnit_Framework_MockObject_MockObject $redirectMock */ - $redirectMock = $this->getMockBuilder(\Magento\Framework\Controller\Result\Redirect::class) + /** @var Redirect|MockObject $redirectMock */ + $redirectMock = $this->getMockBuilder(Redirect::class) ->disableOriginalConstructor() ->getMock(); @@ -713,9 +713,9 @@ public function testExecuteWithNewCustomerAndValidationException() 'dob' => '1996-03-12', ]; - /** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $customerFormMock */ + /** @var AttributeMetadataInterface|MockObject $customerFormMock */ $attributeMock = $this->getMockBuilder( - \Magento\Customer\Api\Data\AttributeMetadataInterface::class + AttributeMetadataInterface::class )->disableOriginalConstructor()->getMock(); $attributeMock->expects($this->exactly(2)) ->method('getAttributeCode') @@ -741,8 +741,8 @@ public function testExecuteWithNewCustomerAndValidationException() ] ); - /** @var \Magento\Framework\DataObject|\PHPUnit_Framework_MockObject_MockObject $objectMock */ - $objectMock = $this->getMockBuilder(\Magento\Framework\DataObject::class) + /** @var DataObject|MockObject $objectMock */ + $objectMock = $this->getMockBuilder(DataObject::class) ->disableOriginalConstructor() ->getMock(); $objectMock->expects($this->exactly(2)) @@ -756,7 +756,7 @@ public function testExecuteWithNewCustomerAndValidationException() ->willReturn($objectMock); $customerFormMock = $this->getMockBuilder( - \Magento\Customer\Model\Metadata\Form::class + Form::class )->disableOriginalConstructor()->getMock(); $customerFormMock->expects($this->exactly(2)) ->method('extractData') @@ -780,9 +780,9 @@ public function testExecuteWithNewCustomerAndValidationException() Form::DONT_IGNORE_INVISIBLE )->willReturn($customerFormMock); - /** @var CustomerInterface|\PHPUnit_Framework_MockObject_MockObject $customerMock */ + /** @var CustomerInterface|MockObject $customerMock */ $customerMock = $this->getMockBuilder( - \Magento\Customer\Api\Data\CustomerInterface::class + CustomerInterface::class )->disableOriginalConstructor()->getMock(); $this->customerDataFactoryMock->expects($this->once()) @@ -814,7 +814,7 @@ public function testExecuteWithNewCustomerAndValidationException() $this->messageManagerMock->expects($this->once()) ->method('addMessage') - ->with(new \Magento\Framework\Message\Error('Validator Exception')); + ->with(new Error('Validator Exception')); $this->sessionMock->expects($this->once()) ->method('setCustomerFormData') @@ -825,8 +825,8 @@ public function testExecuteWithNewCustomerAndValidationException() ] ); - /** @var Redirect|\PHPUnit_Framework_MockObject_MockObject $redirectMock */ - $redirectMock = $this->getMockBuilder(\Magento\Framework\Controller\Result\Redirect::class) + /** @var Redirect|MockObject $redirectMock */ + $redirectMock = $this->getMockBuilder(Redirect::class) ->disableOriginalConstructor() ->getMock(); @@ -864,9 +864,9 @@ public function testExecuteWithNewCustomerAndLocalizedException() 'dob' => '1996-03-12', ]; - /** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $customerFormMock */ + /** @var AttributeMetadataInterface|MockObject $customerFormMock */ $attributeMock = $this->getMockBuilder( - \Magento\Customer\Api\Data\AttributeMetadataInterface::class + AttributeMetadataInterface::class )->disableOriginalConstructor()->getMock(); $attributeMock->expects($this->exactly(2)) ->method('getAttributeCode') @@ -892,8 +892,8 @@ public function testExecuteWithNewCustomerAndLocalizedException() ] ); - /** @var \Magento\Framework\DataObject|\PHPUnit_Framework_MockObject_MockObject $objectMock */ - $objectMock = $this->getMockBuilder(\Magento\Framework\DataObject::class) + /** @var DataObject|MockObject $objectMock */ + $objectMock = $this->getMockBuilder(DataObject::class) ->disableOriginalConstructor() ->getMock(); $objectMock->expects($this->exactly(2)) @@ -906,9 +906,9 @@ public function testExecuteWithNewCustomerAndLocalizedException() ->with(['data' => $postValue]) ->willReturn($objectMock); - /** @var Form|\PHPUnit_Framework_MockObject_MockObject $formMock */ + /** @var Form|MockObject $formMock */ $customerFormMock = $this->getMockBuilder( - \Magento\Customer\Model\Metadata\Form::class + Form::class )->disableOriginalConstructor()->getMock(); $customerFormMock->expects($this->exactly(2)) ->method('extractData') @@ -933,7 +933,7 @@ public function testExecuteWithNewCustomerAndLocalizedException() )->willReturn($customerFormMock); $customerMock = $this->getMockBuilder( - \Magento\Customer\Api\Data\CustomerInterface::class + CustomerInterface::class )->disableOriginalConstructor()->getMock(); $this->customerDataFactoryMock->expects($this->once()) @@ -943,7 +943,7 @@ public function testExecuteWithNewCustomerAndLocalizedException() $this->managementMock->expects($this->once()) ->method('createAccount') ->with($customerMock, null, '') - ->willThrowException(new \Magento\Framework\Exception\LocalizedException(__('Localized Exception'))); + ->willThrowException(new LocalizedException(__('Localized Exception'))); $customerMock->expects($this->never()) ->method('getId'); @@ -965,7 +965,7 @@ public function testExecuteWithNewCustomerAndLocalizedException() $this->messageManagerMock->expects($this->once()) ->method('addMessage') - ->with(new \Magento\Framework\Message\Error('Localized Exception')); + ->with(new Error('Localized Exception')); $this->sessionMock->expects($this->once()) ->method('setCustomerFormData') @@ -976,8 +976,8 @@ public function testExecuteWithNewCustomerAndLocalizedException() ] ); - /** @var Redirect|\PHPUnit_Framework_MockObject_MockObject $redirectMock */ - $redirectMock = $this->getMockBuilder(\Magento\Framework\Controller\Result\Redirect::class) + /** @var Redirect|MockObject $redirectMock */ + $redirectMock = $this->getMockBuilder(Redirect::class) ->disableOriginalConstructor() ->getMock(); @@ -1015,9 +1015,9 @@ public function testExecuteWithNewCustomerAndException() 'dob' => '1996-03-12', ]; - /** @var AttributeMetadataInterface|\PHPUnit_Framework_MockObject_MockObject $customerFormMock */ + /** @var AttributeMetadataInterface|MockObject $customerFormMock */ $attributeMock = $this->getMockBuilder( - \Magento\Customer\Api\Data\AttributeMetadataInterface::class + AttributeMetadataInterface::class )->disableOriginalConstructor()->getMock(); $attributeMock->expects($this->exactly(2)) ->method('getAttributeCode') @@ -1043,8 +1043,8 @@ public function testExecuteWithNewCustomerAndException() ] ); - /** @var \Magento\Framework\DataObject|\PHPUnit_Framework_MockObject_MockObject $objectMock */ - $objectMock = $this->getMockBuilder(\Magento\Framework\DataObject::class) + /** @var DataObject|MockObject $objectMock */ + $objectMock = $this->getMockBuilder(DataObject::class) ->disableOriginalConstructor() ->getMock(); $objectMock->expects($this->exactly(2)) @@ -1058,7 +1058,7 @@ public function testExecuteWithNewCustomerAndException() ->willReturn($objectMock); $customerFormMock = $this->getMockBuilder( - \Magento\Customer\Model\Metadata\Form::class + Form::class )->disableOriginalConstructor()->getMock(); $customerFormMock->expects($this->exactly(2)) ->method('extractData') @@ -1082,9 +1082,9 @@ public function testExecuteWithNewCustomerAndException() Form::DONT_IGNORE_INVISIBLE )->willReturn($customerFormMock); - /** @var CustomerInterface|\PHPUnit_Framework_MockObject_MockObject $customerMock */ + /** @var CustomerInterface|MockObject $customerMock */ $customerMock = $this->getMockBuilder( - \Magento\Customer\Api\Data\CustomerInterface::class + CustomerInterface::class )->disableOriginalConstructor()->getMock(); $this->customerDataFactoryMock->expects($this->once()) @@ -1128,8 +1128,8 @@ public function testExecuteWithNewCustomerAndException() ] ); - /** @var Redirect|\PHPUnit_Framework_MockObject_MockObject $redirectMock */ - $redirectMock = $this->getMockBuilder(\Magento\Framework\Controller\Result\Redirect::class) + /** @var Redirect|MockObject $redirectMock */ + $redirectMock = $this->getMockBuilder(Redirect::class) ->disableOriginalConstructor() ->getMock(); diff --git a/app/code/Magento/Customer/view/adminhtml/templates/tab/newsletter.phtml b/app/code/Magento/Customer/view/adminhtml/templates/tab/newsletter.phtml index 12d4902fb1892..d8bcc59689fac 100644 --- a/app/code/Magento/Customer/view/adminhtml/templates/tab/newsletter.phtml +++ b/app/code/Magento/Customer/view/adminhtml/templates/tab/newsletter.phtml @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ ?> +<?php /** @var \Magento\Customer\Block\Adminhtml\Edit\Tab\Newsletter $block */ ?> <div class="entry-edit"> <?= $block->getForm()->getHtml() ?> </div> diff --git a/app/code/Magento/CustomerGraphQl/Model/Customer/ChangeSubscriptionStatus.php b/app/code/Magento/CustomerGraphQl/Model/Customer/ChangeSubscriptionStatus.php deleted file mode 100644 index 1acb418e7bba6..0000000000000 --- a/app/code/Magento/CustomerGraphQl/Model/Customer/ChangeSubscriptionStatus.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\CustomerGraphQl\Model\Customer; - -use Magento\Newsletter\Model\SubscriberFactory; - -/** - * Change subscription status. Subscribe OR unsubscribe if required - */ -class ChangeSubscriptionStatus -{ - /** - * @var SubscriberFactory - */ - private $subscriberFactory; - - /** - * @param SubscriberFactory $subscriberFactory - */ - public function __construct( - SubscriberFactory $subscriberFactory - ) { - $this->subscriberFactory = $subscriberFactory; - } - - /** - * Change subscription status. Subscribe OR unsubscribe if required - * - * @param int $customerId - * @param bool $subscriptionStatus - * @return void - */ - public function execute(int $customerId, bool $subscriptionStatus): void - { - $subscriber = $this->subscriberFactory->create()->loadByCustomerId($customerId); - - if ($subscriptionStatus === true && !$subscriber->isSubscribed()) { - $this->subscriberFactory->create()->subscribeCustomerById($customerId); - } elseif ($subscriptionStatus === false && $subscriber->isSubscribed()) { - $this->subscriberFactory->create()->unsubscribeCustomerById($customerId); - } - } -} diff --git a/app/code/Magento/CustomerGraphQl/Model/Customer/CreateCustomerAccount.php b/app/code/Magento/CustomerGraphQl/Model/Customer/CreateCustomerAccount.php index 969c205329f2b..a631b7ba86194 100644 --- a/app/code/Magento/CustomerGraphQl/Model/Customer/CreateCustomerAccount.php +++ b/app/code/Magento/CustomerGraphQl/Model/Customer/CreateCustomerAccount.php @@ -14,6 +14,7 @@ use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\Reflection\DataObjectProcessor; +use Magento\Newsletter\Model\SubscriptionManagerInterface; use Magento\Store\Api\Data\StoreInterface; /** @@ -36,11 +37,6 @@ class CreateCustomerAccount */ private $accountManagement; - /** - * @var ChangeSubscriptionStatus - */ - private $changeSubscriptionStatus; - /** * @var ValidateCustomerData */ @@ -51,30 +47,35 @@ class CreateCustomerAccount */ private $dataObjectProcessor; + /** + * @var SubscriptionManagerInterface + */ + private $subscriptionManager; + /** * CreateCustomerAccount constructor. * * @param DataObjectHelper $dataObjectHelper * @param CustomerInterfaceFactory $customerFactory * @param AccountManagementInterface $accountManagement - * @param ChangeSubscriptionStatus $changeSubscriptionStatus * @param DataObjectProcessor $dataObjectProcessor * @param ValidateCustomerData $validateCustomerData + * @param SubscriptionManagerInterface $subscriptionManager */ public function __construct( DataObjectHelper $dataObjectHelper, CustomerInterfaceFactory $customerFactory, AccountManagementInterface $accountManagement, - ChangeSubscriptionStatus $changeSubscriptionStatus, DataObjectProcessor $dataObjectProcessor, - ValidateCustomerData $validateCustomerData + ValidateCustomerData $validateCustomerData, + SubscriptionManagerInterface $subscriptionManager ) { $this->dataObjectHelper = $dataObjectHelper; $this->customerFactory = $customerFactory; $this->accountManagement = $accountManagement; - $this->changeSubscriptionStatus = $changeSubscriptionStatus; $this->validateCustomerData = $validateCustomerData; $this->dataObjectProcessor = $dataObjectProcessor; + $this->subscriptionManager = $subscriptionManager; } /** @@ -94,7 +95,11 @@ public function execute(array $data, StoreInterface $store): CustomerInterface } if (isset($data['is_subscribed'])) { - $this->changeSubscriptionStatus->execute((int)$customer->getId(), (bool)$data['is_subscribed']); + if ((bool)$data['is_subscribed']) { + $this->subscriptionManager->subscribeCustomer((int)$customer->getId(), (int)$store->getId()); + } else { + $this->subscriptionManager->unsubscribeCustomer((int)$customer->getId(), (int)$store->getId()); + } } return $customer; } diff --git a/app/code/Magento/CustomerGraphQl/Model/Customer/UpdateCustomerAccount.php b/app/code/Magento/CustomerGraphQl/Model/Customer/UpdateCustomerAccount.php index f7bf26513dc2e..d82b8c6f941fa 100644 --- a/app/code/Magento/CustomerGraphQl/Model/Customer/UpdateCustomerAccount.php +++ b/app/code/Magento/CustomerGraphQl/Model/Customer/UpdateCustomerAccount.php @@ -14,6 +14,7 @@ use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; use Magento\Framework\Api\DataObjectHelper; +use Magento\Newsletter\Model\SubscriptionManagerInterface; use Magento\Store\Api\Data\StoreInterface; /** @@ -38,11 +39,6 @@ class UpdateCustomerAccount */ private $dataObjectHelper; - /** - * @var ChangeSubscriptionStatus - */ - private $changeSubscriptionStatus; - /** * @var ValidateCustomerData */ @@ -53,28 +49,33 @@ class UpdateCustomerAccount */ private $restrictedKeys; + /** + * @var SubscriptionManagerInterface + */ + private $subscriptionManager; + /** * @param SaveCustomer $saveCustomer * @param CheckCustomerPassword $checkCustomerPassword * @param DataObjectHelper $dataObjectHelper - * @param ChangeSubscriptionStatus $changeSubscriptionStatus * @param ValidateCustomerData $validateCustomerData + * @param SubscriptionManagerInterface $subscriptionManager * @param array $restrictedKeys */ public function __construct( SaveCustomer $saveCustomer, CheckCustomerPassword $checkCustomerPassword, DataObjectHelper $dataObjectHelper, - ChangeSubscriptionStatus $changeSubscriptionStatus, ValidateCustomerData $validateCustomerData, + SubscriptionManagerInterface $subscriptionManager, array $restrictedKeys = [] ) { $this->saveCustomer = $saveCustomer; $this->checkCustomerPassword = $checkCustomerPassword; $this->dataObjectHelper = $dataObjectHelper; $this->restrictedKeys = $restrictedKeys; - $this->changeSubscriptionStatus = $changeSubscriptionStatus; $this->validateCustomerData = $validateCustomerData; + $this->subscriptionManager = $subscriptionManager; } /** @@ -112,7 +113,11 @@ public function execute(CustomerInterface $customer, array $data, StoreInterface $this->saveCustomer->execute($customer); if (isset($data['is_subscribed'])) { - $this->changeSubscriptionStatus->execute((int)$customer->getId(), (bool)$data['is_subscribed']); + if ((bool)$data['is_subscribed']) { + $this->subscriptionManager->subscribeCustomer((int)$customer->getId(), (int)$store->getId()); + } else { + $this->subscriptionManager->unsubscribeCustomer((int)$customer->getId(), (int)$store->getId()); + } } } } diff --git a/app/code/Magento/Newsletter/Controller/Manage/Save.php b/app/code/Magento/Newsletter/Controller/Manage/Save.php index d7d511e2d1906..01012e39a992a 100644 --- a/app/code/Magento/Newsletter/Controller/Manage/Save.php +++ b/app/code/Magento/Newsletter/Controller/Manage/Save.php @@ -12,6 +12,7 @@ use Magento\Framework\App\Action\HttpGetActionInterface; use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Newsletter\Model\Subscriber; +use Magento\Newsletter\Model\SubscriptionManagerInterface; /** * Customers newsletter subscription save controller @@ -34,9 +35,9 @@ class Save extends \Magento\Newsletter\Controller\Manage implements HttpPostActi protected $customerRepository; /** - * @var \Magento\Newsletter\Model\SubscriberFactory + * @var SubscriptionManagerInterface */ - protected $subscriberFactory; + private $subscriptionManager; /** * Initialize dependencies. @@ -46,7 +47,7 @@ class Save extends \Magento\Newsletter\Controller\Manage implements HttpPostActi * @param \Magento\Framework\Data\Form\FormKey\Validator $formKeyValidator * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param CustomerRepository $customerRepository - * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory + * @param SubscriptionManagerInterface $subscriptionManager */ public function __construct( \Magento\Framework\App\Action\Context $context, @@ -54,13 +55,13 @@ public function __construct( \Magento\Framework\Data\Form\FormKey\Validator $formKeyValidator, \Magento\Store\Model\StoreManagerInterface $storeManager, CustomerRepository $customerRepository, - \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory + SubscriptionManagerInterface $subscriptionManager ) { $this->storeManager = $storeManager; $this->formKeyValidator = $formKeyValidator; $this->customerRepository = $customerRepository; - $this->subscriberFactory = $subscriberFactory; parent::__construct($context, $customerSession); + $this->subscriptionManager = $subscriptionManager; } /** @@ -80,28 +81,24 @@ public function execute() } else { try { $customer = $this->customerRepository->getById($customerId); - $storeId = $this->storeManager->getStore()->getId(); + $storeId = (int)$this->storeManager->getStore()->getId(); $customer->setStoreId($storeId); - $isSubscribedState = $customer->getExtensionAttributes() - ->getIsSubscribed(); - $isSubscribedParam = (boolean)$this->getRequest() - ->getParam('is_subscribed', false); + $isSubscribedState = $customer->getExtensionAttributes()->getIsSubscribed(); + $isSubscribedParam = (boolean)$this->getRequest()->getParam('is_subscribed', false); if ($isSubscribedParam !== $isSubscribedState) { // No need to validate customer and customer address while saving subscription preferences $this->setIgnoreValidationFlag($customer); $this->customerRepository->save($customer); if ($isSubscribedParam) { - $subscribeModel = $this->subscriberFactory->create() - ->subscribeCustomerById($customerId); - $subscribeStatus = $subscribeModel->getStatus(); - if ($subscribeStatus == Subscriber::STATUS_SUBSCRIBED) { + $subscribeModel = $this->subscriptionManager->subscribeCustomer((int)$customerId, $storeId); + $subscribeStatus = (int)$subscribeModel->getStatus(); + if ($subscribeStatus === Subscriber::STATUS_SUBSCRIBED) { $this->messageManager->addSuccess(__('We have saved your subscription.')); } else { $this->messageManager->addSuccess(__('A confirmation request has been sent.')); } } else { - $this->subscriberFactory->create() - ->unsubscribeCustomerById($customerId); + $this->subscriptionManager->unsubscribeCustomer((int)$customerId, $storeId); $this->messageManager->addSuccess(__('We have removed your newsletter subscription.')); } } else { diff --git a/app/code/Magento/Newsletter/Controller/Subscriber/NewAction.php b/app/code/Magento/Newsletter/Controller/Subscriber/NewAction.php index 7557f1610b4f4..ea52ae8aaa864 100644 --- a/app/code/Magento/Newsletter/Controller/Subscriber/NewAction.php +++ b/app/code/Magento/Newsletter/Controller/Subscriber/NewAction.php @@ -4,7 +4,6 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - namespace Magento\Newsletter\Controller\Subscriber; use Magento\Customer\Api\AccountManagementInterface as CustomerAccountManagement; @@ -14,11 +13,14 @@ use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\ObjectManager; +use Magento\Framework\Controller\Result\Redirect; +use Magento\Framework\Controller\ResultFactory; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Phrase; use Magento\Framework\Validator\EmailAddress as EmailValidator; use Magento\Newsletter\Controller\Subscriber as SubscriberController; use Magento\Newsletter\Model\Subscriber; +use Magento\Newsletter\Model\SubscriptionManagerInterface; use Magento\Store\Model\ScopeInterface; use Magento\Store\Model\StoreManagerInterface; use Magento\Newsletter\Model\SubscriberFactory; @@ -40,6 +42,11 @@ class NewAction extends SubscriberController implements HttpPostActionInterface */ private $emailValidator; + /** + * @var SubscriptionManagerInterface + */ + private $subscriptionManager; + /** * Initialize dependencies. * @@ -49,6 +56,7 @@ class NewAction extends SubscriberController implements HttpPostActionInterface * @param StoreManagerInterface $storeManager * @param CustomerUrl $customerUrl * @param CustomerAccountManagement $customerAccountManagement + * @param SubscriptionManagerInterface $subscriptionManager * @param EmailValidator $emailValidator */ public function __construct( @@ -58,9 +66,11 @@ public function __construct( StoreManagerInterface $storeManager, CustomerUrl $customerUrl, CustomerAccountManagement $customerAccountManagement, + SubscriptionManagerInterface $subscriptionManager, EmailValidator $emailValidator = null ) { $this->customerAccountManagement = $customerAccountManagement; + $this->subscriptionManager = $subscriptionManager; $this->emailValidator = $emailValidator ?: ObjectManager::getInstance()->get(EmailValidator::class); parent::__construct( $context, @@ -132,7 +142,7 @@ protected function validateEmailFormat($email) /** * New subscription action * - * @return \Magento\Framework\Controller\Result\Redirect + * @return Redirect */ public function execute() { @@ -144,29 +154,55 @@ public function execute() $this->validateGuestSubscription(); $this->validateEmailAvailable($email); - $subscriber = $this->_subscriberFactory->create()->loadByEmail($email); + $websiteId = (int)$this->_storeManager->getStore()->getWebsiteId(); + /** @var Subscriber $subscriber */ + $subscriber = $this->_subscriberFactory->create()->loadBySubscriberEmail($email, $websiteId); if ($subscriber->getId() - && (int) $subscriber->getSubscriberStatus() === Subscriber::STATUS_SUBSCRIBED - ) { + && (int)$subscriber->getSubscriberStatus() === Subscriber::STATUS_SUBSCRIBED) { throw new LocalizedException( __('This email address is already subscribed.') ); } - $status = (int) $this->_subscriberFactory->create()->subscribe($email); - $this->messageManager->addSuccessMessage($this->getSuccessMessage($status)); + $storeId = (int)$this->_storeManager->getStore()->getId(); + $currentCustomerId = $this->getSessionCustomerId($email); + $subscriber = $currentCustomerId + ? $this->subscriptionManager->subscribeCustomer($currentCustomerId, $storeId) + : $this->subscriptionManager->subscribe($email, $storeId); + $message = $this->getSuccessMessage((int)$subscriber->getSubscriberStatus()); + $this->messageManager->addSuccessMessage($message); } catch (LocalizedException $e) { $this->messageManager->addErrorMessage($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addExceptionMessage($e, __('Something went wrong with the subscription.')); } } - /** @var \Magento\Framework\Controller\Result\Redirect $redirect */ - $redirect = $this->resultFactory->create(\Magento\Framework\Controller\ResultFactory::TYPE_REDIRECT); + /** @var Redirect $redirect */ + $redirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); $redirectUrl = $this->_redirect->getRedirectUrl(); return $redirect->setUrl($redirectUrl); } + /** + * Get customer id from session if he is owner of the email + * + * @param string $email + * @return int|null + */ + private function getSessionCustomerId(string $email): ?int + { + if (!$this->_customerSession->isLoggedIn()) { + return null; + } + + $customer = $this->_customerSession->getCustomerDataObject(); + if ($customer->getEmail() !== $email) { + return null; + } + + return (int)$this->_customerSession->getId(); + } + /** * Get success message * diff --git a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php index 309bfadab41b3..59e67e7aa32a7 100644 --- a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php +++ b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php @@ -5,12 +5,19 @@ */ namespace Magento\Newsletter\Model\Plugin; -use Magento\Customer\Api\CustomerRepositoryInterface as CustomerRepository; +use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Customer\Api\Data\CustomerInterface; -use Magento\Newsletter\Model\SubscriberFactory; +use Magento\Customer\Model\Config\Share; use Magento\Framework\Api\ExtensionAttributesFactory; -use Magento\Newsletter\Model\ResourceModel\Subscriber; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Newsletter\Model\Subscriber; +use Magento\Newsletter\Model\ResourceModel\Subscriber\CollectionFactory; use Magento\Customer\Api\Data\CustomerExtensionInterface; +use Magento\Newsletter\Model\SubscriberFactory; +use Magento\Newsletter\Model\SubscriptionManagerInterface; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManagerInterface; +use Psr\Log\LoggerInterface; /** * Newsletter Plugin for customer @@ -18,42 +25,70 @@ class CustomerPlugin { /** - * Factory used for manipulating newsletter subscriptions - * - * @var SubscriberFactory + * @var ExtensionAttributesFactory */ - private $subscriberFactory; + private $extensionFactory; /** - * @var ExtensionAttributesFactory + * @var CollectionFactory */ - private $extensionFactory; + private $collectionFactory; + + /** + * @var SubscriptionManagerInterface + */ + private $subscriptionManager; /** - * @var Subscriber + * @var Share */ - private $subscriberResource; + private $shareConfig; + + /** + * @var StoreManagerInterface + */ + private $storeManager; /** * @var array */ - private $customerSubscriptionStatus = []; + private $customerSubscriber = []; + + /** + * @var SubscriberFactory + */ + private $subscriberFactory; + + /** + * @var LoggerInterface + */ + private $logger; /** - * Initialize dependencies. - * * @param SubscriberFactory $subscriberFactory * @param ExtensionAttributesFactory $extensionFactory - * @param Subscriber $subscriberResource + * @param CollectionFactory $collectionFactory + * @param SubscriptionManagerInterface $subscriptionManager + * @param Share $shareConfig + * @param StoreManagerInterface $storeManager + * @param LoggerInterface $logger */ public function __construct( SubscriberFactory $subscriberFactory, ExtensionAttributesFactory $extensionFactory, - Subscriber $subscriberResource + CollectionFactory $collectionFactory, + SubscriptionManagerInterface $subscriptionManager, + Share $shareConfig, + StoreManagerInterface $storeManager, + LoggerInterface $logger ) { $this->subscriberFactory = $subscriberFactory; $this->extensionFactory = $extensionFactory; - $this->subscriberResource = $subscriberResource; + $this->collectionFactory = $collectionFactory; + $this->subscriptionManager = $subscriptionManager; + $this->shareConfig = $shareConfig; + $this->storeManager = $storeManager; + $this->logger = $logger; } /** @@ -61,128 +96,228 @@ public function __construct( * * If we have extension attribute (is_subscribed) we need to subscribe that customer * - * @param CustomerRepository $subject + * @param CustomerRepositoryInterface $subject * @param CustomerInterface $result * @param CustomerInterface $customer * @return CustomerInterface * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function afterSave(CustomerRepository $subject, CustomerInterface $result, CustomerInterface $customer) - { - $resultId = $result->getId(); - /** @var \Magento\Newsletter\Model\Subscriber $subscriber */ - $subscriber = $this->subscriberFactory->create(); + public function afterSave( + CustomerRepositoryInterface $subject, + CustomerInterface $result, + CustomerInterface $customer + ) { + $subscriber = $this->getSubscriber($result); + $subscribeStatus = $this->getIsSubscribedFromExtensionAttr($customer) ?? $subscriber->isSubscribed(); + $needToUpdate = $this->isSubscriptionChanged($result, $subscriber, $subscribeStatus); - $subscriber->updateSubscription($resultId); - // update the result only if the original customer instance had different value. - $initialExtensionAttributes = $result->getExtensionAttributes(); - if ($initialExtensionAttributes === null) { - /** @var CustomerExtensionInterface $initialExtensionAttributes */ - $initialExtensionAttributes = $this->extensionFactory->create(CustomerInterface::class); - $result->setExtensionAttributes($initialExtensionAttributes); + /** + * If subscriber is waiting to confirm customer registration + * and customer is already confirmed registration + * than need to subscribe customer + */ + if ($subscriber->getStatus() === Subscriber::STATUS_UNCONFIRMED && empty($result->getConfirmation())) { + $needToUpdate = true; + $subscribeStatus = true; } + if ($needToUpdate) { + $storeId = $this->getCurrentStoreId($result); + $subscriber = $subscribeStatus + ? $this->subscriptionManager->subscribeCustomer((int)$result->getId(), $storeId) + : $this->subscriptionManager->unsubscribeCustomer((int)$result->getId(), $storeId); + $this->customerSubscriber[(int)$result->getId()] = $subscriber; + } + $this->addIsSubscribedExtensionAttr($result, $subscriber->isSubscribed()); + + return $result; + } + /** + * Get subscription status from extension customer attribute + * + * @param CustomerInterface $customer + * @return bool|null + */ + private function getIsSubscribedFromExtensionAttr(CustomerInterface $customer): ?bool + { $newExtensionAttributes = $customer->getExtensionAttributes(); - if ($newExtensionAttributes - && $initialExtensionAttributes->getIsSubscribed() !== $newExtensionAttributes->getIsSubscribed() - ) { - if ($newExtensionAttributes->getIsSubscribed()) { - $subscriber->subscribeCustomerById($resultId); - } else { - $subscriber->unsubscribeCustomerById($resultId); - } + if ($newExtensionAttributes === null || $newExtensionAttributes->getIsSubscribed() === null) { + return null; } - $isSubscribed = $subscriber->isSubscribed(); - $this->customerSubscriptionStatus[$resultId] = $isSubscribed; - $initialExtensionAttributes->setIsSubscribed($isSubscribed); + return (bool)$newExtensionAttributes->getIsSubscribed(); + } - return $result; + /** + * Get is customer subscription changed + * + * @param CustomerInterface $customer + * @param Subscriber $subscriber + * @param bool $newStatus + * @return bool + */ + private function isSubscriptionChanged(CustomerInterface $customer, Subscriber $subscriber, bool $newStatus): bool + { + if ($subscriber->isSubscribed() !== $newStatus) { + return true; + } + + if (!$subscriber->getId()) { + return false; + } + + /** + * If customer has changed email or subscriber was loaded by email + * than need to update customer subscription + */ + return $customer->getEmail() !== $subscriber->getEmail() || (int)$subscriber->getCustomerId() === 0; } /** * Plugin around delete customer that updates any newsletter subscription that may have existed. * - * @param CustomerRepository $subject + * @param CustomerRepositoryInterface $subject * @param callable $deleteCustomerById Function we are wrapping around * @param int $customerId Input to the function * @return bool */ public function aroundDeleteById( - CustomerRepository $subject, + CustomerRepositoryInterface $subject, callable $deleteCustomerById, $customerId ) { $customer = $subject->getById($customerId); $result = $deleteCustomerById($customerId); - /** @var \Magento\Newsletter\Model\Subscriber $subscriber */ - $subscriber = $this->subscriberFactory->create(); - $subscriber->loadByEmail($customer->getEmail()); - if ($subscriber->getId()) { - $subscriber->delete(); - } + $this->deleteSubscriptionsAfterCustomerDelete($customer); + return $result; } /** * Plugin after delete customer that updates any newsletter subscription that may have existed. * - * @param CustomerRepository $subject + * @param CustomerRepositoryInterface $subject * @param bool $result * @param CustomerInterface $customer * @return bool * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function afterDelete(CustomerRepository $subject, $result, CustomerInterface $customer) + public function afterDelete(CustomerRepositoryInterface $subject, $result, CustomerInterface $customer) { - $subscriber = $this->subscriberFactory->create(); - $subscriber->loadByEmail($customer->getEmail()); - if ($subscriber->getId()) { - $subscriber->delete(); - } + $this->deleteSubscriptionsAfterCustomerDelete($customer); return $result; } /** * Plugin after getById customer that obtains newsletter subscription status for given customer. * - * @param CustomerRepository $subject + * @param CustomerRepositoryInterface $subject * @param CustomerInterface $customer * @return CustomerInterface * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function afterGetById(CustomerRepository $subject, CustomerInterface $customer) + public function afterGetById(CustomerRepositoryInterface $subject, CustomerInterface $customer) { - $extensionAttributes = $customer->getExtensionAttributes(); + $isSubscribed = $this->getSubscriber($customer)->isSubscribed(); + $this->addIsSubscribedExtensionAttr($customer, $isSubscribed); + + return $customer; + } + /** + * Set Is Subscribed extension attribute + * + * @param CustomerInterface $customer + * @param bool $isSubscribed + */ + private function addIsSubscribedExtensionAttr(CustomerInterface $customer, bool $isSubscribed): void + { + $extensionAttributes = $customer->getExtensionAttributes(); if ($extensionAttributes === null) { /** @var CustomerExtensionInterface $extensionAttributes */ $extensionAttributes = $this->extensionFactory->create(CustomerInterface::class); $customer->setExtensionAttributes($extensionAttributes); } - if ($extensionAttributes->getIsSubscribed() === null) { - $isSubscribed = $this->isSubscribed($customer); - $extensionAttributes->setIsSubscribed($isSubscribed); + $extensionAttributes->setIsSubscribed($isSubscribed); + } + + /** + * Delete customer subscriptions + * + * @param CustomerInterface $customer + * @return void + */ + private function deleteSubscriptionsAfterCustomerDelete(CustomerInterface $customer): void + { + $collection = $this->collectionFactory->create(); + $collection->addFieldToFilter('subscriber_email', $customer->getEmail()); + if ($this->shareConfig->isWebsiteScope()) { + try { + $storeIds = $this->storeManager->getWebsite($customer->getWebsiteId())->getStoreIds(); + $collection->addFieldToFilter('store_id', ['in' => $storeIds]); + } catch (NoSuchEntityException $exception) { + $this->logger->error($exception); + } + } + /** @var Subscriber $subscriber */ + foreach ($collection as $subscriber) { + $subscriber->delete(); } + } - return $customer; + /** + * Get Subscriber model by customer + * + * @param CustomerInterface $customer + * @return Subscriber + */ + private function getSubscriber(CustomerInterface $customer): Subscriber + { + $customerId = (int)$customer->getId(); + if (isset($this->customerSubscriber[$customerId])) { + return $this->customerSubscriber[$customerId]; + } + + /** @var Subscriber $subscriber */ + $subscriber = $this->subscriberFactory->create(); + $websiteId = $this->getCurrentWebsiteId($customer); + $subscriber->loadByCustomer((int)$customer->getId(), $websiteId); + /** + * If subscriber was't found by customer id then try to find subscriber by customer email. + * It need when the customer is creating and he has already subscribed as guest by same email. + */ + if (!$subscriber->getId()) { + $subscriber->loadBySubscriberEmail((string)$customer->getEmail(), $websiteId); + } + $this->customerSubscriber[$customerId] = $subscriber; + + return $subscriber; } /** - * This method returns newsletters subscription status for given customer. + * Retrieve current website id * * @param CustomerInterface $customer - * @return bool + * @return int + */ + private function getCurrentWebsiteId(CustomerInterface $customer): int + { + return (int)$this->storeManager->getStore($this->getCurrentStoreId($customer))->getWebsiteId(); + } + + /** + * Retrieve current store id + * + * @param CustomerInterface $customer + * @return int */ - private function isSubscribed(CustomerInterface $customer) + private function getCurrentStoreId(CustomerInterface $customer): int { - $customerId = $customer->getId(); - if (!isset($this->customerSubscriptionStatus[$customerId])) { - $subscriber = $this->subscriberResource->loadByCustomerData($customer); - $this->customerSubscriptionStatus[$customerId] = isset($subscriber['subscriber_status']) - && $subscriber['subscriber_status'] == 1; + $storeId = (int)$this->storeManager->getStore()->getId(); + if ($storeId === Store::DEFAULT_STORE_ID) { + $storeId = (int)$customer->getStoreId(); } - return $this->customerSubscriptionStatus[$customerId]; + return $storeId; } } diff --git a/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php b/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php index 52009dad6614b..1fc68771e74cb 100644 --- a/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php +++ b/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php @@ -208,6 +208,31 @@ public function addSubscriberFilter($subscriberId) return $this; } + /** + * Set filter for queue by customer + * + * @param int $customerId + * @return $this + */ + public function addCustomerFilter(int $customerId): self + { + $this->getSelect() + ->join( + ['link' => $this->getTable('newsletter_queue_link')], + 'main_table.queue_id=link.queue_id', + ['letter_sent_at'] + )->join( + ['subscriber' => $this->getTable('newsletter_subscriber')], + 'link.subscriber_id=subscriber.subscriber_id', + ['subscriber_store_id' => 'subscriber.store_id'] + )->where( + 'subscriber.customer_id = ?', + $customerId + ); + + return $this; + } + /** * Add filter by only ready for sending item * diff --git a/app/code/Magento/Newsletter/Model/ResourceModel/Subscriber.php b/app/code/Magento/Newsletter/Model/ResourceModel/Subscriber.php index 8ca489d89c1df..6391219e23c7e 100644 --- a/app/code/Magento/Newsletter/Model/ResourceModel/Subscriber.php +++ b/app/code/Magento/Newsletter/Model/ResourceModel/Subscriber.php @@ -5,23 +5,30 @@ */ namespace Magento\Newsletter\Model\ResourceModel; +use Magento\Customer\Api\Data\CustomerInterface; use Magento\Framework\App\ObjectManager; +use Magento\Framework\DB\Adapter\AdapterInterface; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Math\Random; +use Magento\Framework\Model\ResourceModel\Db\AbstractDb; +use Magento\Framework\Model\ResourceModel\Db\Context; +use Magento\Framework\Stdlib\DateTime\DateTime; +use Magento\Newsletter\Model\Subscriber as SubscriberModel; use Magento\Store\Model\StoreManagerInterface; /** * Newsletter subscriber resource model * - * @author Magento Core Team <core@magentocommerce.com> - * + * @author Magento Core Team <core@magentocommerce.com> * @api * @since 100.0.2 */ -class Subscriber extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb +class Subscriber extends AbstractDb { /** * DB connection * - * @var \Magento\Framework\DB\Adapter\AdapterInterface + * @var AdapterInterface */ protected $connection; @@ -42,12 +49,12 @@ class Subscriber extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb /** * Date * - * @var \Magento\Framework\Stdlib\DateTime\DateTime + * @var DateTime */ protected $_date; /** - * @var \Magento\Framework\Math\Random + * @var Random */ protected $mathRandom; @@ -61,16 +68,16 @@ class Subscriber extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb /** * Construct * - * @param \Magento\Framework\Model\ResourceModel\Db\Context $context - * @param \Magento\Framework\Stdlib\DateTime\DateTime $date - * @param \Magento\Framework\Math\Random $mathRandom + * @param Context $context + * @param DateTime $date + * @param Random $mathRandom * @param string $connectionName * @param StoreManagerInterface $storeManager */ public function __construct( - \Magento\Framework\Model\ResourceModel\Db\Context $context, - \Magento\Framework\Stdlib\DateTime\DateTime $date, - \Magento\Framework\Math\Random $mathRandom, + Context $context, + DateTime $date, + Random $mathRandom, $connectionName = null, StoreManagerInterface $storeManager = null ) { @@ -104,65 +111,51 @@ public function setMessagesScope($scope) } /** - * Load subscriber from DB by email + * Load by subscriber email * - * @param string $subscriberEmail + * @param string $email + * @param int $websiteId * @return array */ - public function loadByEmail($subscriberEmail) + public function loadBySubscriberEmail(string $email, int $websiteId): array { - $select = $this->connection->select()->from($this->getMainTable())->where('subscriber_email=:subscriber_email'); - - $result = $this->connection->fetchRow($select, ['subscriber_email' => $subscriberEmail]); - - if (!$result) { + $storeIds = $this->storeManager->getWebsite($websiteId)->getStoreIds(); + $select = $this->connection->select() + ->from($this->getMainTable()) + ->where('subscriber_email = ?', $email) + ->where('store_id IN (?)', $storeIds) + ->limit(1); + + $data = $this->connection->fetchRow($select); + if (!$data) { return []; } - return $result; + return $data; } /** - * Load subscriber by customer + * Load by customer id * - * @param \Magento\Customer\Api\Data\CustomerInterface $customer + * @param int $customerId + * @param int $websiteId * @return array */ - public function loadByCustomerData(\Magento\Customer\Api\Data\CustomerInterface $customer) + public function loadByCustomerId(int $customerId, int $websiteId): array { - $storeIds = $this->storeManager->getWebsite()->getStoreIds(); - - if ($customer->getId()) { - $select = $this->connection - ->select() - ->from($this->getMainTable()) - ->where('customer_id = ?', $customer->getId()) - ->where('store_id IN (?)', $storeIds) - ->limit(1); - - $result = $this->connection->fetchRow($select); - - if ($result) { - return $result; - } - } - - if ($customer->getEmail()) { - $select = $this->connection - ->select() - ->from($this->getMainTable()) - ->where('subscriber_email = ?', $customer->getEmail()) - ->where('store_id IN (?)', $storeIds) - ->limit(1); - - $result = $this->connection->fetchRow($select); - - if ($result) { - return $result; - } + $storeIds = $this->storeManager->getWebsite($websiteId)->getStoreIds(); + $select = $this->connection->select() + ->from($this->getMainTable()) + ->where('customer_id = ?', $customerId) + ->where('store_id IN (?)', $storeIds) + ->limit(1); + + $data = $this->connection->fetchRow($select); + if (!$data) { + return []; } - return []; + return $data; } /** @@ -178,12 +171,12 @@ protected function _generateRandomCode() /** * Updates data when subscriber received * - * @param \Magento\Newsletter\Model\Subscriber $subscriber + * @param SubscriberModel $subscriber * @param \Magento\Newsletter\Model\Queue $queue * @return $this - * @throws \Magento\Framework\Exception\LocalizedException + * @throws LocalizedException */ - public function received(\Magento\Newsletter\Model\Subscriber $subscriber, \Magento\Newsletter\Model\Queue $queue) + public function received(SubscriberModel $subscriber, \Magento\Newsletter\Model\Queue $queue) { $this->connection->beginTransaction(); try { @@ -196,8 +189,41 @@ public function received(\Magento\Newsletter\Model\Subscriber $subscriber, \Mage $this->connection->commit(); } catch (\Exception $e) { $this->connection->rollBack(); - throw new \Magento\Framework\Exception\LocalizedException(__('We cannot mark as received subscriber.')); + throw new LocalizedException(__('We cannot mark as received subscriber.')); } return $this; } + + /** + * Load subscriber from DB by email + * + * @param string $subscriberEmail + * @return array + * @deprecated The subscription should be loaded by website id + * @see loadBySubscriberEmail + */ + public function loadByEmail($subscriberEmail) + { + $websiteId = (int)$this->storeManager->getWebsite()->getId(); + return $this->loadBySubscriberEmail((string)$subscriberEmail, $websiteId); + } + + /** + * Load subscriber by customer + * + * @param CustomerInterface $customer + * @return array + * @deprecated The subscription should be loaded by website id + * @see loadByCustomerId + */ + public function loadByCustomerData(CustomerInterface $customer) + { + $websiteId = (int)$this->storeManager->getWebsite()->getId(); + $data = $this->loadByCustomerId((int)$customer->getId(), $websiteId); + if (empty($data)) { + $data = $this->loadBySubscriberEmail((string)$customer->getEmail(), $websiteId); + } + + return $data; + } } diff --git a/app/code/Magento/Newsletter/Model/Subscriber.php b/app/code/Magento/Newsletter/Model/Subscriber.php index 5df9feacf654b..f33b9929435c3 100644 --- a/app/code/Magento/Newsletter/Model/Subscriber.php +++ b/app/code/Magento/Newsletter/Model/Subscriber.php @@ -9,9 +9,23 @@ use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Customer\Api\Data\CustomerInterfaceFactory; use Magento\Framework\Api\DataObjectHelper; +use Magento\Framework\App\Area; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\ObjectManager; -use Magento\Framework\Exception\MailException; +use Magento\Framework\Data\Collection\AbstractDb; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Mail\Template\TransportBuilder; +use Magento\Framework\Math\Random; +use Magento\Framework\Model\AbstractModel; +use Magento\Framework\Model\Context; +use Magento\Framework\Model\ResourceModel\AbstractResource; +use Magento\Framework\Registry; +use Magento\Framework\Stdlib\DateTime\DateTime; +use Magento\Framework\Translate\Inline\StateInterface; +use Magento\Newsletter\Helper\Data; +use Magento\Store\Model\ScopeInterface; +use Magento\Store\Model\StoreManagerInterface; /** * Subscriber model @@ -33,12 +47,11 @@ * * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - * @SuppressWarnings(PHPMD.CyclomaticComplexity) * * @api * @since 100.0.2 */ -class Subscriber extends \Magento\Framework\Model\AbstractModel +class Subscriber extends AbstractModel { const STATUS_SUBSCRIBED = 1; const STATUS_NOT_ACTIVE = 2; @@ -80,14 +93,14 @@ class Subscriber extends \Magento\Framework\Model\AbstractModel /** * Newsletter data * - * @var \Magento\Newsletter\Helper\Data + * @var Data */ protected $_newsletterData = null; /** * Core store config * - * @var \Magento\Framework\App\Config\ScopeConfigInterface + * @var ScopeConfigInterface */ protected $_scopeConfig; @@ -100,14 +113,14 @@ class Subscriber extends \Magento\Framework\Model\AbstractModel /** * Date - * @var \Magento\Framework\Stdlib\DateTime\DateTime + * @var DateTime */ private $dateTime; /** * Store manager * - * @var \Magento\Store\Model\StoreManagerInterface + * @var StoreManagerInterface */ protected $_storeManager; @@ -122,12 +135,12 @@ class Subscriber extends \Magento\Framework\Model\AbstractModel protected $customerAccountManagement; /** - * @var \Magento\Framework\Mail\Template\TransportBuilder + * @var TransportBuilder */ protected $_transportBuilder; /** - * @var \Magento\Framework\Translate\Inline\StateInterface + * @var StateInterface */ protected $inlineTranslation; @@ -142,51 +155,56 @@ class Subscriber extends \Magento\Framework\Model\AbstractModel private $dataObjectHelper; /** - * Initialize dependencies. - * - * @param \Magento\Framework\Model\Context $context - * @param \Magento\Framework\Registry $registry - * @param \Magento\Newsletter\Helper\Data $newsletterData - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder - * @param \Magento\Store\Model\StoreManagerInterface $storeManager + * @var SubscriptionManagerInterface + */ + private $subscriptionManager; + + /** + * @param Context $context + * @param Registry $registry + * @param Data $newsletterData + * @param ScopeConfigInterface $scopeConfig + * @param TransportBuilder $transportBuilder + * @param StoreManagerInterface $storeManager * @param \Magento\Customer\Model\Session $customerSession * @param CustomerRepositoryInterface $customerRepository * @param AccountManagementInterface $customerAccountManagement - * @param \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation - * @param \Magento\Framework\Model\ResourceModel\AbstractResource|null $resource - * @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection + * @param StateInterface $inlineTranslation + * @param AbstractResource|null $resource + * @param AbstractDb|null $resourceCollection * @param array $data - * @param \Magento\Framework\Stdlib\DateTime\DateTime|null $dateTime + * @param DateTime|null $dateTime * @param CustomerInterfaceFactory|null $customerFactory * @param DataObjectHelper|null $dataObjectHelper + * @param SubscriptionManagerInterface|null $subscriptionManager * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Framework\Model\Context $context, - \Magento\Framework\Registry $registry, - \Magento\Newsletter\Helper\Data $newsletterData, - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder, - \Magento\Store\Model\StoreManagerInterface $storeManager, + Context $context, + Registry $registry, + Data $newsletterData, + ScopeConfigInterface $scopeConfig, + TransportBuilder $transportBuilder, + StoreManagerInterface $storeManager, \Magento\Customer\Model\Session $customerSession, CustomerRepositoryInterface $customerRepository, AccountManagementInterface $customerAccountManagement, - \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation, - \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, - \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, + StateInterface $inlineTranslation, + AbstractResource $resource = null, + AbstractDb $resourceCollection = null, array $data = [], - \Magento\Framework\Stdlib\DateTime\DateTime $dateTime = null, + DateTime $dateTime = null, CustomerInterfaceFactory $customerFactory = null, - DataObjectHelper $dataObjectHelper = null + DataObjectHelper $dataObjectHelper = null, + SubscriptionManagerInterface $subscriptionManager = null ) { $this->_newsletterData = $newsletterData; $this->_scopeConfig = $scopeConfig; $this->_transportBuilder = $transportBuilder; $this->_storeManager = $storeManager; $this->_customerSession = $customerSession; - $this->dateTime = $dateTime ?: \Magento\Framework\App\ObjectManager::getInstance()->get( - \Magento\Framework\Stdlib\DateTime\DateTime::class + $this->dateTime = $dateTime ?: ObjectManager::getInstance()->get( + DateTime::class ); $this->customerFactory = $customerFactory ?: ObjectManager::getInstance() ->get(CustomerInterfaceFactory::class); @@ -195,6 +213,8 @@ public function __construct( $this->customerRepository = $customerRepository; $this->customerAccountManagement = $customerAccountManagement; $this->inlineTranslation = $inlineTranslation; + $this->subscriptionManager = $subscriptionManager ?: ObjectManager::getInstance() + ->get(SubscriptionManagerInterface::class); parent::__construct($context, $registry, $resource, $resourceCollection, $data); } @@ -205,7 +225,7 @@ public function __construct( */ protected function _construct() { - $this->_init(\Magento\Newsletter\Model\ResourceModel\Subscriber::class); + $this->_init(ResourceModel\Subscriber::class); } /** @@ -357,51 +377,38 @@ public function isSubscribed() } /** - * Load subscriber data from resource model by email + * Load by subscriber email * - * @param string $subscriberEmail + * @param string $email + * @param int $websiteId * @return $this */ - public function loadByEmail($subscriberEmail) + public function loadBySubscriberEmail(string $email, int $websiteId): Subscriber { - $storeId = $this->_storeManager->getStore()->getId(); - $customerData = ['store_id' => $storeId, 'email'=> $subscriberEmail]; + /** @var ResourceModel\Subscriber $resource */ + $resource = $this->getResource(); + $data = $resource->loadBySubscriberEmail($email, $websiteId); + $this->addData($data); + $this->setOrigData(); - /** @var \Magento\Customer\Api\Data\CustomerInterface $customer */ - $customer = $this->customerFactory->create(); - $this->dataObjectHelper->populateWithArray( - $customer, - $customerData, - \Magento\Customer\Api\Data\CustomerInterface::class - ); - $this->addData($this->getResource()->loadByCustomerData($customer)); return $this; } /** - * Load subscriber info by customerId + * Load by customer id * * @param int $customerId + * @param int $websiteId * @return $this */ - public function loadByCustomerId($customerId) + public function loadByCustomer(int $customerId, int $websiteId): Subscriber { - try { - $customerData = $this->customerRepository->getById($customerId); - $customerData->setStoreId($this->_storeManager->getStore()->getId()); - if ($customerData->getWebsiteId() === null) { - $customerData->setWebsiteId($this->_storeManager->getStore()->getWebsiteId()); - } - $data = $this->getResource()->loadByCustomerData($customerData); - $this->addData($data); - if (!empty($data) && $customerData->getId() && !$this->getCustomerId()) { - $this->setCustomerId($customerData->getId()); - $this->setSubscriberConfirmCode($this->randomSequence()); - $this->save(); - } - // phpcs:ignore Magento2.CodeAnalysis.EmptyBlock - } catch (NoSuchEntityException $e) { - } + /** @var ResourceModel\Subscriber $resource */ + $resource = $this->getResource(); + $data = $resource->loadByCustomerId($customerId, $websiteId); + $this->addData($data); + $this->setOrigData(); + return $this; } @@ -418,95 +425,23 @@ public function randomSequence($length = 32) $char = array_merge(range('a', 'z'), range(0, 9)); $charLen = count($char) - 1; for ($i = 0; $i < $length; $i++) { - $disc = \Magento\Framework\Math\Random::getRandomNumber(0, $charLen); + $disc = Random::getRandomNumber(0, $charLen); $par[$i] = $char[$disc]; $id = $id . $char[$disc]; } return $id; } - /** - * Subscribes by email - * - * @param string $email - * @throws \Exception - * @return int - * - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - public function subscribe($email) - { - $this->loadByEmail($email); - - if ($this->getId() && $this->getStatus() == self::STATUS_SUBSCRIBED) { - return $this->getStatus(); - } - - if (!$this->getId()) { - $this->setSubscriberConfirmCode($this->randomSequence()); - } - - $isConfirmNeed = $this->_scopeConfig->getValue( - self::XML_PATH_CONFIRMATION_FLAG, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) == 1 ? true : false; - - $isSubscribeOwnEmail = $this->_customerSession->isLoggedIn() - && $this->_customerSession->getCustomerDataObject()->getEmail() == $email; - - if (!$this->getId() || $this->getStatus() == self::STATUS_UNSUBSCRIBED - || $this->getStatus() == self::STATUS_NOT_ACTIVE - ) { - if ($isConfirmNeed === true) { - $this->setStatus(self::STATUS_NOT_ACTIVE); - } else { - $this->setStatus(self::STATUS_SUBSCRIBED); - } - $this->setSubscriberEmail($email); - } - - if ($isSubscribeOwnEmail) { - try { - $customer = $this->customerRepository->getById($this->_customerSession->getCustomerId()); - $this->setStoreId($customer->getStoreId()); - $this->setCustomerId($customer->getId()); - } catch (NoSuchEntityException $e) { - $this->setStoreId($this->_storeManager->getStore()->getId()); - $this->setCustomerId(0); - } - } else { - $this->setStoreId($this->_storeManager->getStore()->getId()); - $this->setCustomerId(0); - } - - $this->setStatusChanged(true); - - try { - /* Save model before sending out email */ - $this->save(); - if ($isConfirmNeed === true) { - $this->sendConfirmationRequestEmail(); - } else { - $this->sendConfirmationSuccessEmail(); - } - return $this->getStatus(); - } catch (\Exception $e) { - // phpcs:ignore Magento2.Exceptions.DirectThrow - throw new \Exception($e->getMessage()); - } - } - /** * Unsubscribes loaded subscription * - * @throws \Magento\Framework\Exception\LocalizedException + * @throws LocalizedException * @return $this */ public function unsubscribe() { if ($this->hasCheckCode() && $this->getCode() != $this->getCheckCode()) { - throw new \Magento\Framework\Exception\LocalizedException( + throw new LocalizedException( __('This is an invalid subscription confirmation code.') ); } @@ -518,149 +453,6 @@ public function unsubscribe() return $this; } - /** - * Subscribe the customer with the id provided - * - * @param int $customerId - * @return $this - */ - public function subscribeCustomerById($customerId) - { - return $this->_updateCustomerSubscription($customerId, true); - } - - /** - * Unsubscribe the customer with the id provided - * - * @param int $customerId - * @return $this - */ - public function unsubscribeCustomerById($customerId) - { - return $this->_updateCustomerSubscription($customerId, false); - } - - /** - * Update the subscription based on latest information of associated customer. - * - * @param int $customerId - * @return $this - */ - public function updateSubscription($customerId) - { - $this->loadByCustomerId($customerId); - $this->_updateCustomerSubscription($customerId, $this->isSubscribed()); - return $this; - } - - /** - * Saving customer subscription status - * - * @param int $customerId - * @param bool $subscribe indicates whether the customer should be subscribed or unsubscribed - * @return $this - * - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - protected function _updateCustomerSubscription($customerId, $subscribe) - { - try { - $customerData = $this->customerRepository->getById($customerId); - } catch (NoSuchEntityException $e) { - return $this; - } - - $this->loadByCustomerId($customerId); - if (!$subscribe && !$this->getId()) { - return $this; - } - - if (!$this->getId()) { - $this->setSubscriberConfirmCode($this->randomSequence()); - } - - $sendInformationEmail = false; - $status = self::STATUS_SUBSCRIBED; - $isConfirmNeed = $this->_scopeConfig->getValue( - self::XML_PATH_CONFIRMATION_FLAG, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) == 1 ? true : false; - if ($subscribe) { - if (AccountManagementInterface::ACCOUNT_CONFIRMATION_REQUIRED - == $this->customerAccountManagement->getConfirmationStatus($customerId) - ) { - if ($this->getId() && $this->getStatus() == self::STATUS_SUBSCRIBED) { - // if a customer was already subscribed then keep the subscribed - $status = self::STATUS_SUBSCRIBED; - } else { - $status = self::STATUS_UNCONFIRMED; - } - } elseif ($isConfirmNeed) { - if ($this->getStatus() != self::STATUS_SUBSCRIBED) { - $status = self::STATUS_NOT_ACTIVE; - } - } - } elseif (($this->getStatus() == self::STATUS_UNCONFIRMED) && ($customerData->getConfirmation() === null)) { - $status = self::STATUS_SUBSCRIBED; - $sendInformationEmail = true; - } elseif (($this->getStatus() == self::STATUS_NOT_ACTIVE) && ($customerData->getConfirmation() === null)) { - $status = self::STATUS_NOT_ACTIVE; - } else { - $status = self::STATUS_UNSUBSCRIBED; - } - /** - * If subscription status has been changed then send email to the customer - */ - if ($status != self::STATUS_UNCONFIRMED && $status != $this->getStatus()) { - $sendInformationEmail = true; - } - - if ($status != $this->getStatus()) { - $this->setStatusChanged(true); - } - - $this->setStatus($status); - - $storeId = $customerData->getStoreId(); - if ((int)$customerData->getStoreId() === 0) { - $storeId = $this->_storeManager->getWebsite($customerData->getWebsiteId())->getDefaultStore()->getId(); - } - - if (!$this->getId()) { - $this->setStoreId($storeId) - ->setCustomerId($customerData->getId()) - ->setEmail($customerData->getEmail()); - } else { - $this->setStoreId($storeId) - ->setEmail($customerData->getEmail()); - } - - $this->save(); - $sendSubscription = $sendInformationEmail; - if ($sendSubscription === null xor $sendSubscription && $this->isStatusChanged()) { - try { - switch ($status) { - case self::STATUS_UNSUBSCRIBED: - $this->sendUnsubscriptionEmail(); - break; - case self::STATUS_SUBSCRIBED: - $this->sendConfirmationSuccessEmail(); - break; - case self::STATUS_NOT_ACTIVE: - if ($isConfirmNeed) { - $this->sendConfirmationRequestEmail(); - } - break; - } - } catch (MailException $e) { - // If we are not able to send a new account email, this should be ignored - $this->_logger->critical($e); - } - } - return $this; - } - /** * Confirms subscriber newsletter * @@ -684,10 +476,10 @@ public function confirm($code) /** * Mark receiving subscriber of queue newsletter * - * @param \Magento\Newsletter\Model\Queue $queue + * @param Queue $queue * @return Subscriber */ - public function received(\Magento\Newsletter\Model\Queue $queue) + public function received(Queue $queue) { $this->getResource()->received($this, $queue); return $this; @@ -700,54 +492,13 @@ public function received(\Magento\Newsletter\Model\Queue $queue) */ public function sendConfirmationRequestEmail() { - if ($this->getImportMode()) { - return $this; - } - - if (!$this->_scopeConfig->getValue( - self::XML_PATH_CONFIRM_EMAIL_TEMPLATE, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) || !$this->_scopeConfig->getValue( - self::XML_PATH_CONFIRM_EMAIL_IDENTITY, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) - ) { - return $this; - } - - $this->inlineTranslation->suspend(); - - $this->_transportBuilder->setTemplateIdentifier( - $this->_scopeConfig->getValue( - self::XML_PATH_CONFIRM_EMAIL_TEMPLATE, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) - )->setTemplateOptions( - [ - 'area' => \Magento\Framework\App\Area::AREA_FRONTEND, - 'store' => $this->_storeManager->getStore()->getId(), - ] - )->setTemplateVars( - [ - 'subscriber' => $this, - 'store' => $this->_storeManager->getStore(), - 'subscriber_data' => [ - 'confirmation_link' => $this->getConfirmationLink(), - ], - ] - )->setFrom( - $this->_scopeConfig->getValue( - self::XML_PATH_CONFIRM_EMAIL_IDENTITY, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) - )->addTo( - $this->getEmail(), - $this->getName() - ); - $transport = $this->_transportBuilder->getTransport(); - $transport->sendMessage(); - - $this->inlineTranslation->resume(); + $vars = [ + 'store' => $this->_storeManager->getStore($this->getStoreId()), + 'subscriber_data' => [ + 'confirmation_link' => $this->getConfirmationLink(), + ], + ]; + $this->sendEmail(self::XML_PATH_CONFIRM_EMAIL_TEMPLATE, self::XML_PATH_CONFIRM_EMAIL_IDENTITY, $vars); return $this; } @@ -759,48 +510,7 @@ public function sendConfirmationRequestEmail() */ public function sendConfirmationSuccessEmail() { - if ($this->getImportMode()) { - return $this; - } - - if (!$this->_scopeConfig->getValue( - self::XML_PATH_SUCCESS_EMAIL_TEMPLATE, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) || !$this->_scopeConfig->getValue( - self::XML_PATH_SUCCESS_EMAIL_IDENTITY, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) - ) { - return $this; - } - - $this->inlineTranslation->suspend(); - - $this->_transportBuilder->setTemplateIdentifier( - $this->_scopeConfig->getValue( - self::XML_PATH_SUCCESS_EMAIL_TEMPLATE, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) - )->setTemplateOptions( - [ - 'area' => \Magento\Framework\App\Area::AREA_FRONTEND, - 'store' => $this->_storeManager->getStore()->getId(), - ] - )->setTemplateVars( - ['subscriber' => $this] - )->setFrom( - $this->_scopeConfig->getValue( - self::XML_PATH_SUCCESS_EMAIL_IDENTITY, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) - )->addTo( - $this->getEmail(), - $this->getName() - ); - $transport = $this->_transportBuilder->getTransport(); - $transport->sendMessage(); - - $this->inlineTranslation->resume(); + $this->sendEmail(self::XML_PATH_SUCCESS_EMAIL_TEMPLATE, self::XML_PATH_SUCCESS_EMAIL_IDENTITY); return $this; } @@ -811,40 +521,45 @@ public function sendConfirmationSuccessEmail() * @return $this */ public function sendUnsubscriptionEmail() + { + $this->sendEmail(self::XML_PATH_UNSUBSCRIBE_EMAIL_TEMPLATE, self::XML_PATH_UNSUBSCRIBE_EMAIL_IDENTITY); + + return $this; + } + + /** + * Send email about change status + * + * @param string $emailTemplatePath + * @param string $emailIdentityPath + * @param array $templateVars + * @return void + */ + private function sendEmail(string $emailTemplatePath, string $emailIdentityPath, array $templateVars = []): void { if ($this->getImportMode()) { - return $this; + return; } - if (!$this->_scopeConfig->getValue( - self::XML_PATH_UNSUBSCRIBE_EMAIL_TEMPLATE, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) || !$this->_scopeConfig->getValue( - self::XML_PATH_UNSUBSCRIBE_EMAIL_IDENTITY, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) - ) { - return $this; + + $template = $this->_scopeConfig->getValue($emailTemplatePath, ScopeInterface::SCOPE_STORE, $this->getStoreId()); + $identity = $this->_scopeConfig->getValue($emailIdentityPath, ScopeInterface::SCOPE_STORE, $this->getStoreId()); + if (!$template || !$identity) { + return; } + $templateVars += ['subscriber' => $this]; $this->inlineTranslation->suspend(); - $this->_transportBuilder->setTemplateIdentifier( - $this->_scopeConfig->getValue( - self::XML_PATH_UNSUBSCRIBE_EMAIL_TEMPLATE, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) + $template )->setTemplateOptions( [ - 'area' => \Magento\Framework\App\Area::AREA_FRONTEND, - 'store' => $this->_storeManager->getStore()->getId(), + 'area' => Area::AREA_FRONTEND, + 'store' => $this->getStoreId(), ] )->setTemplateVars( - ['subscriber' => $this] + $templateVars )->setFrom( - $this->_scopeConfig->getValue( - self::XML_PATH_UNSUBSCRIBE_EMAIL_IDENTITY, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) + $identity )->addTo( $this->getEmail(), $this->getName() @@ -853,8 +568,6 @@ public function sendUnsubscriptionEmail() $transport->sendMessage(); $this->inlineTranslation->resume(); - - return $this; } /** @@ -884,4 +597,125 @@ public function beforeSave() } return $this; } + + /** + * Load subscriber data from resource model by email + * + * @param string $subscriberEmail + * @return $this + * @deprecated The subscription should be loaded by website id + * @see loadBySubscriberEmail + */ + public function loadByEmail($subscriberEmail) + { + $websiteId = (int)$this->_storeManager->getStore()->getWebsiteId(); + $this->loadBySubscriberEmail($subscriberEmail, $websiteId); + + return $this; + } + + /** + * Load subscriber info by customerId + * + * @param int $customerId + * @return $this + * @deprecated The subscription should be loaded by website id + * @see loadByCustomer + */ + public function loadByCustomerId($customerId) + { + try { + $customer = $this->customerRepository->getById($customerId); + $websiteId = (int)$this->_storeManager->getStore()->getWebsiteId(); + $this->loadByCustomer((int)$customerId, $websiteId); + if ($customer->getId() && !$this->getCustomerId()) { + $this->setCustomerId($customer->getId()); + $this->setSubscriberConfirmCode($this->randomSequence()); + $this->save(); + } + // phpcs:ignore Magento2.CodeAnalysis.EmptyBlock + } catch (NoSuchEntityException $e) { + } + return $this; + } + + /** + * Subscribes by email + * + * @param string $email + * @return int + * @deprecated The subscription should be updated by store id + * @see \Magento\Newsletter\Model\SubscriptionManager::subscribe + */ + public function subscribe($email) + { + $storeId = (int)$this->_storeManager->getStore()->getId(); + $subscriber = $this->subscriptionManager->subscribe($email, $storeId); + $this->addData($subscriber->getData()); + + return $this->getStatus(); + } + + /** + * Subscribe the customer with the id provided + * + * @param int $customerId + * @return $this + * @deprecated The subscription should be updated by store id + * @see \Magento\Newsletter\Model\SubscriptionManager::subscribeCustomer + */ + public function subscribeCustomerById($customerId) + { + return $this->_updateCustomerSubscription($customerId, true); + } + + /** + * Unsubscribe the customer with the id provided + * + * @param int $customerId + * @return $this + * @deprecated The subscription should be updated by store id + * @see \Magento\Newsletter\Model\SubscriptionManager::unsubscribeCustomer + */ + public function unsubscribeCustomerById($customerId) + { + return $this->_updateCustomerSubscription($customerId, false); + } + + /** + * Update the subscription based on latest information of associated customer. + * + * @param int $customerId + * @return $this + * @deprecated The subscription should be updated by store id + * @see \Magento\Newsletter\Model\SubscriptionManager::subscribeCustomer + */ + public function updateSubscription($customerId) + { + $this->loadByCustomerId($customerId); + $this->_updateCustomerSubscription($customerId, $this->isSubscribed()); + return $this; + } + + /** + * Saving customer subscription status + * + * @param int $customerId + * @param bool $subscribe indicates whether the customer should be subscribed or unsubscribed + * @return $this + * @deprecated The subscription should be updated by store id + * @see \Magento\Newsletter\Model\SubscriptionManager::subscribeCustomer + */ + protected function _updateCustomerSubscription($customerId, $subscribe) + { + $storeId = (int)$this->_storeManager->getStore()->getId(); + if ($subscribe) { + $subscriber = $this->subscriptionManager->subscribeCustomer((int)$customerId, $storeId); + } else { + $subscriber = $this->subscriptionManager->unsubscribeCustomer((int)$customerId, $storeId); + } + $this->addData($subscriber->getData()); + + return $this; + } } diff --git a/app/code/Magento/Newsletter/Model/SubscriptionManager.php b/app/code/Magento/Newsletter/Model/SubscriptionManager.php new file mode 100644 index 0000000000000..846d095625e0c --- /dev/null +++ b/app/code/Magento/Newsletter/Model/SubscriptionManager.php @@ -0,0 +1,314 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Newsletter\Model; + +use Magento\Customer\Api\AccountManagementInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\Exception\MailException; +use Magento\Store\Model\ScopeInterface; +use Magento\Store\Model\StoreManagerInterface; +use Psr\Log\LoggerInterface; + +/** + * Class to update newsletter subscription status + */ +class SubscriptionManager implements SubscriptionManagerInterface +{ + /** + * @var SubscriberFactory + */ + private $subscriberFactory; + + /** + * @var LoggerInterface + */ + private $logger; + + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @var ScopeConfigInterface + */ + private $scopeConfig; + + /** + * @var AccountManagementInterface + */ + private $customerAccountManagement; + + /** + * @var CustomerRepositoryInterface + */ + private $customerRepository; + + /** + * @param SubscriberFactory $subscriberFactory + * @param LoggerInterface $logger + * @param StoreManagerInterface $storeManager + * @param ScopeConfigInterface $scopeConfig + * @param AccountManagementInterface $customerAccountManagement + * @param CustomerRepositoryInterface $customerRepository + */ + public function __construct( + SubscriberFactory $subscriberFactory, + LoggerInterface $logger, + StoreManagerInterface $storeManager, + ScopeConfigInterface $scopeConfig, + AccountManagementInterface $customerAccountManagement, + CustomerRepositoryInterface $customerRepository + ) { + $this->subscriberFactory = $subscriberFactory; + $this->logger = $logger; + $this->storeManager = $storeManager; + $this->scopeConfig = $scopeConfig; + $this->customerAccountManagement = $customerAccountManagement; + $this->customerRepository = $customerRepository; + } + + /** + * @inheritdoc + */ + public function subscribe(string $email, int $storeId): Subscriber + { + $websiteId = (int)$this->storeManager->getStore($storeId)->getWebsiteId(); + $subscriber = $this->subscriberFactory->create()->loadBySubscriberEmail($email, $websiteId); + $currentStatus = (int)$subscriber->getStatus(); + if ($currentStatus === Subscriber::STATUS_SUBSCRIBED) { + return $subscriber; + } + + $status = $this->isConfirmNeed($storeId) ? Subscriber::STATUS_NOT_ACTIVE : Subscriber::STATUS_SUBSCRIBED; + if (!$subscriber->getId()) { + $subscriber->setSubscriberConfirmCode($subscriber->randomSequence()); + $subscriber->setSubscriberEmail($email); + } + $subscriber->setStatus($status) + ->setStoreId($storeId) + ->save(); + + $this->sendEmailAfterChangeStatus($subscriber); + + return $subscriber; + } + + /** + * @inheritdoc + */ + public function unsubscribe(string $email, int $storeId, string $confirmCode): Subscriber + { + $websiteId = (int)$this->storeManager->getStore($storeId)->getWebsiteId(); + /** @var Subscriber $subscriber */ + $subscriber = $this->subscriberFactory->create()->loadBySubscriberEmail($email, $websiteId); + if (!$subscriber->getId()) { + return $subscriber; + } + $subscriber->setCheckCode($confirmCode); + $subscriber->unsubscribe(); + + return $subscriber; + } + + /** + * @inheritdoc + */ + public function subscribeCustomer(int $customerId, int $storeId): Subscriber + { + return $this->updateCustomerSubscription($customerId, $storeId, true); + } + + /** + * @inheritdoc + */ + public function unsubscribeCustomer(int $customerId, int $storeId): Subscriber + { + return $this->updateCustomerSubscription($customerId, $storeId, false); + } + + /** + * Update customer newsletter subscription + * + * @param int $customerId + * @param int $storeId + * @param bool $status + * @return Subscriber + */ + private function updateCustomerSubscription(int $customerId, int $storeId, bool $status): Subscriber + { + $customer = $this->customerRepository->getById($customerId); + $websiteId = (int)$this->storeManager->getStore($storeId)->getWebsiteId(); + $subscriber = $this->loadSubscriberByCustomer($customer, $websiteId); + if (!$status && !$subscriber->getId()) { + return $subscriber; + } + + $newStatus = $this->getNewSubscriptionStatus($subscriber, $customer, $storeId, $status); + $needToSendLetter = $this->saveSubscriber($subscriber, $customer, $storeId, $newStatus); + if ($needToSendLetter) { + $this->sendEmailAfterChangeStatus($subscriber); + } + + return $subscriber; + } + + /** + * Load subscriber model by customer + * + * @param CustomerInterface $customer + * @param int $websiteId + * @return Subscriber + */ + private function loadSubscriberByCustomer(CustomerInterface $customer, int $websiteId): Subscriber + { + $subscriber = $this->subscriberFactory->create(); + $subscriber->loadByCustomer((int)$customer->getId(), $websiteId); + if (!$subscriber->getId()) { + $subscriber->loadBySubscriberEmail((string)$customer->getEmail(), $websiteId); + } + + return $subscriber; + } + + /** + * Save Subscriber model + * + * @param Subscriber $subscriber + * @param CustomerInterface $customer + * @param int $storeId + * @param int $status + * @return bool Need to send email + */ + private function saveSubscriber( + Subscriber $subscriber, + CustomerInterface $customer, + int $storeId, + int $status + ): bool { + $statusChanged = (int)$subscriber->getStatus() !== $status; + $emailChanged = $subscriber->getEmail() !== $customer->getEmail(); + if ($subscriber->getId() + && !$statusChanged + && (int)$subscriber->getCustomerId() === (int)$customer->getId() + && (int)$subscriber->getStoreId() === $storeId + && !$emailChanged + ) { + return false; + } + + if (!$subscriber->getId()) { + $subscriber->setSubscriberConfirmCode($subscriber->randomSequence()); + } + $subscriber->setStatus($status) + ->setStatusChanged($statusChanged) + ->setCustomerId($customer->getId()) + ->setStoreId($storeId) + ->setEmail($customer->getEmail()) + ->save(); + + if ($statusChanged) { + return true; + } + + /** + * If the subscriber is waiting to confirm from the customer + * and customer changed the email + * than need to send confirmation letter to the new email + */ + return $status === Subscriber::STATUS_NOT_ACTIVE && $emailChanged; + } + + /** + * Get new subscription status + * + * @param Subscriber $subscriber + * @param CustomerInterface $customer + * @param int $storeId + * @param bool $subscribe + * @return int + */ + private function getNewSubscriptionStatus( + Subscriber $subscriber, + CustomerInterface $customer, + int $storeId, + bool $subscribe + ): int { + $currentStatus = (int)$subscriber->getStatus(); + // If the current status is already as needed then return them + if (($subscribe && $currentStatus === Subscriber::STATUS_SUBSCRIBED) + || (!$subscribe && $currentStatus === Subscriber::STATUS_UNSUBSCRIBED) + ) { + return $currentStatus; + } + + $status = $currentStatus; + if ($subscribe) { + $customerConfirmStatus = $this->customerAccountManagement->getConfirmationStatus($customer->getId()); + if ($customerConfirmStatus === AccountManagementInterface::ACCOUNT_CONFIRMATION_REQUIRED) { + $status = Subscriber::STATUS_UNCONFIRMED; + } elseif ($this->isConfirmNeed($storeId)) { + $status = Subscriber::STATUS_NOT_ACTIVE; + } else { + $status = Subscriber::STATUS_SUBSCRIBED; + } + } elseif ($currentStatus === Subscriber::STATUS_SUBSCRIBED) { + $status = Subscriber::STATUS_UNSUBSCRIBED; + } + + return $status; + } + + /** + * Sends out email to customer after change subscription status + * + * @param Subscriber $subscriber + * @return void + */ + private function sendEmailAfterChangeStatus(Subscriber $subscriber): void + { + $status = (int)$subscriber->getStatus(); + if ($status === Subscriber::STATUS_UNCONFIRMED) { + return; + } + + try { + switch ($status) { + case Subscriber::STATUS_UNSUBSCRIBED: + $subscriber->sendUnsubscriptionEmail(); + break; + case Subscriber::STATUS_SUBSCRIBED: + $subscriber->sendConfirmationSuccessEmail(); + break; + case Subscriber::STATUS_NOT_ACTIVE: + $subscriber->sendConfirmationRequestEmail(); + break; + } + } catch (MailException $e) { + // If we are not able to send a new account email, this should be ignored + $this->logger->critical($e); + } + } + + /** + * Is need to confirm subscription + * + * @param int $storeId + * @return bool + */ + private function isConfirmNeed(int $storeId): bool + { + return (bool)$this->scopeConfig->isSetFlag( + Subscriber::XML_PATH_CONFIRMATION_FLAG, + ScopeInterface::SCOPE_STORE, + $storeId + ); + } +} diff --git a/app/code/Magento/Newsletter/Model/SubscriptionManagerInterface.php b/app/code/Magento/Newsletter/Model/SubscriptionManagerInterface.php new file mode 100644 index 0000000000000..8b92d825bdbcd --- /dev/null +++ b/app/code/Magento/Newsletter/Model/SubscriptionManagerInterface.php @@ -0,0 +1,51 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Newsletter\Model; + +/** + * Interface to update newsletter subscription status + */ +interface SubscriptionManagerInterface +{ + /** + * Subscribe to newsletters by email + * + * @param string $email + * @param int $storeId + * @return Subscriber + */ + public function subscribe(string $email, int $storeId): Subscriber; + + /** + * Unsubscribe from newsletters by email + * + * @param string $email + * @param int $storeId + * @param string $confirmCode + * @return Subscriber + */ + public function unsubscribe(string $email, int $storeId, string $confirmCode): Subscriber; + + /** + * Subscribe customer to newsletter + * + * @param int $customerId + * @param int $storeId + * @return Subscriber + */ + public function subscribeCustomer(int $customerId, int $storeId): Subscriber; + + /** + * Unsubscribe customer from newsletter + * + * @param int $customerId + * @param int $storeId + * @return Subscriber + */ + public function unsubscribeCustomer(int $customerId, int $storeId): Subscriber; +} diff --git a/app/code/Magento/Newsletter/Test/Unit/Model/Plugin/CustomerPluginTest.php b/app/code/Magento/Newsletter/Test/Unit/Model/Plugin/CustomerPluginTest.php index e809b7e37a432..52b3df8cb8aa6 100644 --- a/app/code/Magento/Newsletter/Test/Unit/Model/Plugin/CustomerPluginTest.php +++ b/app/code/Magento/Newsletter/Test/Unit/Model/Plugin/CustomerPluginTest.php @@ -5,149 +5,160 @@ */ namespace Magento\Newsletter\Test\Unit\Model\Plugin; +use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Model\Config\Share; use Magento\Customer\Model\ResourceModel\CustomerRepository; use Magento\Customer\Api\Data\CustomerExtensionInterface; use Magento\Framework\Api\ExtensionAttributesFactory; -use Magento\Newsletter\Model\ResourceModel\Subscriber; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Newsletter\Model\Plugin\CustomerPlugin; +use Magento\Newsletter\Model\ResourceModel\Subscriber\Collection; +use Magento\Newsletter\Model\ResourceModel\Subscriber\CollectionFactory; +use Magento\Newsletter\Model\Subscriber; +use Magento\Newsletter\Model\SubscriberFactory; +use Magento\Newsletter\Model\SubscriptionManagerInterface; +use Magento\Store\Api\Data\StoreInterface; +use Magento\Store\Model\StoreManagerInterface; +use Magento\Store\Model\Website; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; -class CustomerPluginTest extends \PHPUnit\Framework\TestCase +/** + * Class to test Newsletter Plugin for customer + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class CustomerPluginTest extends TestCase { /** - * @var \Magento\Newsletter\Model\Plugin\CustomerPlugin + * @var SubscriberFactory|MockObject */ - private $plugin; + private $subscriberFactory; /** - * @var \Magento\Newsletter\Model\SubscriberFactory|\PHPUnit_Framework_MockObject_MockObject + * @var ExtensionAttributesFactory|MockObject */ - private $subscriberFactory; + private $extensionFactory; /** - * @var \Magento\Newsletter\Model\Subscriber|\PHPUnit_Framework_MockObject_MockObject + * @var CollectionFactory|MockObject */ - private $subscriber; + private $collectionFactory; /** - * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager + * @var SubscriptionManagerInterface|MockObject */ - private $objectManager; + private $subscriptionManager; /** - * @var ExtensionAttributesFactory|\PHPUnit_Framework_MockObject_MockObject + * @var Share|MockObject */ - private $extensionFactoryMock; + private $shareConfig; /** - * @var CustomerExtensionInterface|\PHPUnit_Framework_MockObject_MockObject + * @var StoreManagerInterface|MockObject */ - private $customerExtensionMock; + private $storeManager; /** - * @var Subscriber|\PHPUnit_Framework_MockObject_MockObject + * @var ObjectManager */ - private $subscriberResourceMock; + private $objectManager; /** - * @var CustomerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var CustomerPlugin */ - private $customerMock; + private $plugin; + /** + * @inheritdoc + */ protected function setUp() { - $this->subscriberFactory = $this->getMockBuilder(\Magento\Newsletter\Model\SubscriberFactory::class) - ->disableOriginalConstructor() - ->setMethods(['create']) - ->getMock(); - $this->subscriber = $this->getMockBuilder(\Magento\Newsletter\Model\Subscriber::class) - ->setMethods( - [ - 'loadByEmail', - 'getId', - 'delete', - 'updateSubscription', - 'subscribeCustomerById', - 'unsubscribeCustomerById', - 'isSubscribed', - ] - )->disableOriginalConstructor() - ->getMock(); - $this->extensionFactoryMock = $this->getMockBuilder(ExtensionAttributesFactory::class) - ->disableOriginalConstructor() - ->setMethods(['create']) - ->getMock(); - $this->customerExtensionMock = $this->getMockBuilder(CustomerExtensionInterface::class) - ->setMethods(['getIsSubscribed', 'setIsSubscribed']) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - $this->subscriberResourceMock = $this->getMockBuilder(Subscriber::class) - ->disableOriginalConstructor() - ->getMock(); - $this->customerMock = $this->getMockBuilder(CustomerInterface::class) - ->setMethods(['getExtensionAttributes']) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - $this->subscriberFactory->expects($this->any())->method('create')->willReturn($this->subscriber); - $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - + $this->subscriberFactory = $this->createMock(SubscriberFactory::class); + $this->extensionFactory = $this->createMock(ExtensionAttributesFactory::class); + $this->collectionFactory = $this->createMock(CollectionFactory::class); + $this->subscriptionManager = $this->createMock(SubscriptionManagerInterface::class); + $this->shareConfig = $this->createMock(Share::class); + $this->storeManager = $this->createMock(StoreManagerInterface::class); + $this->objectManager = new ObjectManager($this); $this->plugin = $this->objectManager->getObject( - \Magento\Newsletter\Model\Plugin\CustomerPlugin::class, + CustomerPlugin::class, [ 'subscriberFactory' => $this->subscriberFactory, - 'extensionFactory' => $this->extensionFactoryMock, - 'subscriberResource' => $this->subscriberResourceMock, + 'extensionFactory' => $this->extensionFactory, + 'collectionFactory' => $this->collectionFactory, + 'subscriptionManager' => $this->subscriptionManager, + 'shareConfig' => $this->shareConfig, + 'storeManager' => $this->storeManager, ] ); } /** - * @param bool $subscriptionOriginalValue - * @param bool $subscriptionNewValue + * Test to update customer subscription after save customer + * + * @param int|null $originalStatus + * @param bool|null $newValue + * @param bool|null $expectedSubscribe * @dataProvider afterSaveDataProvider - * @return void */ - public function testAfterSave($subscriptionOriginalValue, $subscriptionNewValue) + public function testAfterSave(?int $originalStatus, ?bool $newValue, ?bool $expectedSubscribe) { - $customerId = 1; - /** @var CustomerInterface | \PHPUnit_Framework_MockObject_MockObject $result */ - $result = $this->createMock(\Magento\Customer\Api\Data\CustomerInterface::class); - /** @var CustomerRepository | \PHPUnit_Framework_MockObject_MockObject $subject */ - $subject = $this->createMock(\Magento\Customer\Api\CustomerRepositoryInterface::class); + $storeId = 2; + $websiteId = 1; + $customerId = 3; + $customerEmail = 'email@example.com'; + + $store = $this->createMock(StoreInterface::class); + $store->method('getId')->willReturn($storeId); + $store->method('getWebsiteId')->willReturn($websiteId); + $this->storeManager->method('getStore')->willReturn($store); - /** @var CustomerExtensionInterface|\PHPUnit_Framework_MockObject_MockObject $resultExtensionAttributes */ - $resultExtensionAttributes = $this->getMockBuilder(CustomerExtensionInterface::class) - ->setMethods(['getIsSubscribed', 'setIsSubscribed']) - ->getMockForAbstractClass(); - $result->expects($this->atLeastOnce())->method('getId')->willReturn($customerId); - $result->expects($this->any())->method('getExtensionAttributes')->willReturn(null); - $this->extensionFactoryMock->expects($this->any()) - ->method('create') - ->willReturn($resultExtensionAttributes); - $result->expects($this->once()) - ->method('setExtensionAttributes') - ->with($resultExtensionAttributes) + $subscriber = $this->createMock(Subscriber::class); + $subscriber->method('getStatus')->willReturn($originalStatus); + $subscriber->method('getEmail')->willReturn($customerEmail); + $subscriber->method('isSubscribed')->willReturn($originalStatus === Subscriber::STATUS_SUBSCRIBED); + $subscriber->expects($this->once()) + ->method('loadByCustomer') + ->with($customerId, $websiteId) + ->willReturnSelf(); + $subscriber->expects($this->once()) + ->method('loadBySubscriberEmail') + ->with($customerEmail, $websiteId) ->willReturnSelf(); - $this->customerMock->expects($this->once()) - ->method('getExtensionAttributes') - ->willReturn($this->customerExtensionMock); - $resultExtensionAttributes->expects($this->any()) - ->method('getIsSubscribed') - ->willReturn($subscriptionOriginalValue); - $this->customerExtensionMock->expects($this->any()) - ->method('getIsSubscribed') - ->willReturn($subscriptionNewValue); + $this->subscriberFactory->method('create')->willReturn($subscriber); - if ($subscriptionOriginalValue !== $subscriptionNewValue) { - if ($subscriptionNewValue) { - $this->subscriber->expects($this->once())->method('subscribeCustomerById')->with($customerId); - } else { - $this->subscriber->expects($this->once())->method('unsubscribeCustomerById')->with($customerId); - } - $this->subscriber->expects($this->once())->method('isSubscribed')->willReturn($subscriptionNewValue); - $resultExtensionAttributes->expects($this->once())->method('setIsSubscribed')->with($subscriptionNewValue); + $customerExtension = $this->createPartialMock(CustomerExtensionInterface::class, ['getIsSubscribed']); + $customerExtension->method('getIsSubscribed')->willReturn($newValue); + /** @var CustomerInterface|MockObject $customer */ + $customer = $this->createMock(CustomerInterface::class); + $customer->method('getExtensionAttributes')->willReturn($customerExtension); + + $resultIsSubscribed = $newValue ?? $originalStatus === Subscriber::STATUS_SUBSCRIBED; + if ($expectedSubscribe !== null) { + $resultSubscriber = $this->createMock(Subscriber::class); + $resultSubscriber->method('isSubscribed')->willReturn($resultIsSubscribed); + $this->subscriptionManager->expects($this->once()) + ->method($expectedSubscribe ? 'subscribeCustomer' : 'unsubscribeCustomer') + ->with($customerId, $storeId) + ->willReturn($resultSubscriber); + } else { + $this->subscriptionManager->expects($this->never())->method('subscribeCustomer'); + $this->subscriptionManager->expects($this->never())->method('unsubscribeCustomer'); } + $resultExtension = $this->createPartialMock(CustomerExtensionInterface::class, ['setIsSubscribed']); + $resultExtension->expects($this->once())->method('setIsSubscribed')->with($resultIsSubscribed); + /** @var CustomerInterface|MockObject $result */ + $result = $this->createMock(CustomerInterface::class); + $result->method('getId')->willReturn($customerId); + $result->method('getEmail')->willReturn($customerEmail); + $result->method('getExtensionAttributes')->willReturn($resultExtension); - $this->assertEquals($result, $this->plugin->afterSave($subject, $result, $this->customerMock)); + /** @var CustomerRepository|MockObject $subject */ + $subject = $this->createMock(CustomerRepositoryInterface::class); + $this->assertEquals($result, $this->plugin->afterSave($subject, $result, $customer)); } /** @@ -156,115 +167,135 @@ public function testAfterSave($subscriptionOriginalValue, $subscriptionNewValue) public function afterSaveDataProvider() { return [ - [true, true], - [false, false], - [true, false], - [false, true], + [null, null, null], + [null, true, true], + [null, false, null], + [Subscriber::STATUS_SUBSCRIBED, null, null], + [Subscriber::STATUS_SUBSCRIBED, true, null], + [Subscriber::STATUS_SUBSCRIBED, false, false], + [Subscriber::STATUS_UNSUBSCRIBED, null, null], + [Subscriber::STATUS_UNSUBSCRIBED, true, true], + [Subscriber::STATUS_UNSUBSCRIBED, false, null], + [Subscriber::STATUS_UNCONFIRMED, null, true], + [Subscriber::STATUS_UNCONFIRMED, true, true], + [Subscriber::STATUS_UNCONFIRMED, false, true], ]; } + /** + * Test to delete subscriptions after delete customer + */ public function testAfterDelete() { - $subject = $this->createMock(\Magento\Customer\Api\CustomerRepositoryInterface::class); - $customer = $this->createMock(\Magento\Customer\Api\Data\CustomerInterface::class); - $customer->expects($this->once())->method('getEmail')->willReturn('test@test.com'); - $this->subscriber->expects($this->once())->method('loadByEmail')->with('test@test.com')->willReturnSelf(); - $this->subscriber->expects($this->once())->method('getId')->willReturn(1); - $this->subscriber->expects($this->once())->method('delete')->willReturnSelf(); + $customerEmail = 'email@example.com'; + $websiteId = 1; + $storeIds = [1, 2]; + + $subscriber = $this->createMock(Subscriber::class); + $subscriber->expects($this->once())->method('delete'); + $collection = $this->createMock(Collection::class); + $collection->expects($this->once()) + ->method('addFieldToFilter') + ->with('subscriber_email', $customerEmail) + ->willReturnSelf(); + $collection->method('getIterator')->willReturn(new \ArrayIterator([$subscriber])); + $this->collectionFactory->expects($this->once())->method('create')->willReturn($collection); + $this->shareConfig->method('isWebsiteScope')->willReturn(false); + $website = $this->createMock(Website::class); + $website->method('getStoreIds')->willReturn($storeIds); + $this->storeManager->method('getWebsite')->with($websiteId)->willReturn($website); - $this->assertEquals(true, $this->plugin->afterDelete($subject, true, $customer)); + /** @var CustomerRepositoryInterface|MockObject $subject */ + $subject = $this->createMock(CustomerRepositoryInterface::class); + /** @var CustomerInterface|MockObject $customer */ + $customer = $this->createMock(CustomerInterface::class); + $customer->method('getEmail')->willReturn($customerEmail); + + $this->assertTrue($this->plugin->afterDelete($subject, true, $customer)); } + /** + * Test to delete subscriptions after delete customer by id + */ public function testAroundDeleteById() { $customerId = 1; + $customerEmail = 'test@test.com'; + $websiteId = 1; + $storeIds = [1, 2]; $deleteCustomerById = function () { return true; }; - $subject = $this->createMock(\Magento\Customer\Api\CustomerRepositoryInterface::class); - $customer = $this->createMock(\Magento\Customer\Api\Data\CustomerInterface::class); - $subject->expects($this->once())->method('getById')->willReturn($customer); - $customer->expects($this->once())->method('getEmail')->willReturn('test@test.com'); - $this->subscriber->expects($this->once())->method('loadByEmail')->with('test@test.com')->willReturnSelf(); - $this->subscriber->expects($this->once())->method('getId')->willReturn(1); - $this->subscriber->expects($this->once())->method('delete')->willReturnSelf(); + $customer = $this->createMock(CustomerInterface::class); + $customer->expects($this->once())->method('getEmail')->willReturn($customerEmail); + /** @var CustomerRepositoryInterface|MockObject $subject */ + $subject = $this->createMock(CustomerRepositoryInterface::class); + $subject->expects($this->once())->method('getById')->with($customerId)->willReturn($customer); + + $subscriber = $this->createMock(Subscriber::class); + $subscriber->expects($this->once())->method('delete'); + $collection = $this->createMock(Collection::class); + $collection->expects($this->once()) + ->method('addFieldToFilter') + ->with('subscriber_email', $customerEmail) + ->willReturnSelf(); + $collection->method('getIterator')->willReturn(new \ArrayIterator([$subscriber])); + $this->collectionFactory->expects($this->once())->method('create')->willReturn($collection); + $this->shareConfig->method('isWebsiteScope')->willReturn(false); + $website = $this->createMock(Website::class); + $website->method('getStoreIds')->willReturn($storeIds); + $this->storeManager->method('getWebsite')->with($websiteId)->willReturn($website); - $this->assertEquals(true, $this->plugin->aroundDeleteById($subject, $deleteCustomerById, $customerId)); + $this->assertTrue($this->plugin->aroundDeleteById($subject, $deleteCustomerById, $customerId)); } /** - * @param int|null $subscriberStatusKey - * @param int|null $subscriberStatusValue - * @param bool $isSubscribed - * @dataProvider afterGetByIdDataProvider - * @return void + * Test to load extension attribute after get by id */ - public function testAfterGetByIdCreatesExtensionAttributesIfItIsNotSet( - $subscriberStatusKey, - $subscriberStatusValue, - $isSubscribed - ) { - $subject = $this->createMock(\Magento\Customer\Api\CustomerRepositoryInterface::class); - $subscriber = [$subscriberStatusKey => $subscriberStatusValue]; + public function testAfterGetByIdCreatesExtensionAttributes(): void + { + $storeId = 2; + $websiteId = 1; + $customerId = 3; + $customerEmail = 'email@example.com'; + $subscribed = true; - $this->extensionFactoryMock->expects($this->any()) - ->method('create') - ->willReturn($this->customerExtensionMock); - $this->customerMock->expects($this->once()) - ->method('setExtensionAttributes') - ->with($this->customerExtensionMock) - ->willReturnSelf(); - $this->customerMock->expects($this->any()) - ->method('getId') - ->willReturn(1); - $this->subscriberResourceMock->expects($this->once()) - ->method('loadByCustomerData') - ->with($this->customerMock) - ->willReturn($subscriber); - $this->customerExtensionMock->expects($this->once())->method('setIsSubscribed')->with($isSubscribed); + $store = $this->createMock(StoreInterface::class); + $store->method('getId')->willReturn($storeId); + $store->method('getWebsiteId')->willReturn($websiteId); + $this->storeManager->method('getStore')->willReturn($store); - $this->assertEquals( - $this->customerMock, - $this->plugin->afterGetById($subject, $this->customerMock) - ); - } + /** @var CustomerInterface|MockObject $customer */ + $customer = $this->createMock(CustomerInterface::class); + $customer->method('getId')->willReturn($customerId); + $customer->method('getEmail')->willReturn($customerEmail); - public function testAfterGetByIdSetsIsSubscribedFlagIfItIsNotSet() - { - $subject = $this->createMock(\Magento\Customer\Api\CustomerRepositoryInterface::class); - $subscriber = ['subscriber_id' => 1, 'subscriber_status' => 1]; - - $this->customerMock->expects($this->any()) - ->method('getExtensionAttributes') - ->willReturn($this->customerExtensionMock); - $this->customerExtensionMock->expects($this->any()) - ->method('getIsSubscribed') - ->willReturn(null); - $this->subscriberResourceMock->expects($this->once()) - ->method('loadByCustomerData') - ->with($this->customerMock) - ->willReturn($subscriber); - $this->customerExtensionMock->expects($this->once()) - ->method('setIsSubscribed') + $subscriber = $this->createMock(Subscriber::class); + $subscriber->method('getEmail')->willReturn($customerEmail); + $subscriber->method('isSubscribed')->willReturn($subscribed); + $subscriber->expects($this->once()) + ->method('loadByCustomer') + ->with($customerId, $websiteId) + ->willReturnSelf(); + $subscriber->expects($this->once()) + ->method('loadBySubscriberEmail') + ->with($customerEmail, $websiteId) ->willReturnSelf(); + $this->subscriberFactory->method('create')->willReturn($subscriber); - $this->assertEquals( - $this->customerMock, - $this->plugin->afterGetById($subject, $this->customerMock) + $customerExtension = $this->createPartialMock( + CustomerExtensionInterface::class, + ['getIsSubscribed', 'setIsSubscribed'] ); - } + $customerExtension->expects($this->once())->method('setIsSubscribed')->with($subscribed); + $this->extensionFactory->expects($this->once())->method('create')->willReturn($customerExtension); + $customer->expects($this->once())->method('setExtensionAttributes')->with($customerExtension); - /** - * @return array - */ - public function afterGetByIdDataProvider() - { - return [ - ['subscriber_status', 1, true], - ['subscriber_status', 2, false], - ['subscriber_status', 3, false], - ['subscriber_status', 4, false], - [null, null, false], - ]; + /** @var CustomerRepositoryInterface|MockObject $subject */ + $subject = $this->createMock(CustomerRepositoryInterface::class); + $this->assertEquals( + $customer, + $this->plugin->afterGetById($subject, $customer) + ); } } diff --git a/app/code/Magento/Newsletter/Test/Unit/Model/SubscriberTest.php b/app/code/Magento/Newsletter/Test/Unit/Model/SubscriberTest.php index 6ccbba9f8828b..c3814563aa46c 100644 --- a/app/code/Magento/Newsletter/Test/Unit/Model/SubscriberTest.php +++ b/app/code/Magento/Newsletter/Test/Unit/Model/SubscriberTest.php @@ -5,118 +5,152 @@ */ namespace Magento\Newsletter\Test\Unit\Model; +use Magento\Customer\Api\AccountManagementInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterfaceFactory; +use Magento\Customer\Model\Session; +use Magento\Framework\Api\DataObjectHelper; +use Magento\Framework\App\Area; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\Mail\Template\TransportBuilder; +use Magento\Framework\Mail\TransportInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Framework\Translate\Inline\StateInterface; +use Magento\Newsletter\Helper\Data; +use Magento\Newsletter\Model\Queue; use Magento\Newsletter\Model\Subscriber; +use Magento\Store\Api\Data\StoreInterface; +use Magento\Store\Model\ScopeInterface; +use Magento\Store\Model\StoreManagerInterface; +use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\MockObject\MockObject; /** + * Test Subscriber model functionality + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class SubscriberTest extends \PHPUnit\Framework\TestCase +class SubscriberTest extends TestCase { /** - * @var \Magento\Newsletter\Helper\Data|\PHPUnit_Framework_MockObject_MockObject + * @var Data|MockObject */ - protected $newsletterData; + private $newsletterData; /** - * @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject + * @var ScopeConfigInterface|MockObject */ - protected $scopeConfig; + private $scopeConfig; /** - * @var \Magento\Framework\Mail\Template\TransportBuilder|\PHPUnit_Framework_MockObject_MockObject + * @var TransportBuilder|MockObject */ - protected $transportBuilder; + private $transportBuilder; /** - * @var \Magento\Store\Model\StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var StoreManagerInterface|MockObject */ - protected $storeManager; + private $storeManager; /** - * @var \Magento\Customer\Model\Session|\PHPUnit_Framework_MockObject_MockObject + * @var Session|MockObject */ - protected $customerSession; + private $customerSession; /** - * @var \Magento\Customer\Api\CustomerRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + * @var CustomerRepositoryInterface|MockObject */ - protected $customerRepository; + private $customerRepository; /** - * @var \Magento\Customer\Api\AccountManagementInterface|\PHPUnit_Framework_MockObject_MockObject + * @var AccountManagementInterface|MockObject */ - protected $customerAccountManagement; + private $customerAccountManagement; /** - * @var \Magento\Framework\Translate\Inline\StateInterface|\PHPUnit_Framework_MockObject_MockObject + * @var StateInterface|MockObject */ - protected $inlineTranslation; + private $inlineTranslation; /** - * @var \Magento\Newsletter\Model\ResourceModel\Subscriber|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Newsletter\Model\ResourceModel\Subscriber|MockObject */ - protected $resource; + private $resource; /** - * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager + * @var ObjectManager */ - protected $objectManager; + private $objectManager; /** - * @var \Magento\Framework\Api\DataObjectHelper|\PHPUnit_Framework_MockObject_MockObject + * @var DataObjectHelper|MockObject */ private $dataObjectHelper; /** - * @var \Magento\Customer\Api\Data\CustomerInterfaceFactory|\PHPUnit_Framework_MockObject_MockObject + * @var CustomerInterfaceFactory|MockObject */ private $customerFactory; /** - * @var \Magento\Newsletter\Model\Subscriber + * @var Subscriber */ - protected $subscriber; + private $subscriber; + /** + * @inheritdoc + */ protected function setUp() { - $this->newsletterData = $this->createMock(\Magento\Newsletter\Helper\Data::class); - $this->scopeConfig = $this->createMock(\Magento\Framework\App\Config\ScopeConfigInterface::class); - $this->transportBuilder = $this->createPartialMock(\Magento\Framework\Mail\Template\TransportBuilder::class, [ + $this->newsletterData = $this->createMock(Data::class); + $this->scopeConfig = $this->createMock(ScopeConfigInterface::class); + $this->transportBuilder = $this->createPartialMock( + TransportBuilder::class, + [ 'setTemplateIdentifier', 'setTemplateOptions', 'setTemplateVars', 'setFrom', 'addTo', 'getTransport' - ]); - $this->storeManager = $this->createMock(\Magento\Store\Model\StoreManagerInterface::class); - $this->customerSession = $this->createPartialMock(\Magento\Customer\Model\Session::class, [ + ] + ); + $this->storeManager = $this->createMock(StoreManagerInterface::class); + $this->customerSession = $this->createPartialMock( + Session::class, + [ 'isLoggedIn', 'getCustomerDataObject', 'getCustomerId' - ]); - $this->customerRepository = $this->createMock(\Magento\Customer\Api\CustomerRepositoryInterface::class); - $this->customerAccountManagement = $this->createMock(\Magento\Customer\Api\AccountManagementInterface::class); - $this->inlineTranslation = $this->createMock(\Magento\Framework\Translate\Inline\StateInterface::class); - $this->resource = $this->createPartialMock(\Magento\Newsletter\Model\ResourceModel\Subscriber::class, [ + ] + ); + $this->customerRepository = $this->createMock(CustomerRepositoryInterface::class); + $this->customerAccountManagement = $this->createMock(AccountManagementInterface::class); + $this->inlineTranslation = $this->createMock(StateInterface::class); + $this->resource = $this->createPartialMock( + \Magento\Newsletter\Model\ResourceModel\Subscriber::class, + [ 'loadByEmail', 'getIdFieldName', 'save', - 'loadByCustomerData', - 'received' - ]); - $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + 'loadByCustomer', + 'received', + 'loadBySubscriberEmail', + 'loadByCustomerId', + ] + ); + $this->objectManager = new ObjectManager($this); - $this->customerFactory = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterfaceFactory::class) + $this->customerFactory = $this->getMockBuilder(CustomerInterfaceFactory::class) ->setMethods(['create']) ->disableOriginalConstructor() ->getMock(); - $this->dataObjectHelper = $this->getMockBuilder(\Magento\Framework\Api\DataObjectHelper::class) + $this->dataObjectHelper = $this->getMockBuilder(DataObjectHelper::class) ->disableOriginalConstructor() ->getMock(); $this->subscriber = $this->objectManager->getObject( - \Magento\Newsletter\Model\Subscriber::class, + Subscriber::class, [ 'newsletterData' => $this->newsletterData, 'scopeConfig' => $this->scopeConfig, @@ -128,250 +162,78 @@ protected function setUp() 'inlineTranslation' => $this->inlineTranslation, 'resource' => $this->resource, 'customerFactory' => $this->customerFactory, - 'dataObjectHelper' => $this->dataObjectHelper - ] - ); - } - - public function testSubscribe() - { - $email = 'subscriber_email@magento.com'; - $storeId = 1; - $customerData = ['store_id' => $storeId, 'email' => $email]; - $storeModel = $this->getMockBuilder(\Magento\Store\Model\Store::class) - ->disableOriginalConstructor() - ->getMock(); - $this->storeManager->expects($this->any())->method('getStore')->willReturn($storeModel); - $storeModel->expects($this->any())->method('getId')->willReturn($storeId); - $customer = $this->createMock(\Magento\Customer\Api\Data\CustomerInterface::class); - $this->customerFactory->expects($this->once())->method('create')->willReturn($customer); - $this->dataObjectHelper->expects($this->once())->method('populateWithArray')->with( - $customer, - $customerData, - \Magento\Customer\Api\Data\CustomerInterface::class - ); - $this->resource->expects($this->any())->method('loadByCustomerData')->with($customer)->willReturn( - [ - 'subscriber_status' => Subscriber::STATUS_UNSUBSCRIBED, - 'subscriber_email' => $email, - 'name' => 'subscriber_name' + 'dataObjectHelper' => $this->dataObjectHelper, ] ); - $this->scopeConfig->expects($this->any())->method('getValue')->willReturn(true); - $this->customerSession->expects($this->any())->method('isLoggedIn')->willReturn(true); - $customerDataModel = $this->createMock(\Magento\Customer\Api\Data\CustomerInterface::class); - $this->customerSession->expects($this->any())->method('getCustomerDataObject')->willReturn($customerDataModel); - $this->customerSession->expects($this->any())->method('getCustomerId')->willReturn(1); - $customerDataModel->expects($this->any())->method('getEmail')->willReturn($email); - $this->customerRepository->expects($this->any())->method('getById')->willReturn($customerDataModel); - $customerDataModel->expects($this->any())->method('getStoreId')->willReturn($storeId); - $customerDataModel->expects($this->any())->method('getId')->willReturn(1); - $this->sendEmailCheck(); - $this->resource->expects($this->atLeastOnce())->method('save')->willReturnSelf(); - - $this->assertEquals(Subscriber::STATUS_NOT_ACTIVE, $this->subscriber->subscribe($email)); } - public function testSubscribeNotLoggedIn() + /** + * Test to Load by subscriber email + * + * @return void + */ + public function testLoadBySubscriberEmail(): void { - $email = 'subscriber_email@magento.com'; - $storeId = 1; - $customerData = ['store_id' => $storeId, 'email' => $email]; - $storeModel = $this->getMockBuilder(\Magento\Store\Model\Store::class) - ->disableOriginalConstructor() - ->getMock(); - $this->storeManager->expects($this->any())->method('getStore')->willReturn($storeModel); - $storeModel->expects($this->any())->method('getId')->willReturn($storeId); - $customer = $this->createMock(\Magento\Customer\Api\Data\CustomerInterface::class); - $this->customerFactory->expects($this->once())->method('create')->willReturn($customer); - $this->dataObjectHelper->expects($this->once())->method('populateWithArray')->with( - $customer, - $customerData, - \Magento\Customer\Api\Data\CustomerInterface::class + $email = 'subscriber_email@example.com'; + $websiteId = 1; + $subscriberData = ['some_filed' => 'value']; + + $this->resource->expects($this->once()) + ->method('loadBySubscriberEmail') + ->with($email, $websiteId) + ->willReturn($subscriberData); + + $this->assertEquals( + $subscriberData, + $this->subscriber->loadBySubscriberEmail($email, $websiteId)->getData() ); - $this->resource->expects($this->any())->method('loadByCustomerData')->with($customer)->willReturn( - [ - 'subscriber_status' => Subscriber::STATUS_UNSUBSCRIBED, - 'subscriber_email' => $email, - 'name' => 'subscriber_name' - ] - ); - $this->scopeConfig->expects($this->any())->method('getValue')->willReturn(true); - $this->customerSession->expects($this->any())->method('isLoggedIn')->willReturn(false); - $customerDataModel = $this->createMock(\Magento\Customer\Api\Data\CustomerInterface::class); - $this->customerSession->expects($this->any())->method('getCustomerDataObject')->willReturn($customerDataModel); - $this->customerSession->expects($this->any())->method('getCustomerId')->willReturn(1); - $customerDataModel->expects($this->any())->method('getEmail')->willReturn($email); - $this->customerRepository->expects($this->any())->method('getById')->willReturn($customerDataModel); - $customerDataModel->expects($this->any())->method('getStoreId')->willReturn($storeId); - $customerDataModel->expects($this->any())->method('getId')->willReturn(1); - $this->sendEmailCheck(); - $this->resource->expects($this->atLeastOnce())->method('save')->willReturnSelf(); - - $this->assertEquals(Subscriber::STATUS_NOT_ACTIVE, $this->subscriber->subscribe($email)); } - public function testUpdateSubscription() - { - $storeId = 2; - $customerId = 1; - $customerDataMock = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class) - ->getMock(); - $this->customerRepository->expects($this->atLeastOnce()) - ->method('getById') - ->with($customerId)->willReturn($customerDataMock); - $this->resource->expects($this->atLeastOnce()) - ->method('loadByCustomerData') - ->with($customerDataMock) - ->willReturn( - [ - 'subscriber_id' => 1, - 'subscriber_status' => Subscriber::STATUS_SUBSCRIBED - ] - ); - $customerDataMock->expects($this->atLeastOnce())->method('getId')->willReturn('id'); - $this->resource->expects($this->atLeastOnce())->method('save')->willReturnSelf(); - $this->customerAccountManagement->expects($this->once()) - ->method('getConfirmationStatus') - ->with($customerId) - ->willReturn('account_confirmation_required'); - $customerDataMock->expects($this->exactly(2))->method('getStoreId')->willReturn($storeId); - $customerDataMock->expects($this->once())->method('getEmail')->willReturn('email'); - - $storeModel = $this->getMockBuilder(\Magento\Store\Model\Store::class) - ->disableOriginalConstructor() - ->setMethods(['getId']) - ->getMock(); - $this->storeManager->expects($this->any())->method('getStore')->willReturn($storeModel); - - $this->assertEquals($this->subscriber, $this->subscriber->updateSubscription($customerId)); - } - - public function testUnsubscribeCustomerById() + /** + * Test to Load by customer + * + * @return void + */ + public function testLoadByCustomer(): void { - $storeId = 2; $customerId = 1; - $customerDataMock = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class) - ->getMock(); - $this->customerRepository->expects($this->atLeastOnce()) - ->method('getById') - ->with($customerId)->willReturn($customerDataMock); - $this->resource->expects($this->atLeastOnce()) - ->method('loadByCustomerData') - ->with($customerDataMock) - ->willReturn( - [ - 'subscriber_id' => 1, - 'subscriber_status' => Subscriber::STATUS_SUBSCRIBED - ] - ); - $customerDataMock->expects($this->atLeastOnce())->method('getId')->willReturn('id'); - $this->resource->expects($this->atLeastOnce())->method('save')->willReturnSelf(); - $customerDataMock->expects($this->exactly(2))->method('getStoreId')->willReturn($storeId); - $customerDataMock->expects($this->once())->method('getEmail')->willReturn('email'); - $this->sendEmailCheck(); + $websiteId = 1; + $subscriberData = ['some_filed' => 'value']; - $this->subscriber->unsubscribeCustomerById($customerId); - } - - public function testSubscribeCustomerById() - { - $storeId = 2; - $customerId = 1; - $customerDataMock = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class) - ->getMock(); - $this->customerRepository->expects($this->atLeastOnce()) - ->method('getById') - ->with($customerId)->willReturn($customerDataMock); - $this->resource->expects($this->atLeastOnce()) - ->method('loadByCustomerData') - ->with($customerDataMock) - ->willReturn( - [ - 'subscriber_id' => 1, - 'subscriber_status' => Subscriber::STATUS_UNSUBSCRIBED - ] - ); - $customerDataMock->expects($this->atLeastOnce())->method('getId')->willReturn('id'); - $this->resource->expects($this->atLeastOnce())->method('save')->willReturnSelf(); - $customerDataMock->expects($this->exactly(2))->method('getStoreId')->willReturn($storeId); - $customerDataMock->expects($this->once())->method('getEmail')->willReturn('email'); - $this->sendEmailCheck(); + $this->resource->expects($this->once()) + ->method('loadByCustomerId') + ->with($customerId, $websiteId) + ->willReturn($subscriberData); - $this->subscriber->subscribeCustomerById($customerId); - } - - public function testSubscribeCustomerById1() - { - $storeId = 2; - $customerId = 1; - $customerDataMock = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class) - ->getMock(); - $this->customerRepository->expects($this->atLeastOnce()) - ->method('getById') - ->with($customerId)->willReturn($customerDataMock); - $this->resource->expects($this->atLeastOnce()) - ->method('loadByCustomerData') - ->with($customerDataMock) - ->willReturn( - [ - 'subscriber_id' => 1, - 'subscriber_status' => Subscriber::STATUS_UNSUBSCRIBED - ] - ); - $customerDataMock->expects($this->atLeastOnce())->method('getId')->willReturn('id'); - $this->resource->expects($this->atLeastOnce())->method('save')->willReturnSelf(); - $customerDataMock->expects($this->exactly(2))->method('getStoreId')->willReturn($storeId); - $customerDataMock->expects($this->once())->method('getEmail')->willReturn('email'); - $this->sendEmailCheck(); - $this->customerAccountManagement->expects($this->once()) - ->method('getConfirmationStatus') - ->willReturn(\Magento\Customer\Api\AccountManagementInterface::ACCOUNT_CONFIRMATION_NOT_REQUIRED); - $this->scopeConfig->expects($this->atLeastOnce())->method('getValue')->with()->willReturn(true); - - $this->subscriber->subscribeCustomerById($customerId); - $this->assertEquals(Subscriber::STATUS_NOT_ACTIVE, $this->subscriber->getStatus()); - } - - public function testSubscribeCustomerByIdAfterConfirmation() - { - $storeId = 2; - $customerId = 1; - $customerDataMock = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class) - ->getMock(); - $this->customerRepository->expects($this->atLeastOnce()) - ->method('getById') - ->with($customerId)->willReturn($customerDataMock); - $this->resource->expects($this->atLeastOnce()) - ->method('loadByCustomerData') - ->with($customerDataMock) - ->willReturn( - [ - 'subscriber_id' => 1, - 'subscriber_status' => Subscriber::STATUS_UNCONFIRMED - ] - ); - $customerDataMock->expects($this->atLeastOnce())->method('getId')->willReturn('id'); - $this->resource->expects($this->atLeastOnce())->method('save')->willReturnSelf(); - $customerDataMock->expects($this->exactly(2))->method('getStoreId')->willReturn($storeId); - $customerDataMock->expects($this->once())->method('getEmail')->willReturn('email'); - $this->sendEmailCheck(); - $this->customerAccountManagement->expects($this->never())->method('getConfirmationStatus'); - $this->scopeConfig->expects($this->atLeastOnce())->method('getValue')->with()->willReturn(true); - - $this->subscriber->updateSubscription($customerId); - $this->assertEquals(Subscriber::STATUS_SUBSCRIBED, $this->subscriber->getStatus()); + $this->assertEquals( + $subscriberData, + $this->subscriber->loadByCustomer($customerId, $websiteId)->getData() + ); } + /** + * Test to unsubscribe customer from newsletters + */ public function testUnsubscribe() { $this->resource->expects($this->once())->method('save')->willReturnSelf(); - $this->sendEmailCheck(); + $subscriberData = [ + 'store_id' => 2, + 'email' => 'subscriber_email@example.com', + 'name' => 'Subscriber Name', + ]; + $this->subscriber->setData($subscriberData); + $this->sendEmailCheck( + Subscriber::XML_PATH_UNSUBSCRIBE_EMAIL_TEMPLATE, + Subscriber::XML_PATH_UNSUBSCRIBE_EMAIL_IDENTITY + ); $this->assertEquals($this->subscriber, $this->subscriber->unsubscribe()); } /** + * Test to try unsubscribe customer from newsletters with wrong confirmation code + * * @expectedException \Magento\Framework\Exception\LocalizedException * @expectedExceptionMessage This is an invalid subscription confirmation code. */ @@ -383,6 +245,9 @@ public function testUnsubscribeException() $this->subscriber->unsubscribe(); } + /** + * Test to get subscriber full name + */ public function testGetSubscriberFullName() { $this->subscriber->setFirstname('John'); @@ -391,6 +256,9 @@ public function testGetSubscriberFullName() $this->assertEquals('John Doe', $this->subscriber->getSubscriberFullName()); } + /** + * Test to confirm customer subscription + */ public function testConfirm() { $code = 111; @@ -400,6 +268,9 @@ public function testConfirm() $this->assertTrue($this->subscriber->confirm($code)); } + /** + * Test to doesn't confirm customer subscription + */ public function testConfirmWrongCode() { $code = 111; @@ -408,9 +279,12 @@ public function testConfirmWrongCode() $this->assertFalse($this->subscriber->confirm($code)); } + /** + * Test to mark receiving subscriber of queue newsletter + */ public function testReceived() { - $queue = $this->getMockBuilder(\Magento\Newsletter\Model\Queue::class) + $queue = $this->getMockBuilder(Queue::class) ->disableOriginalConstructor() ->getMock(); $this->resource->expects($this->once())->method('received')->with($this->subscriber, $queue)->willReturnSelf(); @@ -419,28 +293,103 @@ public function testReceived() } /** - * @return $this + * Test to Sends out confirmation email + * + * @return void */ - protected function sendEmailCheck() + public function testSendConfirmationRequestEmail(): void { - $storeModel = $this->getMockBuilder(\Magento\Store\Model\Store::class) - ->disableOriginalConstructor() - ->setMethods(['getId']) - ->getMock(); - $transport = $this->createMock(\Magento\Framework\Mail\TransportInterface::class); - $this->scopeConfig->expects($this->any())->method('getValue')->willReturn(true); - $this->transportBuilder->expects($this->once())->method('setTemplateIdentifier')->willReturnSelf(); - $this->transportBuilder->expects($this->once())->method('setTemplateOptions')->willReturnSelf(); - $this->transportBuilder->expects($this->once())->method('setTemplateVars')->willReturnSelf(); - $this->transportBuilder->expects($this->once())->method('setFrom')->willReturnSelf(); - $this->transportBuilder->expects($this->once())->method('addTo')->willReturnSelf(); - $this->storeManager->expects($this->any())->method('getStore')->willReturn($storeModel); - $storeModel->expects($this->any())->method('getId')->willReturn(1); - $this->transportBuilder->expects($this->once())->method('getTransport')->willReturn($transport); + $confirmLink = 'confirm link'; + $storeId = 2; + $subscriberData = [ + 'store_id' => $storeId, + 'email' => 'subscriber_email@example.com', + 'name' => 'Subscriber Name', + ]; + $store = $this->createMock(StoreInterface::class); + $this->storeManager->method('getStore')->with($storeId)->willReturn($store); + $this->newsletterData->expects($this->once()) + ->method('getConfirmationUrl') + ->with($this->subscriber) + ->willReturn($confirmLink); + $this->subscriber->setData($subscriberData); + $this->sendEmailCheck( + Subscriber::XML_PATH_CONFIRM_EMAIL_TEMPLATE, + Subscriber::XML_PATH_CONFIRM_EMAIL_IDENTITY, + [ + 'store' => $store, + 'subscriber_data' => [ + 'confirmation_link' => $confirmLink, + ], + ] + ); + $this->assertEquals($this->subscriber, $this->subscriber->sendConfirmationRequestEmail()); + } + + /** + * Test to Sends out success email + * + * @return void + */ + public function testSendConfirmationSuccessEmail(): void + { + $subscriberData = [ + 'store_id' => 2, + 'email' => 'subscriber_email@example.com', + 'name' => 'Subscriber Name', + ]; + $this->subscriber->setData($subscriberData); + $this->sendEmailCheck( + Subscriber::XML_PATH_SUCCESS_EMAIL_TEMPLATE, + Subscriber::XML_PATH_SUCCESS_EMAIL_IDENTITY + ); + $this->assertEquals($this->subscriber, $this->subscriber->sendConfirmationSuccessEmail()); + } + + /** + * Check to send email + * + * @param string $templateConfigPath + * @param string $identityTemplatePath + * @return void + */ + private function sendEmailCheck(string $templateConfigPath, string $identityTemplatePath, array $vars = []): void + { + $template = 'email_template'; + $identity = 'email_identity'; + $vars += ['subscriber' => $this->subscriber]; + + $this->scopeConfig->method('getValue') + ->willReturnMap( + [ + [$templateConfigPath, ScopeInterface::SCOPE_STORE, $this->subscriber->getStoreId(), $template], + [$identityTemplatePath, ScopeInterface::SCOPE_STORE, $this->subscriber->getStoreId(), $identity], + ] + ); + $this->transportBuilder->expects($this->once()) + ->method('setTemplateIdentifier') + ->with($template) + ->willReturnSelf(); + $this->transportBuilder->expects($this->once()) + ->method('setTemplateOptions') + ->with(['area' => Area::AREA_FRONTEND, 'store' => $this->subscriber->getStoreId()]) + ->willReturnSelf(); + $this->transportBuilder->expects($this->once()) + ->method('setTemplateVars') + ->with($vars) + ->willReturnSelf(); + $this->transportBuilder->expects($this->once()) + ->method('setFrom') + ->with($identity) + ->willReturnSelf(); + $this->transportBuilder->expects($this->once()) + ->method('addTo') + ->with($this->subscriber->getEmail(), $this->subscriber->getName()) + ->willReturnSelf(); + $transport = $this->createMock(TransportInterface::class); $transport->expects($this->once())->method('sendMessage')->willReturnSelf(); + $this->transportBuilder->expects($this->once())->method('getTransport')->willReturn($transport); $this->inlineTranslation->expects($this->once())->method('suspend')->willReturnSelf(); $this->inlineTranslation->expects($this->once())->method('resume')->willReturnSelf(); - - return $this; } } diff --git a/app/code/Magento/Newsletter/Test/Unit/Model/SubscriptionManagerTest.php b/app/code/Magento/Newsletter/Test/Unit/Model/SubscriptionManagerTest.php new file mode 100644 index 0000000000000..ecb30f12742c8 --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Unit/Model/SubscriptionManagerTest.php @@ -0,0 +1,651 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Newsletter\Test\Unit\Model; + +use Magento\Customer\Api\AccountManagementInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Newsletter\Model\Subscriber; +use Magento\Newsletter\Model\SubscriberFactory; +use Magento\Newsletter\Model\SubscriptionManager; +use Magento\Store\Api\Data\StoreInterface; +use Magento\Store\Model\ScopeInterface; +use Magento\Store\Model\StoreManagerInterface; +use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\MockObject\MockObject; +use Psr\Log\LoggerInterface; + +/** + * Test to update newsletter subscription status + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class SubscriptionManagerTest extends TestCase +{ + /** + * @var SubscriberFactory|MockObject + */ + private $subscriberFactory; + + /** + * @var LoggerInterface|MockObject + */ + private $logger; + + /** + * @var StoreManagerInterface|MockObject + */ + private $storeManager; + + /** + * @var ScopeConfigInterface|MockObject + */ + private $scopeConfig; + + /** + * @var AccountManagementInterface|MockObject + */ + private $customerAccountManagement; + + /** + * @var CustomerRepositoryInterface|MockObject + */ + private $customerRepository; + + /** + * @var SubscriptionManager + */ + private $subscriptionManager; + + /** + * @inheritdoc + */ + protected function setUp() + { + $this->subscriberFactory = $this->createMock(SubscriberFactory::class); + $this->logger = $this->createMock(LoggerInterface::class); + $this->storeManager = $this->createMock(StoreManagerInterface::class); + $this->scopeConfig = $this->createMock(ScopeConfigInterface::class); + $this->customerAccountManagement = $this->createMock(AccountManagementInterface::class); + $this->customerRepository = $this->createMock(CustomerRepositoryInterface::class); + + $objectManager = new ObjectManager($this); + $this->subscriptionManager = $objectManager->getObject( + SubscriptionManager::class, + [ + 'subscriberFactory' => $this->subscriberFactory, + 'logger' => $this->logger, + 'storeManager' => $this->storeManager, + 'scopeConfig' => $this->scopeConfig, + 'customerAccountManagement' => $this->customerAccountManagement, + 'customerRepository' => $this->customerRepository, + ] + ); + } + + /** + * Test to Subscribe to newsletters by email + * + * @param array $subscriberData + * @param string $email + * @param int $storeId + * @param bool $isConfirmNeed + * @param array $expectedData + * @dataProvider subscribeDataProvider + */ + public function testSubscribe( + array $subscriberData, + string $email, + int $storeId, + bool $isConfirmNeed, + array $expectedData + ): void { + $websiteId = 1; + $store = $this->createMock(StoreInterface::class); + $store->method('getWebsiteId')->willReturn($websiteId); + $this->storeManager->method('getStore')->with($storeId)->willReturn($store); + /** @var Subscriber|MockObject $subscriber */ + $subscriber = $this->createPartialMock( + Subscriber::class, + [ + 'loadBySubscriberEmail', + 'randomSequence', + 'save', + 'sendConfirmationRequestEmail', + 'sendConfirmationSuccessEmail', + 'sendUnsubscriptionEmail' + ] + ); + $subscriber->expects($this->once()) + ->method('loadBySubscriberEmail') + ->with($email, $websiteId) + ->willReturnSelf(); + $subscriber->setData($subscriberData); + if (empty($subscriberData['id'])) { + $subscriber->method('randomSequence')->willReturn($expectedData['subscriber_confirm_code']); + } + $this->subscriberFactory->method('create')->willReturn($subscriber); + $this->scopeConfig->method('isSetFlag') + ->with(Subscriber::XML_PATH_CONFIRMATION_FLAG, ScopeInterface::SCOPE_STORE, $storeId) + ->willReturn($isConfirmNeed); + + $this->assertEquals( + $subscriber, + $this->subscriptionManager->subscribe($email, $storeId) + ); + $this->assertEquals($subscriber->getData(), $expectedData); + } + + /** + * Subscribe customer data provider + * + * @return array + */ + public function subscribeDataProvider(): array + { + return [ + 'Subscribe new' => [ + 'subscriber_data' => [], + 'email' => 'email@example.com', + 'store_id' => 1, + 'is_confirm_need' => false, + 'expected_data' => [ + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_SUBSCRIBED, + 'subscriber_confirm_code' => '', + ], + ], + 'Subscribe new: confirm required' => [ + 'subscriber_data' => [], + 'email' => 'email@example.com', + 'store_id' => 1, + 'is_confirm_need' => true, + 'expected_data' => [ + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_NOT_ACTIVE, + 'subscriber_confirm_code' => '', + ], + ], + 'Subscribe existing' => [ + 'subscriber_data' => [ + 'subscriber_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_UNSUBSCRIBED, + 'subscriber_confirm_code' => '', + 'customer_id' => 0, + ], + 'email' => 'email@example.com', + 'store_id' => 1, + 'is_confirm_need' => false, + 'expected_data' => [ + 'subscriber_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_SUBSCRIBED, + 'subscriber_confirm_code' => '', + 'customer_id' => 0, + ], + ], + ]; + } + + /** + * Test to Unsubscribe from newsletters by email + */ + public function testUnsubscribe(): void + { + $email = 'email@example.com'; + $storeId = 2; + $websiteId = 1; + $store = $this->createMock(StoreInterface::class); + $store->method('getWebsiteId')->willReturn($websiteId); + $this->storeManager->method('getStore')->with($storeId)->willReturn($store); + $confirmCode = 'confirm code'; + /** @var Subscriber|MockObject $subscriber */ + $subscriber = $this->createPartialMock( + Subscriber::class, + ['loadBySubscriberEmail', 'getId', 'setCheckCode', 'unsubscribe'] + ); + $subscriber->expects($this->once()) + ->method('loadBySubscriberEmail') + ->with($email, $websiteId) + ->willReturnSelf(); + $subscriber->method('getId')->willReturn(1); + $subscriber->expects($this->once())->method('setCheckCode')->with($confirmCode)->willReturnSelf(); + $subscriber->expects($this->once())->method('unsubscribe')->willReturnSelf(); + $this->subscriberFactory->method('create')->willReturn($subscriber); + + $this->assertEquals( + $subscriber, + $this->subscriptionManager->unsubscribe($email, $storeId, $confirmCode) + ); + } + + /** + * Test to Subscribe customer to newsletter + * + * @param array $subscriberData + * @param array $customerData + * @param int $storeId + * @param bool $isConfirmNeed + * @param array $expectedData + * @param bool $needToSendEmail + * @dataProvider subscribeCustomerDataProvider + */ + public function testSubscribeCustomer( + array $subscriberData, + array $customerData, + int $storeId, + bool $isConfirmNeed, + array $expectedData, + bool $needToSendEmail + ): void { + $websiteId = 1; + $customerId = $customerData['id']; + $store = $this->createMock(StoreInterface::class); + $store->method('getWebsiteId')->willReturn($websiteId); + $this->storeManager->method('getStore')->with($storeId)->willReturn($store); + /** @var CustomerInterface|MockObject $customer */ + $customer = $this->createMock(CustomerInterface::class); + $customer->method('getId')->willReturn($customerId); + $customer->method('getEmail')->willReturn($customerData['email']); + $this->customerRepository->method('getById')->with($customerId)->willReturn($customer); + /** @var Subscriber|MockObject $subscriber */ + $subscriber = $this->createPartialMock( + Subscriber::class, + [ + 'loadByCustomer', + 'loadBySubscriberEmail', + 'randomSequence', + 'save', + 'sendConfirmationRequestEmail', + 'sendConfirmationSuccessEmail', + 'sendUnsubscriptionEmail' + ] + ); + $subscriber->expects($this->once()) + ->method('loadByCustomer') + ->with($customerId, $websiteId) + ->willReturnSelf(); + if (empty($subscriberData['subscriber_id'])) { + $subscriber->expects($this->once()) + ->method('loadBySubscriberEmail') + ->with($customerData['email'], $websiteId) + ->willReturnSelf(); + } + $subscriber->setData($subscriberData); + if (empty($subscriberData['subscriber_id'])) { + $subscriber->method('randomSequence')->willReturn($expectedData['subscriber_confirm_code']); + } + $sendEmailMethod = $this->getSendEmailMethod($expectedData['subscriber_status'] ?? 0); + if ($needToSendEmail) { + $subscriber->expects($this->once())->method($sendEmailMethod); + } else { + $subscriber->expects($this->never())->method('sendConfirmationRequestEmail'); + $subscriber->expects($this->never())->method('sendConfirmationSuccessEmail'); + $subscriber->expects($this->never())->method('sendUnsubscriptionEmail'); + } + $this->subscriberFactory->method('create')->willReturn($subscriber); + $this->scopeConfig->method('isSetFlag') + ->with(Subscriber::XML_PATH_CONFIRMATION_FLAG, ScopeInterface::SCOPE_STORE, $storeId) + ->willReturn($isConfirmNeed); + $this->customerAccountManagement + ->method('getConfirmationStatus') + ->willReturn($customerData['confirmation_status']); + + $this->assertEquals( + $subscriber, + $this->subscriptionManager->subscribeCustomer($customerId, $storeId) + ); + $this->assertEquals($subscriber->getData(), $expectedData); + } + + /** + * Get expected send email method + * + * @param int $status + * @return string + */ + private function getSendEmailMethod(int $status): string + { + switch ($status) { + case Subscriber::STATUS_SUBSCRIBED: + $sendEmailMethod = 'sendConfirmationSuccessEmail'; + break; + case Subscriber::STATUS_NOT_ACTIVE: + $sendEmailMethod = 'sendConfirmationRequestEmail'; + break; + case Subscriber::STATUS_UNSUBSCRIBED: + $sendEmailMethod = 'sendUnsubscriptionEmail'; + break; + default: + $sendEmailMethod = ''; + } + + return $sendEmailMethod; + } + + /** + * Subscribe customer data provider + * + * @return array + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + */ + public function subscribeCustomerDataProvider(): array + { + return [ + 'Subscribe new' => [ + 'subscriber_data' => [], + 'customer_data' => [ + 'id' => 1, + 'email' => 'email@example.com', + 'confirmation_status' => AccountManagementInterface::ACCOUNT_CONFIRMED, + ], + 'store_id' => 1, + 'is_confirm_need' => false, + 'expected_data' => [ + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_SUBSCRIBED, + 'subscriber_confirm_code' => '', + ], + 'needToSendEmail' => true, + ], + 'Subscribe new: customer confirm required' => [ + 'subscriber_data' => [], + 'customer_data' => [ + 'id' => 1, + 'email' => 'email@example.com', + 'confirmation_status' => AccountManagementInterface::ACCOUNT_CONFIRMATION_REQUIRED, + ], + 'store_id' => 1, + 'is_confirm_need' => false, + 'expected_data' => [ + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_UNCONFIRMED, + 'subscriber_confirm_code' => '', + ], + 'needToSendEmail' => false, + ], + 'Subscribe existing' => [ + 'subscriber_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_UNSUBSCRIBED, + 'subscriber_confirm_code' => '', + ], + 'customer_data' => [ + 'id' => 1, + 'email' => 'email@example.com', + 'confirmation_status' => AccountManagementInterface::ACCOUNT_CONFIRMED, + ], + 'store_id' => 1, + 'is_confirm_need' => false, + 'expected_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_SUBSCRIBED, + 'subscriber_confirm_code' => '', + ], + 'needToSendEmail' => true, + ], + 'Subscribe existing: subscription confirm required' => [ + 'subscriber_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_UNSUBSCRIBED, + 'subscriber_confirm_code' => '', + ], + 'customer_data' => [ + 'id' => 1, + 'email' => 'email@example.com', + 'confirmation_status' => AccountManagementInterface::ACCOUNT_CONFIRMED, + ], + 'store_id' => 1, + 'is_confirm_need' => true, + 'expected_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_NOT_ACTIVE, + 'subscriber_confirm_code' => '', + ], + 'needToSendEmail' => true, + ], + 'Update subscription data' => [ + 'subscriber_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_SUBSCRIBED, + 'subscriber_confirm_code' => '', + ], + 'customer_data' => [ + 'id' => 1, + 'email' => 'email2@example.com', + 'confirmation_status' => AccountManagementInterface::ACCOUNT_CONFIRMED, + ], + 'store_id' => 2, + 'is_confirm_need' => false, + 'expected_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email2@example.com', + 'store_id' => 2, + 'subscriber_status' => Subscriber::STATUS_SUBSCRIBED, + 'subscriber_confirm_code' => '', + ], + 'needToSendEmail' => false, + ], + 'Update subscription data: subscription confirm required ' => [ + 'subscriber_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_NOT_ACTIVE, + 'subscriber_confirm_code' => '', + ], + 'customer_data' => [ + 'id' => 1, + 'email' => 'email2@example.com', + 'confirmation_status' => AccountManagementInterface::ACCOUNT_CONFIRMED, + ], + 'store_id' => 2, + 'is_confirm_need' => true, + 'expected_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email2@example.com', + 'store_id' => 2, + 'subscriber_status' => Subscriber::STATUS_NOT_ACTIVE, + 'subscriber_confirm_code' => '', + ], + 'needToSendEmail' => true, + ], + ]; + } + + /** + * Test to Unsubscribe customer from newsletter + * + * @param array $subscriberData + * @param array $customerData + * @param int $storeId + * @param array $expectedData + * @param bool $needToSendEmail + * @dataProvider unsubscribeCustomerDataProvider + */ + public function testUnsubscribeCustomer( + array $subscriberData, + array $customerData, + int $storeId, + array $expectedData, + bool $needToSendEmail + ): void { + $websiteId = 1; + $customerId = $customerData['id']; + $store = $this->createMock(StoreInterface::class); + $store->method('getWebsiteId')->willReturn($websiteId); + $this->storeManager->method('getStore')->with($storeId)->willReturn($store); + /** @var CustomerInterface|MockObject $customer */ + $customer = $this->createMock(CustomerInterface::class); + $customer->method('getId')->willReturn($customerId); + $customer->method('getEmail')->willReturn($customerData['email']); + $this->customerRepository->method('getById')->with($customerId)->willReturn($customer); + /** @var Subscriber|MockObject $subscriber */ + $subscriber = $this->createPartialMock( + Subscriber::class, + [ + 'loadByCustomer', + 'loadBySubscriberEmail', + 'randomSequence', + 'save', + 'sendConfirmationRequestEmail', + 'sendConfirmationSuccessEmail', + 'sendUnsubscriptionEmail' + ] + ); + $subscriber->expects($this->once()) + ->method('loadByCustomer') + ->with($customerId, $websiteId) + ->willReturnSelf(); + if (empty($subscriberData['subscriber_id'])) { + $subscriber->expects($this->once()) + ->method('loadBySubscriberEmail') + ->with($customerData['email'], $websiteId) + ->willReturnSelf(); + } + $subscriber->setData($subscriberData); + $sendEmailMethod = $this->getSendEmailMethod($expectedData['subscriber_status'] ?? 0); + if ($needToSendEmail) { + $subscriber->expects($this->once())->method($sendEmailMethod); + } else { + $subscriber->expects($this->never())->method('sendConfirmationRequestEmail'); + $subscriber->expects($this->never())->method('sendConfirmationSuccessEmail'); + $subscriber->expects($this->never())->method('sendUnsubscriptionEmail'); + } + $this->subscriberFactory->method('create')->willReturn($subscriber); + + $this->assertEquals( + $subscriber, + $this->subscriptionManager->unsubscribeCustomer($customerId, $storeId) + ); + $this->assertEquals($subscriber->getData(), $expectedData); + } + + /** + * Unsubscribe customer data provider + * + * @return array + */ + public function unsubscribeCustomerDataProvider(): array + { + return [ + 'Unsubscribe new' => [ + 'subscriber_data' => [], + 'customer_data' => [ + 'id' => 1, + 'email' => 'email@example.com', + ], + 'store_id' => 1, + 'expected_data' => [ + ], + 'needToSendEmail' => false, + ], + 'Unsubscribe existing' => [ + 'subscriber_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_SUBSCRIBED, + 'subscriber_confirm_code' => '', + ], + 'customer_data' => [ + 'id' => 1, + 'email' => 'email@example.com', + ], + 'store_id' => 1, + 'expected_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_UNSUBSCRIBED, + 'subscriber_confirm_code' => '', + ], + 'needToSendEmail' => true, + ], + 'Unsubscribe existing: subscription confirm required' => [ + 'subscriber_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_NOT_ACTIVE, + 'subscriber_confirm_code' => '', + ], + 'customer_data' => [ + 'id' => 1, + 'email' => 'email@example.com', + ], + 'store_id' => 1, + 'expected_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_NOT_ACTIVE, + 'subscriber_confirm_code' => '', + ], + 'needToSendEmail' => false, + ], + 'Update subscription data' => [ + 'subscriber_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email@example.com', + 'store_id' => 1, + 'subscriber_status' => Subscriber::STATUS_UNSUBSCRIBED, + 'subscriber_confirm_code' => '', + ], + 'customer_data' => [ + 'id' => 1, + 'email' => 'email2@example.com', + ], + 'store_id' => 2, + 'expected_data' => [ + 'subscriber_id' => 1, + 'customer_id' => 1, + 'subscriber_email' => 'email2@example.com', + 'store_id' => 2, + 'subscriber_status' => Subscriber::STATUS_UNSUBSCRIBED, + 'subscriber_confirm_code' => '', + ], + 'needToSendEmail' => false, + ], + ]; + } +} diff --git a/app/code/Magento/Newsletter/etc/di.xml b/app/code/Magento/Newsletter/etc/di.xml index 179ec19cccfc5..3c35936a2e8aa 100644 --- a/app/code/Magento/Newsletter/etc/di.xml +++ b/app/code/Magento/Newsletter/etc/di.xml @@ -25,4 +25,11 @@ <plugin name="update_newsletter_subscription_on_customer_update" type="Magento\Newsletter\Model\Plugin\CustomerPlugin"/> </type> + <type name="Magento\Newsletter\Model\Subscriber"> + <arguments> + <argument name="customerSession" xsi:type="object">Magento\Customer\Model\Session\Proxy</argument> + </arguments> + </type> + <preference for="Magento\Newsletter\Model\SubscriptionManagerInterface" + type="Magento\Newsletter\Model\SubscriptionManager"/> </config> diff --git a/app/code/Magento/Store/Model/System/Store.php b/app/code/Magento/Store/Model/System/Store.php index 744019b107247..d13781b8c146b 100644 --- a/app/code/Magento/Store/Model/System/Store.php +++ b/app/code/Magento/Store/Model/System/Store.php @@ -52,6 +52,11 @@ class Store extends \Magento\Framework\DataObject implements OptionSourceInterfa */ protected $_storeManager; + /** + * @var string + */ + private $nonEscapableNbspChar; + /** * Init model * Load Website, Group and Store collections @@ -61,6 +66,9 @@ class Store extends \Magento\Framework\DataObject implements OptionSourceInterfa public function __construct(\Magento\Store\Model\StoreManagerInterface $storeManager) { $this->_storeManager = $storeManager; + // phpcs:ignore Magento2.Functions.DiscouragedFunction + $this->nonEscapableNbspChar = html_entity_decode(' ', ENT_NOQUOTES, 'UTF-8'); + return $this->reload(); } @@ -121,9 +129,6 @@ public function getStoreValuesForForm($empty = false, $all = false) $options[] = ['label' => __('All Store Views'), 'value' => 0]; } - // phpcs:ignore Magento2.Functions.DiscouragedFunction - $nonEscapableNbspChar = html_entity_decode(' ', ENT_NOQUOTES, 'UTF-8'); - foreach ($this->_websiteCollection as $website) { $websiteShow = false; foreach ($this->_groupCollection as $group) { @@ -140,13 +145,13 @@ public function getStoreValuesForForm($empty = false, $all = false) $websiteShow = true; } $values[] = [ - 'label' => str_repeat($nonEscapableNbspChar, 4) . $store->getName(), + 'label' => str_repeat($this->nonEscapableNbspChar, 4) . $store->getName(), 'value' => $store->getId(), ]; } if (!empty($values)) { $options[] = [ - 'label' => str_repeat($nonEscapableNbspChar, 4) . $group->getName(), + 'label' => str_repeat($this->nonEscapableNbspChar, 4) . $group->getName(), 'value' => $values, ]; } @@ -216,6 +221,22 @@ public function getStoresStructure($isAll = false, $storeIds = [], $groupIds = [ return $out; } + /** + * Get store options in tree view + * + * @param bool $isAll + * @param array $storeIds + * @param array $groupIds + * @param array $websiteIds + * @return array Format: array(array('value' => '<value>', 'label' => '<label>'), ...) + */ + public function getStoreOptionsTree($isAll = false, $storeIds = [], $groupIds = [], $websiteIds = []): array + { + $storeStructure = $this->getStoresStructure($isAll, $storeIds, $groupIds, $websiteIds); + + return $this->retrieveOptionValues($storeStructure); + } + /** * Website label/value array getter, compatible with form dropdown options * @@ -480,4 +501,35 @@ public function toOptionArray() { return $this->getStoreValuesForForm(); } + + /** + * Retrieve option values + * + * Return array of options as value-label pairs in tree view + * + * @param array $structure + * @param bool $needSpacePrefix + * @return array + */ + private function retrieveOptionValues(array $structure, bool $needSpacePrefix = false): array + { + $prefix = ''; + if ($needSpacePrefix) { + $prefix = str_repeat($this->nonEscapableNbspChar, 4); + } + + $values = []; + foreach ($structure as $item) { + $value = !empty($item['children']) + ? $this->retrieveOptionValues($item['children'], true) + : $item['value']; + + $values[] = [ + 'label' => $prefix . $item['label'], + 'value' => $value, + ]; + } + + return $values; + } } diff --git a/app/design/adminhtml/Magento/backend/Magento_Customer/web/css/source/_module.less b/app/design/adminhtml/Magento/backend/Magento_Customer/web/css/source/_module.less index c8f2530df22e0..0c7dd7e7cb94c 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Customer/web/css/source/_module.less +++ b/app/design/adminhtml/Magento/backend/Magento_Customer/web/css/source/_module.less @@ -78,3 +78,33 @@ } } } + +.customer-newsletter-fieldset.admin__fieldset { + &.multi-website { + > .admin__field > .admin__field-control { + width: ~'calc(100% * 0.75 - 30px)'; + + table { + th.subscriber-status { + text-align: center; + } + + td { + &.subscriber-status { + text-align: center; + } + + select.admin__control-select { + width: 100%; + } + } + } + } + } + + > .admin__field > .admin__field-control { + input[type='checkbox'] { + margin: 8px 0 0 0; + } + } +} diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/NewsletterTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/NewsletterTest.php index e28a9602b9377..a44101da77d6d 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/NewsletterTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/NewsletterTest.php @@ -61,12 +61,13 @@ public function tearDown() */ public function testRenderingNewsletterBlock() { + $websiteId = 1; $this->getRequest()->setParam('id', 1); $this->dispatch('backend/customer/index/edit'); $body = $this->getResponse()->getBody(); $this->assertContains('\u003Cspan\u003ENewsletter Information\u003C\/span\u003E', $body); - $this->assertContains('\u003Cinput id=\"_newslettersubscription\"', $body); + $this->assertContains('\u003Cinput id=\"_newslettersubscription_status_' . $websiteId . '\"', $body); $this->assertNotContains('checked="checked"', $body); $this->assertContains('\u003Cspan\u003ESubscribed to Newsletter\u003C\/span\u003E', $body); $this->assertContains('\u003ENo Newsletter Found\u003C', $body); diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php index 1b7f2c1f7efdd..4fc549f3caf86 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php @@ -128,6 +128,7 @@ public function testSaveActionWithInvalidFormData() public function testSaveActionExistingCustomerUnsubscribeNewsletter() { $customerId = 1; + $websiteId = 1; /** @var \Magento\Newsletter\Model\Subscriber $subscriber */ $subscriber = $this->objectManager->get(\Magento\Newsletter\Model\SubscriberFactory::class)->create(); @@ -144,7 +145,7 @@ public function testSaveActionExistingCustomerUnsubscribeNewsletter() 'lastname' => 'test lastname', 'sendemail_store_id' => 1 ], - 'subscription' => '0' + 'subscription_status' => [$websiteId => '0'] ]; $this->getRequest()->setPostValue($post)->setMethod(HttpRequest::METHOD_POST); $this->getRequest()->setParam('id', 1); From 72705ada1f90fa2afe7fdfdc14258c70d90bd014 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Mon, 25 Nov 2019 15:10:52 +0200 Subject: [PATCH 488/595] MC-4242: Newsletter subscriptions per website --- app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php index 59e67e7aa32a7..424a42f629cdc 100644 --- a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php +++ b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php @@ -21,6 +21,8 @@ /** * Newsletter Plugin for customer + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class CustomerPlugin { From 644c063d7c8ae32dee8861ae73a0fcf6d1e779c4 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Tue, 26 Nov 2019 09:21:18 +0200 Subject: [PATCH 489/595] MC-4242: Newsletter subscriptions per website --- .../Newsletter/Model/ResourceModel/Queue/Collection.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php b/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php index 1fc68771e74cb..0553fae0f3b18 100644 --- a/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php +++ b/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php @@ -5,6 +5,8 @@ */ namespace Magento\Newsletter\Model\ResourceModel\Queue; +use Magento\Newsletter\Model\Subscriber; + /** * Newsletter queue collection. * @@ -214,7 +216,7 @@ public function addSubscriberFilter($subscriberId) * @param int $customerId * @return $this */ - public function addCustomerFilter(int $customerId): self + public function addCustomerFilter(int $customerId): Collection { $this->getSelect() ->join( From c16f055dae7c035c643bc66f27f6fa5173d2ce2a Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Tue, 26 Nov 2019 09:21:56 +0200 Subject: [PATCH 490/595] MC-4242: Newsletter subscriptions per website --- .../Magento/Newsletter/Model/ResourceModel/Queue/Collection.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php b/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php index 0553fae0f3b18..33c539fbba84f 100644 --- a/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php +++ b/app/code/Magento/Newsletter/Model/ResourceModel/Queue/Collection.php @@ -5,8 +5,6 @@ */ namespace Magento\Newsletter\Model\ResourceModel\Queue; -use Magento\Newsletter\Model\Subscriber; - /** * Newsletter queue collection. * From 51c6d1d18c106a35b9fb4338e986dc38190b21f5 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Wed, 27 Nov 2019 15:49:05 +0200 Subject: [PATCH 491/595] MC-4242: Newsletter subscriptions per website --- app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php index 424a42f629cdc..83bafe5bf2887 100644 --- a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php +++ b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php @@ -118,7 +118,7 @@ public function afterSave( * and customer is already confirmed registration * than need to subscribe customer */ - if ($subscriber->getStatus() === Subscriber::STATUS_UNCONFIRMED && empty($result->getConfirmation())) { + if ((int)$subscriber->getStatus() === Subscriber::STATUS_UNCONFIRMED && empty($result->getConfirmation())) { $needToUpdate = true; $subscribeStatus = true; } From 107d68a6929bbbd396e8fb6b68c88227d282c2a2 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Tue, 3 Dec 2019 16:27:32 +0200 Subject: [PATCH 492/595] MC-4242: Newsletter subscriptions per website --- .../Magento/backend/web/css/styles-old.less | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/styles-old.less b/app/design/adminhtml/Magento/backend/web/css/styles-old.less index 1703e87691788..247316ab0361b 100644 --- a/app/design/adminhtml/Magento/backend/web/css/styles-old.less +++ b/app/design/adminhtml/Magento/backend/web/css/styles-old.less @@ -3962,22 +3962,6 @@ .grid tr.headings th > span { white-space: normal; } - - .field { - &.field-subscription { - .admin__field-label { - margin-left: 10px; - float: none; - cursor: pointer; - } - - .admin__field-control { - float: left; - width: auto; - margin: 6px 0px 0px 0px; - } - } - } } } From 53548365e5c52bcdb76ce089b85276dbc447c6ff Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Thu, 5 Dec 2019 11:23:43 +0200 Subject: [PATCH 493/595] MC-4242: Newsletter subscriptions per website --- .../Adminhtml/Index/MassUnsubscribe.php | 45 +++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php index 17f420d864df0..723f325cb08c8 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php @@ -6,10 +6,13 @@ namespace Magento\Customer\Controller\Adminhtml\Index; use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Customer\Model\Config\Share; use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; use Magento\Framework\Controller\ResultFactory; use Magento\Backend\App\Action\Context; use Magento\Newsletter\Model\SubscriptionManagerInterface; +use Magento\Store\Model\StoreManagerInterface; use Magento\Ui\Component\MassAction\Filter; use Magento\Customer\Model\ResourceModel\Customer\CollectionFactory; use Magento\Eav\Model\Entity\Collection\AbstractCollection; @@ -29,23 +32,38 @@ class MassUnsubscribe extends AbstractMassAction implements HttpPostActionInterf */ private $subscriptionManager; + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @var Share + */ + private $shareConfig; + /** * @param Context $context * @param Filter $filter * @param CollectionFactory $collectionFactory * @param CustomerRepositoryInterface $customerRepository * @param SubscriptionManagerInterface $subscriptionManager + * @param Share $shareConfig */ public function __construct( Context $context, Filter $filter, CollectionFactory $collectionFactory, CustomerRepositoryInterface $customerRepository, - SubscriptionManagerInterface $subscriptionManager + SubscriptionManagerInterface $subscriptionManager, + StoreManagerInterface $storeManager, + Share $shareConfig ) { parent::__construct($context, $filter, $collectionFactory); $this->customerRepository = $customerRepository; $this->subscriptionManager = $subscriptionManager; + $this->storeManager = $storeManager; + $this->shareConfig = $shareConfig; } /** @@ -60,8 +78,9 @@ protected function massAction(AbstractCollection $collection) foreach ($collection->getAllIds() as $customerId) { // Verify customer exists $customer = $this->customerRepository->getById($customerId); - $storeId = (int)$customer->getStoreId(); - $this->subscriptionManager->unsubscribeCustomer($customerId, $storeId); + foreach ($this->getUnsubscribeStoreIds($customer) as $storeId) { + $this->subscriptionManager->unsubscribeCustomer((int)$customerId, $storeId); + } $customersUpdated++; } @@ -74,4 +93,24 @@ protected function massAction(AbstractCollection $collection) return $resultRedirect; } + + /** + * Get store ids to unsubscribe customer + * + * @param CustomerInterface $customer + * @return array + */ + private function getUnsubscribeStoreIds(CustomerInterface $customer): array + { + $storeIds = []; + if ($this->shareConfig->isGlobalScope()) { + foreach ($this->storeManager->getStores() as $store) { + $storeIds[(int)$store->getWebsiteId()] = (int)$store->getId(); + } + } else { + $storeIds = [(int)$customer->getStoreId()]; + } + + return $storeIds; + } } From c6697f065e461a7f244c5379603ce2a75feece18 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Thu, 5 Dec 2019 14:17:27 +0200 Subject: [PATCH 494/595] MC-4242: Newsletter subscriptions per website --- .../Controller/Adminhtml/Index/MassUnsubscribe.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php index 723f325cb08c8..05f8a24e30c42 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php @@ -5,6 +5,7 @@ */ namespace Magento\Customer\Controller\Adminhtml\Index; +use Magento\Backend\Model\View\Result\Redirect; use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Customer\Api\Data\CustomerInterface; use Magento\Customer\Model\Config\Share; @@ -48,6 +49,7 @@ class MassUnsubscribe extends AbstractMassAction implements HttpPostActionInterf * @param CollectionFactory $collectionFactory * @param CustomerRepositoryInterface $customerRepository * @param SubscriptionManagerInterface $subscriptionManager + * @param StoreManagerInterface $storeManager * @param Share $shareConfig */ public function __construct( @@ -70,13 +72,13 @@ public function __construct( * Customer mass unsubscribe action * * @param AbstractCollection $collection - * @return \Magento\Backend\Model\View\Result\Redirect + * @return Redirect */ protected function massAction(AbstractCollection $collection) { $customersUpdated = 0; foreach ($collection->getAllIds() as $customerId) { - // Verify customer exists + // Verify that customer exists $customer = $this->customerRepository->getById($customerId); foreach ($this->getUnsubscribeStoreIds($customer) as $storeId) { $this->subscriptionManager->unsubscribeCustomer((int)$customerId, $storeId); @@ -87,7 +89,7 @@ protected function massAction(AbstractCollection $collection) if ($customersUpdated) { $this->messageManager->addSuccessMessage(__('A total of %1 record(s) were updated.', $customersUpdated)); } - /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ + /** @var Redirect $resultRedirect */ $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); $resultRedirect->setPath($this->getComponentRefererUrl()); From 74958a2004335596deb3f3a2799f06b6d47b1a1f Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Mon, 9 Dec 2019 15:46:11 +0200 Subject: [PATCH 495/595] MC-4242: Newsletter subscriptions per website --- .../Customer/Controller/Adminhtml/Index/MassSubscribe.php | 2 +- .../Customer/Controller/Adminhtml/Index/MassUnsubscribe.php | 2 +- .../Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php | 3 ++- .../Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassSubscribe.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassSubscribe.php index 881c5caebcbee..453035ad3151b 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassSubscribe.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassSubscribe.php @@ -15,7 +15,7 @@ use Magento\Framework\Controller\ResultFactory; /** - * Class MassSubscribe + * Class to mass subscribe customers by ids */ class MassSubscribe extends AbstractMassAction implements HttpPostActionInterface { diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php index 05f8a24e30c42..245e06699e6b0 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/MassUnsubscribe.php @@ -19,7 +19,7 @@ use Magento\Eav\Model\Entity\Collection\AbstractCollection; /** - * Class MassUnsubscribe + * Class to mass unsubscribe customers by ids */ class MassUnsubscribe extends AbstractMassAction implements HttpPostActionInterface { diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php index 8f672fbfb4da6..d8b88bba2cdbe 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassSubscribeTest.php @@ -26,7 +26,8 @@ use PHPUnit\Framework\TestCase; /** - * Class MassSubscribeTest + * Class to test mass subscribe customers by ids + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class MassSubscribeTest extends TestCase diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php index 303a11989236f..8220d50f418be 100644 --- a/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php +++ b/app/code/Magento/Customer/Test/Unit/Controller/Adminhtml/Index/MassUnsubscribeTest.php @@ -26,7 +26,8 @@ use PHPUnit\Framework\TestCase; /** - * Class MassUnsubscribeTest + * Class to test mass unsubscribe customers by ids + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class MassUnsubscribeTest extends TestCase From 3ccaec554c95517564aa41dd72dc3771e2d94907 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Mon, 9 Dec 2019 16:26:37 +0200 Subject: [PATCH 496/595] MC-4242: Newsletter subscriptions per website --- .../Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php | 2 +- .../Customer/Block/Adminhtml/Edit/Tab/NewsletterTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php index 22a22742cdb8d..d0ea012a11e1e 100644 --- a/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php +++ b/app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/NewsletterTest.php @@ -16,7 +16,7 @@ use Magento\Framework\Data\Form; use Magento\Framework\Data\Form\Element\Checkbox; use Magento\Framework\Data\Form\Element\Fieldset; -use \Magento\Framework\Data\Form\Element\Select; +use Magento\Framework\Data\Form\Element\Select; use Magento\Framework\Data\FormFactory; use Magento\Framework\Registry; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; diff --git a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/NewsletterTest.php b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/NewsletterTest.php index a44101da77d6d..9ddba4b994b40 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/NewsletterTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/NewsletterTest.php @@ -9,7 +9,7 @@ use Magento\TestFramework\Helper\Bootstrap; /** - * Class NewsletterTest + * Test Customer account form block functionality * * @magentoAppArea adminhtml */ From ecca7514a4a956eea2fa7efb34f9f176f00d1e60 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Tue, 10 Dec 2019 10:40:13 +0200 Subject: [PATCH 497/595] MC-4242: Newsletter subscriptions per website --- .../Magento/Newsletter/Model/Plugin/CustomerPlugin.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php index 83bafe5bf2887..60b279b659ca6 100644 --- a/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php +++ b/app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php @@ -220,8 +220,11 @@ public function afterDelete(CustomerRepositoryInterface $subject, $result, Custo */ public function afterGetById(CustomerRepositoryInterface $subject, CustomerInterface $customer) { - $isSubscribed = $this->getSubscriber($customer)->isSubscribed(); - $this->addIsSubscribedExtensionAttr($customer, $isSubscribed); + $extensionAttributes = $customer->getExtensionAttributes(); + if ($extensionAttributes === null || $extensionAttributes->getIsSubscribed() === null) { + $isSubscribed = $this->getSubscriber($customer)->isSubscribed(); + $this->addIsSubscribedExtensionAttr($customer, $isSubscribed); + } return $customer; } From f4373bcce058fafbfc818a9e17bd355cd9b1d4ef Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Wed, 11 Dec 2019 15:12:13 +0200 Subject: [PATCH 498/595] static-test fix --- .../js/jasmine/tests/lib/mage/browser.test.js | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/dev/tests/js/jasmine/tests/lib/mage/browser.test.js b/dev/tests/js/jasmine/tests/lib/mage/browser.test.js index 2c60497ce1bcc..ce76f5ec02b64 100644 --- a/dev/tests/js/jasmine/tests/lib/mage/browser.test.js +++ b/dev/tests/js/jasmine/tests/lib/mage/browser.test.js @@ -33,10 +33,13 @@ define([ spyOn($, 'ajax').and.callFake( function () { return { - done: function (data) { - obj.targetElementId = 1; - } - } + /** + * Succes result of ajax request + */ + done: function () { + obj.targetElementId = 1; + } + }; }); obj.openDialog('instance/url', 100, 100, 'title', options); obj.openDialog('instance/url', 100, 100, 'title', options); @@ -48,11 +51,14 @@ define([ spyOn($, 'ajax').and.callFake( function () { return { - done: function (data) { - obj.targetElementId = 'instance/url'; - obj.modalLoaded = true; - } - } + /** + * Succes result of ajax request + */ + done: function () { + obj.targetElementId = 'instance/url'; + obj.modalLoaded = true; + } + }; }); obj.openDialog('instance/url', 100, 100, 'title', undefined); obj.openDialog('instance/url', 100, 100, 'title', undefined); From d12ab03ef3788575ff69f1dc1ed0d9dd785de2ef Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Wed, 11 Dec 2019 21:54:17 +0700 Subject: [PATCH 499/595] [InstantPurchase] Cover Ui/CustomerAddressesFormatter and Ui/ShippingMethodFormatter by Unit Test --- .../Ui/CustomerAddressesFormatterTest.php | 56 +++++++++++++++++++ .../Model/Ui/ShippingMethodFormatterTest.php | 46 +++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/CustomerAddressesFormatterTest.php create mode 100644 app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/ShippingMethodFormatterTest.php diff --git a/app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/CustomerAddressesFormatterTest.php b/app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/CustomerAddressesFormatterTest.php new file mode 100644 index 0000000000000..2abe6b82bc3a9 --- /dev/null +++ b/app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/CustomerAddressesFormatterTest.php @@ -0,0 +1,56 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\InstantPurchase\Test\Unit\Model\Ui; + +use Magento\InstantPurchase\Model\Ui\CustomerAddressesFormatter; +use Magento\Customer\Model\Address; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Directory\Model\Country; +use PHPUnit\Framework\TestCase; + +class CustomerAddressesFormatterTest extends TestCase +{ + /** + * @var CustomerAddressesFormatter|\PHPUnit_Framework_MockObject_MockObject + */ + private $customerAddressesFormatter; + + /** + * Setup environment for testing + */ + protected function setUp() + { + $objectManager = new ObjectManagerHelper($this); + $this->customerAddressesFormatter = $objectManager->getObject(CustomerAddressesFormatter::class); + } + + /** + * Test format() + */ + public function testFormat() + { + $addressMock = $this->createPartialMock( + Address::class, + ['getName', 'getStreetFull', 'getCity', 'getRegion', 'getPostcode', 'getCountryModel'] + ); + $countryMock = $this->createMock(Country::class); + + $countryMock->expects($this->any())->method('getName')->willReturn('USA'); + $addressMock->expects($this->any())->method('getName')->willReturn('Address Name'); + $addressMock->expects($this->any())->method('getStreetFull')->willReturn('Address Street Full'); + $addressMock->expects($this->any())->method('getCity')->willReturn('Address City'); + $addressMock->expects($this->any())->method('getRegion')->willReturn('Address Region'); + $addressMock->expects($this->any())->method('getPostcode')->willReturn('Address Postcode'); + $addressMock->expects($this->any())->method('getCountryModel')->willReturn($countryMock); + + $this->assertEquals( + 'Address Name, Address Street Full, Address City, Address Region Address Postcode, USA', + $this->customerAddressesFormatter->format($addressMock) + ); + } +} diff --git a/app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/ShippingMethodFormatterTest.php b/app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/ShippingMethodFormatterTest.php new file mode 100644 index 0000000000000..632392bcb35e3 --- /dev/null +++ b/app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/ShippingMethodFormatterTest.php @@ -0,0 +1,46 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\InstantPurchase\Test\Unit\Model\Ui; + +use Magento\InstantPurchase\Model\Ui\ShippingMethodFormatter; +use Magento\Quote\Api\Data\ShippingMethodInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use PHPUnit\Framework\TestCase; + +class ShippingMethodFormatterTest extends TestCase +{ + /** + * @var ShippingMethodFormatter|\PHPUnit_Framework_MockObject_MockObject + */ + private $shippingMethodFormatter; + + /** + * Setup environment for testing + */ + protected function setUp() + { + $objectManager = new ObjectManagerHelper($this); + $this->shippingMethodFormatter = $objectManager->getObject(ShippingMethodFormatter::class); + } + + /** + * Test format() + */ + public function testFormat() + { + $shippingMethodMock = $this->createMock(ShippingMethodInterface::class, ['getCarrierTitle', 'getMethodTitle']); + + $shippingMethodMock->expects($this->any())->method('getCarrierTitle')->willReturn('flatrate'); + $shippingMethodMock->expects($this->any())->method('getMethodTitle')->willReturn('flatrate'); + + $this->assertEquals( + 'flatrate - flatrate', + $this->shippingMethodFormatter->format($shippingMethodMock) + ); + } +} From f8452c7a24b12af236b19b66f7d29b49421d0d54 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Wed, 11 Dec 2019 21:59:59 +0700 Subject: [PATCH 500/595] [InstantPurchase] Cover Ui/CustomerAddressesFormatter and Ui/ShippingMethodFormatter by Unit Test --- .../Test/Unit/Model/Ui/CustomerAddressesFormatterTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/CustomerAddressesFormatterTest.php b/app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/CustomerAddressesFormatterTest.php index 2abe6b82bc3a9..2a53a36a46cd6 100644 --- a/app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/CustomerAddressesFormatterTest.php +++ b/app/code/Magento/InstantPurchase/Test/Unit/Model/Ui/CustomerAddressesFormatterTest.php @@ -44,12 +44,12 @@ public function testFormat() $addressMock->expects($this->any())->method('getName')->willReturn('Address Name'); $addressMock->expects($this->any())->method('getStreetFull')->willReturn('Address Street Full'); $addressMock->expects($this->any())->method('getCity')->willReturn('Address City'); - $addressMock->expects($this->any())->method('getRegion')->willReturn('Address Region'); - $addressMock->expects($this->any())->method('getPostcode')->willReturn('Address Postcode'); + $addressMock->expects($this->any())->method('getRegion')->willReturn('California'); + $addressMock->expects($this->any())->method('getPostcode')->willReturn('12345'); $addressMock->expects($this->any())->method('getCountryModel')->willReturn($countryMock); $this->assertEquals( - 'Address Name, Address Street Full, Address City, Address Region Address Postcode, USA', + 'Address Name, Address Street Full, Address City, California 12345, USA', $this->customerAddressesFormatter->format($addressMock) ); } From 9dea197f30e4dd40966805296efee6b69982710d Mon Sep 17 00:00:00 2001 From: Adam Mellen <github@mellen.io> Date: Wed, 11 Dec 2019 15:16:04 +0000 Subject: [PATCH 501/595] Updating wee -> weee as per https://github.com/magento/devdocs/pull/5911 --- app/code/Magento/Weee/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Weee/README.md b/app/code/Magento/Weee/README.md index 61f9b8d6d8970..ef433ec4c96f9 100644 --- a/app/code/Magento/Weee/README.md +++ b/app/code/Magento/Weee/README.md @@ -2,10 +2,10 @@ The Magento_Weee module enables the application of fees/fixed product taxes (FPT) on certain types of products, usually related to electronic devices and recycling. Fixed product taxes can be used to setup a WEEE tax that is a fixed amount, rather than a percentage of the product price. FPT can be configured to be displayed at various places in Magento. Rules, amounts, and display options can be configured in the backend. This module extends the existing functionality of Magento_Tax. -The Magento_Wee module includes the following: +The Magento_Weee module includes the following: * ability to add different number of fixed product taxes to product. They are treated as a product attribute; -* configuration of where Weee appears (on category, product, sales, invoice, or credit memo pages) and whether FPT should be taxed; +* configuration of where WEEE appears (on category, product, sales, invoice, or credit memo pages) and whether FPT should be taxed; * a new line item in the totals section. # System requirements From 01e0f9168b9724a99724dda89f3ee988c729476e Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Wed, 11 Dec 2019 22:28:55 +0700 Subject: [PATCH 502/595] [Newsletter] Refactor code and Cover Model/Observer class by Unit Test --- .../Magento/Newsletter/Model/Observer.php | 37 ++++++++--- .../Test/Unit/Model/ObserverTest.php | 63 +++++++++++++++++++ 2 files changed, 91 insertions(+), 9 deletions(-) create mode 100644 app/code/Magento/Newsletter/Test/Unit/Model/ObserverTest.php diff --git a/app/code/Magento/Newsletter/Model/Observer.php b/app/code/Magento/Newsletter/Model/Observer.php index d77371569601f..a6f8ffd461d08 100644 --- a/app/code/Magento/Newsletter/Model/Observer.php +++ b/app/code/Magento/Newsletter/Model/Observer.php @@ -3,8 +3,14 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +declare(strict_types=1); + namespace Magento\Newsletter\Model; +use Magento\Newsletter\Model\ResourceModel\Queue\Collection; +use Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory; + /** * Newsletter module observer * @@ -12,20 +18,35 @@ */ class Observer { + /** + * Number of queue + */ + private const COUNT_OF_QUEUE = 3; + + /** + * Number of subscriptions + */ + private const COUNT_OF_SUBSCRIPTIONS = 20; + + /** + * First page in collection + */ + private const FIRST_PAGE = 1; + /** * Queue collection factory * - * @var \Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory + * @var CollectionFactory */ protected $_queueCollectionFactory; /** * Construct * - * @param \Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory $queueCollectionFactory + * @param CollectionFactory $queueCollectionFactory */ public function __construct( - \Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory $queueCollectionFactory + CollectionFactory $queueCollectionFactory ) { $this->_queueCollectionFactory = $queueCollectionFactory; } @@ -37,13 +58,11 @@ public function __construct( */ public function scheduledSend() { - $countOfQueue = 3; - $countOfSubscriptions = 20; - - /** @var \Magento\Newsletter\Model\ResourceModel\Queue\Collection $collection */ + /** @var Collection $collection */ $collection = $this->_queueCollectionFactory->create(); - $collection->setPageSize($countOfQueue)->setCurPage(1)->addOnlyForSendingFilter()->load(); + $collection->setPageSize(self::COUNT_OF_QUEUE) + ->setCurPage(self::FIRST_PAGE)->addOnlyForSendingFilter()->load(); - $collection->walk('sendPerSubscriber', [$countOfSubscriptions]); + $collection->walk('sendPerSubscriber', [self::COUNT_OF_SUBSCRIPTIONS]); } } diff --git a/app/code/Magento/Newsletter/Test/Unit/Model/ObserverTest.php b/app/code/Magento/Newsletter/Test/Unit/Model/ObserverTest.php new file mode 100644 index 0000000000000..7bf6d1e1c8671 --- /dev/null +++ b/app/code/Magento/Newsletter/Test/Unit/Model/ObserverTest.php @@ -0,0 +1,63 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Newsletter\Test\Unit\Model; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Newsletter\Model\Observer; +use Magento\Newsletter\Model\ResourceModel\Queue\Collection; +use Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory; +use PHPUnit\Framework\TestCase; + +class ObserverTest extends TestCase +{ + /** + * @var Observer + */ + private $model; + + /** + * @var CollectionFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $collectionFactoryMock; + + /** + * Setup environment for test + */ + protected function setUp() + { + $objectManager = new ObjectManagerHelper($this); + + $this->collectionFactoryMock = $this->createPartialMock( + CollectionFactory::class, + ['create'] + ); + + $this->model = $objectManager->getObject( + Observer::class, + [ + 'queueCollectionFactory' => $this->collectionFactoryMock + ] + ); + } + + /** + * Test scheduledSend() method + */ + public function testScheduledSend() + { + $collectionMock = $this->createMock(Collection::class); + $this->collectionFactoryMock->expects($this->once())->method('create')->willReturn($collectionMock); + $collectionMock->expects($this->once())->method('setPageSize')->with(3)->willReturnSelf(); + $collectionMock->expects($this->once())->method('setCurPage')->with(1)->willReturnSelf(); + $collectionMock->expects($this->once())->method('addOnlyForSendingFilter')->willReturnSelf(); + $collectionMock->expects($this->once())->method('load')->willReturnSelf(); + $collectionMock->expects($this->once())->method('walk')->with('sendPerSubscriber', [20]); + + $this->model->scheduledSend(); + } +} From 29f0417a28ad71d4dd42485b88da125ccd960a2e Mon Sep 17 00:00:00 2001 From: Mastiuhin Olexandr <mastiuhin.olexandr@transoftgroup.com> Date: Wed, 11 Dec 2019 18:08:28 +0200 Subject: [PATCH 503/595] MC-25098: Product is not deleted from minicart if not included in shared catalog --- app/code/Magento/Checkout/Model/Session.php | 4 +++ .../Magento/Checkout/Model/SessionTest.php | 30 +++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/app/code/Magento/Checkout/Model/Session.php b/app/code/Magento/Checkout/Model/Session.php index 4a4861fa9ccd2..7af00f1df8e95 100644 --- a/app/code/Magento/Checkout/Model/Session.php +++ b/app/code/Magento/Checkout/Model/Session.php @@ -272,6 +272,10 @@ public function getQuote() */ $quote = $this->quoteRepository->get($this->getQuoteId()); } + + if ($quote->getTotalsCollectedFlag() === false) { + $quote->collectTotals(); + } } catch (NoSuchEntityException $e) { $this->setQuoteId(null); } diff --git a/dev/tests/integration/testsuite/Magento/Checkout/Model/SessionTest.php b/dev/tests/integration/testsuite/Magento/Checkout/Model/SessionTest.php index 4682453012952..c7802f73a9a47 100644 --- a/dev/tests/integration/testsuite/Magento/Checkout/Model/SessionTest.php +++ b/dev/tests/integration/testsuite/Magento/Checkout/Model/SessionTest.php @@ -7,6 +7,7 @@ use Magento\Catalog\Api\Data\ProductTierPriceInterface; use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product\Attribute\Source\Status; use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Customer\Model\Session as CustomerSession; use Magento\Framework\Api\FilterBuilder; @@ -54,6 +55,35 @@ protected function setUp() $this->checkoutSession = $this->objectManager->create(Session::class); } + /** + * Tests that quote items and totals are correct when product becomes unavailable. + * + * @magentoDataFixture Magento/Customer/_files/customer.php + * @magentoDataFixture Magento/Sales/_files/quote.php + * @magentoAppIsolation enabled + */ + public function testGetQuoteWithUnavailableProduct() + { + $reservedOrderId = 'test01'; + $quoteGrandTotal = 10; + + $quote = $this->getQuote($reservedOrderId); + $this->assertEquals(1, $quote->getItemsCount()); + $this->assertCount(1, $quote->getItems()); + $this->assertEquals($quoteGrandTotal, $quote->getShippingAddress()->getBaseGrandTotal()); + + $productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + $product = $productRepository->get('simple'); + $product->setStatus(Status::STATUS_DISABLED); + $productRepository->save($product); + $this->checkoutSession->setQuoteId($quote->getId()); + $quote = $this->checkoutSession->getQuote(); + + $this->assertEquals(0, $quote->getItemsCount()); + $this->assertEmpty($quote->getItems()); + $this->assertEquals(0, $quote->getShippingAddress()->getBaseGrandTotal()); + } + /** * Test covers case when quote is not yet initialized and customer data is set to checkout session model. * From 5a1e0fff4c94a732e327ae4aec969365185f0289 Mon Sep 17 00:00:00 2001 From: Tom Reece <treece@adobe.com> Date: Wed, 11 Dec 2019 10:17:12 -0600 Subject: [PATCH 504/595] MQE-1921: [MTF-To-MFTF] Process PR 711 --- .../StorefrontClickHeaderLinkActionGroup.xml | 6 +-- .../StorefrontSeeHeaderLinksActionGroup.xml | 4 +- .../Mftf/Section/StorefrontHeaderSection.xml | 3 +- ...teAccountPasswordComplexityActionGroup.xml | 2 +- .../StorefrontCustomerCreateFormSection.xml | 2 +- .../NewCustomerPasswordComplexityTest.xml | 32 ++++++-------- .../Test/NewCustomerPasswordLengthTest.xml | 43 +++++++++++++++++++ .../NewCustomerPasswordComplexityTest.xml | 6 +-- 8 files changed, 66 insertions(+), 32 deletions(-) create mode 100644 app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordLengthTest.xml diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml index 46c06e909b4d9..052a5ac6a14e6 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml @@ -9,9 +9,9 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="StorefrontClickHeaderLinkActionGroup"> <arguments> - <argument name="LinkName" type="string" defaultValue="Create an Account"/> + <argument name="linkName" type="string" defaultValue="Create an Account"/> </arguments> - <click stepKey="ClickTheLink" selector="{{StorefrontHeaderSection.HeaderLinkByText(LinkName)}}"/> - <waitForPageLoad stepKey="Wait"/> + <click stepKey="clickTheLink" selector="{{StorefrontHeaderSection.headerLinkByText(linkName)}}"/> + <waitForPageLoad stepKey="wait"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml index 3155cca583d59..f4498e3b6cdd7 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml @@ -9,8 +9,8 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="StorefrontSeeHeaderLinksActionGroup"> <arguments> - <argument name="LinkName" type="string" defaultValue="Create an Account"/> + <argument name="linkName" type="string" defaultValue="Create an Account"/> </arguments> - <see stepKey="SeeElement" selector="{{StorefrontHeaderSection.headerlinks}}" userInput="{{LinkName}}"/> + <see stepKey="seeElement" selector="{{StorefrontHeaderSection.headerlinks}}" userInput="{{linkName}}"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Cms/Test/Mftf/Section/StorefrontHeaderSection.xml b/app/code/Magento/Cms/Test/Mftf/Section/StorefrontHeaderSection.xml index fefde1e6035f3..7b47c6b49db7b 100644 --- a/app/code/Magento/Cms/Test/Mftf/Section/StorefrontHeaderSection.xml +++ b/app/code/Magento/Cms/Test/Mftf/Section/StorefrontHeaderSection.xml @@ -10,7 +10,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="StorefrontHeaderSection"> <element name="headerlinks" type="text" selector="ul.header.links"/> - <element name="HeaderLinkByText" type="text" selector="//ul[contains(@class, 'header') and contains(@class, 'links')]/li/a[contains(text(),'{{LinkName}}')]" - parameterized="true" /> + <element name="headerLinkByText" type="text" selector="//ul[contains(@class, 'header') and contains(@class, 'links')]/li/a[contains(text(),'{{LinkName}}')]" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.xml index 9d7dbc604f59d..95a03042bec3b 100644 --- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.xml +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.xml @@ -12,6 +12,6 @@ <arguments> <argument name="message" type="string"/> </arguments> - <see userInput="{{message}}" selector="{{StorefrontCustomerCreateFormSection.PasswordErrorMessages}}" stepKey="verifyMessage" /> + <see userInput="{{message}}" selector="{{StorefrontCustomerCreateFormSection.passwordErrorMessages}}" stepKey="verifyMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml index 17048dda688e6..9fc26a03b04ee 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml @@ -17,7 +17,7 @@ <element name="passwordField" type="input" selector="#password"/> <element name="confirmPasswordField" type="input" selector="#password-confirmation"/> <element name="createAccountButton" type="button" selector="button.action.submit.primary" timeout="30"/> - <element name="PasswordErrorMessages" type="text" selector="#password-error"/> + <element name="passwordErrorMessages" type="text" selector="#password-error"/> </section> <section name="StoreFrontCustomerAdvancedAttributesSection"> <element name="textFieldAttribute" type="input" selector="//input[@id='{{var}}']" parameterized="true" /> diff --git a/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml b/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml index ccd97f83cd0a6..74a9c68cb2f79 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordComplexityTest.xml @@ -11,39 +11,33 @@ <test name="NewCustomerPasswordComplexityTest"> <annotations> <features value="Security"/> - <stories value="Checking customer's password length and password complexity"/> - <title value="Notify the customer if password length or complexity is not match to requirements"/> - <description value="Show notifies to the customer if password length or complexity is not match to requirements"/> + <stories value="Checking customer's password complexity"/> + <title value="Notify the customer if password complexity does not match the requirements"/> + <description value="Notify the customer if password complexity does not match the requirements"/> + <testCaseId value="MC-14368"/> <group value="security"/> <group value="mtf_migrated"/> </annotations> - <!-- TEST BODY --> <!-- Go to storefront home page --> <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/> + <!-- See the Registration Link --> - <actionGroup ref="StorefrontSeeHeaderLinksActionGroup" stepKey="SeeTheLink"/> + <actionGroup ref="StorefrontSeeHeaderLinksActionGroup" stepKey="seeTheLink"/> + <!-- Click the Registration Link --> - <actionGroup ref="StorefrontClickHeaderLinkActionGroup" stepKey="ClickTheLink"> - <argument name="LinkName" value="Create an Account"/> - </actionGroup> - <!-- Fill Registration Form with Password length is bellow 8 Characters --> - <actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="FillRegistrationFormPasswordLengthBellowEightCharacters"> - <argument name="customer" value="Simple_Customer_With_Password_Length_Is_Below_Eight_Characters"/> - </actionGroup> - <!-- See the Error --> - <actionGroup ref="AssertMessageCustomerCreateAccountPasswordComplexityActionGroup" stepKey="SeeTheErrorPasswordLength"> - <argument name="message" value="Minimum length of this field must be equal or greater than 8 symbols. Leading and trailing spaces will be ignored."/> + <actionGroup ref="StorefrontClickHeaderLinkActionGroup" stepKey="clickTheLink"> + <argument name="linkName" value="Create an Account"/> </actionGroup> + <!-- Fill Registration Form with not secure enough password --> - <actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="FillRegistrationFormPasswordNotSecure"> + <actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="fillRegistrationFormPasswordNotSecure"> <argument name="customer" value="Simple_Customer_With_Not_Secure_Password"/> </actionGroup> + <!-- See the Error --> - <actionGroup ref="AssertMessageCustomerCreateAccountPasswordComplexityActionGroup" stepKey="SeeTheErrorPasswordSecure"> + <actionGroup ref="AssertMessageCustomerCreateAccountPasswordComplexityActionGroup" stepKey="seeTheErrorPasswordSecure"> <argument name="message" value="Minimum of different classes of characters in password is 3. Classes of characters: Lower Case, Upper Case, Digits, Special Characters."/> </actionGroup> - <!--Test Body END--> - </test> </tests> diff --git a/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordLengthTest.xml b/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordLengthTest.xml new file mode 100644 index 0000000000000..a10059d0603c5 --- /dev/null +++ b/app/code/Magento/Security/Test/Mftf/Test/NewCustomerPasswordLengthTest.xml @@ -0,0 +1,43 @@ +<?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="NewCustomerPasswordLengthTest"> + <annotations> + <features value="Security"/> + <stories value="Checking customer's password length"/> + <title value="Notify the customer if password length does not match the requirements"/> + <description value="Notify the customer if password length does not match the requirements"/> + <testCaseId value="MC-14367"/> + <group value="security"/> + <group value="mtf_migrated"/> + </annotations> + + <!-- Go to storefront home page --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openStoreFrontHomePage"/> + + <!-- See the Registration Link --> + <actionGroup ref="StorefrontSeeHeaderLinksActionGroup" stepKey="seeTheLink"/> + + <!-- Click the Registration Link --> + <actionGroup ref="StorefrontClickHeaderLinkActionGroup" stepKey="clickTheLink"> + <argument name="linkName" value="Create an Account"/> + </actionGroup> + + <!-- Fill Registration Form with Password length is bellow 8 Characters --> + <actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="fillRegistrationFormPasswordLengthBellowEightCharacters"> + <argument name="customer" value="Simple_Customer_With_Password_Length_Is_Below_Eight_Characters"/> + </actionGroup> + + <!-- See the Error --> + <actionGroup ref="AssertMessageCustomerCreateAccountPasswordComplexityActionGroup" stepKey="seeTheErrorPasswordLength"> + <argument name="message" value="Minimum length of this field must be equal or greater than 8 symbols. Leading and trailing spaces will be ignored."/> + </actionGroup> + </test> +</tests> diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.xml b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.xml index 7b6f3e981714c..534f692a36aef 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Security\Test\TestCase\NewCustomerPasswordComplexityTest" summary="New customer password complexity" ticketId="MAGETWO-49044"> <variation name="PasswordLengthTest" summary="Customer password length is below 8 characters"> - <data name="tag" xsi:type="string">severity:S1</data> + <data name="tag" xsi:type="string">severity:S1,mftf_migrated:yes</data> <data name="customer/data/firstname" xsi:type="string">john</data> <data name="customer/data/lastname" xsi:type="string">doe</data> <data name="customer/data/email" xsi:type="string">johndoe%isolation%@example.com</data> @@ -16,10 +16,9 @@ <data name="customer/data/password" xsi:type="string">123123</data> <data name="customer/data/password_confirmation" xsi:type="string">123123</data> <constraint name="Magento\Security\Test\Constraint\AssertPasswordLengthErrorMessage" /> - <data name="tag" xsi:type="string">mftf_migrated:yes</data> </variation> <variation name="PasswordComplexityTest" summary="Customer password is not secure enough"> - <data name="tag" xsi:type="string">severity:S1</data> + <data name="tag" xsi:type="string">severity:S1,mftf_migrated:yes</data> <data name="customer/data/firstname" xsi:type="string">john</data> <data name="customer/data/lastname" xsi:type="string">doe</data> <data name="customer/data/email" xsi:type="string">johndoe%isolation%@example.com</data> @@ -27,7 +26,6 @@ <data name="customer/data/password" xsi:type="string">123123qa</data> <data name="customer/data/password_confirmation" xsi:type="string">123123qa</data> <constraint name="Magento\Security\Test\Constraint\AssertPasswordIsNotSecureEnoughMessage" /> - <data name="tag" xsi:type="string">mftf_migrated:yes</data> </variation> </testCase> </config> From 0dd0db5943415f8892d5ee1e3b2811caaf679351 Mon Sep 17 00:00:00 2001 From: Tom Reece <treece@adobe.com> Date: Wed, 11 Dec 2019 10:47:23 -0600 Subject: [PATCH 505/595] MQE-1921: [MTF-To-MFTF] Process PR 711 - Add annotations to new action groups --- .../Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml | 4 ++++ .../Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml | 3 +++ ...sageCustomerCreateAccountPasswordComplexityActionGroup.xml | 3 +++ 3 files changed, 10 insertions(+) diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml index 052a5ac6a14e6..48e7ec81ae1c1 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontClickHeaderLinkActionGroup.xml @@ -8,9 +8,13 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="StorefrontClickHeaderLinkActionGroup"> + <annotations> + <description>Clicks a link in the storefront header.</description> + </annotations> <arguments> <argument name="linkName" type="string" defaultValue="Create an Account"/> </arguments> + <click stepKey="clickTheLink" selector="{{StorefrontHeaderSection.headerLinkByText(linkName)}}"/> <waitForPageLoad stepKey="wait"/> </actionGroup> diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml index f4498e3b6cdd7..ec5c388ee1c6b 100644 --- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml +++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/StorefrontSeeHeaderLinksActionGroup.xml @@ -8,6 +8,9 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="StorefrontSeeHeaderLinksActionGroup"> + <annotations> + <description>See a link by name in the storefront header.</description> + </annotations> <arguments> <argument name="linkName" type="string" defaultValue="Create an Account"/> </arguments> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.xml index 95a03042bec3b..b62f5435275a3 100644 --- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.xml +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertMessageCustomerCreateAccountPasswordComplexityActionGroup.xml @@ -9,6 +9,9 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AssertMessageCustomerCreateAccountPasswordComplexityActionGroup"> + <annotations> + <description>Assert is shown an error about their password during new user form filling.</description> + </annotations> <arguments> <argument name="message" type="string"/> </arguments> From 0b7b23616d1a391125cd7cb3230f09ac28572441 Mon Sep 17 00:00:00 2001 From: Tom Reece <treece@adobe.com> Date: Wed, 11 Dec 2019 11:04:02 -0600 Subject: [PATCH 506/595] MQE-1857: [MTF-To-MFTF] Process PR 746 --- .../AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml | 9 +++++---- ...nDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml | 8 ++++---- ...nDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml | 8 ++++---- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml index 4c3bd8179578c..b6cd116956812 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml @@ -6,16 +6,16 @@ */ --> -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest"> <annotations> <stories value="Delete CMS Page URL rewrite with No Redirects"/> <title value="Delete CMS Page URL rewrite with No Redirects"/> <description value="Log in to admin and delete CMS Page URL rewrite with No Redirects"/> - <group value="cMSContent"/> + <testCaseId value="MC-14648"/> <group value="mtf_migrated"/> </annotations> - <before> <createData entity="simpleCmsPage" stepKey="createCMSPage"/> <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> @@ -46,14 +46,15 @@ <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> <argument name="message" value="You deleted the URL rewrite."/> </actionGroup> + <!--Search and verify AssertUrlRewriteNotInGrid--> <actionGroup ref="AdminSearchDeletedUrlRewrite" stepKey="searchDeletedUrlRewriteInGrid"> <argument name="requestPath" value="newrequestpath"/> </actionGroup> + <!--Verify AssertPageByUrlRewriteIsNotFound--> <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFound"> <argument name="requestPath" value="newrequestpath"/> </actionGroup> - </test> </tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml index 89f663b54e017..1f76493bac89c 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml @@ -6,16 +6,16 @@ */ --> -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest"> <annotations> <stories value="Delete CMS Page URL rewrite with Permanent Redirect"/> <title value="Delete CMS Page URL rewrite with Permanent Redirect"/> <description value="Log in to admin and delete CMS Page URL rewrite with Permanent Redirect"/> - <group value="cMSContent"/> + <testCaseId value="MC-14649"/> <group value="mtf_migrated"/> </annotations> - <before> <createData entity="simpleCmsPage" stepKey="createCMSPage"/> <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> @@ -46,10 +46,10 @@ <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> <argument name="message" value="You deleted the URL rewrite."/> </actionGroup> + <!-- Verify AssertPageByUrlRewriteIsNotFound --> <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFound"> <argument name="requestPath" value="permanentrequestpath.html"/> </actionGroup> - </test> </tests> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml index ad7aec335b7a3..c62f0ece7e780 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml @@ -6,16 +6,16 @@ */ --> -<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest"> <annotations> <stories value="Delete CMS Page URL rewrite with Temporary Redirect"/> <title value="Delete CMS Page URL rewrite with Temporary Redirect"/> <description value="Log in to admin and delete CMS Page URL rewrite with Temporary Redirect"/> - <group value="cMSContent"/> + <testCaseId value="MC-14650"/> <group value="mtf_migrated"/> </annotations> - <before> <createData entity="simpleCmsPage" stepKey="createCMSPage"/> <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> @@ -46,10 +46,10 @@ <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> <argument name="message" value="You deleted the URL rewrite."/> </actionGroup> + <!--Verify AssertPageByUrlRewriteIsNotFound--> <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFound"> <argument name="requestPath" value="temporaryrequestpath.html"/> </actionGroup> - </test> </tests> From 26e5774754cd2ce52707bd1327345c6a89f12d19 Mon Sep 17 00:00:00 2001 From: Dmytro Cheshun <d.cheshun@atwix.com> Date: Wed, 11 Dec 2019 21:06:27 +0200 Subject: [PATCH 507/595] Minor code style fixes --- .../js/jasmine/tests/lib/mage/browser.test.js | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/dev/tests/js/jasmine/tests/lib/mage/browser.test.js b/dev/tests/js/jasmine/tests/lib/mage/browser.test.js index ce76f5ec02b64..06f355908daca 100644 --- a/dev/tests/js/jasmine/tests/lib/mage/browser.test.js +++ b/dev/tests/js/jasmine/tests/lib/mage/browser.test.js @@ -12,7 +12,6 @@ define([ var obj; beforeEach(function () { - /** * Dummy constructor to use for instantiation * @constructor @@ -27,14 +26,14 @@ define([ describe('"openDialog" method', function () { it('Opens dialog with provided targetElementId', function () { var options = { - 'targetElementId': 1 - }; + 'targetElementId': 1 + }; spyOn($, 'ajax').and.callFake( - function () { + function () { return { /** - * Succes result of ajax request + * Success result of ajax request */ done: function () { obj.targetElementId = 1; @@ -44,22 +43,21 @@ define([ obj.openDialog('instance/url', 100, 100, 'title', options); obj.openDialog('instance/url', 100, 100, 'title', options); expect($.ajax.calls.count()).toBe(1); - }); it('Opens dialog with provided url param', function () { spyOn($, 'ajax').and.callFake( - function () { - return { - /** - * Succes result of ajax request - */ - done: function () { - obj.targetElementId = 'instance/url'; - obj.modalLoaded = true; - } - }; - }); + function () { + return { + /** + * Success result of ajax request + */ + done: function () { + obj.targetElementId = 'instance/url'; + obj.modalLoaded = true; + } + }; + }); obj.openDialog('instance/url', 100, 100, 'title', undefined); obj.openDialog('instance/url', 100, 100, 'title', undefined); expect($.ajax.calls.count()).toBe(1); From 0934026841b91b302dab5a06c5e2118cb1d2ac59 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Wed, 11 Dec 2019 13:38:10 -0600 Subject: [PATCH 508/595] Change action groups name according to CE branch changes --- .../AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml index 1c1f7af5a5cd5..4b9f37f628f34 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest.xml @@ -38,7 +38,7 @@ </actionGroup> <!--Delete the Category Url Rewrite--> - <actionGroup ref="AssertPageByUrlRewriteIsNotFoundActionGroup" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="-"/> </actionGroup> <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> From 16ab63b347dd4628ed1cc1947929ff44b6bad90c Mon Sep 17 00:00:00 2001 From: Lukasz Lewandowski <luklewluk@gmail.com> Date: Wed, 11 Dec 2019 15:25:39 -0600 Subject: [PATCH 509/595] Fix caching Product Metadata getVersion --- lib/internal/Magento/Framework/App/ProductMetadata.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/App/ProductMetadata.php b/lib/internal/Magento/Framework/App/ProductMetadata.php index 052119713294b..8f989351743d2 100644 --- a/lib/internal/Magento/Framework/App/ProductMetadata.php +++ b/lib/internal/Magento/Framework/App/ProductMetadata.php @@ -85,8 +85,8 @@ public function getVersion() } else { $this->version = 'UNKNOWN'; } - $this->cache->save($this->version, self::VERSION_CACHE_KEY, [Config::CACHE_TAG]); } + $this->cache->save($this->version, self::VERSION_CACHE_KEY, [Config::CACHE_TAG]); } return $this->version; } From 09136b5ff8f0b4f1f78163ce4ab142b33a99f60d Mon Sep 17 00:00:00 2001 From: Tom Reece <treece@adobe.com> Date: Wed, 11 Dec 2019 15:55:27 -0600 Subject: [PATCH 510/595] MQE-1857: [MTF-To-MFTF] Process PR 746 - Try to fix some flakiness --- .../Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml | 2 ++ .../Test/Mftf/Test/AdminCreateCreditMemoPartialRefundTest.xml | 1 + 2 files changed, 3 insertions(+) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml index 94d488f216b49..eb4f2b5c25281 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml @@ -31,6 +31,8 @@ <argument name="category" value="$$createPreReqCategory$$"/> <argument name="simpleProduct" value="ProductWithUnicode"/> </actionGroup> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" stepKey="flushCache"/> <actionGroup ref="AssertProductInStorefrontCategoryPage" stepKey="assertProductInStorefront1"> <argument name="category" value="$$createPreReqCategory$$"/> <argument name="product" value="ProductWithUnicode"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoPartialRefundTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoPartialRefundTest.xml index 418c0e72dc1fc..4b618495f19d5 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoPartialRefundTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateCreditMemoPartialRefundTest.xml @@ -80,6 +80,7 @@ <waitForPageLoad stepKey="waitForResultPage"/> <!-- Perform all assertions: assert refund success create message --> + <waitForElementVisible selector="{{AdminIndexManagementSection.successMessage}}" stepKey="waitForSuccessMessage"/> <see selector="{{AdminIndexManagementSection.successMessage}}" userInput="You created the credit memo." stepKey="assertRefundSuccessCreateMessage"/> <!-- Assert Credit Memo button --> From 264e6e6e86f4b0c7e17436ad72e331599a72c4ec Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Wed, 11 Dec 2019 21:27:49 -0600 Subject: [PATCH 511/595] Fix static --- .../Sales/view/adminhtml/templates/order/address/form.phtml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/address/form.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/address/form.phtml index b794c418de8d9..0cc23056b3c2f 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/address/form.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/address/form.phtml @@ -7,7 +7,11 @@ <div class="messages"> <div class="message message-notice"> <div class="message-inner"> - <div class="message-content"><?= $block->escapeHtml(__('Changing address information will not recalculate shipping, tax or other order amount.')) ?></div> + <div class="message-content"> + <?= $block->escapeHtml( + __('Changing address information will not recalculate shipping, tax or other order amount.') + ) ?> + </div> </div> </div> </div> From 4ce1365d58117883c7267be7abd5569c4dc99f45 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Thu, 12 Dec 2019 11:33:41 +0700 Subject: [PATCH 512/595] [Backend] Cover action admin/dashboard/ajaxBlock by Integration Test --- .../Adminhtml/Dashboard/AjaxBlockTest.php | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/Dashboard/AjaxBlockTest.php diff --git a/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/Dashboard/AjaxBlockTest.php b/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/Dashboard/AjaxBlockTest.php new file mode 100644 index 0000000000000..3deb225cead18 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/Dashboard/AjaxBlockTest.php @@ -0,0 +1,69 @@ +<?php +/** + * + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Backend\Controller\Adminhtml\Dashboard; + +use Magento\TestFramework\TestCase\AbstractBackendController; +use Magento\Framework\App\Request\Http as HttpRequest; + +/** + * @magentoAppArea adminhtml + */ +class AjaxBlockTest extends AbstractBackendController +{ + /** + * Test execute to check render block + * + * @dataProvider ajaxBlockDataProvider + */ + public function testExecute($block, $expectedResult) + { + $this->getRequest()->setMethod(HttpRequest::METHOD_POST); + $this->getRequest()->setParam('block', $block); + + $this->dispatch('backend/admin/dashboard/ajaxBlock/'); + + $this->assertEquals(200, $this->getResponse()->getHttpResponseCode()); + + $actual = $this->getResponse()->getBody(); + + $this->assertContains($expectedResult, $actual); + } + + /** + * Provides POST data and Expected Result + * + * @return array + */ + public function ajaxBlockDataProvider() + { + return [ + [ + 'tab_orders', + 'order_orders_period' + ], + [ + 'tab_amounts', + 'order_amounts_period' + ], + [ + 'totals', + 'dashboard_diagram_totals' + ], + [ + '', + '' + ], + [ + 'test_block', + '' + ] + ]; + } +} From 32fb4d3b02ebc1529b29a2158e7ccf59cd4384f8 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Thu, 12 Dec 2019 09:38:43 +0200 Subject: [PATCH 513/595] MC-5233: DateTime product attributes support --- .../CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml index 3b60e4b09de28..1cec03a4c765e 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml @@ -308,6 +308,10 @@ <createData entity="_defaultProduct" stepKey="createSimpleProduct"> <requiredEntity createDataKey="createCategory"/> </createData> + + <!-- Perform reindex and flush cache --> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <deleteData stepKey="deleteProduct" createDataKey="createSimpleProduct"/> From ae8cb2cc39828276cb60e602a0dd878774beff7b Mon Sep 17 00:00:00 2001 From: Mastiuhin Olexandr <mastiuhin.olexandr@transoftgroup.com> Date: Thu, 12 Dec 2019 13:15:12 +0200 Subject: [PATCH 514/595] MC-25098: Product is not deleted from minicart if not included in shared catalog --- .../testsuite/Magento/Checkout/Model/SessionTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/Checkout/Model/SessionTest.php b/dev/tests/integration/testsuite/Magento/Checkout/Model/SessionTest.php index c7802f73a9a47..e0e390e89c97c 100644 --- a/dev/tests/integration/testsuite/Magento/Checkout/Model/SessionTest.php +++ b/dev/tests/integration/testsuite/Magento/Checkout/Model/SessionTest.php @@ -18,7 +18,7 @@ use Magento\TestFramework\Helper\Bootstrap; /** - * Class SessionTest + * Checkout Session model test. * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ From 70b199cd3660b9e581c618f27ac7adc7db3c4114 Mon Sep 17 00:00:00 2001 From: divyajyothi5321 <54176640+divyajyothi5321@users.noreply.github.com> Date: Thu, 12 Dec 2019 17:22:03 +0530 Subject: [PATCH 515/595] Fixed the issue 25930 --- .../Magento/backend/web/css/source/components/_messages.less | 1 + 1 file changed, 1 insertion(+) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/components/_messages.less b/app/design/adminhtml/Magento/backend/web/css/source/components/_messages.less index 15cd295885892..6660f780afdaf 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/components/_messages.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/components/_messages.less @@ -44,6 +44,7 @@ .messages { .message { + .lib-wrap-words(); &:last-child { margin: 0 0 2rem; } From b67ab4377e58cb977e1ec95c86607943bad1144e Mon Sep 17 00:00:00 2001 From: Mastiuhin Olexandr <mastiuhin.olexandr@transoftgroup.com> Date: Thu, 12 Dec 2019 14:03:00 +0200 Subject: [PATCH 516/595] MC-29578: A lot of identical reviews are created after many times clicking on Submit Review button --- .../Review/view/frontend/templates/form.phtml | 14 ++++++++------ .../view/frontend/web/js/submit-review.js | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 app/code/Magento/Review/view/frontend/web/js/submit-review.js diff --git a/app/code/Magento/Review/view/frontend/templates/form.phtml b/app/code/Magento/Review/view/frontend/templates/form.phtml index f1340945043e9..6b00bf681c1e3 100644 --- a/app/code/Magento/Review/view/frontend/templates/form.phtml +++ b/app/code/Magento/Review/view/frontend/templates/form.phtml @@ -5,28 +5,29 @@ */ /** @var \Magento\Review\Block\Form $block */ +//phpcs:disable Generic.Files.LineLength ?> <div class="block review-add"> <div class="block-title"><strong><?= $block->escapeHtml(__('Write Your Own Review')) ?></strong></div> <div class="block-content"> -<?php if ($block->getAllowWriteReviewFlag()) : ?> +<?php if ($block->getAllowWriteReviewFlag()):?> <form action="<?= $block->escapeUrl($block->getAction()) ?>" class="review-form" method="post" id="review-form" data-role="product-review-form" data-bind="scope: 'review-form'"> <?= $block->getBlockHtml('formkey') ?> <?= $block->getChildHtml('form_fields_before') ?> <fieldset class="fieldset review-fieldset" data-hasrequired="<?= $block->escapeHtmlAttr(__('* Required Fields')) ?>"> <legend class="legend review-legend"><span><?= $block->escapeHtml(__("You're reviewing:")) ?></span><strong><?= $block->escapeHtml($block->getProductInfo()->getName()) ?></strong></legend><br /> - <?php if ($block->getRatings() && $block->getRatings()->getSize()) : ?> + <?php if ($block->getRatings() && $block->getRatings()->getSize()): ?> <span id="input-message-box"></span> <fieldset class="field required review-field-ratings"> <legend class="label"><span><?= $block->escapeHtml(__('Your Rating')) ?></span></legend><br/> <div class="control"> <div class="nested" id="product-review-table"> - <?php foreach ($block->getRatings() as $_rating) : ?> + <?php foreach ($block->getRatings() as $_rating): ?> <div class="field choice review-field-rating"> <label class="label" id="<?= $block->escapeHtml($_rating->getRatingCode()) ?>_rating_label"><span><?= $block->escapeHtml($_rating->getRatingCode()) ?></span></label> <div class="control review-control-vote"> <?php $options = $_rating->getOptions();?> - <?php $iterator = 1; foreach ($options as $_option) : ?> + <?php $iterator = 1; foreach ($options as $_option): ?> <input type="radio" name="ratings[<?= $block->escapeHtmlAttr($_rating->getId()) ?>]" @@ -84,11 +85,12 @@ }, "#review-form": { "Magento_Review/js/error-placement": {}, - "Magento_Review/js/validate-review": {} + "Magento_Review/js/validate-review": {}, + "Magento_Review/js/submit-review": {} } } </script> -<?php else : ?> +<?php else: ?> <div class="message info notlogged" id="review-form"> <div> <?= $block->escapeHtml(__('Only registered users can write reviews. Please <a href="%1">Sign in</a> or <a href="%2">create an account</a>', $block->getLoginLink(), $block->getRegisterUrl()), ['a']) ?> diff --git a/app/code/Magento/Review/view/frontend/web/js/submit-review.js b/app/code/Magento/Review/view/frontend/web/js/submit-review.js new file mode 100644 index 0000000000000..6399ce22ffe88 --- /dev/null +++ b/app/code/Magento/Review/view/frontend/web/js/submit-review.js @@ -0,0 +1,18 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'jquery' +], function ($) { + 'use strict'; + + return function (config, element) { + $(element).on('submit', function () { + if ($(this).valid()) { + $(this).find('.submit').attr('disabled', true); + } + }); + }; +}); From 3096b56dcebdd96d864ea09059997e4021333403 Mon Sep 17 00:00:00 2001 From: Nikita Shcherbatykh <nikita.shcherbatykh@transoftgroup.com> Date: Thu, 12 Dec 2019 15:12:50 +0200 Subject: [PATCH 517/595] MC-25257: Special from / to date wrong on administrator Dutch locale --- .../Product/Initialization/Helper.php | 55 +++-------- .../Catalog/Model/Product/Filter/DateTime.php | 67 ++++++++++++++ .../Product/Initialization/HelperTest.php | 78 ++++++++++------ .../Model/Product/Filter/DateTimeTest.php | 91 +++++++++++++++++++ 4 files changed, 219 insertions(+), 72 deletions(-) create mode 100644 app/code/Magento/Catalog/Model/Product/Filter/DateTime.php create mode 100644 app/code/Magento/Catalog/Test/Unit/Model/Product/Filter/DateTimeTest.php diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php index 62bcb1c8cd6d7..2ae97223d6359 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php @@ -6,7 +6,6 @@ namespace Magento\Catalog\Controller\Adminhtml\Product\Initialization; -use DateTime; use Magento\Backend\Helper\Js; use Magento\Catalog\Api\Data\ProductCustomOptionInterfaceFactory as CustomOptionFactory; use Magento\Catalog\Api\Data\ProductLinkInterfaceFactory as ProductLinkFactory; @@ -15,6 +14,8 @@ use Magento\Catalog\Api\ProductRepositoryInterface\Proxy as ProductRepository; use Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper\AttributeFilter; use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Authorization as ProductAuthorization; +use Magento\Catalog\Model\Product\Filter\DateTime as DateTimeFilter; use Magento\Catalog\Model\Product\Initialization\Helper\ProductLinks; use Magento\Catalog\Model\Product\Link\Resolver as LinkResolver; use Magento\Catalog\Model\Product\LinkTypeProvider; @@ -24,13 +25,13 @@ use Magento\Framework\Stdlib\DateTime\Filter\Date; use Magento\Store\Model\StoreManagerInterface; use Zend_Filter_Input; -use Magento\Catalog\Model\Product\Authorization as ProductAuthorization; /** * Product helper * * @api * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings(PHPMD.TooManyFields) * @since 100.0.2 */ class Helper @@ -89,11 +90,6 @@ class Helper */ private $linkResolver; - /** - * @var \Magento\Framework\Stdlib\DateTime\Filter\DateTime - */ - private $dateTimeFilter; - /** * @var LinkTypeProvider */ @@ -114,6 +110,11 @@ class Helper */ private $localeFormat; + /** + * @var DateTimeFilter + */ + private $dateTimeFilter; + /** * Constructor * @@ -130,6 +131,7 @@ class Helper * @param AttributeFilter|null $attributeFilter * @param FormatInterface|null $localeFormat * @param ProductAuthorization|null $productAuthorization + * @param DateTimeFilter|null $dateTimeFilter * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -145,7 +147,8 @@ public function __construct( LinkTypeProvider $linkTypeProvider = null, AttributeFilter $attributeFilter = null, FormatInterface $localeFormat = null, - ?ProductAuthorization $productAuthorization = null + ?ProductAuthorization $productAuthorization = null, + ?DateTimeFilter $dateTimeFilter = null ) { $this->request = $request; $this->storeManager = $storeManager; @@ -162,6 +165,7 @@ public function __construct( $this->attributeFilter = $attributeFilter ?: $objectManager->get(AttributeFilter::class); $this->localeFormat = $localeFormat ?: $objectManager->get(FormatInterface::class); $this->productAuthorization = $productAuthorization ?? $objectManager->get(ProductAuthorization::class); + $this->dateTimeFilter = $dateTimeFilter ?? $objectManager->get(DateTimeFilter::class); } /** @@ -185,7 +189,6 @@ public function initializeFromData(Product $product, array $productData) } $productData = $this->normalize($productData); - $productData = $this->convertSpecialFromDateStringToObject($productData); if (!empty($productData['is_downloadable'])) { $productData['product_has_weight'] = 0; @@ -209,7 +212,7 @@ public function initializeFromData(Product $product, array $productData) foreach ($attributes as $attrKey => $attribute) { if ($attribute->getBackend()->getType() == 'datetime') { if (array_key_exists($attrKey, $productData) && $productData[$attrKey] != '') { - $dateFieldFilters[$attrKey] = $this->getDateTimeFilter(); + $dateFieldFilters[$attrKey] = $this->dateTimeFilter; } } } @@ -408,22 +411,6 @@ private function getLinkResolver() return $this->linkResolver; } - /** - * Get DateTimeFilter instance - * - * @return \Magento\Framework\Stdlib\DateTime\Filter\DateTime - * @deprecated 101.0.0 - */ - private function getDateTimeFilter() - { - if ($this->dateTimeFilter === null) { - $this->dateTimeFilter = ObjectManager::getInstance() - ->get(\Magento\Framework\Stdlib\DateTime\Filter\DateTime::class); - } - - return $this->dateTimeFilter; - } - /** * Remove ids of non selected websites from $websiteIds array and return filtered data * @@ -497,20 +484,4 @@ function ($valueData) { return $product->setOptions($customOptions); } - - /** - * Convert string date presentation into object - * - * @param array $productData - * @return array - */ - private function convertSpecialFromDateStringToObject($productData) - { - if (isset($productData['special_from_date']) && $productData['special_from_date'] != '') { - $productData['special_from_date'] = $this->getDateTimeFilter()->filter($productData['special_from_date']); - $productData['special_from_date'] = new DateTime($productData['special_from_date']); - } - - return $productData; - } } diff --git a/app/code/Magento/Catalog/Model/Product/Filter/DateTime.php b/app/code/Magento/Catalog/Model/Product/Filter/DateTime.php new file mode 100644 index 0000000000000..93b7d55458a9f --- /dev/null +++ b/app/code/Magento/Catalog/Model/Product/Filter/DateTime.php @@ -0,0 +1,67 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\Product\Filter; + +use Magento\Framework\Stdlib\DateTime as StdlibDateTime; +use Magento\Framework\Stdlib\DateTime\Filter\DateTime as StdlibDateTimeFilter; + +/** + * Product datetime fields values filter + */ +class DateTime implements \Zend_Filter_Interface +{ + /** + * @var StdlibDateTimeFilter + */ + private $stdlibDateTimeFilter; + + /** + * Initializes dependencies. + * + * @param StdlibDateTimeFilter $stdlibDateTimeFilter + */ + public function __construct(StdlibDateTimeFilter $stdlibDateTimeFilter) + { + $this->stdlibDateTimeFilter = $stdlibDateTimeFilter; + } + + /** + * Convert datetime from locale format to internal format; + * + * Make an additional check for MySql date format which is wrongly parsed by IntlDateFormatter + * + * @param mixed $value + * @return mixed|string + * @throws \Exception + */ + public function filter($value) + { + if (is_string($value)) { + $value = $this->createDateFromMySqlFormat($value) ?? $value; + } + return $this->stdlibDateTimeFilter->filter($value); + } + + /** + * Parse a string in MySql date format into a new DateTime object + * + * @param string $value + * @return \DateTime|null + */ + private function createDateFromMySqlFormat(string $value): ?\DateTime + { + $datetime = date_create_from_format(StdlibDateTime::DATETIME_PHP_FORMAT, $value); + if ($datetime === false) { + $datetime = date_create_from_format(StdlibDateTime::DATE_PHP_FORMAT, $value); + if ($datetime !== false) { + $datetime->setTime(0, 0, 0, 0); + } + } + return $datetime instanceof \DateTime ? $datetime : null; + } +} diff --git a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/HelperTest.php b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/HelperTest.php index 134c6f9edeaf7..2aea34244437d 100644 --- a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/HelperTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/HelperTest.php @@ -165,6 +165,8 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); + $this->dateTimeFilterMock = $this->createMock(\Magento\Catalog\Model\Product\Filter\DateTime::class); + $this->helper = $this->objectManager->getObject( Helper::class, [ @@ -178,6 +180,7 @@ protected function setUp() 'linkTypeProvider' => $this->linkTypeProviderMock, 'attributeFilter' => $this->attributeFilterMock, 'localeFormat' => $this->localeFormatMock, + 'dateTimeFilter' => $this->dateTimeFilterMock ] ); @@ -188,11 +191,6 @@ protected function setUp() $resolverProperty = $helperReflection->getProperty('linkResolver'); $resolverProperty->setAccessible(true); $resolverProperty->setValue($this->helper, $this->linkResolverMock); - - $this->dateTimeFilterMock = $this->createMock(\Magento\Framework\Stdlib\DateTime\Filter\DateTime::class); - $dateTimeFilterProperty = $helperReflection->getProperty('dateTimeFilter'); - $dateTimeFilterProperty->setAccessible(true); - $dateTimeFilterProperty->setValue($this->helper, $this->dateTimeFilterMock); } /** @@ -226,6 +224,7 @@ public function testInitialize( ]; $specialFromDate = '2018-03-03 19:30:00'; $productData = [ + 'name' => 'Simple Product', 'stock_data' => ['stock_data'], 'options' => $optionsData, 'website_ids' => $websiteIds, @@ -235,30 +234,23 @@ public function testInitialize( $productData = array_merge($productData, ['tier_price' => $tierPrice]); } - $this->dateTimeFilterMock->expects($this->once()) + $this->dateTimeFilterMock + ->expects($this->once()) ->method('filter') - ->with($specialFromDate) - ->willReturn($specialFromDate); - - $attributeNonDate = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class) - ->disableOriginalConstructor() - ->getMock(); - $attributeDate = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class) - ->disableOriginalConstructor() - ->getMock(); - - $attributeNonDateBackEnd = - $this->getMockBuilder(\Magento\Eav\Model\Entity\Attribute\Backend\DefaultBackend::class) - ->disableOriginalConstructor() - ->getMock(); - $attributeDateBackEnd = $this->getMockBuilder(\Magento\Eav\Model\Entity\Attribute\Backend\Datetime::class) - ->disableOriginalConstructor() - ->getMock(); + ->willReturnArgument(0); - $attributeNonDate->expects($this->any())->method('getBackend')->willReturn($attributeNonDateBackEnd); - $attributeDate->expects($this->any())->method('getBackend')->willReturn($attributeDateBackEnd); - $attributeNonDateBackEnd->expects($this->any())->method('getType')->willReturn('non-datetime'); - $attributeDateBackEnd->expects($this->any())->method('getType')->willReturn('datetime'); + $this->setProductAttributes( + [ + [ + 'code' => 'name', + 'backend_type' => 'varchar', + ], + [ + 'code' => 'special_from_date', + 'backend_type' => 'datetime', + ] + ] + ); $useDefaults = ['attributeCode1', 'attributeCode2']; @@ -274,8 +266,6 @@ public function testInitialize( $this->productMock->expects($this->once())->method('isLockedAttribute')->with('media')->willReturn(true); $this->productMock->expects($this->once())->method('unlockAttribute')->with('media'); $this->productMock->expects($this->once())->method('lockAttribute')->with('media'); - $this->productMock->expects($this->once())->method('getAttributes') - ->willReturn([$attributeNonDate, $attributeDate]); $this->productMock->expects($this->any())->method('getSku')->willReturn('sku'); $this->productMock->expects($this->any())->method('getOptionsReadOnly')->willReturn(false); @@ -348,7 +338,35 @@ function () { } $this->assertEquals($expectedLinks, $resultLinks); - $this->assertEquals($specialFromDate, $productData['special_from_date']); + $this->assertEquals($specialFromDate, $this->productMock->getSpecialFromDate()); + } + + /** + * Mock product attributes + * + * @param array $attributes + */ + private function setProductAttributes(array $attributes): void + { + $attributesModels = []; + foreach ($attributes as $attribute) { + $attributeModel = $this->createMock(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class); + $backendModel = $attribute['backend_model'] + ?? $this->createMock(\Magento\Eav\Model\Entity\Attribute\Backend\DefaultBackend::class); + $attributeModel->expects($this->any()) + ->method('getBackend') + ->willReturn($backendModel); + $attributeModel->expects($this->any()) + ->method('getAttributeCode') + ->willReturn($attribute['code']); + $backendModel->expects($this->any()) + ->method('getType') + ->willReturn($attribute['backend_type']); + $attributesModels[$attribute['code']] = $attributeModel; + } + $this->productMock->expects($this->once()) + ->method('getAttributes') + ->willReturn($attributesModels); } /** diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Filter/DateTimeTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Filter/DateTimeTest.php new file mode 100644 index 0000000000000..aefa0b1cf106d --- /dev/null +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Filter/DateTimeTest.php @@ -0,0 +1,91 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Test\Unit\Model\Product\Filter; + +use Magento\Framework\Locale\Resolver; +use Magento\Framework\Locale\ResolverInterface; +use Magento\Framework\Stdlib\DateTime\Timezone; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\TestCase; + +/** + * Test datetime filter + */ +class DateTimeTest extends TestCase +{ + /** + * @var string + */ + private $locale; + /** + * @var \Magento\Catalog\Model\Product\Filter\DateTime + */ + private $model; + + /** + * @inheritDoc + */ + protected function setUp() + { + parent::setUp(); + $objectManager = new ObjectManager($this); + $this->locale = Resolver::DEFAULT_LOCALE; + $localeResolver = $this->getMockForAbstractClass(ResolverInterface::class); + $localeResolver->expects($this->any()) + ->method('getLocale') + ->willReturnCallback( + function () { + return $this->locale; + } + ); + $timezone = $objectManager->getObject( + Timezone::class, + ['localeResolver' => $localeResolver] + ); + $stdlibDateTimeFilter = $objectManager->getObject( + \Magento\Framework\Stdlib\DateTime\Filter\DateTime::class, + ['localeDate' => $timezone] + ); + $this->model = $objectManager->getObject( + \Magento\Catalog\Model\Product\Filter\DateTime::class, + [ + 'stdlibDateTimeFilter' => $stdlibDateTimeFilter + ] + ); + } + + /** + * Test filter with different dates formats and locales + * + * @dataProvider provideFilter + */ + public function testFilter(string $date, string $expectedDate, string $locale = Resolver::DEFAULT_LOCALE) + { + $this->locale = $locale; + $this->assertEquals($expectedDate, $this->model->filter($date)); + } + + /** + * Provide date formats and locales + * + * @return array + */ + public function provideFilter(): array + { + return [ + ['1999-12-31', '1999-12-31 00:00:00', 'en_US'], + ['12-31-1999', '1999-12-31 00:00:00', 'en_US'], + ['12/31/1999', '1999-12-31 00:00:00', 'en_US'], + ['December 31, 1999', '1999-12-31 00:00:00', 'en_US'], + ['1999-12-31', '1999-12-31 00:00:00', 'fr_FR'], + ['31-12-1999', '1999-12-31 00:00:00', 'fr_FR'], + ['31/12/1999', '1999-12-31 00:00:00', 'fr_FR'], + ['31 Décembre 1999', '1999-12-31 00:00:00', 'fr_FR'], + ]; + } +} From 97d2358bb6b2f9f85dcd1656aca7510d1455ecd0 Mon Sep 17 00:00:00 2001 From: Tom Reece <treece@adobe.com> Date: Thu, 12 Dec 2019 09:22:57 -0600 Subject: [PATCH 518/595] MQE-1857: [MTF-To-MFTF] Process PR 746 - Remove unnecessary hardcoded ID reference --- .../AdminFilteringCategoryProductsUsingScopeSelectorTest.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml index 41b446b474078..501a5bd2282be 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml @@ -131,7 +131,6 @@ userInput="$$createProduct1.name$$" stepKey="seeProductName4"/> <see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct12.name$$)}}" userInput="$$createProduct12.name$$" stepKey="seeProductName5"/> - <waitForText userInput="$$createCategory.name$$ (ID: 6) (2)" stepKey="seeCorrectProductCount"/> <dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct0.name$$)}}" userInput="$$createProduct0.name$$" stepKey="dontSeeProductName"/> <dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct2.name$$)}}" @@ -151,7 +150,6 @@ userInput="$$createProduct2.name$$" stepKey="seeProductName6"/> <see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct12.name$$)}}" userInput="$$createProduct12.name$$" stepKey="seeProductName7"/> - <waitForText userInput="$$createCategory.name$$ (ID: 6) (2)" stepKey="seeCorrectProductCount2"/> <dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct0.name$$)}}" userInput="$$createProduct0.name$$" stepKey="dontSeeProductName2"/> <dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct2.name$$)}}" From efa362f0b2d4abf6d2f17f64e5e55f6e45288821 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Thu, 12 Dec 2019 23:06:28 +0700 Subject: [PATCH 519/595] [DownloadableImportExport] Cover Helper Data by Unit Test --- .../Test/Unit/Helper/DataTest.php | 278 ++++++++++++++++++ 1 file changed, 278 insertions(+) create mode 100644 app/code/Magento/DownloadableImportExport/Test/Unit/Helper/DataTest.php diff --git a/app/code/Magento/DownloadableImportExport/Test/Unit/Helper/DataTest.php b/app/code/Magento/DownloadableImportExport/Test/Unit/Helper/DataTest.php new file mode 100644 index 0000000000000..56dc11733cec4 --- /dev/null +++ b/app/code/Magento/DownloadableImportExport/Test/Unit/Helper/DataTest.php @@ -0,0 +1,278 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\DownloadableImportExport\Test\Unit\Helper; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\DownloadableImportExport\Helper\Data as HelperData; +use PHPUnit\Framework\TestCase; + +class DataTest extends TestCase +{ + /** + * @var HelperData + */ + private $helper; + + /** + * Setup environment for test + */ + protected function setUp() + { + $objectManagerHelper = new ObjectManagerHelper($this); + $this->helper = $objectManagerHelper->getObject(HelperData::class); + } + + /** + * Test isRowDownloadableEmptyOptions with dataProvider + * + * @param array $rowData + * @param bool $expected + * @dataProvider isRowDownloadableEmptyOptionsDataProvider + */ + public function testIsRowDownloadableEmptyOptions($rowData, $expected) + { + $this->assertEquals($expected, $this->helper->isRowDownloadableEmptyOptions($rowData)); + } + + /** + * Data Provider to test isRowDownloadableEmptyOptions + * + * @return array + */ + public function isRowDownloadableEmptyOptionsDataProvider() + { + return [ + 'Data set include downloadable link and sample' => [ + [ + 'downloadable_links' => 'https://magento2.com/download_link', + 'downloadable_samples' => 'https://magento2.com/sample_link' + ], + false + ], + 'Data set with empty' => [ + [ + 'downloadable_links' => '', + 'downloadable_samples' => '' + ], + true + ] + ]; + } + + /** + * Test isRowDownloadableNoValid with dataProvider + * + * @param array $rowData + * @param bool $expected + * @dataProvider isRowDownloadableNoValidDataProvider + */ + public function isRowDownloadableNoValid($rowData, $expected) + { + $this->assertEquals($expected, $this->helper->isRowDownloadableNoValid($rowData)); + } + + /** + * Data Provider to test isRowDownloadableEmptyOptions + * + * @return array + */ + public function isRowDownloadableNoValidDataProvider() + { + return [ + 'Data set include downloadable link and sample' => [ + [ + 'downloadable_links' => 'https://magento2.com/download_link', + 'downloadable_samples' => 'https://magento2.com/sample_link' + ], + true + ], + 'Data set with empty' => [ + [ + 'downloadable_links' => '', + 'downloadable_samples' => '' + ], + false + ] + ]; + } + + /** + * Test fillExistOptions with dataProvider + * + * @param array $base + * @param array $option + * @param array $existingOptions + * @param array $expected + * @dataProvider fillExistOptionsDataProvider + */ + public function testFillExistOptions($base, $option, $existingOptions, $expected) + { + $this->assertEquals($expected, $this->helper->fillExistOptions($base, $option, $existingOptions)); + } + + /** + * Data Provider to test fillExistOptions + * + * @return array + */ + public function fillExistOptionsDataProvider() + { + return [ + 'Data set 1' => [ + [], + [ + 'product_id' => 1, + 'sample_type' => 'sample_type1', + 'sample_url' => 'sample_url1', + 'sample_file' => 'sample_file1', + 'link_file' => 'link_file1', + 'link_type' => 'link_type1', + 'link_url' => 'link_url1' + ], + [ + [ + 'product_id' => 1, + 'sample_type' => 'sample_type1', + 'sample_url' => 'sample_url1', + 'sample_file' => 'sample_file1', + 'link_file' => 'link_file1', + 'link_type' => 'link_type1', + 'link_url' => 'link_url1' + ], + [ + 'product_id' => 2, + 'sample_type' => 'sample_type2', + 'sample_url' => 'sample_url2', + 'sample_file' => 'sample_file2', + 'link_file' => 'link_file2', + 'link_type' => 'link_type2', + 'link_url' => 'link_url2' + ] + ], + [ + 'product_id' => 1, + 'sample_type' => 'sample_type1', + 'sample_url' => 'sample_url1', + 'sample_file' => 'sample_file1', + 'link_file' => 'link_file1', + 'link_type' => 'link_type1', + 'link_url' => 'link_url1' + ] + ], + 'Data set 2' => [ + [], + [ + 'product_id' => 1, + 'sample_type' => 'sample_type1', + 'sample_url' => 'sample_url1', + 'sample_file' => 'sample_file1', + 'link_file' => 'link_file1', + 'link_type' => 'link_type1', + 'link_url' => 'link_url1' + ], + [], + [] + ] + ]; + } + + /** + * Test prepareDataForSave with dataProvider + * + * @param array $base + * @param array $replacement + * @param array $expected + * @dataProvider prepareDataForSaveDataProvider + */ + public function testPrepareDataForSave($base, $replacement, $expected) + { + $this->assertEquals($expected, $this->helper->prepareDataForSave($base, $replacement)); + } + + /** + * Data Provider to test prepareDataForSave + * + * @return array + */ + public function prepareDataForSaveDataProvider() + { + return [ + 'Data set 1' => [ + [], + [], + [] + ], + + 'Data set 2' => [ + [ + 'product_id' => 1, + 'sample_type' => 'sample_type1', + 'sample_url' => 'sample_url1', + 'sample_file' => 'sample_file1', + 'link_file' => 'link_file1', + 'link_type' => 'link_type1', + 'link_url' => 'link_url1' + ], + [ + [ + 'product_id' => 2, + 'sample_type' => 'sample_type2', + 'sample_url' => 'sample_url2', + 'sample_file' => 'sample_file2', + 'link_file' => 'link_file2', + 'link_type' => 'link_type2', + 'link_url' => 'link_url2' + ] + ], + [ + [ + 'product_id' => 2, + 'sample_type' => 'sample_type2', + 'sample_url' => 'sample_url2', + 'sample_file' => 'sample_file2', + 'link_file' => 'link_file2', + 'link_type' => 'link_type2', + 'link_url' => 'link_url2' + ] + ] + ] + ]; + } + + /** + * Test getTypeByValue with dataProvider + * + * @param string $option + * @param string $expected + * @dataProvider getTypeByValueDataProvider + */ + public function testGetTypeByValue($option, $expected) + { + $this->assertEquals($expected, $this->helper->getTypeByValue($option)); + } + + /** + * Data Provider for getTypeByValue + * + * @return array + */ + public function getTypeByValueDataProvider() + { + return [ + 'Case File Option Value' => [ + 'file1', + 'file' + ], + 'Case url Option Value' => [ + 'https://example.com', + 'url' + ] + ]; + } +} From 32d40dec5cbb5817e6a04daf999a9e024aacd2cf Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Thu, 12 Dec 2019 23:09:32 +0700 Subject: [PATCH 520/595] [DownloadableImportExport] Cover Helper Data by Unit Test --- .../Test/Unit/Helper/DataTest.php | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/DownloadableImportExport/Test/Unit/Helper/DataTest.php b/app/code/Magento/DownloadableImportExport/Test/Unit/Helper/DataTest.php index 56dc11733cec4..ce42514e52263 100644 --- a/app/code/Magento/DownloadableImportExport/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/DownloadableImportExport/Test/Unit/Helper/DataTest.php @@ -10,6 +10,7 @@ use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; use Magento\DownloadableImportExport\Helper\Data as HelperData; +use Magento\DownloadableImportExport\Model\Import\Product\Type\Downloadable; use PHPUnit\Framework\TestCase; class DataTest extends TestCase @@ -50,15 +51,15 @@ public function isRowDownloadableEmptyOptionsDataProvider() return [ 'Data set include downloadable link and sample' => [ [ - 'downloadable_links' => 'https://magento2.com/download_link', - 'downloadable_samples' => 'https://magento2.com/sample_link' + Downloadable::COL_DOWNLOADABLE_LINKS => 'https://magento2.com/download_link', + Downloadable::COL_DOWNLOADABLE_SAMPLES => 'https://magento2.com/sample_link' ], false ], 'Data set with empty' => [ [ - 'downloadable_links' => '', - 'downloadable_samples' => '' + Downloadable::COL_DOWNLOADABLE_LINKS => '', + Downloadable::COL_DOWNLOADABLE_SAMPLES => '' ], true ] @@ -87,15 +88,15 @@ public function isRowDownloadableNoValidDataProvider() return [ 'Data set include downloadable link and sample' => [ [ - 'downloadable_links' => 'https://magento2.com/download_link', - 'downloadable_samples' => 'https://magento2.com/sample_link' + Downloadable::COL_DOWNLOADABLE_LINKS => 'https://magento2.com/download_link', + Downloadable::COL_DOWNLOADABLE_SAMPLES => 'https://magento2.com/sample_link' ], true ], 'Data set with empty' => [ [ - 'downloadable_links' => '', - 'downloadable_samples' => '' + Downloadable::COL_DOWNLOADABLE_LINKS => '', + Downloadable::COL_DOWNLOADABLE_SAMPLES => '' ], false ] @@ -267,11 +268,11 @@ public function getTypeByValueDataProvider() return [ 'Case File Option Value' => [ 'file1', - 'file' + Downloadable::FILE_OPTION_VALUE ], 'Case url Option Value' => [ 'https://example.com', - 'url' + Downloadable::URL_OPTION_VALUE ] ]; } From bdf2c46b07930f1bb04649aafdd0d2c962ba9e7e Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Thu, 12 Dec 2019 10:32:35 -0600 Subject: [PATCH 521/595] Change action groups name according to CE branch changes --- ...uctAttributeAdvancedSectionActionGroup.xml | 20 ++++++++++++++ ...tAttributeWithDatetimeFieldActionGroup.xml | 26 +++++++++++++++++++ ...uctAttributeByAttributeCodeActionGroup.xml | 1 + ...teToCreatedProductAttributeActionGroup.xml | 1 + ...dminCreateDatetimeProductAttributeTest.xml | 8 +++--- ...SimpleProductWithDatetimeAttributeTest.xml | 2 +- 6 files changed, 53 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminNavigateToProductAttributeAdvancedSectionActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminNavigateToProductAttributeAdvancedSectionActionGroup.xml index e69de29bb2d1d..27aa0474c362d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminNavigateToProductAttributeAdvancedSectionActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminNavigateToProductAttributeAdvancedSectionActionGroup.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="AdminNavigateToProductAttributeAdvancedSectionActionGroup"> + <annotations> + <description>Navigate and open Advanced Attribute Properties section on product attribute page</description> + </annotations> + + <scrollTo selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="scrollToSection"/> + <conditionalClick selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" dependentSelector="{{AdvancedAttributePropertiesSection.AttributeCode}}" visible="false" stepKey="openSection"/> + <waitForElementVisible selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" stepKey="waitForSlideOutSection"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDatetimeFieldActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDatetimeFieldActionGroup.xml index e69de29bb2d1d..545f36966feaa 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDatetimeFieldActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDatetimeFieldActionGroup.xml @@ -0,0 +1,26 @@ +<?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="CreateProductAttributeWithDatetimeFieldActionGroup" extends="createProductAttribute" insertAfter="checkRequired"> + <annotations> + <description>EXTENDS: createProductAttribute. Fills in the Attribute Code and Default Value (Attribute Type: Date and Time Field).</description> + </annotations> + <arguments> + <argument name="date" type="string"/> + </arguments> + + <scrollTo selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" stepKey="scrollToAdvancedSection"/> + <conditionalClick selector="{{AdvancedAttributePropertiesSection.AdvancedAttributePropertiesSectionToggle}}" dependentSelector="{{AdvancedAttributePropertiesSection.AttributeCode}}" visible="false" stepKey="openAdvancedSection"/> + <waitForElementVisible selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" stepKey="waitForSlideOutAdvancedSection"/> + <fillField selector="{{AdvancedAttributePropertiesSection.AttributeCode}}" userInput="{{attribute.attribute_code}}" stepKey="fillCode"/> + <scrollTo selector="{{AdvancedAttributePropertiesSection.defaultValueDatetime}}" stepKey="scrollToDefaultField"/> + <fillField selector="{{AdvancedAttributePropertiesSection.defaultValueDatetime}}" userInput="{{date}}" stepKey="fillDefaultValue"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml index c40a0f6d31dc0..7fbf6a9b2a178 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml @@ -25,5 +25,6 @@ <click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="deleteAttribute"/> <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOnDeleteButton"/> <waitForPageLoad stepKey="waitForPageLoad"/> + <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductAttributeActionGroup.xml index 850939501eb81..57ce7de7f3c0b 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductAttributeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/NavigateToCreatedProductAttributeActionGroup.xml @@ -17,6 +17,7 @@ </arguments> <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttribute.attribute_code}}" stepKey="setAttributeCode"/> <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> <click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml index e46114ff752f6..5da824d2ccdb9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDatetimeProductAttributeTest.xml @@ -20,7 +20,7 @@ <actionGroup ref="LoginAsAdmin" stepKey="login"/> </before> <after> - <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteAttribute"> <argument name="ProductAttribute" value="DatetimeProductAttribute"/> </actionGroup> <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="resetGridFilter"/> @@ -31,16 +31,16 @@ <!-- Create new datetime product attribute --> <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="goToProductAttributes"/> <waitForPageLoad stepKey="waitForPageLoadAttributes"/> - <actionGroup ref="CreateProductAttributeWithDatetimeField" stepKey="createAttribute"> + <actionGroup ref="CreateProductAttributeWithDatetimeFieldActionGroup" stepKey="createAttribute"> <argument name="attribute" value="DatetimeProductAttribute"/> <argument name="date" value="{$generateDefaultValue}"/> </actionGroup> <!-- Navigate to created product attribute --> - <actionGroup ref="navigateToCreatedProductAttribute" stepKey="navigateToAttribute"> + <actionGroup ref="NavigateToCreatedProductAttributeActionGroup" stepKey="navigateToAttribute"> <argument name="ProductAttribute" value="DatetimeProductAttribute"/> </actionGroup> <!-- Check the saved datetime default value --> - <actionGroup ref="AdminNavigateToProductAttributeAdvancedSection" stepKey="goToAdvancedSection"/> + <actionGroup ref="AdminNavigateToProductAttributeAdvancedSectionActionGroup" stepKey="goToAdvancedSection"/> <scrollTo selector="{{AdvancedAttributePropertiesSection.defaultValueDatetime}}" stepKey="scrollToDefaultValue"/> <seeInField userInput="{$generateDefaultValue}" selector="{{AdvancedAttributePropertiesSection.defaultValueDatetime}}" diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml index 6772e95b6ec27..41ad840930bc2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml @@ -42,7 +42,7 @@ <actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="openNewProductPage"/> <actionGroup ref="fillMainProductForm" stepKey="fillDefaultProductFields"/> <!-- Add datetime attribute --> - <actionGroup ref="addProductAttributeInProductModal" stepKey="addDatetimeAttribute"> + <actionGroup ref="AddProductAttributeInProductModalActionGroup" stepKey="addDatetimeAttribute"> <argument name="attributeCode" value="$createDatetimeAttribute.attribute_code$"/> </actionGroup> <!-- Flush config cache to reset product attributes in attribute set --> From 840afc3584858dd14dfc81f3e50d3d194185698f Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Thu, 12 Dec 2019 10:50:22 -0600 Subject: [PATCH 522/595] Change action groups name according to CE branch changes --- .../CreateProductAttributeWithDatetimeFieldActionGroup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDatetimeFieldActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDatetimeFieldActionGroup.xml index 545f36966feaa..a4f0d22f6edb5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDatetimeFieldActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateProductAttributeWithDatetimeFieldActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="CreateProductAttributeWithDatetimeFieldActionGroup" extends="createProductAttribute" insertAfter="checkRequired"> + <actionGroup name="CreateProductAttributeWithDatetimeFieldActionGroup" extends="CreateProductAttributeActionGroup" insertAfter="checkRequired"> <annotations> <description>EXTENDS: createProductAttribute. Fills in the Attribute Code and Default Value (Attribute Type: Date and Time Field).</description> </annotations> From 28a41d9adb780ec751eed888563df58e0483e267 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Thu, 12 Dec 2019 11:44:57 -0600 Subject: [PATCH 523/595] Change action groups name according to CE branch changes --- .../AdminCreateSimpleProductWithDatetimeAttributeTest.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml index 41ad840930bc2..0f88fa9d6abf4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml @@ -23,10 +23,10 @@ </before> <after> <deleteData createDataKey="createDatetimeAttribute" stepKey="deleteDatetimeAttribute"/> - <actionGroup ref="deleteProductBySku" stepKey="deleteCreatedProduct"> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteCreatedProduct"> <argument name="sku" value="{{_defaultProduct.sku}}"/> </actionGroup> - <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFiltersOnProductIndexPage"/> + <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFiltersOnProductIndexPage"/> <actionGroup ref="logout" stepKey="logout"/> </after> @@ -40,7 +40,7 @@ </createData> <!-- Open the new simple product page --> <actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="openNewProductPage"/> - <actionGroup ref="fillMainProductForm" stepKey="fillDefaultProductFields"/> + <actionGroup ref="FillMainProductFormActionGroup" stepKey="fillDefaultProductFields"/> <!-- Add datetime attribute --> <actionGroup ref="AddProductAttributeInProductModalActionGroup" stepKey="addDatetimeAttribute"> <argument name="attributeCode" value="$createDatetimeAttribute.attribute_code$"/> @@ -48,7 +48,7 @@ <!-- Flush config cache to reset product attributes in attribute set --> <magentoCLI command="cache:flush" arguments="config" stepKey="flushConfigCache"/> <!-- Save the product --> - <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> <!-- Check default value --> <scrollTo selector="{{AdminProductAttributesSection.sectionHeader}}" stepKey="goToAttributesSection"/> <click selector="{{AdminProductAttributesSection.sectionHeader}}" stepKey="openAttributesSection"/> From 46b676bb4ea3f19aed99566085e10db185ebb9c0 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Thu, 12 Dec 2019 13:26:52 -0600 Subject: [PATCH 524/595] Change action groups name according to CE branch changes --- .../Test/StorefrontFreeShippingDisplayWithInclTaxOptionTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/OfflineShipping/Test/Mftf/Test/StorefrontFreeShippingDisplayWithInclTaxOptionTest.xml b/app/code/Magento/OfflineShipping/Test/Mftf/Test/StorefrontFreeShippingDisplayWithInclTaxOptionTest.xml index db44a06b54a88..d2e092283e9bd 100644 --- a/app/code/Magento/OfflineShipping/Test/Mftf/Test/StorefrontFreeShippingDisplayWithInclTaxOptionTest.xml +++ b/app/code/Magento/OfflineShipping/Test/Mftf/Test/StorefrontFreeShippingDisplayWithInclTaxOptionTest.xml @@ -41,7 +41,7 @@ <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> </after> <!-- Add simple product to cart --> - <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="$$createSimpleProduct$$"/> </actionGroup> <!-- Assert that taxes are applied correctly for CA --> From b7640b056a7b9baa16984643f13ea0d001fd7b68 Mon Sep 17 00:00:00 2001 From: Dan Wallis <mrdanwallis@gmail.com> Date: Thu, 12 Dec 2019 23:01:33 +0000 Subject: [PATCH 525/595] Position arrow by item, not centrally in menu --- .../Magento/backend/web/css/source/_actions.less | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/_actions.less b/app/design/adminhtml/Magento/backend/web/css/source/_actions.less index c86e9cdbf0866..852c6c1f3799e 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/_actions.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/_actions.less @@ -451,11 +451,9 @@ button { border-width: .4rem 0 .4rem .5rem; content: ''; height: 0; - margin-top: -.2rem; - position: absolute; - right: 1rem; - top: 50%; - transition: all .2s linear; + position: relative; + right: 1.2rem; + top: 1.4rem; width: 0; } } From ab6cabd682ae18a48aaf1429232047d90e4e881c Mon Sep 17 00:00:00 2001 From: Lukasz Lewandowski <llewandowski@gpmd.co.uk> Date: Fri, 13 Dec 2019 08:44:14 -0600 Subject: [PATCH 526/595] Add tests for cached getVersion and update class description --- .../Magento/Framework/App/ProductMetadata.php | 4 +--- .../App/Test/Unit/ProductMetadataTest.php | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/App/ProductMetadata.php b/lib/internal/Magento/Framework/App/ProductMetadata.php index 8f989351743d2..55e98bb085d41 100644 --- a/lib/internal/Magento/Framework/App/ProductMetadata.php +++ b/lib/internal/Magento/Framework/App/ProductMetadata.php @@ -13,9 +13,7 @@ use Magento\Framework\Composer\ComposerInformation; /** - * Class ProductMetadata - * - * @package Magento\Framework\App + * Magento application product metadata */ class ProductMetadata implements ProductMetadataInterface { diff --git a/lib/internal/Magento/Framework/App/Test/Unit/ProductMetadataTest.php b/lib/internal/Magento/Framework/App/Test/Unit/ProductMetadataTest.php index 8e1acc89437e2..bc1abb169b4f8 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/ProductMetadataTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/ProductMetadataTest.php @@ -5,6 +5,7 @@ */ namespace Magento\Framework\App\Test\Unit; +use Magento\Framework\App\CacheInterface; use Magento\Framework\App\ProductMetadata; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; @@ -20,16 +21,27 @@ class ProductMetadataTest extends \PHPUnit\Framework\TestCase */ private $composerInformationMock; + /** + * @var CacheInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $cacheMock; + protected function setUp() { $this->composerInformationMock = $this->getMockBuilder(\Magento\Framework\Composer\ComposerInformation::class) ->disableOriginalConstructor()->getMock(); + $this->cacheMock = $this->getMockBuilder(CacheInterface::class)->getMock(); + $objectManager = new ObjectManager($this); $this->productMetadata = $objectManager->getObject(ProductMetadata::class); $reflectionProperty = new \ReflectionProperty($this->productMetadata, 'composerInformation'); $reflectionProperty->setAccessible(true); $reflectionProperty->setValue($this->productMetadata, $this->composerInformationMock); + + $reflectionProperty = new \ReflectionProperty($this->productMetadata, 'cache'); + $reflectionProperty->setAccessible(true); + $reflectionProperty->setValue($this->productMetadata, $this->cacheMock); } /** @@ -40,11 +52,21 @@ protected function setUp() public function testGetVersion($packageList, $expectedVersion) { $this->composerInformationMock->expects($this->any())->method('getSystemPackages')->willReturn($packageList); + $this->cacheMock->expects($this->once())->method('save')->with($expectedVersion); $productVersion = $this->productMetadata->getVersion(); $this->assertNotEmpty($productVersion, 'Empty product version'); $this->assertEquals($expectedVersion, $productVersion); } + public function testGetVersionCached() + { + $expectedVersion = '1.2.3'; + $this->composerInformationMock->expects($this->never())->method('getSystemPackages'); + $this->cacheMock->expects($this->once())->method('load')->willReturn($expectedVersion); + $productVersion = $this->productMetadata->getVersion(); + $this->assertEquals($expectedVersion, $productVersion); + } + /** * @return array */ From 16d0cfc692b497e397df08ebe0ce0487827e46ea Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Fri, 13 Dec 2019 17:14:17 +0200 Subject: [PATCH 527/595] MC-4242: Newsletter subscriptions per website --- app/code/Magento/Newsletter/Model/Subscriber.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Newsletter/Model/Subscriber.php b/app/code/Magento/Newsletter/Model/Subscriber.php index f33b9929435c3..5c573f47aa0bf 100644 --- a/app/code/Magento/Newsletter/Model/Subscriber.php +++ b/app/code/Magento/Newsletter/Model/Subscriber.php @@ -628,7 +628,7 @@ public function loadByCustomerId($customerId) $customer = $this->customerRepository->getById($customerId); $websiteId = (int)$this->_storeManager->getStore()->getWebsiteId(); $this->loadByCustomer((int)$customerId, $websiteId); - if ($customer->getId() && !$this->getCustomerId()) { + if ($this->getId() && $customer->getId() && !$this->getCustomerId()) { $this->setCustomerId($customer->getId()); $this->setSubscriberConfirmCode($this->randomSequence()); $this->save(); From f1f7dadd2100a8d6d676510742a38f3672be6363 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Fri, 13 Dec 2019 17:23:40 +0200 Subject: [PATCH 528/595] MC-4242: Newsletter subscriptions per website --- .../CustomerGraphQl/Model/Resolver/IsSubscribed.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CustomerGraphQl/Model/Resolver/IsSubscribed.php b/app/code/Magento/CustomerGraphQl/Model/Resolver/IsSubscribed.php index 4e49891b5870a..3e69723d4e771 100644 --- a/app/code/Magento/CustomerGraphQl/Model/Resolver/IsSubscribed.php +++ b/app/code/Magento/CustomerGraphQl/Model/Resolver/IsSubscribed.php @@ -7,6 +7,7 @@ namespace Magento\CustomerGraphQl\Model\Resolver; +use Magento\Customer\Api\Data\CustomerInterface; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Framework\GraphQl\Config\Element\Field; @@ -45,10 +46,12 @@ public function resolve( if (!isset($value['model'])) { throw new LocalizedException(__('"model" value should be specified')); } - /** @var Customer $customer */ + /** @var CustomerInterface $customer */ $customer = $value['model']; + $customerId = (int)$customer->getId(); + $websiteId = (int)$customer->getWebsiteId(); + $status = $this->subscriberFactory->create()->loadByCustomer($customerId, $websiteId)->isSubscribed(); - $status = $this->subscriberFactory->create()->loadByCustomerId((int)$customer->getId())->isSubscribed(); return (bool)$status; } } From 0b7c34ef79307da52e088b6d3652663e9cd2c3a1 Mon Sep 17 00:00:00 2001 From: Lukasz Lewandowski <llewandowski@gpmd.co.uk> Date: Fri, 13 Dec 2019 09:26:43 -0600 Subject: [PATCH 529/595] Update tests --- .../Framework/App/Test/Unit/ProductMetadataTest.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/internal/Magento/Framework/App/Test/Unit/ProductMetadataTest.php b/lib/internal/Magento/Framework/App/Test/Unit/ProductMetadataTest.php index bc1abb169b4f8..c504c5f480669 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/ProductMetadataTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/ProductMetadataTest.php @@ -34,14 +34,10 @@ protected function setUp() $this->cacheMock = $this->getMockBuilder(CacheInterface::class)->getMock(); $objectManager = new ObjectManager($this); - $this->productMetadata = $objectManager->getObject(ProductMetadata::class); + $this->productMetadata = $objectManager->getObject(ProductMetadata::class, ['cache' => $this->cacheMock]); $reflectionProperty = new \ReflectionProperty($this->productMetadata, 'composerInformation'); $reflectionProperty->setAccessible(true); $reflectionProperty->setValue($this->productMetadata, $this->composerInformationMock); - - $reflectionProperty = new \ReflectionProperty($this->productMetadata, 'cache'); - $reflectionProperty->setAccessible(true); - $reflectionProperty->setValue($this->productMetadata, $this->cacheMock); } /** @@ -63,6 +59,7 @@ public function testGetVersionCached() $expectedVersion = '1.2.3'; $this->composerInformationMock->expects($this->never())->method('getSystemPackages'); $this->cacheMock->expects($this->once())->method('load')->willReturn($expectedVersion); + $this->cacheMock->expects($this->never())->method('save'); $productVersion = $this->productMetadata->getVersion(); $this->assertEquals($expectedVersion, $productVersion); } From f59c1ca61e034a7973e0ac08ab765cbe4060ed84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Tylek?= <pawel.tylek@creativestyle.pl> Date: Fri, 13 Dec 2019 19:24:10 +0100 Subject: [PATCH 530/595] MAGETWO-95866 Add horizontal scroll if elements extend menu's width --- .../Magento_Backend/web/css/source/module/_menu.less | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less index d0b17b3439d66..4332ac93ffcd2 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less +++ b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less @@ -17,7 +17,7 @@ @menu-logo__padding-bottom: 1.7rem; @menu-logo__outer-size: @menu-logo__padding-top + @menu-logo-img__height + @menu-logo__padding-bottom; -@menu-logo__padding-top: 1.7rem; +@menu-logo__padding-top: 1.7rem; @menu-logo-img__height: 4.1rem; @menu-logo-img__width: 3.5rem; @@ -37,6 +37,7 @@ @submenu__padding-horizontal: 1.5rem; @submenu__padding-vertical: 2rem; @submenu__z-index: @menu__z-index - 2; +@submenu__height: 720px; @submenu-column__width: 23.8rem; @submenu-column__width__l: 19.8rem; @submenu-title__color: @color-white; @@ -252,7 +253,6 @@ background-color: @submenu__background-color; box-shadow: 0 0 3px @color-black; left: 100%; // align all submenus with one Y axis line - min-height: ~'calc(@{menu-logo__outer-size} + 2rem + 100%)'; padding: @submenu__padding-vertical 0 0; position: absolute; top: 0; @@ -266,6 +266,13 @@ .ie11 & { height: 100%; } + + > ul[role="menu"] { + max-width: ~'calc(100vw - @{menu__width})'; + min-height: @submenu__height; + overflow-y: hidden; + overflow-x: auto; + } } &._show { From 7a2bc8fe52e570cfec0201fa36c7118eaf26f6a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Tylek?= <pawel.tylek@creativestyle.pl> Date: Fri, 13 Dec 2019 20:19:48 +0100 Subject: [PATCH 531/595] MAGETWO-95866 Fix tests --- .../Magento_Backend/web/css/source/module/_menu.less | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less index 4332ac93ffcd2..c84a54efd5028 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less +++ b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less @@ -267,11 +267,11 @@ height: 100%; } - > ul[role="menu"] { - max-width: ~'calc(100vw - @{menu__width})'; - min-height: @submenu__height; - overflow-y: hidden; + > ul[role='menu'] { overflow-x: auto; + overflow-y: hidden; + max-width: ~'calc(100vw - @{menu__width})'; + min-height: @submenu__height; } } From 3c0b60a33e1bda64eb694ac278f11d2f750a4eb0 Mon Sep 17 00:00:00 2001 From: Krzysztof Daniel <krzysztof.daniel@creativestyle.pl> Date: Fri, 13 Dec 2019 23:26:51 +0100 Subject: [PATCH 532/595] Fixes phpcs errors and warnings for Magento\Framework\View\Element I was working with those classes and spotted a few warnings and errors that prevent from smooth pull requests. Here are most fixes. --- .../Framework/View/Element/ExceptionHandlerBlockFactory.php | 1 + lib/internal/Magento/Framework/View/Element/FormKey.php | 2 ++ lib/internal/Magento/Framework/View/Element/Js/Components.php | 2 ++ lib/internal/Magento/Framework/View/Element/Js/Cookie.php | 4 ++++ lib/internal/Magento/Framework/View/Element/RendererList.php | 2 ++ lib/internal/Magento/Framework/View/Element/Template.php | 2 ++ .../Magento/Framework/View/Element/Template/File/Resolver.php | 1 + .../Magento/Framework/View/Element/UiComponentInterface.php | 2 ++ 8 files changed, 16 insertions(+) diff --git a/lib/internal/Magento/Framework/View/Element/ExceptionHandlerBlockFactory.php b/lib/internal/Magento/Framework/View/Element/ExceptionHandlerBlockFactory.php index 83f7dda94328f..b1c74777fb102 100644 --- a/lib/internal/Magento/Framework/View/Element/ExceptionHandlerBlockFactory.php +++ b/lib/internal/Magento/Framework/View/Element/ExceptionHandlerBlockFactory.php @@ -7,6 +7,7 @@ /** * Class ExceptionHandlerBlockFactory + * * @package Magento\Framework\View\Element */ class ExceptionHandlerBlockFactory diff --git a/lib/internal/Magento/Framework/View/Element/FormKey.php b/lib/internal/Magento/Framework/View/Element/FormKey.php index 072ba42b34f1d..e6ecd20435ce8 100644 --- a/lib/internal/Magento/Framework/View/Element/FormKey.php +++ b/lib/internal/Magento/Framework/View/Element/FormKey.php @@ -10,6 +10,8 @@ namespace Magento\Framework\View\Element; /** + * Element with FormKey + * * @api */ class FormKey extends \Magento\Framework\View\Element\AbstractBlock diff --git a/lib/internal/Magento/Framework/View/Element/Js/Components.php b/lib/internal/Magento/Framework/View/Element/Js/Components.php index 3f9be417d62be..8e33ca5581960 100644 --- a/lib/internal/Magento/Framework/View/Element/Js/Components.php +++ b/lib/internal/Magento/Framework/View/Element/Js/Components.php @@ -9,6 +9,8 @@ use Magento\Framework\View\Element\Template; /** + * Block for Components + * * @api */ class Components extends Template diff --git a/lib/internal/Magento/Framework/View/Element/Js/Cookie.php b/lib/internal/Magento/Framework/View/Element/Js/Cookie.php index c44bad026ecac..b37a9387c07f6 100644 --- a/lib/internal/Magento/Framework/View/Element/Js/Cookie.php +++ b/lib/internal/Magento/Framework/View/Element/Js/Cookie.php @@ -10,6 +10,8 @@ use Magento\Framework\View\Element\Template\Context; /** + * Block passes configuration for cookies set by JS + * * @api */ class Cookie extends Template @@ -75,6 +77,8 @@ public function getPath() } /** + * Get configured cookie lifetime + * * @return int */ public function getLifetime() diff --git a/lib/internal/Magento/Framework/View/Element/RendererList.php b/lib/internal/Magento/Framework/View/Element/RendererList.php index 30bc38aed28f3..96707c74dd253 100644 --- a/lib/internal/Magento/Framework/View/Element/RendererList.php +++ b/lib/internal/Magento/Framework/View/Element/RendererList.php @@ -6,6 +6,8 @@ namespace Magento\Framework\View\Element; /** + * Renderer List + * * @api */ class RendererList extends AbstractBlock diff --git a/lib/internal/Magento/Framework/View/Element/Template.php b/lib/internal/Magento/Framework/View/Element/Template.php index a1aa599156d2a..99c876b440665 100644 --- a/lib/internal/Magento/Framework/View/Element/Template.php +++ b/lib/internal/Magento/Framework/View/Element/Template.php @@ -10,6 +10,7 @@ /** * Standard Magento block. + * * Should be used when you declare a block in frontend area layout handle. * * Avoid extending this class. @@ -166,6 +167,7 @@ public function setTemplateContext($templateContext) /** * Internal constructor, that is called from real constructor + * * @return void */ protected function _construct() diff --git a/lib/internal/Magento/Framework/View/Element/Template/File/Resolver.php b/lib/internal/Magento/Framework/View/Element/Template/File/Resolver.php index abad0eee856c3..b13caa55d3174 100644 --- a/lib/internal/Magento/Framework/View/Element/Template/File/Resolver.php +++ b/lib/internal/Magento/Framework/View/Element/Template/File/Resolver.php @@ -10,6 +10,7 @@ /** * Class Resolver + * * @package Magento\Framework\View\Element\Template\File */ class Resolver diff --git a/lib/internal/Magento/Framework/View/Element/UiComponentInterface.php b/lib/internal/Magento/Framework/View/Element/UiComponentInterface.php index b5c3546084fcb..3ae2627881101 100644 --- a/lib/internal/Magento/Framework/View/Element/UiComponentInterface.php +++ b/lib/internal/Magento/Framework/View/Element/UiComponentInterface.php @@ -52,6 +52,8 @@ public function render(); public function addComponent($name, UiComponentInterface $component); /** + * Get component + * * @param string $name * @return UiComponentInterface */ From 75532257cf22ede587602be75e70f5c0c8a9d490 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sat, 14 Dec 2019 19:05:16 +0700 Subject: [PATCH 533/595] [Catalog] Cover Component/FilterFactory by Unit Test --- .../Unit/Ui/Component/FilterFactoryTest.php | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php new file mode 100644 index 0000000000000..545b9e7326ff1 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php @@ -0,0 +1,100 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Test\Unit\Ui\Component; + +use PHPUnit\Framework\TestCase; +use Magento\Catalog\Ui\Component\FilterFactory; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Framework\View\Element\UiComponentFactory; +use Magento\Catalog\Api\Data\ProductAttributeInterface; +use Magento\Eav\Model\Entity\Attribute\Source\SourceInterface; +use Magento\Framework\View\Element\UiComponent\ContextInterface; + +class FilterFactoryTest extends TestCase +{ + /** + * @var FilterFactory + */ + private $filterFactory; + + /** + * @var UiComponentFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $componentFactoryMock; + + /** + * Setup environment for test + */ + protected function setUp() + { + $objectManager = new ObjectManagerHelper($this); + + $this->componentFactoryMock = $this->createMock(UiComponentFactory::class); + + $this->filterFactory = $objectManager->getObject( + FilterFactory::class, + [ + 'componentFactory' => $this->componentFactoryMock + ] + ); + } + + /** + * Test create() with use source attribute + */ + public function testCreateWithUseSourceAttribute() + { + $contextMock = $this->createMock(ContextInterface::class); + $attributeMock = $this->getMockBuilder(ProductAttributeInterface::class) + ->setMethods(['usesSource', 'getSource']) + ->getMockForAbstractClass(); + $attributeMock->method('getAttributeCode')->willReturn('color'); + $attributeMock->method('getDefaultFrontendLabel')->willReturn('Color'); + $attributeMock->method('usesSource')->willReturn(true); + $attributeMock->method('getSourceModel')->willReturn('getSourceModel value'); + $attributeMock->method('getFrontendInput')->willReturn('select'); + $sourceMock = $this->createMock(SourceInterface::class); + $attributeMock->method('getSource')->willReturn($sourceMock); + $sourceMock->method('getAllOptions')->willReturn( + [ + [ + 'value' => 1, + 'label' => 'Black', + ], + [ + 'value' => 2, + 'label' => 'White', + ] + ] + ); + $this->componentFactoryMock->expects($this->once()) + ->method('create') + ->with('color', 'filterSelect', [ + 'data' => [ + 'config' => [ + 'options' => [ + [ + 'value' => 1, + 'label' => 'Black', + ], + [ + 'value' => 2, + 'label' => 'White', + ] + ], + 'caption' => (string)__('Select...'), + 'dataScope' => 'color', + 'label' => (string)__('Color'), + ] + ], + 'context' => $contextMock + ]); + + $this->filterFactory->create($attributeMock, $contextMock); + } +} From ad48079535d018ddab62d7f1313d93a4268f859f Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sat, 14 Dec 2019 20:11:23 +0700 Subject: [PATCH 534/595] [Persistent] Cover CustomerData by Unit Test --- .../Test/Unit/CustomerData/PersistentTest.php | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php diff --git a/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php b/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php new file mode 100644 index 0000000000000..381555ed0fe79 --- /dev/null +++ b/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php @@ -0,0 +1,109 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Persistent\Test\Unit\CustomerData; + +use PHPUnit\Framework\TestCase; +use Magento\Persistent\CustomerData\Persistent; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Helper\View; +use Magento\Persistent\Helper\Session; +use Magento\Persistent\Model\Session as PersistentSession; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; + +class PersistentTest extends TestCase +{ + /** + * @var Persistent + */ + private $customerData; + + /** + * @var Session + */ + private $persistentSessionHelperMock; + + /** + * @var View + */ + private $customerViewHelperMock; + + /** + * @var CustomerRepositoryInterface + */ + private $customerRepositoryMock; + + /** + * Setup environment for test + */ + protected function setUp() + { + $this->persistentSessionHelperMock = $this->createMock(Session::class); + $this->customerViewHelperMock = $this->createMock(View::class); + $this->customerRepositoryMock = $this->createMock(CustomerRepositoryInterface::class); + + $objectManager = new ObjectManagerHelper($this); + + $this->customerData = $objectManager->getObject( + Persistent::class, + [ + 'persistentSession' => $this->persistentSessionHelperMock, + 'customerViewHelper' => $this->customerViewHelperMock, + 'customerRepository' => $this->customerRepositoryMock + ] + ); + } + + /** + * Test getSectionData() when disable persistent + */ + public function testGetSectionDataWhenDisablePersistent() + { + $this->persistentSessionHelperMock->method('isPersistent')->willReturn(false); + + $this->assertEquals([], $this->customerData->getSectionData()); + } + + /** + * Test getSectionData() when customer doesn't login + */ + public function testGetSectionDataWithNotLogin() + { + $this->persistentSessionHelperMock->method('isPersistent')->willReturn(true); + + $persistentSessionMock = $this->createPartialMock(PersistentSession::class, ['getCustomerId']); + $persistentSessionMock->method('getCustomerId')->willReturn(null); + $this->persistentSessionHelperMock->method('getSession')->willReturn($persistentSessionMock); + + $this->assertEquals([], $this->customerData->getSectionData()); + } + + /** + * Test getSectionData() when customer login and enable persistent + */ + public function testGetSectionDataCustomerLoginAndEnablePersistent() + { + $this->persistentSessionHelperMock->method('isPersistent')->willReturn(true); + + $persistentSessionMock = $this->createPartialMock(PersistentSession::class, ['getCustomerId']); + $persistentSessionMock->method('getCustomerId')->willReturn(1); + $this->persistentSessionHelperMock->method('getSession')->willReturn($persistentSessionMock); + + $customerMock = $this->createMock(CustomerInterface::class); + $this->customerRepositoryMock->method('getById')->with(1)->willReturn($customerMock); + $this->customerViewHelperMock->method('getCustomerName')->with($customerMock)->willReturn('Adam John'); + + $this->assertEquals( + [ + 'fullname' => 'Adam John' + ], + $this->customerData->getSectionData() + ); + } +} From 1c699b25db84b0690888ee85f145bd336607d672 Mon Sep 17 00:00:00 2001 From: Eden Duong <quocviet312@gmail.com> Date: Sat, 14 Dec 2019 20:25:24 +0700 Subject: [PATCH 535/595] Update phpdocs --- .../Persistent/Test/Unit/CustomerData/PersistentTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php b/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php index 381555ed0fe79..16df8181a0e61 100644 --- a/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php +++ b/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php @@ -25,17 +25,17 @@ class PersistentTest extends TestCase private $customerData; /** - * @var Session + * @var Session|\PHPUnit_Framework_MockObject_MockObject */ private $persistentSessionHelperMock; /** - * @var View + * @var View|\PHPUnit_Framework_MockObject_MockObject */ private $customerViewHelperMock; /** - * @var CustomerRepositoryInterface + * @var CustomerRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject */ private $customerRepositoryMock; From fc04d190a098796680070a338d2b8124e117feb9 Mon Sep 17 00:00:00 2001 From: Giancarlo Peris <gperis93@gmail.com> Date: Sat, 14 Dec 2019 13:53:57 +0000 Subject: [PATCH 536/595] Initialise value as empty when color picker input is reset so the preview gets updated --- .../view/base/web/js/lib/knockout/bindings/color-picker.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/color-picker.js b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/color-picker.js index c678b85276093..1e8e89894d22f 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/color-picker.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/color-picker.js @@ -71,6 +71,11 @@ define([ update: function (element, valueAccessor, allBindings, viewModel) { var config = valueAccessor(); + /** Initialise value as empty if it is undefined when color picker input is reset **/ + if (config.value() === undefined) { + config.value(''); + } + if (tinycolor(config.value()).isValid() || config.value() === '') { $(element).spectrum('set', config.value()); From e704d62ef2af5b2bcbb31574c9b8bee8874c90e1 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sat, 14 Dec 2019 21:06:18 +0700 Subject: [PATCH 537/595] [Downloadable] Cover Helper Data by Unit Test --- .../Test/Unit/Helper/DataTest.php | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 app/code/Magento/Downloadable/Test/Unit/Helper/DataTest.php diff --git a/app/code/Magento/Downloadable/Test/Unit/Helper/DataTest.php b/app/code/Magento/Downloadable/Test/Unit/Helper/DataTest.php new file mode 100644 index 0000000000000..7c59ef7d7ec64 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Unit/Helper/DataTest.php @@ -0,0 +1,86 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Downloadable\Test\Unit\Helper; + +use Magento\Downloadable\Model\Link; +use Magento\Store\Model\ScopeInterface; +use PHPUnit\Framework\TestCase; +use Magento\Downloadable\Helper\Data; +use Magento\Framework\App\Helper\Context; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; + +class DataTest extends TestCase +{ + /** + * @var Data + */ + private $helper; + + /** + * @var ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $scopeConfigMock; + + /** + * @var Context|\PHPUnit_Framework_MockObject_MockObject + */ + private $contextMock; + + /** + * Setup environment for test + */ + protected function setUp() + { + $this->scopeConfigMock = $this->createMock(ScopeConfigInterface::class); + $this->contextMock = $this->createMock(Context::class); + $this->contextMock->method('getScopeConfig')->willReturn($this->scopeConfigMock); + + $objectManager = new ObjectManagerHelper($this); + $this->helper = $objectManager->getObject( + Data::class, + ['context' => $this->contextMock] + ); + } + + /** + * Test getIsShareable() with data provider + * + * @param int $linkShareable + * @param bool $config + * @param bool $expectedResult + * @dataProvider getIsShareableDataProvider + */ + public function testGetIsShareable($linkShareable, $config, $expectedResult) + { + $this->scopeConfigMock->method('isSetFlag') + ->with(Link::XML_PATH_CONFIG_IS_SHAREABLE, ScopeInterface::SCOPE_STORE) + ->willReturn($config); + + $linkMock = $this->createMock(Link::class); + $linkMock->method('getIsShareable')->willReturn($linkShareable); + + $this->assertEquals($expectedResult, $this->helper->getIsShareable($linkMock)); + } + + /** + * Data provider for getIsShareable() + * + * @return array + */ + public function getIsShareableDataProvider() + { + return [ + 'link shareable yes' => [Link::LINK_SHAREABLE_YES, true, true], + 'link shareable no' => [Link::LINK_SHAREABLE_NO, true, false], + 'link shareable config true' => [Link::LINK_SHAREABLE_CONFIG, true, true], + 'link shareable config false' => [Link::LINK_SHAREABLE_CONFIG, false, false], + ]; + } +} From f075d4e4120dc833867a3ddc047804b8e1ea9070 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Sun, 15 Dec 2019 01:23:06 +0530 Subject: [PATCH 538/595] [Catalog] cover ViewModel AddToCompareAvailability by Unit Test --- .../Checker/AddToCompareAvailabilityTest.php | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php diff --git a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php new file mode 100644 index 0000000000000..4295b11a58077 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php @@ -0,0 +1,118 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Catalog\Test\Unit\ViewModel\Product\Checker; + +use Magento\Catalog\ViewModel\Product\Checker\AddToCompareAvailability; +use Magento\CatalogInventory\Api\StockConfigurationInterface; +use Magento\Catalog\Model\Product; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\MockObject\MockObject; + +/** + * Unit test for Magento\Catalog\ViewModel\Product\Checker\AddToCompareAvailability. + */ +class AddToCompareAvailabilityTest extends \PHPUnit\Framework\TestCase +{ + + /** + * @var AddToCompareAvailability + */ + private $viewModel; + + /** + * @var StockConfigurationInterface|MockObject + */ + protected $stockConfiguration; + + /** + * @var ObjectManager + */ + private $objectManager; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + + $this->stockConfiguration = + $this->getMockBuilder(StockConfigurationInterface::class) + ->getMock(); + + $this->viewModel = $this->getObjectManager()->getObject( + AddToCompareAvailability::class, + [ + 'stockConfiguration' => $this->stockConfiguration + ] + ); + } + + /** + * Test IsAvailableForCompare() with data provider + * + * @param bool $status + * @param bool $isSalable + * @param array $isInStock + * @param bool $isShowOutOfStock + * @return boolean + * @dataProvider isAvailableForCompareDataProvider + */ + public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isShowOutOfStock): bool + { + $productMock = $this->getMockBuilder(Product::class) + ->disableOriginalConstructor() + ->getMock(); + + $productMock->expects($this->once()) + ->method('getStatus') + ->willReturn($status); + + $productMock->expects($this->any()) + ->method('isSalable') + ->willReturn($isSalable); + + $productMock->expects($this->any()) + ->method('getQuantityAndStockStatus') + ->willReturn($isInStock); + + $this->stockConfiguration->expects($this->any()) + ->method('isShowOutOfStock') + ->willReturn($isShowOutOfStock); + + return $this->viewModel->isAvailableForCompare($productMock); + } + + /** + * Data provider for isAvailableForCompare() + * + * @return array + */ + public function isAvailableForCompareDataProvider(): array + { + return [ + [1, true, ['is_in_stock' => true], false], + [1, true, ['is_in_stock' => false], true], + [1, true, [], false], + [1, false, [], false], + [2, true, ['is_in_stock' => true], false] + ]; + } + + /** + * @return ObjectManager + */ + private function getObjectManager(): ObjectManager + { + if (null === $this->objectManager) { + $this->objectManager = new ObjectManager($this); + } + + return $this->objectManager; + } +} From 0b806f9cf6d4f1cf89a294d18c552cc3eaa9c2ad Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Sun, 15 Dec 2019 02:19:06 +0530 Subject: [PATCH 539/595] Fixed the static tests & feedbacks --- .../Checker/AddToCompareAvailabilityTest.php | 33 +++++-------------- 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php index 4295b11a58077..88dba7ebee1c6 100644 --- a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php +++ b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php @@ -26,14 +26,9 @@ class AddToCompareAvailabilityTest extends \PHPUnit\Framework\TestCase private $viewModel; /** - * @var StockConfigurationInterface|MockObject + * @var StockConfigurationInterface|MockObject */ - protected $stockConfiguration; - - /** - * @var ObjectManager - */ - private $objectManager; + protected $stockConfigurationMock; /** * @inheritdoc @@ -41,14 +36,16 @@ class AddToCompareAvailabilityTest extends \PHPUnit\Framework\TestCase protected function setUp(): void { - $this->stockConfiguration = + $objectManager = new ObjectManager($this); + + $this->stockConfigurationMock = $this->getMockBuilder(StockConfigurationInterface::class) ->getMock(); - $this->viewModel = $this->getObjectManager()->getObject( + $this->viewModel = $objectManager->getObject( AddToCompareAvailability::class, [ - 'stockConfiguration' => $this->stockConfiguration + 'stockConfiguration' => $this->stockConfigurationMock ] ); } @@ -81,7 +78,7 @@ public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isSh ->method('getQuantityAndStockStatus') ->willReturn($isInStock); - $this->stockConfiguration->expects($this->any()) + $this->stockConfigurationMock->expects($this->any()) ->method('isShowOutOfStock') ->willReturn($isShowOutOfStock); @@ -90,7 +87,7 @@ public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isSh /** * Data provider for isAvailableForCompare() - * + * * @return array */ public function isAvailableForCompareDataProvider(): array @@ -103,16 +100,4 @@ public function isAvailableForCompareDataProvider(): array [2, true, ['is_in_stock' => true], false] ]; } - - /** - * @return ObjectManager - */ - private function getObjectManager(): ObjectManager - { - if (null === $this->objectManager) { - $this->objectManager = new ObjectManager($this); - } - - return $this->objectManager; - } } From 97fe3ffe0b0e891284301f7ef749ee96391ea013 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Sun, 15 Dec 2019 03:08:39 +0530 Subject: [PATCH 540/595] Assert added with expected results --- .../Checker/AddToCompareAvailabilityTest.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php index 88dba7ebee1c6..1b743d26a4297 100644 --- a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php +++ b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php @@ -57,10 +57,11 @@ protected function setUp(): void * @param bool $isSalable * @param array $isInStock * @param bool $isShowOutOfStock - * @return boolean + * @param bool $expectedBool + * @return void * @dataProvider isAvailableForCompareDataProvider */ - public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isShowOutOfStock): bool + public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isShowOutOfStock, $expectedBool): void { $productMock = $this->getMockBuilder(Product::class) ->disableOriginalConstructor() @@ -82,7 +83,7 @@ public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isSh ->method('isShowOutOfStock') ->willReturn($isShowOutOfStock); - return $this->viewModel->isAvailableForCompare($productMock); + $this->assertEquals($expectedBool, $this->viewModel->isAvailableForCompare($productMock)); } /** @@ -93,11 +94,11 @@ public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isSh public function isAvailableForCompareDataProvider(): array { return [ - [1, true, ['is_in_stock' => true], false], - [1, true, ['is_in_stock' => false], true], - [1, true, [], false], - [1, false, [], false], - [2, true, ['is_in_stock' => true], false] + [1, true, ['is_in_stock' => true], false, true], + [1, true, ['is_in_stock' => false], true, true], + [1, true, [], false, true], + [1, false, [], false, false], + [2, true, ['is_in_stock' => true], false, false] ]; } } From 5cedaf8e26fe72b7335058be87ab2b1a39977382 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sun, 15 Dec 2019 05:44:47 +0700 Subject: [PATCH 541/595] Refactor code --- .../Test/Unit/CustomerData/PersistentTest.php | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php b/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php index 381555ed0fe79..15889a74439d7 100644 --- a/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php +++ b/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php @@ -16,26 +16,37 @@ use Magento\Persistent\Model\Session as PersistentSession; use Magento\Customer\Api\Data\CustomerInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use PHPUnit\Framework\MockObject\MockObject; class PersistentTest extends TestCase { + /** + * Stub customer id + */ + private const STUB_CUSTOMER_ID = 1; + + /** + * Stub customer name + */ + private const STUB_CUSTOMER_NAME = 'Adam John'; + /** * @var Persistent */ private $customerData; /** - * @var Session + * @var Session|MockObject */ private $persistentSessionHelperMock; /** - * @var View + * @var View|MockObject */ private $customerViewHelperMock; /** - * @var CustomerRepositoryInterface + * @var CustomerRepositoryInterface|MockObject */ private $customerRepositoryMock; @@ -73,7 +84,7 @@ public function testGetSectionDataWhenDisablePersistent() /** * Test getSectionData() when customer doesn't login */ - public function testGetSectionDataWithNotLogin() + public function testGetSectionDataWhenCustomerNotLoggedInReturnsEmptyArray() { $this->persistentSessionHelperMock->method('isPersistent')->willReturn(true); @@ -92,16 +103,17 @@ public function testGetSectionDataCustomerLoginAndEnablePersistent() $this->persistentSessionHelperMock->method('isPersistent')->willReturn(true); $persistentSessionMock = $this->createPartialMock(PersistentSession::class, ['getCustomerId']); - $persistentSessionMock->method('getCustomerId')->willReturn(1); + $persistentSessionMock->method('getCustomerId')->willReturn(self::STUB_CUSTOMER_ID); $this->persistentSessionHelperMock->method('getSession')->willReturn($persistentSessionMock); $customerMock = $this->createMock(CustomerInterface::class); $this->customerRepositoryMock->method('getById')->with(1)->willReturn($customerMock); - $this->customerViewHelperMock->method('getCustomerName')->with($customerMock)->willReturn('Adam John'); + $this->customerViewHelperMock->method('getCustomerName')->with($customerMock) + ->willReturn(self::STUB_CUSTOMER_NAME); $this->assertEquals( [ - 'fullname' => 'Adam John' + 'fullname' => self::STUB_CUSTOMER_NAME ], $this->customerData->getSectionData() ); From bbfdb089bb5cbd7b61882896984ad87bea62deee Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sun, 15 Dec 2019 06:02:50 +0700 Subject: [PATCH 542/595] Refactor code --- .../Unit/Ui/Component/FilterFactoryTest.php | 73 ++++++++++--------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php index 545b9e7326ff1..4b43a41c42fad 100644 --- a/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php @@ -7,23 +7,45 @@ namespace Magento\Catalog\Test\Unit\Ui\Component; -use PHPUnit\Framework\TestCase; -use Magento\Catalog\Ui\Component\FilterFactory; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; -use Magento\Framework\View\Element\UiComponentFactory; use Magento\Catalog\Api\Data\ProductAttributeInterface; +use Magento\Catalog\Ui\Component\FilterFactory; use Magento\Eav\Model\Entity\Attribute\Source\SourceInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Framework\View\Element\UiComponent\ContextInterface; +use Magento\Framework\View\Element\UiComponentFactory; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; class FilterFactoryTest extends TestCase { + /** + * Stub attribute + */ + private const STUB_ATTRIBUTE = [ + 'attribute_code' => 'color', + 'default_frontend_label' => 'Color', + 'uses_source' => 'Color', + 'source_model' => 'getSourceModel value', + 'frontend_input' => 'select', + 'all_options' => [ + [ + 'value' => 1, + 'label' => 'Black', + ], + [ + 'value' => 2, + 'label' => 'White', + ] + ] + ]; + /** * @var FilterFactory */ private $filterFactory; /** - * @var UiComponentFactory|\PHPUnit_Framework_MockObject_MockObject + * @var UiComponentFactory|MockObject */ private $componentFactoryMock; @@ -32,7 +54,7 @@ class FilterFactoryTest extends TestCase */ protected function setUp() { - $objectManager = new ObjectManagerHelper($this); + $objectManager = new ObjectManager($this); $this->componentFactoryMock = $this->createMock(UiComponentFactory::class); @@ -53,43 +75,24 @@ public function testCreateWithUseSourceAttribute() $attributeMock = $this->getMockBuilder(ProductAttributeInterface::class) ->setMethods(['usesSource', 'getSource']) ->getMockForAbstractClass(); - $attributeMock->method('getAttributeCode')->willReturn('color'); - $attributeMock->method('getDefaultFrontendLabel')->willReturn('Color'); - $attributeMock->method('usesSource')->willReturn(true); - $attributeMock->method('getSourceModel')->willReturn('getSourceModel value'); - $attributeMock->method('getFrontendInput')->willReturn('select'); + $attributeMock->method('getAttributeCode')->willReturn(self::STUB_ATTRIBUTE['attribute_code']); + $attributeMock->method('getDefaultFrontendLabel') + ->willReturn(self::STUB_ATTRIBUTE['default_frontend_label']); + $attributeMock->method('usesSource')->willReturn(self::STUB_ATTRIBUTE['uses_source']); + $attributeMock->method('getSourceModel')->willReturn(self::STUB_ATTRIBUTE['source_model']); + $attributeMock->method('getFrontendInput')->willReturn(self::STUB_ATTRIBUTE['frontend_input']); $sourceMock = $this->createMock(SourceInterface::class); $attributeMock->method('getSource')->willReturn($sourceMock); - $sourceMock->method('getAllOptions')->willReturn( - [ - [ - 'value' => 1, - 'label' => 'Black', - ], - [ - 'value' => 2, - 'label' => 'White', - ] - ] - ); + $sourceMock->method('getAllOptions')->willReturn(self::STUB_ATTRIBUTE['all_options']); $this->componentFactoryMock->expects($this->once()) ->method('create') ->with('color', 'filterSelect', [ 'data' => [ 'config' => [ - 'options' => [ - [ - 'value' => 1, - 'label' => 'Black', - ], - [ - 'value' => 2, - 'label' => 'White', - ] - ], + 'options' => self::STUB_ATTRIBUTE['all_options'], 'caption' => (string)__('Select...'), - 'dataScope' => 'color', - 'label' => (string)__('Color'), + 'dataScope' => self::STUB_ATTRIBUTE['attribute_code'], + 'label' => (string)__(self::STUB_ATTRIBUTE['default_frontend_label']), ] ], 'context' => $contextMock From 78ba90500058250770676f3c60c826a23f1de366 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sun, 15 Dec 2019 06:03:36 +0700 Subject: [PATCH 543/595] optimize import --- .../Persistent/Test/Unit/CustomerData/PersistentTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php b/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php index 15889a74439d7..7120474ba0eee 100644 --- a/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php +++ b/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php @@ -8,15 +8,15 @@ namespace Magento\Persistent\Test\Unit\CustomerData; -use PHPUnit\Framework\TestCase; -use Magento\Persistent\CustomerData\Persistent; use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; use Magento\Customer\Helper\View; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Persistent\CustomerData\Persistent; use Magento\Persistent\Helper\Session; use Magento\Persistent\Model\Session as PersistentSession; -use Magento\Customer\Api\Data\CustomerInterface; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; class PersistentTest extends TestCase { From 50b006e1cfbb59d84914e8b7dd9d81afaf22cf01 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sun, 15 Dec 2019 06:35:16 +0700 Subject: [PATCH 544/595] refactor code --- .../Persistent/Test/Unit/CustomerData/PersistentTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php b/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php index 7120474ba0eee..a95f5530bb800 100644 --- a/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php +++ b/app/code/Magento/Persistent/Test/Unit/CustomerData/PersistentTest.php @@ -107,7 +107,7 @@ public function testGetSectionDataCustomerLoginAndEnablePersistent() $this->persistentSessionHelperMock->method('getSession')->willReturn($persistentSessionMock); $customerMock = $this->createMock(CustomerInterface::class); - $this->customerRepositoryMock->method('getById')->with(1)->willReturn($customerMock); + $this->customerRepositoryMock->method('getById')->with(self::STUB_CUSTOMER_ID)->willReturn($customerMock); $this->customerViewHelperMock->method('getCustomerName')->with($customerMock) ->willReturn(self::STUB_CUSTOMER_NAME); From 888ad592a5995e189783a20bf855d8b979338324 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sun, 15 Dec 2019 07:12:55 +0700 Subject: [PATCH 545/595] refactor code --- .../Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php index 4b43a41c42fad..e19284447c07d 100644 --- a/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php @@ -92,7 +92,7 @@ public function testCreateWithUseSourceAttribute() 'options' => self::STUB_ATTRIBUTE['all_options'], 'caption' => (string)__('Select...'), 'dataScope' => self::STUB_ATTRIBUTE['attribute_code'], - 'label' => (string)__(self::STUB_ATTRIBUTE['default_frontend_label']), + 'label' => self::STUB_ATTRIBUTE['default_frontend_label'], ] ], 'context' => $contextMock From 9e042b677e1d6e7af4efa2958697a4088b63400e Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Sun, 15 Dec 2019 06:37:41 +0530 Subject: [PATCH 546/595] Magic numbers replaced with class --- .../Product/Checker/AddToCompareAvailabilityTest.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php index 1b743d26a4297..682f652339820 100644 --- a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php +++ b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php @@ -11,6 +11,7 @@ use Magento\Catalog\ViewModel\Product\Checker\AddToCompareAvailability; use Magento\CatalogInventory\Api\StockConfigurationInterface; use Magento\Catalog\Model\Product; +use \Magento\Catalog\Model\Product\Attribute\Source\Status; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use PHPUnit\Framework\MockObject\MockObject; @@ -94,11 +95,11 @@ public function testIsAvailableForCompare($status, $isSalable, $isInStock, $isSh public function isAvailableForCompareDataProvider(): array { return [ - [1, true, ['is_in_stock' => true], false, true], - [1, true, ['is_in_stock' => false], true, true], - [1, true, [], false, true], - [1, false, [], false, false], - [2, true, ['is_in_stock' => true], false, false] + [Status::STATUS_ENABLED, true, ['is_in_stock' => true], false, true], + [Status::STATUS_ENABLED, true, ['is_in_stock' => false], true, true], + [Status::STATUS_ENABLED, true, [], false, true], + [Status::STATUS_ENABLED, false, [], false, false], + [Status::STATUS_DISABLED, true, ['is_in_stock' => true], false, false] ]; } } From a308d4add176b1250d19f8dec6abad9b655333e1 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Sun, 15 Dec 2019 06:40:07 +0530 Subject: [PATCH 547/595] Magic numbers replaced with class --- .../ViewModel/Product/Checker/AddToCompareAvailabilityTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php index 682f652339820..55bfbe8b4ec71 100644 --- a/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php +++ b/app/code/Magento/Catalog/Test/Unit/ViewModel/Product/Checker/AddToCompareAvailabilityTest.php @@ -11,7 +11,7 @@ use Magento\Catalog\ViewModel\Product\Checker\AddToCompareAvailability; use Magento\CatalogInventory\Api\StockConfigurationInterface; use Magento\Catalog\Model\Product; -use \Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\Product\Attribute\Source\Status; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use PHPUnit\Framework\MockObject\MockObject; From 0a1ae3b37f3c1b937a2000f6f7f45205a3d32145 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Sun, 15 Dec 2019 11:30:51 +0700 Subject: [PATCH 548/595] Refactor filter factory test --- .../Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php b/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php index e19284447c07d..1e72b7ba35864 100644 --- a/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Ui/Component/FilterFactoryTest.php @@ -86,7 +86,7 @@ public function testCreateWithUseSourceAttribute() $sourceMock->method('getAllOptions')->willReturn(self::STUB_ATTRIBUTE['all_options']); $this->componentFactoryMock->expects($this->once()) ->method('create') - ->with('color', 'filterSelect', [ + ->with(self::STUB_ATTRIBUTE['attribute_code'], 'filterSelect', [ 'data' => [ 'config' => [ 'options' => self::STUB_ATTRIBUTE['all_options'], From 56bf55ed2975af90f2daf646eee540f043831a99 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Mon, 16 Dec 2019 01:16:57 +0530 Subject: [PATCH 549/595] [Contact] covered Model Config by Unit Test --- .../Contact/Test/Unit/Model/ConfigTest.php | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php diff --git a/app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php b/app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php new file mode 100644 index 0000000000000..56351bae87698 --- /dev/null +++ b/app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php @@ -0,0 +1,127 @@ +<?php + +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Contact\Test\Unit\Model; + +use Magento\Contact\Model\Config; +use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\MockObject\MockObject; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Store\Model\ScopeInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; + +/** + * Unit test for Magento\Contact\Model\Config + */ +class ConfigTest extends TestCase +{ + /** + * @var Config + */ + private $model; + + /** + * @var ScopeConfigInterface|MockObject + */ + private $scopeConfigMock; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + $this->scopeConfigMock = $this->getMockBuilder(ScopeConfigInterface::class) + ->setMethods(['getValue', 'isSetFlag']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $objectManager = new ObjectManagerHelper($this); + $this->model = $objectManager->getObject( + Config::class, + [ + 'scopeConfig' => $this->scopeConfigMock + ] + ); + } + + /** + * Test isEnabled() + * + * @return void + */ + public function testIsEnabled(): void + { + $this->scopeConfigMock->expects($this->once()) + ->method('isSetFlag') + ->with(config::XML_PATH_ENABLED, ScopeInterface::SCOPE_STORE) + ->willReturn(true); + + $this->assertTrue(true, $this->model->isEnabled()); + } + + /** + * Test isNotEnabled() + * + * @return void + */ + public function testIsNotEnabled(): void + { + $this->scopeConfigMock->expects($this->once()) + ->method('isSetFlag') + ->with(config::XML_PATH_ENABLED, ScopeInterface::SCOPE_STORE) + ->willReturn(false); + + $this->assertFalse(false, $this->model->isEnabled()); + } + + /** + * Test emailTemplate() + * + * @return void + */ + public function testEmailTemplate(): void + { + $this->scopeConfigMock->expects($this->once()) + ->method('getValue') + ->with(config::XML_PATH_EMAIL_TEMPLATE, ScopeInterface::SCOPE_STORE) + ->willReturn('contact_email_email_template'); + + $this->assertEquals('contact_email_email_template', $this->model->emailTemplate()); + } + + /** + * Test emailSender() + * + * @return void + */ + public function testEmailSender(): void + { + $this->scopeConfigMock->expects($this->once()) + ->method('getValue') + ->with(config::XML_PATH_EMAIL_SENDER, ScopeInterface::SCOPE_STORE) + ->willReturn('custom2'); + + $this->assertEquals('custom2', $this->model->emailSender()); + } + + /** + * Test emailRecipient() + * + * @return void + */ + public function testEmailRecipient(): void + { + $this->scopeConfigMock->expects($this->once()) + ->method('getValue') + ->with(config::XML_PATH_EMAIL_RECIPIENT, ScopeInterface::SCOPE_STORE) + ->willReturn('hello@example.com'); + + $this->assertEquals('hello@example.com', $this->model->emailRecipient()); + } +} From 929a2c4edcf79242ca4cbdebe8bdaa019f4d8257 Mon Sep 17 00:00:00 2001 From: Matheus Gontijo <matheus@matheusgontijo.com> Date: Sun, 15 Dec 2019 17:24:11 -0300 Subject: [PATCH 550/595] fixed typo: "reviwGrid" to "reviewGrid" --- app/code/Magento/Review/Block/Adminhtml/Grid.php | 2 +- .../Review/Test/Mftf/Section/AdminReviewGridSection.xml | 8 ++++---- .../Test/Block/Adminhtml/Customer/Edit/Tab/Reviews.php | 2 +- .../app/Magento/Review/Test/Block/Adminhtml/Grid.php | 2 +- .../Magento/Review/Test/Page/Adminhtml/ReviewIndex.xml | 2 +- .../Magento/Customer/Controller/Adminhtml/IndexTest.php | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Review/Block/Adminhtml/Grid.php b/app/code/Magento/Review/Block/Adminhtml/Grid.php index 02477bb89610f..e20cb7554e094 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Grid.php +++ b/app/code/Magento/Review/Block/Adminhtml/Grid.php @@ -90,7 +90,7 @@ public function __construct( protected function _construct() { parent::_construct(); - $this->setId('reviwGrid'); + $this->setId('reviewGrid'); $this->setDefaultSort('created_at'); } diff --git a/app/code/Magento/Review/Test/Mftf/Section/AdminReviewGridSection.xml b/app/code/Magento/Review/Test/Mftf/Section/AdminReviewGridSection.xml index 2c5588cf2645b..981de91f357cb 100644 --- a/app/code/Magento/Review/Test/Mftf/Section/AdminReviewGridSection.xml +++ b/app/code/Magento/Review/Test/Mftf/Section/AdminReviewGridSection.xml @@ -9,11 +9,11 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminReviewGridSection"> - <element name="nickname" type="input" selector="#reviwGrid_filter_nickname"/> - <element name="status" type="select" selector="#reviwGrid_filter_status"/> + <element name="nickname" type="input" selector="#reviewGrid_filter_nickname"/> + <element name="status" type="select" selector="#reviewGrid_filter_status"/> <element name="firstRow" type="block" selector=".data-grid tbody tr:nth-of-type(1)"/> - <element name="massActions" type="button" selector="#reviwGrid_massaction-mass-select"/> - <element name="massActionsSelect" type="button" selector="#reviwGrid_massaction-select"/> + <element name="massActions" type="button" selector="#reviewGrid_massaction-mass-select"/> + <element name="massActionsSelect" type="button" selector="#reviewGrid_massaction-select"/> <element name="submit" type="button" selector=".admin__grid-massaction-form .action-default.scalable"/> <element name="acceptModal" type="button" selector=".modal-popup.confirm button.action-accept"/> </section> diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Customer/Edit/Tab/Reviews.php b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Customer/Edit/Tab/Reviews.php index cd46dc24ee3e9..5000fb838ec73 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Customer/Edit/Tab/Reviews.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Customer/Edit/Tab/Reviews.php @@ -18,7 +18,7 @@ class Reviews extends Tab * * @var string */ - protected $reviews = '#reviwGrid'; + protected $reviews = '#reviewGrid'; /** * Returns product reviews grid. diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Grid.php b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Grid.php index 7614cd332bd04..23f877b96f3a2 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Grid.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Grid.php @@ -27,7 +27,7 @@ class Grid extends GridAbstract 'selector' => 'input[name="title"]', ], 'status' => [ - 'selector' => '#reviwGrid_filter_status', + 'selector' => '#reviewGrid_filter_status', 'input' => 'select', ], 'nickname' => [ diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Page/Adminhtml/ReviewIndex.xml b/dev/tests/functional/tests/app/Magento/Review/Test/Page/Adminhtml/ReviewIndex.xml index fa77210b11875..c533067e9516e 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Page/Adminhtml/ReviewIndex.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Page/Adminhtml/ReviewIndex.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> <page name="ReviewIndex" area="Adminhtml" mca="review/product/index" module="Magento_Review"> <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector" /> - <block name="reviewGrid" class="Magento\Review\Test\Block\Adminhtml\Grid" locator="#reviwGrid" strategy="css selector" /> + <block name="reviewGrid" class="Magento\Review\Test\Block\Adminhtml\Grid" locator="#reviewGrid" strategy="css selector" /> <block name="reviewActions" class="Magento\Backend\Test\Block\GridPageActions" locator=".page-main-actions" strategy="css selector" /> </page> </config> diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php index 1b7f2c1f7efdd..b3826cd8daa8d 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php @@ -444,7 +444,7 @@ public function testProductReviewsAction() $this->getRequest()->setParam('id', 1); $this->dispatch('backend/customer/index/productReviews'); $body = $this->getResponse()->getBody(); - $this->assertContains('<div id="reviwGrid"', $body); + $this->assertContains('<div id="reviewGrid"', $body); } /** From 9b1883458be9e7c2481df3b08ca1865798921b1d Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Mon, 16 Dec 2019 02:18:28 +0530 Subject: [PATCH 551/595] Assert updated --- app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php b/app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php index 56351bae87698..a665b6b71c8c9 100644 --- a/app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php +++ b/app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php @@ -62,7 +62,7 @@ public function testIsEnabled(): void ->with(config::XML_PATH_ENABLED, ScopeInterface::SCOPE_STORE) ->willReturn(true); - $this->assertTrue(true, $this->model->isEnabled()); + $this->assertTrue($this->model->isEnabled()); } /** @@ -77,7 +77,7 @@ public function testIsNotEnabled(): void ->with(config::XML_PATH_ENABLED, ScopeInterface::SCOPE_STORE) ->willReturn(false); - $this->assertFalse(false, $this->model->isEnabled()); + $this->assertFalse($this->model->isEnabled()); } /** From 4b0178429b1c75e456d7d433caa37148ea3657fb Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Sun, 15 Dec 2019 22:45:20 -0600 Subject: [PATCH 552/595] Change action groups name according to CE branch changes --- .../Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml | 2 +- .../AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml | 2 +- .../AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml index b6cd116956812..82dc8d9ef7377 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml @@ -40,7 +40,7 @@ </actionGroup> <!--Delete the URL Rewrite for CMS Page with No redirects--> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteCustomUrlRewrite"> <argument name="requestPath" value="newrequestpath"/> </actionGroup> <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml index 1f76493bac89c..53be81c19f4f1 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml @@ -40,7 +40,7 @@ </actionGroup> <!-- Delete the URL Rewrite for CMS Page with permanent redirect--> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deletePermanentUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deletePermanentUrlRewrite"> <argument name="requestPath" value="permanentrequestpath.html"/> </actionGroup> <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml index c62f0ece7e780..a5a0be6df767f 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml @@ -40,7 +40,7 @@ </actionGroup> <!-- Delete the URL Rewrite for CMS Page with with temporary redirect--> - <actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteTemporaryUrlRewrite"> + <actionGroup ref="AdminDeleteUrlRewriteActionGroup" stepKey="deleteTemporaryUrlRewrite"> <argument name="requestPath" value="temporaryrequestpath.html"/> </actionGroup> <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> From 454330355f7a166d53a4e7bc6bed68973b6be445 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Sun, 15 Dec 2019 23:04:20 -0600 Subject: [PATCH 553/595] Change action groups name according to CE branch changes --- .../Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml index 82dc8d9ef7377..94065ec059840 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml @@ -48,7 +48,7 @@ </actionGroup> <!--Search and verify AssertUrlRewriteNotInGrid--> - <actionGroup ref="AdminSearchDeletedUrlRewrite" stepKey="searchDeletedUrlRewriteInGrid"> + <actionGroup ref="AdminSearchDeletedUrlRewriteActionGroup" stepKey="searchDeletedUrlRewriteInGrid"> <argument name="requestPath" value="newrequestpath"/> </actionGroup> From 804e2f857ec9ad192781c292a5ee3295de10d457 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Mon, 16 Dec 2019 12:08:41 +0700 Subject: [PATCH 554/595] [Downloadable] Cover the Observer SetHasDownloadableProductsObserver by Unit Test --- ...SetHasDownloadableProductsObserverTest.php | 185 ++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 app/code/Magento/Downloadable/Test/Unit/Observer/SetHasDownloadableProductsObserverTest.php diff --git a/app/code/Magento/Downloadable/Test/Unit/Observer/SetHasDownloadableProductsObserverTest.php b/app/code/Magento/Downloadable/Test/Unit/Observer/SetHasDownloadableProductsObserverTest.php new file mode 100644 index 0000000000000..cd79049465d06 --- /dev/null +++ b/app/code/Magento/Downloadable/Test/Unit/Observer/SetHasDownloadableProductsObserverTest.php @@ -0,0 +1,185 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Downloadable\Test\Unit\Observer; + +use Magento\Catalog\Model\Product\Type as ProductType; +use Magento\Checkout\Model\Session as CheckoutSession; +use Magento\Downloadable\Model\Product\Type as DownloadableProductType; +use Magento\Downloadable\Observer\SetHasDownloadableProductsObserver; +use Magento\Framework\DataObject; +use Magento\Framework\Event\Observer; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Sales\Model\Order; +use Magento\Sales\Model\Order\Item; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class SetHasDownloadableProductsObserverTest extends TestCase +{ + /** + * @var ObjectManager + */ + private $objectManager; + + /** + * @var CheckoutSession|MockObject + */ + private $checkoutSessionMock; + + /** + * @var SetHasDownloadableProductsObserver + */ + private $setHasDownloadableProductsObserver; + + /** + * @var Order|MockObject + */ + private $orderMock; + + /** + * Setup environment for test + */ + protected function setUp() + { + $this->objectManager = new ObjectManager($this); + + $this->orderMock = $this->createPartialMock(Order::class, ['getAllItems']); + + $this->checkoutSessionMock = $this->createPartialMock( + CheckoutSession::class, + [ + 'getHasDownloadableProducts', + 'setHasDownloadableProducts' + ] + ); + + + $this->setHasDownloadableProductsObserver = $this->objectManager->getObject( + SetHasDownloadableProductsObserver::class, + [ + 'checkoutSession' => $this->checkoutSessionMock + ] + ); + } + + /** + * Test execute with session has downloadable products + */ + public function testExecuteWithSessionHasDownloadableProducts() + { + $event = new DataObject(['item' => $this->orderMock]); + $observer = new Observer(['event' => $event]); + + $this->checkoutSessionMock->method('getHasDownloadableProducts')->willReturn(true); + $this->orderMock->method('getAllItems')->willReturn([]); + + $this->checkoutSessionMock->expects($this->never()) + ->method('setHasDownloadableProducts')->with(true); + + $this->setHasDownloadableProductsObserver->execute($observer); + } + + /** + * Test execute with session has no downloadable products with the data provider + * + * @dataProvider executeWithSessionNoDownloadableProductsDataProvider + */ + public function testExecuteWithSessionNoDownloadableProducts($allItems, $expectedCall) + { + $event = new DataObject(['order' => $this->orderMock]); + $observer = new Observer(['event' => $event]); + + $allOrderItemsMock = []; + foreach ($allItems as $item) { + $allOrderItemsMock[] = $this->createOrderItem(...$item); + } + + $this->checkoutSessionMock->method('getHasDownloadableProducts')->willReturn(false); + + $this->orderMock->method('getAllItems')->willReturn($allOrderItemsMock); + + $this->checkoutSessionMock->expects($expectedCall) + ->method('setHasDownloadableProducts')->with(true); + + $this->setHasDownloadableProductsObserver->execute($observer); + } + + /** + * Create Order Item Mock + * + * @param string $productType + * @param string $realProductType + * @param string $isDownloadable + * @return Item|MockObject + */ + private function createOrderItem( + $productType = DownloadableProductType::TYPE_DOWNLOADABLE, + $realProductType = DownloadableProductType::TYPE_DOWNLOADABLE, + $isDownloadable = '1' + ) { + $item = $this->createPartialMock( + Item::class, + ['getProductType', 'getRealProductType', 'getProductOptionByCode'] + ); + + $item->expects($this->any()) + ->method('getProductType') + ->willReturn($productType); + $item->expects($this->any()) + ->method('getRealProductType') + ->willReturn($realProductType); + $item->expects($this->any()) + ->method('getProductOptionByCode') + ->with('is_downloadable') + ->willReturn($isDownloadable); + + return $item; + } + + /** + * Data Provider for test execute with session has no downloadable product + * + * @return array + */ + public function executeWithSessionNoDownloadableProductsDataProvider() + { + return [ + 'Order has once item is downloadable product' => [ + [ + [ + DownloadableProductType::TYPE_DOWNLOADABLE, + DownloadableProductType::TYPE_DOWNLOADABLE, + '1' + ], + [ + ProductType::TYPE_SIMPLE, + ProductType::TYPE_SIMPLE, + '1' + ] + ], + $this->once() + ], + 'Order has all items are simple product' => [ + [ + [ + ProductType::TYPE_SIMPLE, + ProductType::TYPE_SIMPLE, + '0' + ], + [ + ProductType::TYPE_SIMPLE, + ProductType::TYPE_SIMPLE, + '0' + ] + ], + $this->never() + ], + ]; + } +} From aa09a07e4c62245e0d32268acdcc270f5460ed88 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Sun, 15 Dec 2019 23:23:50 -0600 Subject: [PATCH 555/595] Change action groups name according to CE branch changes --- .../Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml | 2 +- .../AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml | 2 +- .../AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml index 94065ec059840..c40dd3256114e 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithNoRedirectsTest.xml @@ -53,7 +53,7 @@ </actionGroup> <!--Verify AssertPageByUrlRewriteIsNotFound--> - <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFound"> + <actionGroup ref="AssertPageByUrlRewriteIsNotFoundActionGroup" stepKey="assertPageByUrlRewriteIsNotFound"> <argument name="requestPath" value="newrequestpath"/> </actionGroup> </test> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml index 53be81c19f4f1..741be6985d517 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithPermanentRedirectTest.xml @@ -48,7 +48,7 @@ </actionGroup> <!-- Verify AssertPageByUrlRewriteIsNotFound --> - <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFound"> + <actionGroup ref="AssertPageByUrlRewriteIsNotFoundActionGroup" stepKey="assertPageByUrlRewriteIsNotFound"> <argument name="requestPath" value="permanentrequestpath.html"/> </actionGroup> </test> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml index a5a0be6df767f..43de4123f35a8 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminDeleteCmsPageUrlRewriteWithTemporaryRedirectTest.xml @@ -48,7 +48,7 @@ </actionGroup> <!--Verify AssertPageByUrlRewriteIsNotFound--> - <actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="assertPageByUrlRewriteIsNotFound"> + <actionGroup ref="AssertPageByUrlRewriteIsNotFoundActionGroup" stepKey="assertPageByUrlRewriteIsNotFound"> <argument name="requestPath" value="temporaryrequestpath.html"/> </actionGroup> </test> From 4002829574a00a8bad40acca3cb2af116cceb17c Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Mon, 16 Dec 2019 13:00:02 +0700 Subject: [PATCH 556/595] Fix static test --- .../Unit/Observer/SetHasDownloadableProductsObserverTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/Downloadable/Test/Unit/Observer/SetHasDownloadableProductsObserverTest.php b/app/code/Magento/Downloadable/Test/Unit/Observer/SetHasDownloadableProductsObserverTest.php index cd79049465d06..53d9878f46ea2 100644 --- a/app/code/Magento/Downloadable/Test/Unit/Observer/SetHasDownloadableProductsObserverTest.php +++ b/app/code/Magento/Downloadable/Test/Unit/Observer/SetHasDownloadableProductsObserverTest.php @@ -59,7 +59,6 @@ protected function setUp() ] ); - $this->setHasDownloadableProductsObserver = $this->objectManager->getObject( SetHasDownloadableProductsObserver::class, [ @@ -150,7 +149,7 @@ private function createOrderItem( public function executeWithSessionNoDownloadableProductsDataProvider() { return [ - 'Order has once item is downloadable product' => [ + 'Order has one item is downloadable product' => [ [ [ DownloadableProductType::TYPE_DOWNLOADABLE, From 78cdd70586a7babfd78a571ac2b2454b017fbd73 Mon Sep 17 00:00:00 2001 From: Ashna-Jahan <32352950+Ashna-Jahan@users.noreply.github.com> Date: Mon, 16 Dec 2019 12:31:11 +0530 Subject: [PATCH 557/595] Fix the issue. --- .../backend/web/css/source/forms/fields/_control-table.less | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less index 22957cb86cb55..fce92e873e5bb 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less @@ -244,11 +244,10 @@ .product_form_product_form_advanced_pricing_modal .admin__control-table td, .product_form_product_form_advanced_pricing_modal .admin__control-table th { - padding: 1.3rem 0.7rem 1.3rem 0.3; overflow-y: visible; } .product_form_product_form_advanced_pricing_modal .admin__fieldset { - margin: -40px; + margin-left: -30px; } .product_form_product_form_advanced_pricing_modal .admin__control-table-wrapper { From 7ae9ab1fcd8eb6380b484e033cb847ecbb407643 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Mon, 16 Dec 2019 15:46:03 +0700 Subject: [PATCH 558/595] [Backend] Cover Dashboard Helper Data by Unit Test --- .../Test/Unit/Helper/Dashboard/DataTest.php | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 app/code/Magento/Backend/Test/Unit/Helper/Dashboard/DataTest.php diff --git a/app/code/Magento/Backend/Test/Unit/Helper/Dashboard/DataTest.php b/app/code/Magento/Backend/Test/Unit/Helper/Dashboard/DataTest.php new file mode 100644 index 0000000000000..21c72cb6b4477 --- /dev/null +++ b/app/code/Magento/Backend/Test/Unit/Helper/Dashboard/DataTest.php @@ -0,0 +1,111 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Backend\Test\Unit\Helper\Dashboard; + +use Magento\Backend\Helper\Dashboard\Data as HelperData; +use Magento\Framework\App\DeploymentConfig; +use Magento\Framework\Config\ConfigOptionsListConstants; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Store\Model\ResourceModel\Store\Collection as StoreCollection; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManagerInterface; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class DataTest extends TestCase +{ + /** + * Stub path install + */ + private const STUB_PATH_INSTALL = 'Sat, 6 Sep 2014 16:46:11 UTC'; + + /** + * Stub chart data hash + */ + private const STUB_CHART_DATA_HASH = '52870842b23068a78220e01eb9d4404d'; + + /** + * @var \Magento\Backend\Helper\Dashboard\Data + */ + private $helper; + + /** + * @var StoreManagerInterface|MockObject + */ + private $storeManagerMock; + + /** + * @var DeploymentConfig|MockObject + */ + private $deploymentConfigMock; + + /** + * Prepare environment for test + */ + protected function setUp() + { + $this->storeManagerMock = $this->createMock(StoreManagerInterface::class); + $this->deploymentConfigMock = $this->createMock(DeploymentConfig::class); + $this->deploymentConfigMock->expects($this->once())->method('get') + ->with(ConfigOptionsListConstants::CONFIG_PATH_INSTALL_DATE) + ->will($this->returnValue(self::STUB_PATH_INSTALL)); + + $objectManager = new ObjectManager($this); + $this->helper = $objectManager->getObject( + HelperData::class, + [ + 'storeManager' => $this->storeManagerMock, + 'deploymentConfig' => $this->deploymentConfigMock + ] + ); + } + + /** + * Test getStores() when $_stores attribute is null + */ + public function testGetStoresWhenStoreAttributeIsNull() + { + $storeMock = $this->createPartialMock(Store::class, ['getResourceCollection']); + $storeCollectionMock = $this->createMock(StoreCollection::class); + + $storeCollectionMock->expects($this->once())->method('load')->willReturnSelf(); + $storeMock->expects($this->once())->method('getResourceCollection')->willReturn($storeCollectionMock); + $this->storeManagerMock->expects($this->once())->method('getStore')->willReturn($storeMock); + + $this->assertEquals($storeCollectionMock, $this->helper->getStores()); + } + + /** + * Test getDatePeriods() method + */ + public function testGetDatePeriods() + { + $this->assertEquals( + [ + '24h' => (string)__('Last 24 Hours'), + '7d' => (string)__('Last 7 Days'), + '1m' => (string)__('Current Month'), + '1y' => (string)__('YTD'), + '2y' => (string)__('2YTD') + ], + $this->helper->getDatePeriods() + ); + } + + /** + * Test getChartDataHash() method + */ + public function testGetChartDataHash() + { + $this->assertEquals( + self::STUB_CHART_DATA_HASH, + $this->helper->getChartDataHash(self::STUB_PATH_INSTALL) + ); + } +} From ccc399a6920c4f1c9def5536f70094a87bdf1577 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Mon, 16 Dec 2019 10:47:25 +0200 Subject: [PATCH 559/595] MC-4242: Newsletter subscriptions per website --- ...esAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml index 52dce4d67f698..716bb60ce68bd 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml @@ -29,6 +29,10 @@ <requiredEntity createDataKey="createSecondCategory"/> </createData> + <!-- Reindex and flush the cache --> + <magentoCLI command="indexer:reindex" stepKey="runReindex"/> + <magentoCLI command="cache:flush" stepKey="cleanCache"/> + <!-- Log in to backend --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> From 6bf903f0521c7ef1f2561af6db71e391ecdc39ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Tylek?= <pawel.tylek@creativestyle.pl> Date: Mon, 16 Dec 2019 10:24:30 +0100 Subject: [PATCH 560/595] MAGETWO-95866 Fix tests --- .../backend/Magento_Backend/web/css/source/module/_menu.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less index c84a54efd5028..29a7499ec72f4 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less +++ b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/_menu.less @@ -268,10 +268,10 @@ } > ul[role='menu'] { - overflow-x: auto; - overflow-y: hidden; max-width: ~'calc(100vw - @{menu__width})'; min-height: @submenu__height; + overflow-x: auto; + overflow-y: hidden; } } From b394255d6d5c1df661c2c6cd5f6507f603b2d1f9 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Mon, 16 Dec 2019 15:40:13 +0530 Subject: [PATCH 561/595] Removed duplicated logic with data provider --- .../Contact/Test/Unit/Model/ConfigTest.php | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php b/app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php index a665b6b71c8c9..9456ea4b48105 100644 --- a/app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php +++ b/app/code/Magento/Contact/Test/Unit/Model/ConfigTest.php @@ -54,30 +54,29 @@ protected function setUp(): void * Test isEnabled() * * @return void + * @dataProvider isEnabledDataProvider */ - public function testIsEnabled(): void + public function testIsEnabled($isSetFlag, $result): void { $this->scopeConfigMock->expects($this->once()) ->method('isSetFlag') ->with(config::XML_PATH_ENABLED, ScopeInterface::SCOPE_STORE) - ->willReturn(true); + ->willReturn($isSetFlag); - $this->assertTrue($this->model->isEnabled()); + $this->assertEquals($result, $this->model->isEnabled()); } /** - * Test isNotEnabled() + * Data provider for isEnabled() * - * @return void + * @return array */ - public function testIsNotEnabled(): void + public function isEnabledDataProvider(): array { - $this->scopeConfigMock->expects($this->once()) - ->method('isSetFlag') - ->with(config::XML_PATH_ENABLED, ScopeInterface::SCOPE_STORE) - ->willReturn(false); - - $this->assertFalse($this->model->isEnabled()); + return [ + [true, true], + [false, false] + ]; } /** From b8d5c105115e4ed143fe29d99f5f5e0e89ef8521 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Mon, 16 Dec 2019 12:21:37 +0200 Subject: [PATCH 562/595] MC-4242: Newsletter subscriptions per website --- ...terChangingUrlKeyForStoreViewAndMovingCategoryTest.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml index 716bb60ce68bd..0986443fd5893 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml @@ -29,15 +29,15 @@ <requiredEntity createDataKey="createSecondCategory"/> </createData> - <!-- Reindex and flush the cache --> - <magentoCLI command="indexer:reindex" stepKey="runReindex"/> - <magentoCLI command="cache:flush" stepKey="cleanCache"/> - <!-- Log in to backend --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!--Create additional Store View in Main Website Store --> <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView"/> + + <!-- Reindex and flush the cache --> + <magentoCLI command="indexer:reindex" stepKey="runReindex"/> + <magentoCLI command="cache:flush" stepKey="cleanCache"/> </before> <after> <deleteData createDataKey="createFirstCategory" stepKey="deleteFirstCategory"/> From 56d198d03f6fcc9f56da78cdad53023750a1a188 Mon Sep 17 00:00:00 2001 From: Ashna-Jahan <32352950+Ashna-Jahan@users.noreply.github.com> Date: Mon, 16 Dec 2019 16:17:14 +0530 Subject: [PATCH 563/595] fix Allure Report issue --- .../backend/web/css/source/forms/fields/_control-table.less | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less index fce92e873e5bb..0a81223525fbd 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_control-table.less @@ -238,7 +238,8 @@ } } -.product_form_product_form_advanced_pricing_modal .admin__fieldset > .admin__field > .admin__field-label, .product_form_product_form_advanced_pricing_modal [class*='admin__control-grouped'] > .admin__field:first-child > .admin__field-label { +.product_form_product_form_advanced_pricing_modal .admin__fieldset > .admin__field > .admin__field-label, +.product_form_product_form_advanced_pricing_modal [class*='admin__control-grouped'] > .admin__field:first-child > .admin__field-label { margin-left: 0; } @@ -246,6 +247,7 @@ .product_form_product_form_advanced_pricing_modal .admin__control-table th { overflow-y: visible; } + .product_form_product_form_advanced_pricing_modal .admin__fieldset { margin-left: -30px; } From 18500e1410a96b06a7e59ac19733e84784b14cfc Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Mon, 16 Dec 2019 14:41:16 +0200 Subject: [PATCH 564/595] MC-4242: Newsletter subscriptions per website --- ...iesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml index 0986443fd5893..7b901658faa4a 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCheckUrlRewritesInCatalogCategoriesAfterChangingUrlKeyForStoreViewAndMovingCategoryTest.xml @@ -80,7 +80,6 @@ <!-- Assert category url with custom store view --> <amOnPage url="{{StorefrontHomePage.url}}$$createSecondCategory.name$$/{{SimpleRootSubCategory.url_key}}.html" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForCategoryPageLoad"/> - <dontSee userInput="$$createSecondSimpleProduct.name$$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="dontSeeProductInCategory"/> - <see selector="{{StorefrontCategoryMainSection.emptyProductMessage}}" userInput="We can't find products matching the selection." stepKey="seeEmptyProductMessage"/> + <see userInput="$$createFirstSimpleProduct.name$$" selector="{{StorefrontCategoryMainSection.productsList}}" stepKey="seeProductInCategory"/> </test> </tests> From 218c3ff32418c9dacb4da0ed812b226f81e8400a Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Mon, 16 Dec 2019 16:15:39 +0200 Subject: [PATCH 565/595] Reverting container class --- .../Theme/view/adminhtml/page_layout/admin-2columns-left.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Theme/view/adminhtml/page_layout/admin-2columns-left.xml b/app/code/Magento/Theme/view/adminhtml/page_layout/admin-2columns-left.xml index cee241233a199..9cb89746ad85d 100644 --- a/app/code/Magento/Theme/view/adminhtml/page_layout/admin-2columns-left.xml +++ b/app/code/Magento/Theme/view/adminhtml/page_layout/admin-2columns-left.xml @@ -31,7 +31,7 @@ </container> <container name="page.main.container" as="page_main_container" htmlId="page:main-container" htmlTag="div" htmlClass="page-columns"> <container name="main.col" as="main-col" htmlId="container" htmlTag="div" htmlClass="main-col"> - <container name="admin.scope.col.wrap" as="admin-scope-col-wrap" htmlTag="div" htmlClass="form-inline"> <!-- ToDo UI: remove this wrapper remove with old styles removal --> + <container name="admin.scope.col.wrap" as="admin-scope-col-wrap" htmlTag="div" htmlClass="admin__scope-old"> <!-- ToDo UI: remove this wrapper remove with old styles removal --> <container name="content" as="content"/> </container> </container> From 6ac10980c6322e949b13af43dfea320113586c2f Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Mon, 16 Dec 2019 23:13:53 +0700 Subject: [PATCH 566/595] [Msrp] Cover MsrpPriceCalculator by Unit Test --- .../Unit/Pricing/MsrpPriceCalculatorTest.php | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php diff --git a/app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php b/app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php new file mode 100644 index 0000000000000..613547943c9a4 --- /dev/null +++ b/app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php @@ -0,0 +1,103 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Msrp\Test\Unit\Pricing; + +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Type as Type; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\GroupedProduct\Model\Product\Type\Grouped as GroupedType; +use Magento\Msrp\Pricing\MsrpPriceCalculator; +use Magento\MsrpGroupedProduct\Pricing\MsrpPriceCalculator as MsrpGroupedCalculator; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class MsrpPriceCalculatorTest extends TestCase +{ + /** + * Test getMrspPriceValue() with the data provider below + * + * @param array $msrpPriceCalculators + * @param Product $productMock + * @param float $expected + * @dataProvider getMsrpPriceValueDataProvider + */ + public function testGetMsrpPriceValue($msrpPriceCalculators, $productMock, $expected) + { + $objectManager = new ObjectManager($this); + $pricing = $objectManager->getObject(MsrpPriceCalculator::class, + [ + 'msrpPriceCalculators' => $msrpPriceCalculators + ] + ); + + $this->assertEquals($expected, $pricing->getMsrpPriceValue($productMock)); + } + + /** + * Data Provider for test getMrspPriceValue() + * + * @return array + */ + public function getMsrpPriceValueDataProvider() + { + return [ + 'Get Mrsp Price with grouped product and price calculator is also grouped product type' => [ + [ + [ + 'productType' => GroupedType::TYPE_CODE, + 'priceCalculator' => $this->createPriceCalculatorMock( + MsrpGroupedCalculator::class, 23.50) + ] + ], + $this->createProductMock(GroupedType::TYPE_CODE, 0), + 23.50 + ], + 'Get Mrsp Price with simple product and price calculator is grouped product type' => [ + [ + [ + 'productType' => GroupedType::TYPE_CODE, + 'priceCalculator' => $this->createPriceCalculatorMock( + MsrpGroupedCalculator::class, 0) + ] + ], + $this->createProductMock(Type::TYPE_SIMPLE, 24.88), + 24.88 + ] + ]; + } + + /** + * Create Price Calculator Mock + * + * @param string $class + * @param float $msrpPriceValue + * @return MockObject + */ + private function createPriceCalculatorMock($class, $msrpPriceValue) + { + $priceCalculatorMock = $this->createMock($class); + $priceCalculatorMock->expects($this->any())->method('getMsrpPriceValue')->willReturn($msrpPriceValue); + return $priceCalculatorMock; + } + + /** + * Create Product Mock + * + * @param string $typeId + * @param float $msrp + * @return MockObject + */ + private function createProductMock($typeId, $msrp) + { + $productMock = $this->createPartialMock(Product::class, ['getTypeId', 'getMsrp']); + $productMock->expects($this->any())->method('getTypeId')->willReturn($typeId); + $productMock->expects($this->any())->method('getMsrp')->willReturn($msrp); + return $productMock; + } +} From fb7aa9c9c41ec300d697eb2fbb5b3398fbbd7a00 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Mon, 16 Dec 2019 23:37:11 +0700 Subject: [PATCH 567/595] fix static test --- .../Test/Unit/Pricing/MsrpPriceCalculatorTest.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php b/app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php index 613547943c9a4..aac6852b7000c 100644 --- a/app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php +++ b/app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php @@ -30,7 +30,8 @@ class MsrpPriceCalculatorTest extends TestCase public function testGetMsrpPriceValue($msrpPriceCalculators, $productMock, $expected) { $objectManager = new ObjectManager($this); - $pricing = $objectManager->getObject(MsrpPriceCalculator::class, + $pricing = $objectManager->getObject( + MsrpPriceCalculator::class, [ 'msrpPriceCalculators' => $msrpPriceCalculators ] @@ -52,7 +53,9 @@ public function getMsrpPriceValueDataProvider() [ 'productType' => GroupedType::TYPE_CODE, 'priceCalculator' => $this->createPriceCalculatorMock( - MsrpGroupedCalculator::class, 23.50) + MsrpGroupedCalculator::class, + 23.50 + ) ] ], $this->createProductMock(GroupedType::TYPE_CODE, 0), @@ -63,7 +66,9 @@ public function getMsrpPriceValueDataProvider() [ 'productType' => GroupedType::TYPE_CODE, 'priceCalculator' => $this->createPriceCalculatorMock( - MsrpGroupedCalculator::class, 0) + MsrpGroupedCalculator::class, + 0 + ) ] ], $this->createProductMock(Type::TYPE_SIMPLE, 24.88), From be81804df70a98ab61e7b79d383da8112e61de08 Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Mon, 16 Dec 2019 22:22:20 +0530 Subject: [PATCH 568/595] [GoogleAnalytics] covered Helper Data by Unit Test --- .../Test/Unit/Helper/DataTest.php | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 app/code/Magento/GoogleAnalytics/Test/Unit/Helper/DataTest.php diff --git a/app/code/Magento/GoogleAnalytics/Test/Unit/Helper/DataTest.php b/app/code/Magento/GoogleAnalytics/Test/Unit/Helper/DataTest.php new file mode 100644 index 0000000000000..ea1df498499de --- /dev/null +++ b/app/code/Magento/GoogleAnalytics/Test/Unit/Helper/DataTest.php @@ -0,0 +1,115 @@ +<?php + +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\GoogleAnalytics\Test\Unit\Helper; + +use Magento\GoogleAnalytics\Helper\Data as HelperData; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Store\Model\ScopeInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\MockObject\MockObject; + +/** + * Unit test for Magento\GoogleAnalytics\Helper\Data + */ +class DataTest extends TestCase +{ + /** + * @var HelperData + */ + private $helper; + + /** + * @var ScopeConfigInterface|MockObject + */ + private $scopeConfigMock; + + /** + * @inheritDoc + */ + protected function setUp(): void + { + $this->scopeConfigMock = $this->getMockBuilder(ScopeConfigInterface::class) + ->setMethods(['getValue', 'isSetFlag']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $objectManager = new ObjectManager($this); + $this->helper = $objectManager->getObject( + HelperData::class, + [ + 'scopeConfig' => $this->scopeConfigMock + ] + ); + } + + /** + * Test for isGoogleAnalyticsAvailable() + * + * @return void + * @dataProvider gaDataProvider + */ + public function testIsGoogleAnalyticsAvailable($value, $flag): void + { + $this->scopeConfigMock->expects($this->once()) + ->method('getValue') + ->with(HelperData::XML_PATH_ACCOUNT, ScopeInterface::SCOPE_STORE) + ->willReturn($value); + + $this->scopeConfigMock->expects($this->any()) + ->method('isSetFlag') + ->with(HelperData::XML_PATH_ACTIVE, ScopeInterface::SCOPE_STORE) + ->willReturn($flag); + + $this->assertEquals(($value && $flag), $this->helper->isGoogleAnalyticsAvailable()); + } + + /** + * Data provider for isGoogleAnalyticsAvailable() + * + * @return array + */ + public function gaDataProvider(): array + { + return [ + ['GA-XXXX', true], + ['GA-XXXX', false], + ['', true] + ]; + } + + /** + * Test for isAnonymizedIpActive() + * + * @return void + * @dataProvider yesNoDataProvider + */ + public function testIsAnonymizedIpActive($value): void + { + $this->scopeConfigMock->expects($this->once()) + ->method('getValue') + ->with(HelperData::XML_PATH_ANONYMIZE, ScopeInterface::SCOPE_STORE) + ->willReturn($value); + $this->assertEquals((bool) $value, $this->helper->isAnonymizedIpActive()); + } + + /** + * Data provider for isAnonymizedIpActive() + * + * @return array + */ + public function yesNoDataProvider(): array + { + return [ + ['Yes' => '1'], + ['No' => '0'] + ]; + } +} From cf0725a78721e28a60cf68af5c30844424c89d1f Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Mon, 16 Dec 2019 19:52:01 +0200 Subject: [PATCH 569/595] Covering the UrlBuilder ViewModel by Unit Test --- .../ViewModel/Page/Grid/UrlBuilderTest.php | 191 ++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 app/code/Magento/Cms/Test/Unit/ViewModel/Page/Grid/UrlBuilderTest.php diff --git a/app/code/Magento/Cms/Test/Unit/ViewModel/Page/Grid/UrlBuilderTest.php b/app/code/Magento/Cms/Test/Unit/ViewModel/Page/Grid/UrlBuilderTest.php new file mode 100644 index 0000000000000..c75f86b7e5ffb --- /dev/null +++ b/app/code/Magento/Cms/Test/Unit/ViewModel/Page/Grid/UrlBuilderTest.php @@ -0,0 +1,191 @@ +<?php +/*** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Cms\Test\Unit\ViewModel\Page\Grid; + +use Magento\Cms\ViewModel\Page\Grid\UrlBuilder; +use Magento\Framework\Url\EncoderInterface; +use Magento\Framework\UrlInterface; +use Magento\Store\Api\Data\StoreInterface; +use Magento\Store\Model\StoreManagerInterface; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * Class UrlBuilderTest + */ +class UrlBuilderTest extends TestCase +{ + /** + * @var UrlBuilder + */ + private $viewModel; + + /** + * @var UrlInterface|MockObject + */ + private $frontendUrlBuilderMock; + + /** + * @var EncoderInterface|MockObject + */ + private $urlEncoderMock; + + /** + * @var StoreManagerInterface|MockObject + */ + private $storeManagerMock; + + /** + * Set Up + */ + public function setUp() + { + $this->frontendUrlBuilderMock = $this->getMockBuilder(UrlInterface::class) + ->setMethods(['getUrl', 'setScope']) + ->getMockForAbstractClass(); + $this->urlEncoderMock = $this->createMock(EncoderInterface::class); + $this->storeManagerMock = $this->getMockBuilder(StoreManagerInterface::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->viewModel = new UrlBuilder( + $this->frontendUrlBuilderMock, + $this->urlEncoderMock, + $this->storeManagerMock + ); + } + + /** + * Testing url builder with no scope provided + * + * @dataProvider nonScopedUrlsDataProvider + * + * @param array $url + * @param string $expected + * @param string $store + * @param null $scope + */ + public function testUrlBuilderWithNoScope(array $url, string $expected, string $store, $scope = null) + { + $this->frontendUrlBuilderMock->expects($this->any()) + ->method('getUrl') + ->with($url['path'], $url['params']) + ->willReturn($expected); + + $result = $this->viewModel->getUrl($url['path'], $scope, $store); + + $this->assertSame($expected, $result); + } + + /** + * Providing a non scoped urls + * + * @return array + */ + public function nonScopedUrlsDataProvider(): array + { + return [ + [ + [ + 'path' => 'test/view', + 'params' => [ + '_current' => false, + '_nosid' => true + ] + ], + 'http://domain.com/test/view/', + 'en' + ] + ]; + } + + /** + * Testing url builder with a scope provided + * + * @dataProvider scopedUrlsDataProvider + * + * @param string $storeCode + * @param string $defaultStoreCode + * @param array $urlParams + * @param string $scope + */ + public function testScopedUrlBuilder( + string $storeCode, + string $defaultStoreCode, + array $urlParams, + string $scope = 'store' + ) { + /** @var StoreInterface|MockObject $storeMock */ + $storeMock = $this->createMock(StoreInterface::class); + $storeMock->expects($this->any()) + ->method('getCode') + ->willReturn($defaultStoreCode); + $this->storeManagerMock->expects($this->once()) + ->method('getDefaultStoreView') + ->willReturn($storeMock); + + $this->frontendUrlBuilderMock->expects($this->any()) + ->method('getUrl') + ->withConsecutive( + [ + 'test/index', + [ + '_current' => false, + '_nosid' => true, + '_query' => [ + StoreManagerInterface::PARAM_NAME => $storeCode + ] + ] + ], [ + 'stores/store/switch', + $urlParams + ] + ) + ->willReturnOnConsecutiveCalls( + 'http://domain.com/test', + 'http://domain.com/test/index' + ); + + $result = $this->viewModel->getUrl('test/index', $scope, $storeCode); + + $this->assertSame('http://domain.com/test/index', $result); + } + + /** + * Providing a scoped urls + * + * @return array + */ + public function scopedUrlsDataProvider(): array + { + $enStoreCode = 'en'; + $frStoreCode = 'fr'; + $scopedDefaultUrlParams = $defaultUrlParams = [ + '_current' => false, + '_nosid' => true, + '_query' => [ + '___store' => $enStoreCode, + 'uenc' => null, + ] + ]; + $scopedDefaultUrlParams['_query']['___from_store'] = $frStoreCode; + + return [ + [ + $enStoreCode, + $enStoreCode, + $defaultUrlParams, + ], + [ + $enStoreCode, + $frStoreCode, + $scopedDefaultUrlParams + ] + ]; + } +} From 59d6c757bf6a010ebb7fdd12af9650ea937be417 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Mon, 16 Dec 2019 20:36:41 +0200 Subject: [PATCH 570/595] Small adjustments --- .../Cms/Test/Unit/ViewModel/Page/Grid/UrlBuilderTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Cms/Test/Unit/ViewModel/Page/Grid/UrlBuilderTest.php b/app/code/Magento/Cms/Test/Unit/ViewModel/Page/Grid/UrlBuilderTest.php index c75f86b7e5ffb..fbb2fb1eb65c5 100644 --- a/app/code/Magento/Cms/Test/Unit/ViewModel/Page/Grid/UrlBuilderTest.php +++ b/app/code/Magento/Cms/Test/Unit/ViewModel/Page/Grid/UrlBuilderTest.php @@ -17,6 +17,8 @@ /** * Class UrlBuilderTest + * + * Testing the UrlBuilder */ class UrlBuilderTest extends TestCase { @@ -141,7 +143,8 @@ public function testScopedUrlBuilder( StoreManagerInterface::PARAM_NAME => $storeCode ] ] - ], [ + ], + [ 'stores/store/switch', $urlParams ] From 193bce2eeacbb6b93be55007a8880c53accd94ae Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Mon, 16 Dec 2019 15:22:34 -0600 Subject: [PATCH 571/595] Change action groups name according to CE branch changes --- .../Test/Mftf/ActionGroup/AdminCreateStoreViewActionGroup.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewActionGroup.xml index 7df225368779b..108b8014bf127 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewActionGroup.xml @@ -30,7 +30,6 @@ <waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForModal"/> <see selector="{{AdminConfirmationModalSection.title}}" userInput="Warning message" stepKey="seeWarningAboutTakingALongTimeToComplete"/> <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmModal"/> - <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForPageReload"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You saved the store view." stepKey="seeSavedMessage"/> + <waitForText selector="{{AdminMessagesSection.success}}" userInput="You saved the store view." stepKey="seeSavedMessage"/> </actionGroup> </actionGroups> From 8258a162a4629d0ae00ed8c36adff846cb99fd89 Mon Sep 17 00:00:00 2001 From: Oleksandr Miroshnichenko <omiroshnichenko@magento.com> Date: Mon, 16 Dec 2019 15:25:24 -0600 Subject: [PATCH 572/595] add missed dependency on jquery ui core module --- app/code/Magento/Ui/view/base/web/js/modal/modal.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Ui/view/base/web/js/modal/modal.js b/app/code/Magento/Ui/view/base/web/js/modal/modal.js index cefe79b42e503..bcbb2f3c31dbd 100644 --- a/app/code/Magento/Ui/view/base/web/js/modal/modal.js +++ b/app/code/Magento/Ui/view/base/web/js/modal/modal.js @@ -15,6 +15,7 @@ define([ 'text!ui/template/modal/modal-custom.html', 'Magento_Ui/js/lib/key-codes', 'jquery-ui-modules/widget', + 'jquery-ui-modules/core', 'mage/translate' ], function ($, _, template, popupTpl, slideTpl, customTpl, keyCodes) { 'use strict'; From b6819dc9a5440e9f75dc980bf9bc1645a10ca3ed Mon Sep 17 00:00:00 2001 From: Viktor Tymchynskyi <vtymchynskyi@magento.com> Date: Mon, 16 Dec 2019 15:28:21 -0600 Subject: [PATCH 573/595] MC-25203: Introduce PHPStan code analysis tool to the static build --- composer.json | 4 +- composer.lock | 554 +++++++++++------- .../Design/Theme/Edit/Tab/GeneralTest.php | 2 +- .../Formatters/FilteredErrorFormatter.php | 142 +++++ .../framework/Magento/PhpStan/autoload.php | 34 ++ .../CodingStandard/Tool/PhpStan.php | 108 ++++ dev/tests/static/framework/bootstrap.php | 4 +- .../Formatters/FilteredErrorFormatterTest.php | 143 +++++ .../Fixtures/ClassWithIgnoreAnnotation.php | 44 ++ .../Fixtures/ClassWithoutIgnoreAnnotation.php | 33 ++ .../ClassAnnotationStructureSniffTest.php | 9 +- .../MethodAnnotationStructureSniffTest.php | 6 +- .../Magento/Test/Php/LiveCodeTest.php | 36 ++ .../Php/_files/phpstan/blacklist/common.txt | 14 + .../Test/Php/_files/phpstan/phpstan.neon | 38 ++ .../Framework/EntityManager/TypeResolver.php | 6 +- .../Test/Unit/Config/ConfigTest.php | 90 +-- .../Unit/Autoloader/FactoryGenerator.php | 3 + 18 files changed, 988 insertions(+), 282 deletions(-) create mode 100644 dev/tests/static/framework/Magento/PhpStan/Formatters/FilteredErrorFormatter.php create mode 100644 dev/tests/static/framework/Magento/PhpStan/autoload.php create mode 100644 dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/PhpStan.php create mode 100644 dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/FilteredErrorFormatterTest.php create mode 100644 dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/Fixtures/ClassWithIgnoreAnnotation.php create mode 100644 dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/Fixtures/ClassWithoutIgnoreAnnotation.php create mode 100644 dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/blacklist/common.txt create mode 100644 dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon diff --git a/composer.json b/composer.json index 4e78f54942576..59737c298b720 100644 --- a/composer.json +++ b/composer.json @@ -92,6 +92,7 @@ "pdepend/pdepend": "2.5.2", "phpcompatibility/php-compatibility": "^9.3", "phpmd/phpmd": "@stable", + "phpstan/phpstan": "^0.12.2", "phpunit/phpunit": "~6.5.0", "sebastian/phpcpd": "~3.0.0", "squizlabs/php_codesniffer": "~3.4.0" @@ -341,7 +342,8 @@ "Magento\\Tools\\": "dev/tools/Magento/Tools/", "Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/", "Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/", - "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/" + "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/", + "Magento\\PhpStan\\": "dev/tests/static/framework/Magento/PhpStan/" } }, "prefer-stable": true diff --git a/composer.lock b/composer.lock index ba126b3eabefc..8391dd2f48518 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e3ad90186a7742707e4c12cda2580b35", + "content-hash": "7effdb746287f89357497d7bc2ed1bf4", "packages": [ { "name": "braintree/braintree_php", @@ -201,16 +201,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.2.4", + "version": "1.2.5", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "10bb96592168a0f8e8f6dcde3532d9fa50b0b527" + "reference": "62e8fc2dc550e5d6d8c9360c7721662670f58149" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/10bb96592168a0f8e8f6dcde3532d9fa50b0b527", - "reference": "10bb96592168a0f8e8f6dcde3532d9fa50b0b527", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/62e8fc2dc550e5d6d8c9360c7721662670f58149", + "reference": "62e8fc2dc550e5d6d8c9360c7721662670f58149", "shasum": "" }, "require": { @@ -221,7 +221,7 @@ "require-dev": { "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8", "psr/log": "^1.0", - "symfony/process": "^2.5 || ^3.0 || ^4.0" + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" }, "type": "library", "extra": { @@ -253,7 +253,7 @@ "ssl", "tls" ], - "time": "2019-08-30T08:44:50+00:00" + "time": "2019-12-11T14:44:42+00:00" }, { "name": "composer/composer", @@ -595,16 +595,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.4.1", + "version": "6.5.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "0895c932405407fd3a7368b6910c09a24d26db11" + "reference": "dbc2bc3a293ed6b1ae08a3651e2bfd213d19b6a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/0895c932405407fd3a7368b6910c09a24d26db11", - "reference": "0895c932405407fd3a7368b6910c09a24d26db11", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/dbc2bc3a293ed6b1ae08a3651e2bfd213d19b6a5", + "reference": "dbc2bc3a293ed6b1ae08a3651e2bfd213d19b6a5", "shasum": "" }, "require": { @@ -619,12 +619,13 @@ "psr/log": "^1.1" }, "suggest": { + "ext-intl": "Required for Internationalized Domain Name (IDN) support", "psr/log": "Required for using the Log middleware" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.3-dev" + "dev-master": "6.5-dev" } }, "autoload": { @@ -657,7 +658,7 @@ "rest", "web service" ], - "time": "2019-10-23T15:58:00+00:00" + "time": "2019-12-07T18:20:45+00:00" }, { "name": "guzzlehttp/promises", @@ -1065,16 +1066,16 @@ }, { "name": "magento/zendframework1", - "version": "1.14.2", + "version": "1.14.3", "source": { "type": "git", "url": "https://github.com/magento/zf1.git", - "reference": "8221062d42a198e431d183bbe672e5e1a2f98c5f" + "reference": "726855dfb080089dc7bc7b016624129f8e7bc4e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/zf1/zipball/8221062d42a198e431d183bbe672e5e1a2f98c5f", - "reference": "8221062d42a198e431d183bbe672e5e1a2f98c5f", + "url": "https://api.github.com/repos/magento/zf1/zipball/726855dfb080089dc7bc7b016624129f8e7bc4e5", + "reference": "726855dfb080089dc7bc7b016624129f8e7bc4e5", "shasum": "" }, "require": { @@ -1108,7 +1109,7 @@ "ZF1", "framework" ], - "time": "2019-07-26T16:43:11+00:00" + "time": "2019-11-26T15:09:40+00:00" }, { "name": "monolog/monolog", @@ -2083,16 +2084,16 @@ }, { "name": "symfony/css-selector", - "version": "v4.3.8", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "f4b3ff6a549d9ed28b2b0ecd1781bf67cf220ee9" + "reference": "64acec7e0d67125e9f4656c68d4a38a42ab5a0b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/f4b3ff6a549d9ed28b2b0ecd1781bf67cf220ee9", - "reference": "f4b3ff6a549d9ed28b2b0ecd1781bf67cf220ee9", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/64acec7e0d67125e9f4656c68d4a38a42ab5a0b7", + "reference": "64acec7e0d67125e9f4656c68d4a38a42ab5a0b7", "shasum": "" }, "require": { @@ -2101,7 +2102,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -2132,20 +2133,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2019-10-02T08:36:26+00:00" + "time": "2019-10-12T00:35:04+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.3.8", + "version": "v4.3.9", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "0df002fd4f500392eabd243c2947061a50937287" + "reference": "87a1ae7480f2020818013605a65776b9033bcc4f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/0df002fd4f500392eabd243c2947061a50937287", - "reference": "0df002fd4f500392eabd243c2947061a50937287", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/87a1ae7480f2020818013605a65776b9033bcc4f", + "reference": "87a1ae7480f2020818013605a65776b9033bcc4f", "shasum": "" }, "require": { @@ -2202,7 +2203,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2019-11-03T09:04:05+00:00" + "time": "2019-11-28T13:25:45+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -2264,16 +2265,16 @@ }, { "name": "symfony/filesystem", - "version": "v4.3.8", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "9abbb7ef96a51f4d7e69627bc6f63307994e4263" + "reference": "40c2606131d56eff6f193b6e2ceb92414653b591" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/9abbb7ef96a51f4d7e69627bc6f63307994e4263", - "reference": "9abbb7ef96a51f4d7e69627bc6f63307994e4263", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/40c2606131d56eff6f193b6e2ceb92414653b591", + "reference": "40c2606131d56eff6f193b6e2ceb92414653b591", "shasum": "" }, "require": { @@ -2283,7 +2284,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -2310,20 +2311,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2019-08-20T14:07:54+00:00" + "time": "2019-11-26T23:16:41+00:00" }, { "name": "symfony/finder", - "version": "v4.3.8", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "72a068f77e317ae77c0a0495236ad292cfb5ce6f" + "reference": "ce8743441da64c41e2a667b8eb66070444ed911e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/72a068f77e317ae77c0a0495236ad292cfb5ce6f", - "reference": "72a068f77e317ae77c0a0495236ad292cfb5ce6f", + "url": "https://api.github.com/repos/symfony/finder/zipball/ce8743441da64c41e2a667b8eb66070444ed911e", + "reference": "ce8743441da64c41e2a667b8eb66070444ed911e", "shasum": "" }, "require": { @@ -2332,7 +2333,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -2359,20 +2360,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2019-10-30T12:53:54+00:00" + "time": "2019-11-17T21:56:56+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", "shasum": "" }, "require": { @@ -2384,7 +2385,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -2417,20 +2418,20 @@ "polyfill", "portable" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17" + "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f", + "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f", "shasum": "" }, "require": { @@ -2442,7 +2443,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -2476,20 +2477,20 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T14:18:11+00:00" }, { "name": "symfony/process", - "version": "v4.3.8", + "version": "v4.3.9", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "3b2e0cb029afbb0395034509291f21191d1a4db0" + "reference": "207dab1f17d34ad71ea72e9741ab8049a9d8251b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/3b2e0cb029afbb0395034509291f21191d1a4db0", - "reference": "3b2e0cb029afbb0395034509291f21191d1a4db0", + "url": "https://api.github.com/repos/symfony/process/zipball/207dab1f17d34ad71ea72e9741ab8049a9d8251b", + "reference": "207dab1f17d34ad71ea72e9741ab8049a9d8251b", "shasum": "" }, "require": { @@ -2525,7 +2526,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2019-10-28T17:07:32+00:00" + "time": "2019-11-28T10:05:26+00:00" }, { "name": "tedivm/jshrink", @@ -3529,16 +3530,16 @@ }, { "name": "zendframework/zend-http", - "version": "2.10.0", + "version": "2.11.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-http.git", - "reference": "4b4983178693a8fdda53b0bbee58552e2d2b1ac0" + "reference": "76000da8490b8685d63ff6f6ff8eefa459f6e9e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-http/zipball/4b4983178693a8fdda53b0bbee58552e2d2b1ac0", - "reference": "4b4983178693a8fdda53b0bbee58552e2d2b1ac0", + "url": "https://api.github.com/repos/zendframework/zend-http/zipball/76000da8490b8685d63ff6f6ff8eefa459f6e9e7", + "reference": "76000da8490b8685d63ff6f6ff8eefa459f6e9e7", "shasum": "" }, "require": { @@ -3559,8 +3560,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.10.x-dev", - "dev-develop": "2.11.x-dev" + "dev-master": "2.11.x-dev", + "dev-develop": "2.12.x-dev" } }, "autoload": { @@ -3580,7 +3581,7 @@ "zend", "zf" ], - "time": "2019-02-19T18:58:14+00:00" + "time": "2019-12-04T23:02:34+00:00" }, { "name": "zendframework/zend-hydrator", @@ -3644,22 +3645,26 @@ }, { "name": "zendframework/zend-i18n", - "version": "2.9.2", + "version": "2.10.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-i18n.git", - "reference": "e17a54b3aee333ab156958f570cde630acee8b07" + "reference": "84038e6a1838b611dcc491b1c40321fa4c3a123c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-i18n/zipball/e17a54b3aee333ab156958f570cde630acee8b07", - "reference": "e17a54b3aee333ab156958f570cde630acee8b07", + "url": "https://api.github.com/repos/zendframework/zend-i18n/zipball/84038e6a1838b611dcc491b1c40321fa4c3a123c", + "reference": "84038e6a1838b611dcc491b1c40321fa4c3a123c", "shasum": "" }, "require": { + "ext-intl": "*", "php": "^5.6 || ^7.0", "zendframework/zend-stdlib": "^2.7 || ^3.0" }, + "conflict": { + "phpspec/prophecy": "<1.9.0" + }, "require-dev": { "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.16", "zendframework/zend-cache": "^2.6.1", @@ -3672,7 +3677,6 @@ "zendframework/zend-view": "^2.6.3" }, "suggest": { - "ext-intl": "Required for most features of Zend\\I18n; included in default builds of PHP", "zendframework/zend-cache": "Zend\\Cache component", "zendframework/zend-config": "Zend\\Config component", "zendframework/zend-eventmanager": "You should install this package to use the events in the translator", @@ -3685,8 +3689,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.9.x-dev", - "dev-develop": "2.10.x-dev" + "dev-master": "2.10.x-dev", + "dev-develop": "2.11.x-dev" }, "zf": { "component": "Zend\\I18n", @@ -3708,7 +3712,7 @@ "i18n", "zf" ], - "time": "2019-09-30T12:04:37+00:00" + "time": "2019-12-12T14:08:22+00:00" }, { "name": "zendframework/zend-inputfilter", @@ -4794,16 +4798,16 @@ }, { "name": "zendframework/zend-view", - "version": "2.11.3", + "version": "2.11.4", "source": { "type": "git", "url": "https://github.com/zendframework/zend-view.git", - "reference": "e766457bd6ce13c5354e443bb949511b6904d7f5" + "reference": "a8b1b2d9b52e191539be861a6529f8c8a0c06b9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-view/zipball/e766457bd6ce13c5354e443bb949511b6904d7f5", - "reference": "e766457bd6ce13c5354e443bb949511b6904d7f5", + "url": "https://api.github.com/repos/zendframework/zend-view/zipball/a8b1b2d9b52e191539be861a6529f8c8a0c06b9d", + "reference": "a8b1b2d9b52e191539be861a6529f8c8a0c06b9d", "shasum": "" }, "require": { @@ -4877,7 +4881,7 @@ "view", "zf" ], - "time": "2019-10-11T21:10:04+00:00" + "time": "2019-12-04T08:40:50+00:00" } ], "packages-dev": [ @@ -5280,16 +5284,16 @@ }, { "name": "codeception/phpunit-wrapper", - "version": "6.7.0", + "version": "6.7.1", "source": { "type": "git", "url": "https://github.com/Codeception/phpunit-wrapper.git", - "reference": "93f59e028826464eac086052fa226e58967f6907" + "reference": "d3b611635b47a583dfaa1a9e98b98fa476d14025" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/93f59e028826464eac086052fa226e58967f6907", - "reference": "93f59e028826464eac086052fa226e58967f6907", + "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/d3b611635b47a583dfaa1a9e98b98fa476d14025", + "reference": "d3b611635b47a583dfaa1a9e98b98fa476d14025", "shasum": "" }, "require": { @@ -5322,7 +5326,7 @@ } ], "description": "PHPUnit classes used by Codeception", - "time": "2019-08-18T15:43:35+00:00" + "time": "2019-11-23T18:22:38+00:00" }, { "name": "codeception/stub", @@ -6162,16 +6166,16 @@ }, { "name": "doctrine/cache", - "version": "1.9.1", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "89a5c76c39c292f7798f964ab3c836c3f8192a55" + "reference": "382e7f4db9a12dc6c19431743a2b096041bcdd62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/89a5c76c39c292f7798f964ab3c836c3f8192a55", - "reference": "89a5c76c39c292f7798f964ab3c836c3f8192a55", + "url": "https://api.github.com/repos/doctrine/cache/zipball/382e7f4db9a12dc6c19431743a2b096041bcdd62", + "reference": "382e7f4db9a12dc6c19431743a2b096041bcdd62", "shasum": "" }, "require": { @@ -6238,10 +6242,9 @@ "memcached", "php", "redis", - "riak", "xcache" ], - "time": "2019-11-15T14:31:57+00:00" + "time": "2019-11-29T15:36:20+00:00" }, { "name": "doctrine/inflector", @@ -6620,16 +6623,16 @@ }, { "name": "fzaninotto/faker", - "version": "v1.9.0", + "version": "v1.9.1", "source": { "type": "git", "url": "https://github.com/fzaninotto/Faker.git", - "reference": "27a216cbe72327b2d6369fab721a5843be71e57d" + "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/27a216cbe72327b2d6369fab721a5843be71e57d", - "reference": "27a216cbe72327b2d6369fab721a5843be71e57d", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/fc10d778e4b84d5bd315dad194661e091d307c6f", + "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f", "shasum": "" }, "require": { @@ -6642,7 +6645,9 @@ }, "type": "library", "extra": { - "branch-alias": [] + "branch-alias": { + "dev-master": "1.9-dev" + } }, "autoload": { "psr-4": { @@ -6664,7 +6669,7 @@ "faker", "fixtures" ], - "time": "2019-11-14T13:13:06+00:00" + "time": "2019-12-12T13:22:17+00:00" }, { "name": "grasmash/expander", @@ -7030,16 +7035,16 @@ }, { "name": "league/flysystem", - "version": "1.0.57", + "version": "1.0.61", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a" + "reference": "4fb13c01784a6c9f165a351e996871488ca2d8c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a", - "reference": "0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/4fb13c01784a6c9f165a351e996871488ca2d8c9", + "reference": "4fb13c01784a6c9f165a351e996871488ca2d8c9", "shasum": "" }, "require": { @@ -7110,7 +7115,7 @@ "sftp", "storage" ], - "time": "2019-10-16T21:01:05+00:00" + "time": "2019-12-08T21:46:50+00:00" }, { "name": "lusitanian/oauth", @@ -7344,16 +7349,16 @@ }, { "name": "mustache/mustache", - "version": "v2.12.0", + "version": "v2.13.0", "source": { "type": "git", "url": "https://github.com/bobthecow/mustache.php.git", - "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e" + "reference": "e95c5a008c23d3151d59ea72484d4f72049ab7f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/fe8fe72e9d580591854de404cc59a1b83ca4d19e", - "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e", + "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/e95c5a008c23d3151d59ea72484d4f72049ab7f4", + "reference": "e95c5a008c23d3151d59ea72484d4f72049ab7f4", "shasum": "" }, "require": { @@ -7386,20 +7391,20 @@ "mustache", "templating" ], - "time": "2017-07-11T12:54:05+00:00" + "time": "2019-11-23T21:40:31+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.9.3", + "version": "1.9.4", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea" + "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/579bb7356d91f9456ccd505f24ca8b667966a0a7", + "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7", "shasum": "" }, "require": { @@ -7434,7 +7439,59 @@ "object", "object graph" ], - "time": "2019-08-09T12:45:53+00:00" + "time": "2019-12-15T19:12:40+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.3.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/9a9981c347c5c49d6dfe5cf826bb882b824080dc", + "reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "0.0.5", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.3-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2019-11-08T13:50:10+00:00" }, { "name": "pdepend/pdepend", @@ -7926,20 +7983,20 @@ "authors": [ { "name": "Manuel Pichler", - "role": "Project Founder", "email": "github@manuel-pichler.de", - "homepage": "https://github.com/manuelpichler" + "homepage": "https://github.com/manuelpichler", + "role": "Project Founder" }, { "name": "Marc Würth", - "role": "Project Maintainer", "email": "ravage@bluewin.ch", - "homepage": "https://github.com/ravage84" + "homepage": "https://github.com/ravage84", + "role": "Project Maintainer" }, { "name": "Other contributors", - "role": "Contributors", - "homepage": "https://github.com/phpmd/phpmd/graphs/contributors" + "homepage": "https://github.com/phpmd/phpmd/graphs/contributors", + "role": "Contributors" } ], "description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.", @@ -7955,33 +8012,34 @@ }, { "name": "phpoption/phpoption", - "version": "1.5.2", + "version": "1.7.2", "source": { "type": "git", "url": "https://github.com/schmittjoh/php-option.git", - "reference": "2ba2586380f8d2b44ad1b9feb61c371020b27793" + "reference": "77f7c4d2e65413aff5b5a8cc8b3caf7a28d81959" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/2ba2586380f8d2b44ad1b9feb61c371020b27793", - "reference": "2ba2586380f8d2b44ad1b9feb61c371020b27793", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/77f7c4d2e65413aff5b5a8cc8b3caf7a28d81959", + "reference": "77f7c4d2e65413aff5b5a8cc8b3caf7a28d81959", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^5.5.9 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.7|^5.0" + "bamarni/composer-bin-plugin": "^1.3", + "phpunit/phpunit": "^4.8.35 || ^5.0 || ^6.0 || ^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5-dev" + "dev-master": "1.7-dev" } }, "autoload": { - "psr-0": { - "PhpOption\\": "src/" + "psr-4": { + "PhpOption\\": "src/PhpOption/" } }, "notification-url": "https://packagist.org/downloads/", @@ -7992,6 +8050,10 @@ { "name": "Johannes M. Schmitt", "email": "schmittjoh@gmail.com" + }, + { + "name": "Graham Campbell", + "email": "graham@alt-three.com" } ], "description": "Option Type for PHP", @@ -8001,7 +8063,7 @@ "php", "type" ], - "time": "2019-11-06T22:27:00+00:00" + "time": "2019-12-15T19:35:24+00:00" }, { "name": "phpspec/prophecy", @@ -8066,6 +8128,46 @@ ], "time": "2019-10-03T11:07:50+00:00" }, + { + "name": "phpstan/phpstan", + "version": "0.12.3", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "c15a6ea55da71d8133399306f560cfe4d30301b7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c15a6ea55da71d8133399306f560cfe4d30301b7", + "reference": "c15a6ea55da71d8133399306f560cfe4d30301b7", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.3.0", + "php": "^7.1" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.12-dev" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "time": "2019-12-14T13:41:17+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "5.3.2", @@ -9254,27 +9356,27 @@ }, { "name": "symfony/browser-kit", - "version": "v4.3.8", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "b14fa08508afd152257d5dcc7adb5f278654d972" + "reference": "e19e465c055137938afd40cfddd687e7511bbbf0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/b14fa08508afd152257d5dcc7adb5f278654d972", - "reference": "b14fa08508afd152257d5dcc7adb5f278654d972", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/e19e465c055137938afd40cfddd687e7511bbbf0", + "reference": "e19e465c055137938afd40cfddd687e7511bbbf0", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/dom-crawler": "~3.4|~4.0" + "symfony/dom-crawler": "^3.4|^4.0|^5.0" }, "require-dev": { - "symfony/css-selector": "~3.4|~4.0", - "symfony/http-client": "^4.3", - "symfony/mime": "^4.3", - "symfony/process": "~3.4|~4.0" + "symfony/css-selector": "^3.4|^4.0|^5.0", + "symfony/http-client": "^4.3|^5.0", + "symfony/mime": "^4.3|^5.0", + "symfony/process": "^3.4|^4.0|^5.0" }, "suggest": { "symfony/process": "" @@ -9282,7 +9384,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -9309,36 +9411,36 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2019-10-28T17:07:32+00:00" + "time": "2019-10-28T20:30:34+00:00" }, { "name": "symfony/config", - "version": "v4.3.8", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "8267214841c44d315a55242ea867684eb43c42ce" + "reference": "7aa5817f1b7a8ed377752b90fcc47dfb3c67b40c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/8267214841c44d315a55242ea867684eb43c42ce", - "reference": "8267214841c44d315a55242ea867684eb43c42ce", + "url": "https://api.github.com/repos/symfony/config/zipball/7aa5817f1b7a8ed377752b90fcc47dfb3c67b40c", + "reference": "7aa5817f1b7a8ed377752b90fcc47dfb3c67b40c", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/filesystem": "~3.4|~4.0", + "symfony/filesystem": "^3.4|^4.0|^5.0", "symfony/polyfill-ctype": "~1.8" }, "conflict": { "symfony/finder": "<3.4" }, "require-dev": { - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~3.4|~4.0", - "symfony/finder": "~3.4|~4.0", - "symfony/messenger": "~4.1", - "symfony/yaml": "~3.4|~4.0" + "symfony/event-dispatcher": "^3.4|^4.0|^5.0", + "symfony/finder": "^3.4|^4.0|^5.0", + "symfony/messenger": "^4.1|^5.0", + "symfony/service-contracts": "^1.1|^2", + "symfony/yaml": "^3.4|^4.0|^5.0" }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" @@ -9346,7 +9448,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -9373,29 +9475,29 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2019-11-08T08:31:27+00:00" + "time": "2019-12-01T10:50:45+00:00" }, { "name": "symfony/dependency-injection", - "version": "v4.3.8", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "80c6d9e19467dfbba14f830ed478eb592ce51b64" + "reference": "ad46a4def1325befab696b49c839dffea3fc92bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/80c6d9e19467dfbba14f830ed478eb592ce51b64", - "reference": "80c6d9e19467dfbba14f830ed478eb592ce51b64", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/ad46a4def1325befab696b49c839dffea3fc92bd", + "reference": "ad46a4def1325befab696b49c839dffea3fc92bd", "shasum": "" }, "require": { "php": "^7.1.3", "psr/container": "^1.0", - "symfony/service-contracts": "^1.1.6" + "symfony/service-contracts": "^1.1.6|^2" }, "conflict": { - "symfony/config": "<4.3", + "symfony/config": "<4.3|>=5.0", "symfony/finder": "<3.4", "symfony/proxy-manager-bridge": "<3.4", "symfony/yaml": "<3.4" @@ -9406,8 +9508,8 @@ }, "require-dev": { "symfony/config": "^4.3", - "symfony/expression-language": "~3.4|~4.0", - "symfony/yaml": "~3.4|~4.0" + "symfony/expression-language": "^3.4|^4.0|^5.0", + "symfony/yaml": "^3.4|^4.0|^5.0" }, "suggest": { "symfony/config": "", @@ -9419,7 +9521,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -9446,20 +9548,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2019-11-08T16:22:27+00:00" + "time": "2019-12-01T10:19:36+00:00" }, { "name": "symfony/dom-crawler", - "version": "v4.3.8", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "4b9efd5708c3a38593e19b6a33e40867f4f89d72" + "reference": "36bbcab9369fc2f583220890efd43bf262d563fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/4b9efd5708c3a38593e19b6a33e40867f4f89d72", - "reference": "4b9efd5708c3a38593e19b6a33e40867f4f89d72", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/36bbcab9369fc2f583220890efd43bf262d563fd", + "reference": "36bbcab9369fc2f583220890efd43bf262d563fd", "shasum": "" }, "require": { @@ -9472,7 +9574,7 @@ }, "require-dev": { "masterminds/html5": "^2.6", - "symfony/css-selector": "~3.4|~4.0" + "symfony/css-selector": "^3.4|^4.0|^5.0" }, "suggest": { "symfony/css-selector": "" @@ -9480,7 +9582,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -9507,7 +9609,7 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2019-10-28T17:07:32+00:00" + "time": "2019-10-29T11:38:30+00:00" }, { "name": "symfony/http-foundation", @@ -9566,16 +9668,16 @@ }, { "name": "symfony/options-resolver", - "version": "v4.3.8", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "f46c7fc8e207bd8a2188f54f8738f232533765a4" + "reference": "2be23e63f33de16b49294ea6581f462932a77e2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/f46c7fc8e207bd8a2188f54f8738f232533765a4", - "reference": "f46c7fc8e207bd8a2188f54f8738f232533765a4", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/2be23e63f33de16b49294ea6581f462932a77e2f", + "reference": "2be23e63f33de16b49294ea6581f462932a77e2f", "shasum": "" }, "require": { @@ -9584,7 +9686,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -9616,20 +9718,20 @@ "configuration", "options" ], - "time": "2019-10-28T20:59:01+00:00" + "time": "2019-10-28T21:57:16+00:00" }, { "name": "symfony/polyfill-php54", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php54.git", - "reference": "a043bcced870214922fbb4bf22679d431ec0296a" + "reference": "dd1618047426412036e98d159940d58a81fc392c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/a043bcced870214922fbb4bf22679d431ec0296a", - "reference": "a043bcced870214922fbb4bf22679d431ec0296a", + "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/dd1618047426412036e98d159940d58a81fc392c", + "reference": "dd1618047426412036e98d159940d58a81fc392c", "shasum": "" }, "require": { @@ -9638,7 +9740,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -9674,20 +9776,20 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "symfony/polyfill-php55", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php55.git", - "reference": "548bb39407e78e54f785b4e18c7e0d5d9e493265" + "reference": "b0d838f225725e2951af1aafc784d2e5ea7b656e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/548bb39407e78e54f785b4e18c7e0d5d9e493265", - "reference": "548bb39407e78e54f785b4e18c7e0d5d9e493265", + "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/b0d838f225725e2951af1aafc784d2e5ea7b656e", + "reference": "b0d838f225725e2951af1aafc784d2e5ea7b656e", "shasum": "" }, "require": { @@ -9697,7 +9799,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -9730,20 +9832,20 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "symfony/polyfill-php70", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "54b4c428a0054e254223797d2713c31e08610831" + "reference": "af23c7bb26a73b850840823662dda371484926c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/54b4c428a0054e254223797d2713c31e08610831", - "reference": "54b4c428a0054e254223797d2713c31e08610831", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/af23c7bb26a73b850840823662dda371484926c4", + "reference": "af23c7bb26a73b850840823662dda371484926c4", "shasum": "" }, "require": { @@ -9753,7 +9855,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -9789,20 +9891,20 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.12.0", + "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "04ce3335667451138df4307d6a9b61565560199e" + "reference": "66fea50f6cb37a35eea048d75a7d99a45b586038" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/04ce3335667451138df4307d6a9b61565560199e", - "reference": "04ce3335667451138df4307d6a9b61565560199e", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/66fea50f6cb37a35eea048d75a7d99a45b586038", + "reference": "66fea50f6cb37a35eea048d75a7d99a45b586038", "shasum": "" }, "require": { @@ -9811,7 +9913,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { @@ -9844,24 +9946,24 @@ "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T13:56:44+00:00" }, { "name": "symfony/service-contracts", - "version": "v1.1.8", + "version": "v2.0.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf" + "reference": "144c5e51266b281231e947b51223ba14acf1a749" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ffc7f5692092df31515df2a5ecf3b7302b3ddacf", - "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", + "reference": "144c5e51266b281231e947b51223ba14acf1a749", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^7.2.5", "psr/container": "^1.0" }, "suggest": { @@ -9870,7 +9972,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -9902,30 +10004,30 @@ "interoperability", "standards" ], - "time": "2019-10-14T12:27:06+00:00" + "time": "2019-11-18T17:27:11+00:00" }, { "name": "symfony/stopwatch", - "version": "v4.3.8", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "e96c259de6abcd0cead71f0bf4d730d53ee464d0" + "reference": "5745b514fc56ae1907c6b8ed74f94f90f64694e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/e96c259de6abcd0cead71f0bf4d730d53ee464d0", - "reference": "e96c259de6abcd0cead71f0bf4d730d53ee464d0", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5745b514fc56ae1907c6b8ed74f94f90f64694e9", + "reference": "5745b514fc56ae1907c6b8ed74f94f90f64694e9", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/service-contracts": "^1.0" + "symfony/service-contracts": "^1.0|^2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -9952,20 +10054,20 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2019-11-05T14:48:09+00:00" + "time": "2019-11-05T16:11:08+00:00" }, { "name": "symfony/yaml", - "version": "v4.3.8", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "324cf4b19c345465fad14f3602050519e09e361d" + "reference": "76de473358fe802578a415d5bb43c296cf09d211" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/324cf4b19c345465fad14f3602050519e09e361d", - "reference": "324cf4b19c345465fad14f3602050519e09e361d", + "url": "https://api.github.com/repos/symfony/yaml/zipball/76de473358fe802578a415d5bb43c296cf09d211", + "reference": "76de473358fe802578a415d5bb43c296cf09d211", "shasum": "" }, "require": { @@ -9976,7 +10078,7 @@ "symfony/console": "<3.4" }, "require-dev": { - "symfony/console": "~3.4|~4.0" + "symfony/console": "^3.4|^4.0|^5.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" @@ -9984,7 +10086,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -10011,7 +10113,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-10-30T12:58:49+00:00" + "time": "2019-11-12T14:51:11+00:00" }, { "name": "theseer/fdomdocument", @@ -10146,31 +10248,29 @@ }, { "name": "webmozart/assert", - "version": "1.5.0", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4" + "reference": "573381c0a64f155a0d9a23f4b0c797194805b925" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4", + "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925", + "reference": "573381c0a64f155a0d9a23f4b0c797194805b925", "shasum": "" }, "require": { "php": "^5.3.3 || ^7.0", "symfony/polyfill-ctype": "^1.8" }, + "conflict": { + "vimeo/psalm": "<3.6.0" + }, "require-dev": { "phpunit/phpunit": "^4.8.36 || ^7.5.13" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -10192,7 +10292,7 @@ "check", "validate" ], - "time": "2019-08-24T08:43:50+00:00" + "time": "2019-11-24T13:36:37+00:00" }, { "name": "weew/helpers-array", diff --git a/dev/tests/integration/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/GeneralTest.php b/dev/tests/integration/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/GeneralTest.php index 2539011f25a36..2613b71c24202 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/GeneralTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/GeneralTest.php @@ -16,7 +16,7 @@ class GeneralTest extends \PHPUnit\Framework\TestCase /** @var \Magento\Framework\View\Design\ThemeInterface */ protected $_theme; - /** @var \Magento\Theme\Block\Adminhtml\System\Design\Theme\Edit\Tab_General */ + /** @var \Magento\Theme\Block\Adminhtml\System\Design\Theme\Edit\Tab\General */ protected $_block; protected function setUp() diff --git a/dev/tests/static/framework/Magento/PhpStan/Formatters/FilteredErrorFormatter.php b/dev/tests/static/framework/Magento/PhpStan/Formatters/FilteredErrorFormatter.php new file mode 100644 index 0000000000000..b3a4bd9ae0791 --- /dev/null +++ b/dev/tests/static/framework/Magento/PhpStan/Formatters/FilteredErrorFormatter.php @@ -0,0 +1,142 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\PhpStan\Formatters; + +use PHPStan\Command\AnalysisResult; +use PHPStan\Command\ErrorFormatter\TableErrorFormatter; +use PHPStan\Command\Output; + +/** + * To mute the PHPStan error message add a comment above the reported error line. + * + * Example of usage: + * + * // phpstan:ignore "Method Magento\TestModule\TestClass::testMethod() invoked with 1 parameter, 0 required." + * $this->testMethod(1); + * + * or replace some part of error message with * + * + * // phpstan:ignore "Method * invoked with 1 parameter, 0 required." + * $this->testMethod(1); + * + * or just + * + * // phpstan:ignore + * $this->testMethod(1); + * + * or + * + * $this->testMethod(1); // phpstan:ignore + * + * The error message will be suppressed. + * + * @see \Magento\PhpStan\Formatters\Fixtures\ClassWithIgnoreAnnotation + */ +class FilteredErrorFormatter extends TableErrorFormatter +{ + private const MUTE_ERROR_ANNOTATION = 'phpstan:ignore'; + + private const NO_ERRORS = 0; + + /** + * @inheritdoc + */ + public function formatErrors(AnalysisResult $analysisResult, Output $output): int + { + if (!$analysisResult->hasErrors()) { + $style = $output->getStyle(); + $style->success('No errors'); + return self::NO_ERRORS; + } + + $fileSpecificErrorsWithoutIgnoredErrors = $this->clearIgnoredErrors( + $analysisResult->getFileSpecificErrors() + ); + + $clearedAnalysisResult = new AnalysisResult( + $fileSpecificErrorsWithoutIgnoredErrors, + $analysisResult->getNotFileSpecificErrors(), + $analysisResult->isDefaultLevelUsed(), + $analysisResult->hasInferrablePropertyTypesFromConstructor(), + $analysisResult->getProjectConfigFile() + ); + + return parent::formatErrors($clearedAnalysisResult, $output); + } + + /** + * Filters error list. + * + * @param array $fileSpecificErrors + * @return array + */ + private function clearIgnoredErrors(array $fileSpecificErrors): array + { + foreach ($fileSpecificErrors as $index => $error) { + $fileName = $error->getFile(); + // phpcs:ignore Magento2.Functions.DiscouragedFunction + if (!file_exists($fileName)) { + continue; + } + + $line = $error->getLine() ? $this->getLineWithMuteErrorAnnotation($error->getLine(), $fileName) : null; + if ($line === null) { + continue; + } + + $extractErrorPattern = '@' . self::MUTE_ERROR_ANNOTATION . '\s+"(.*?)"@'; + $errorPattern = preg_match($extractErrorPattern, $line, $result) ? $this->preparePattern($result[1]) : ''; + if ($errorPattern && !preg_match('@' . $errorPattern . '@i', $error->getMessage())) { + continue; + } + + unset($fileSpecificErrors[$index]); + } + + return $fileSpecificErrors; + } + + /** + * Returns context of the line with mute error annotation. + * + * @param int $errorLine + * @param string $fileName + * @return string|null + */ + private function getLineWithMuteErrorAnnotation(int $errorLine, string $fileName): ?string + { + $file = new \SplFileObject($fileName); + $lineNumbersToCheck = [ + $errorLine - 2, // the line above to the line that caused the error + $errorLine - 1, // the line that caused the error + $errorLine - 3, // the line two lines above to the line that caused the error + ]; + + foreach ($lineNumbersToCheck as $lineNumber) { + $file->seek($lineNumber > 0 ? $lineNumber : 0); + $line = $file->current(); + if (strpos($line, self::MUTE_ERROR_ANNOTATION) !== false) { + return $line; + } + } + + return null; + } + + /** + * Prepares error pattern. + * + * @param string $errorDescription + * @return string + */ + private function preparePattern(string $errorDescription) + { + // phpcs:ignore Magento2.Functions.DiscouragedFunction + return str_replace('*', '(?:.*?)', addcslashes(trim($errorDescription), '\()[]')); + } +} diff --git a/dev/tests/static/framework/Magento/PhpStan/autoload.php b/dev/tests/static/framework/Magento/PhpStan/autoload.php new file mode 100644 index 0000000000000..baf44b2381759 --- /dev/null +++ b/dev/tests/static/framework/Magento/PhpStan/autoload.php @@ -0,0 +1,34 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +// phpcs:disable + +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Code\Generator\Io; +use Magento\Framework\Filesystem\Driver\File; +use Magento\Framework\TestFramework\Unit\Autoloader\ExtensionAttributesGenerator; +use Magento\Framework\TestFramework\Unit\Autoloader\ExtensionAttributesInterfaceGenerator; +use Magento\Framework\TestFramework\Unit\Autoloader\FactoryGenerator; +use Magento\Framework\TestFramework\Unit\Autoloader\GeneratedClassesAutoloader; + +if (!defined('TESTS_TEMP_DIR')) { + //phpcs:ignore Magento2.Functions.DiscouragedFunction + define('TESTS_TEMP_DIR', dirname(__DIR__) . '/../../tmp'); +} + +$generatorIo = new Io( + new File(), + TESTS_TEMP_DIR . '/' . DirectoryList::getDefaultConfig()[DirectoryList::GENERATED_CODE][DirectoryList::PATH] +); +$generatedCodeAutoloader = new GeneratedClassesAutoloader( + [ + new ExtensionAttributesGenerator(), + new ExtensionAttributesInterfaceGenerator(), + new FactoryGenerator(), + ], + $generatorIo +); +spl_autoload_register([$generatedCodeAutoloader, 'load']); diff --git a/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/PhpStan.php b/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/PhpStan.php new file mode 100644 index 0000000000000..9048262722d48 --- /dev/null +++ b/dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/PhpStan.php @@ -0,0 +1,108 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\TestFramework\CodingStandard\Tool; + +use Magento\TestFramework\CodingStandard\ToolInterface; + +/** + * PhpStan tool wrapper. + */ +class PhpStan implements ToolInterface +{ + /** + * Rule level to be used. + * + * @see https://github.com/phpstan/phpstan#rule-levels + */ + private const RULE_LEVEL = 0; + + /** + * Memory limit required by PHPStan for full Magento project scan. + */ + private const MEMORY_LIMIT = '4G'; + + /** + * Error formatter to be used. + * + * @see https://github.com/phpstan/phpstan#existing-error-formatters-to-be-used + */ + private const ERROR_FORMAT = 'filtered'; + + /** + * Report file. + * + * @var string + */ + private $reportFile; + + /** + * PHPStan configuration file in neon format. + * + * @var string + */ + private $confFile; + + /** + * @param string $confFile + * @param string $reportFile + */ + public function __construct(string $confFile, string $reportFile) + { + $this->reportFile = $reportFile; + $this->confFile = $confFile; + } + + /** + * @inheritdoc + * @SuppressWarnings(PHPMD.UnusedLocalVariable) + */ + public function canRun(): bool + { + // phpcs:disable Magento2.Security.InsecureFunction + exec($this->getCommand() . ' --version', $output, $exitCode); + return $exitCode === 0; + } + + /** + * @inheritdoc + * @SuppressWarnings(PHPMD.UnusedLocalVariable) + */ + public function run(array $whiteList): int + { + if (empty($whiteList)) { + return 0; + } + + $command = $this->getCommand() . ' analyse' . + ' --level ' . self::RULE_LEVEL . + ' --no-progress' . + ' --error-format=' . self::ERROR_FORMAT . + ' --memory-limit=' . self::MEMORY_LIMIT . + // phpcs:ignore Magento2.Functions.DiscouragedFunction + ' --configuration ' . escapeshellarg($this->confFile) . + ' ' . implode(' ', $whiteList) . + ' > ' . $this->reportFile; + + // phpcs:disable Magento2.Security.InsecureFunction + exec($command, $output, $exitCode); + + return $exitCode; + } + + /** + * Get PHPStan CLI command + * + * @return string + */ + private function getCommand(): string + { + // phpcs:ignore Magento2.Security.IncludeFile + $vendorDir = require BP . '/app/etc/vendor_path.php'; + return 'php ' . BP . '/' . $vendorDir . '/bin/phpstan'; + } +} diff --git a/dev/tests/static/framework/bootstrap.php b/dev/tests/static/framework/bootstrap.php index 5e3336ebc28de..e43337cf06026 100644 --- a/dev/tests/static/framework/bootstrap.php +++ b/dev/tests/static/framework/bootstrap.php @@ -4,6 +4,8 @@ * See COPYING.txt for license details. */ +// phpcs:disable + use Magento\Framework\App\Utility\Files; use Magento\Framework\Component\ComponentRegistrar; use Magento\Framework\Component\DirSearch; @@ -15,7 +17,7 @@ require __DIR__ . '/autoload.php'; if (!defined('TESTS_TEMP_DIR')) { - define('TESTS_TEMP_DIR', __DIR__ . DIRECTORY_SEPARATOR . 'tmp'); + define('TESTS_TEMP_DIR', dirname(__DIR__) . '/tmp'); } setCustomErrorHandler(); diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/FilteredErrorFormatterTest.php b/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/FilteredErrorFormatterTest.php new file mode 100644 index 0000000000000..dfedd625fdb0e --- /dev/null +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/FilteredErrorFormatterTest.php @@ -0,0 +1,143 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types = 1); + +namespace Magento\PhpStan\Formatters; + +use PHPStan\Analyser\Error; +use PHPStan\Command\AnalysisResult; +use PHPStan\File\FuzzyRelativePathHelper; +use PHPStan\ShouldNotHappenException; +use PHPStan\Testing\ErrorFormatterTestCase; + +/** + * Tests filter error formatter. + */ +class FilteredErrorFormatterTest extends ErrorFormatterTestCase +{ + protected const DIRECTORY_PATH = __DIR__ . '/Fixtures'; + + /** + * Tests errors filtering. + * + * @param string $message + * @param int $exitCode + * @param array $fileErrors + * @param string $expected + * @throws ShouldNotHappenException + * + * @dataProvider dataFormatterOutputProvider + */ + public function testFormatErrors( + string $message, + int $exitCode + array $fileErrors, + string $expected + ): void { + $formatter = new FilteredErrorFormatter( + new FuzzyRelativePathHelper(self::DIRECTORY_PATH, '/', []), + false, + false, + false, + true + ); + + $analysisResult = new AnalysisResult( + $fileErrors, + [], + false, + false, + null + ); + + $this->assertSame( + $exitCode, + $formatter->formatErrors( + $analysisResult, + $this->getOutput() + ), + sprintf('%s: response code do not match', $message) + ); + $this->assertEquals( + $expected, + $this->getOutputContent(), + sprintf('%s: output do not match', $message) + ); + } + + /** + * @return array + */ + public function dataFormatterOutputProvider(): array + { + // phpcs:disable Generic.Files.LineLength.TooLong + $errorMessage = 'Method Magento\PhpStan\Formatters\Fixtures\ClassWithIgnoreAnnotation::testMethod() invoked with 2 parameters, 1 required.'; + // phpcs:enable Generic.Files.LineLength.TooLong + + return [ + [ + 'No errors', + 0, + [], + "\n [OK] No errors\n\n", + ], + [ + 'All errors are suppressed by ignore annotations', + 0, + [ + new Error( + 'Method level error', + self::DIRECTORY_PATH . '/ClassWithIgnoreAnnotation.php', + 22 + ), + new Error( + $errorMessage, + self::DIRECTORY_PATH . '/ClassWithIgnoreAnnotation.php', + 25 + ), + new Error( + $errorMessage, + self::DIRECTORY_PATH . '/ClassWithIgnoreAnnotation.php', + 28 + ), + new Error( + $errorMessage, + self::DIRECTORY_PATH . '/ClassWithIgnoreAnnotation.php', + 31 + ), + new Error( + $errorMessage, + self::DIRECTORY_PATH . '/ClassWithIgnoreAnnotation.php', + 33 + ), + ], + "\n [OK] No errors\n\n", + ], + [ + 'Errors aren\'t suppressed by ignore annotations', + 1, + [ + new Error( + $errorMessage, + self::DIRECTORY_PATH . '/ClassWithoutIgnoreAnnotation.php', + 21 + ), + ], + // phpcs:disable Generic.Files.LineLength.TooLong + ' ------ --------------------------------------------------------------------------------------------------------------------------- + Line ClassWithoutIgnoreAnnotation.php + ------ --------------------------------------------------------------------------------------------------------------------------- + 21 Method Magento\PhpStan\Formatters\Fixtures\ClassWithIgnoreAnnotation::testMethod() invoked with 2 parameters, 1 required. + ------ --------------------------------------------------------------------------------------------------------------------------- + + [ERROR] Found 1 error + +', + // phpcs:enable Generic.Files.LineLength.TooLong + ] + ]; + } +} diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/Fixtures/ClassWithIgnoreAnnotation.php b/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/Fixtures/ClassWithIgnoreAnnotation.php new file mode 100644 index 0000000000000..dc0637704ec82 --- /dev/null +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/Fixtures/ClassWithIgnoreAnnotation.php @@ -0,0 +1,44 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\PhpStan\Formatters\Fixtures; + +/** + * Class ClassWithIgnoreAnnotation + * + * phpcs:ignoreFile + */ +class ClassWithIgnoreAnnotation +{ + /** + * Test method. + * phpstan:ignore "Method level error" + */ + public function getProductList() + { + // phpstan:ignore "Method Magento\PhpStan\Formatters\Fixtures\ClassWithIgnoreAnnotation::testMethod() invoked with 2 parameters, 1 required." + $this->testMethod('test1', 'test2'); + + // phpstan:ignore "Method * invoked with 2 parameters, 1 required." + $this->testMethod('test1', 'test2'); + + // phpstan:ignore + $this->testMethod('test1', 'test2'); + + $this->testMethod('test1', 'test2'); // phpstan:ignore + } + + /** + * @param string $arg1 + * @return string + */ + private function testMethod(string $arg1) + { + return $arg1; + } +} diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/Fixtures/ClassWithoutIgnoreAnnotation.php b/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/Fixtures/ClassWithoutIgnoreAnnotation.php new file mode 100644 index 0000000000000..d46ba7c63d86a --- /dev/null +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/Fixtures/ClassWithoutIgnoreAnnotation.php @@ -0,0 +1,33 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\PhpStan\Formatters\Fixtures; + +/** + * Class ClassWithoutIgnoreAnnotation + * phpcs:ignoreFile + */ +class ClassWithoutIgnoreAnnotation +{ + /** + * Test method. + */ + public function getProductList() + { + $this->testMethod('test1', 'test2'); + } + + /** + * @param string $arg1 + * @return string + */ + private function testMethod(string $arg1) + { + return $arg1; + } +} diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/Sniffs/Annotation/ClassAnnotationStructureSniffTest.php b/dev/tests/static/framework/tests/unit/testsuite/Magento/Sniffs/Annotation/ClassAnnotationStructureSniffTest.php index b12cb1fbfcbd3..afe559fdd6759 100644 --- a/dev/tests/static/framework/tests/unit/testsuite/Magento/Sniffs/Annotation/ClassAnnotationStructureSniffTest.php +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/Sniffs/Annotation/ClassAnnotationStructureSniffTest.php @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ declare(strict_types=1); + namespace Magento\Sniffs\Annotation; class ClassAnnotationStructureSniffTest extends \PHPUnit\Framework\TestCase @@ -63,8 +64,8 @@ public function testProcess($fileUnderTest, $expectedReportFile) { $reportFile = __DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'phpcs_report.txt'; $this->copyFile( - __DIR__ . DIRECTORY_SEPARATOR . '_files'. DIRECTORY_SEPARATOR, - TESTS_TEMP_DIR + __DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR, + TESTS_TEMP_DIR . DIRECTORY_SEPARATOR ); $codeSniffer = new \Magento\TestFramework\CodingStandard\Tool\CodeSniffer( 'Magento', @@ -72,11 +73,11 @@ public function testProcess($fileUnderTest, $expectedReportFile) new \Magento\TestFramework\CodingStandard\Tool\CodeSniffer\Wrapper() ); $result = $codeSniffer->run( - [TESTS_TEMP_DIR . $fileUnderTest] + [TESTS_TEMP_DIR . DIRECTORY_SEPARATOR . $fileUnderTest] ); $actual = file_get_contents($reportFile); $expected = file_get_contents( - TESTS_TEMP_DIR . $expectedReportFile + TESTS_TEMP_DIR . DIRECTORY_SEPARATOR . $expectedReportFile ); unlink($reportFile); $this->assertEquals(2, $result); diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/Sniffs/Annotation/MethodAnnotationStructureSniffTest.php b/dev/tests/static/framework/tests/unit/testsuite/Magento/Sniffs/Annotation/MethodAnnotationStructureSniffTest.php index b56239f4df8a5..d471597565077 100644 --- a/dev/tests/static/framework/tests/unit/testsuite/Magento/Sniffs/Annotation/MethodAnnotationStructureSniffTest.php +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/Sniffs/Annotation/MethodAnnotationStructureSniffTest.php @@ -54,7 +54,7 @@ public function testProcess($fileUnderTest, $expectedReportFile) $reportFile = __DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'phpcs_report.txt'; $this->copyFile( __DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR, - TESTS_TEMP_DIR + TESTS_TEMP_DIR . DIRECTORY_SEPARATOR ); $codeSniffer = new \Magento\TestFramework\CodingStandard\Tool\CodeSniffer( 'Magento', @@ -62,11 +62,11 @@ public function testProcess($fileUnderTest, $expectedReportFile) new \Magento\TestFramework\CodingStandard\Tool\CodeSniffer\Wrapper() ); $result = $codeSniffer->run( - [TESTS_TEMP_DIR . $fileUnderTest] + [TESTS_TEMP_DIR . DIRECTORY_SEPARATOR . $fileUnderTest] ); $actual = file_get_contents($reportFile); $expected = file_get_contents( - TESTS_TEMP_DIR . $expectedReportFile + TESTS_TEMP_DIR . DIRECTORY_SEPARATOR . $expectedReportFile ); unlink($reportFile); $this->assertEquals(2, $result); diff --git a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php index a00c09ceadcef..8ccda77a25191 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php @@ -13,6 +13,7 @@ use Magento\TestFramework\CodingStandard\Tool\CodeSniffer\Wrapper; use Magento\TestFramework\CodingStandard\Tool\CopyPasteDetector; use Magento\TestFramework\CodingStandard\Tool\PhpCompatibility; +use Magento\TestFramework\CodingStandard\Tool\PhpStan; use PHPMD\TextUI\Command; /** @@ -465,4 +466,39 @@ public function testPhpCompatibility() 'PHP Compatibility detected violation(s):' . PHP_EOL . $report ); } + + /** + * Test code quality using PHPStan + * + * @throws \Exception + */ + public function testPhpStan() + { + $reportFile = self::$reportDir . '/phpstan_report.txt'; + $confFile = __DIR__ . '/_files/phpstan/phpstan.neon'; + + if (!file_exists($reportFile)) { + touch($reportFile); + } + + $fileList = self::getWhitelist(['php']); + $blackList = Files::init()->readLists(__DIR__ . '/_files/phpstan/blacklist/*.txt'); + if ($blackList) { + $blackListPattern = sprintf('#(%s)#i', implode('|', $blackList)); + $fileList = array_filter( + $fileList, + function ($path) use ($blackListPattern) { + return !preg_match($blackListPattern, $path); + } + ); + } + + $phpStan = new PhpStan($confFile, $reportFile); + $exitCode = $phpStan->run($fileList); + $report = file_get_contents($reportFile); + + $errorMessage = empty($report) ? + 'PHPStan command run failed.' : 'PHPStan detected violation(s):' . PHP_EOL . $report; + $this->assertEquals(0, $exitCode, $errorMessage); + } } diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/blacklist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/blacklist/common.txt new file mode 100644 index 0000000000000..34965bda0dba6 --- /dev/null +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/blacklist/common.txt @@ -0,0 +1,14 @@ +# Format: path to directory or path to file +# +# Example: +# app/code/Magento/Catalog +# dev/tests/static/framework/bootstrap.php +lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php +lib/internal/Magento/Framework/Cache/Backend/Eaccelerator.php +dev/tests/integration/framework/deployTestModules.php +dev/tests/integration/testsuite/Magento/Framework/Session/ConfigTest.php +dev/tests/integration/testsuite/Magento/Framework/Session/SessionManagerTest.php +dev/tests/api-functional/testsuite/Magento/Customer/Api/AddressRepositoryTest.php +dev/tests/api-functional/testsuite/Magento/Framework/Model/Entity/HydratorTest.php +dev/tests/api-functional/testsuite/Magento/Integration/Model/AdminTokenServiceTest.php +dev/tests/api-functional/testsuite/Magento/Integration/Model/CustomerTokenServiceTest.php diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon new file mode 100644 index 0000000000000..f4f6ff87f8175 --- /dev/null +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon @@ -0,0 +1,38 @@ +parameters: + checkExplicitMixedMissingReturn: true + checkPhpDocMissingReturn: true + reportUnmatchedIgnoredErrors: false + excludes_analyse: + - %rootDir%/../../../lib/internal/Magento/Framework/ObjectManager/Test/Unit/* + - %rootDir%/../../../*/_files/* + - %rootDir%/../../../dev/tests/functional/* + - %rootDir%/../../../dev/tests/*/Fixtures/* + - %rootDir%/../../../dev/tests/*/tmp/* + - %rootDir%/../../../dev/tests/*/_generated/* + - %rootDir%/../../../pub/* + autoload_directories: + - %rootDir%/../../../dev/tests/static/framework/tests/unit/testsuite/Magento + - %rootDir%/../../../dev/tests/integration/framework/tests/unit/testsuite/Magento + - %rootDir%/../../../dev/tests/api-functional/_files/Magento + autoload_files: + - %rootDir%/../../../dev/tests/static/framework/autoload.php + - %rootDir%/../../../dev/tests/integration/framework/autoload.php + - %rootDir%/../../../dev/tests/api-functional/framework/autoload.php + - %rootDir%/../../../dev/tests/setup-integration/framework/autoload.php + - %rootDir%/../../../dev/tests/static/framework/Magento/PhpStan/autoload.php + ignoreErrors: + # Ignore PHPStan\Rules\Classes\UnusedConstructorParametersRule + - '#Constructor of class [a-zA-Z0-9\\_]+ has an unused parameter#' + # Ignore setCustomErrorHandler function not found in bootstrap files + - '#Function setCustomErrorHandler not found#' + # Ignore 'return statement is missing' error when 'void' is present in return type list + - '#Method (?:.*?) should return (?:.*?)void(?:.*?) but return statement is missing.#' + +services: + errorFormatter.filtered: + class: Magento\PhpStan\Formatters\FilteredErrorFormatter + arguments: + showTipsOfTheDay: false + checkThisOnly: false + inferPrivatePropertyTypeFromConstructor: true + checkMissingTypehints: %checkMissingTypehints% diff --git a/lib/internal/Magento/Framework/EntityManager/TypeResolver.php b/lib/internal/Magento/Framework/EntityManager/TypeResolver.php index 79cdbae126d7a..1f559c01f11b6 100644 --- a/lib/internal/Magento/Framework/EntityManager/TypeResolver.php +++ b/lib/internal/Magento/Framework/EntityManager/TypeResolver.php @@ -6,7 +6,7 @@ namespace Magento\Framework\EntityManager; /** - * Class TypeResolver + * Resolves types. */ class TypeResolver { @@ -20,7 +20,9 @@ class TypeResolver */ private $typeMapping = [ \Magento\SalesRule\Model\Rule::class => \Magento\SalesRule\Api\Data\RuleInterface::class, + // phpstan:ignore "Class Magento\SalesRule\Model\Rule\Interceptor not found." \Magento\SalesRule\Model\Rule\Interceptor::class => \Magento\SalesRule\Api\Data\RuleInterface::class, + // phpstan:ignore "Class Magento\SalesRule\Model\Rule\Proxy not found." \Magento\SalesRule\Model\Rule\Proxy::class => \Magento\SalesRule\Api\Data\RuleInterface::class ]; @@ -34,6 +36,8 @@ public function __construct(MetadataPool $metadataPool) } /** + * Resolves type. + * * @param object $type * @return string * @throws \Exception diff --git a/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php b/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php index 61eb2e62091ea..98bac47e8e1b0 100644 --- a/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php +++ b/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php @@ -6,8 +6,6 @@ namespace Magento\Framework\Interception\Test\Unit\Config; -use Magento\Framework\Serialize\SerializerInterface; - require_once __DIR__ . '/../Custom/Module/Model/Item.php'; require_once __DIR__ . '/../Custom/Module/Model/Item/Enhanced.php'; require_once __DIR__ . '/../Custom/Module/Model/ItemContainer.php'; @@ -89,48 +87,52 @@ public function testHasPluginsWhenDataIsNotCached($expectedResult, $type, $entit ->will($this->returnValue(null)); $this->omConfigMock->expects($this->any()) ->method('getOriginalInstanceType') - ->will($this->returnValueMap( - [ - [ - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer::class, - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer::class, - ], - [ - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item::class, - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item::class, - ], - [ - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item\Enhanced::class, - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item\Enhanced::class, - ], - [ - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer\Enhanced::class, - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer\Enhanced::class, - ], - [ - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer\Proxy::class, - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer\Proxy::class, - ], + ->will( + $this->returnValueMap( [ - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemProxy::class, - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemProxy::class, - ], - [ - \Magento\Framework\Interception\Custom\Module\Model\Backslash\ItemProxy::class, - \Magento\Framework\Interception\Custom\Module\Model\Backslash\ItemProxy::class - ], - [ - 'virtual_custom_item', - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item::class - ], + [ + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer::class, + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer::class, + ], + [ + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item::class, + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item::class, + ], + [ + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item\Enhanced::class, + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item\Enhanced::class, + ], + [ + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer\Enhanced::class, + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer\Enhanced::class, + ], + [ + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer\Proxy::class, + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer\Proxy::class, + ], + [ + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item\Proxy::class, + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item\Proxy::class, + ], + [ + \Magento\Framework\Interception\Custom\Module\Model\Backslash\Item\Proxy::class, + \Magento\Framework\Interception\Custom\Module\Model\Backslash\Item\Proxy::class + ], + [ + 'virtual_custom_item', + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item::class + ], + ] + ) + ); + $this->definitionMock->expects($this->any())->method('getClasses')->will( + $this->returnValue( + [ + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item\Proxy::class, + \Magento\Framework\Interception\Custom\Module\Model\Backslash\Item\Proxy::class ] - )); - $this->definitionMock->expects($this->any())->method('getClasses')->will($this->returnValue( - [ - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemProxy::class, - \Magento\Framework\Interception\Custom\Module\Model\Backslash\ItemProxy::class - ] - )); + ) + ); $this->relationsMock->expects($this->any())->method('has')->will($this->returnValue($expectedResult)); $this->relationsMock->expects($this->any())->method('getParents')->will($this->returnValue($entityParents)); @@ -163,7 +165,7 @@ public function testHasPluginsWhenDataIsCached($expectedResult, $type) \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item\Enhanced::class => true, \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer\Enhanced::class => true, \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer\Proxy::class => true, - \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemProxy::class => false, + \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item\Proxy::class => false, 'virtual_custom_item' => true ]; $this->readerMock->expects($this->never())->method('read'); @@ -221,7 +223,7 @@ public function hasPluginsDataProvider() [\Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemContainer::class] ], [ - false, \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\ItemProxy::class, + false, \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\Item\Proxy::class, [] ], [ diff --git a/lib/internal/Magento/Framework/TestFramework/Unit/Autoloader/FactoryGenerator.php b/lib/internal/Magento/Framework/TestFramework/Unit/Autoloader/FactoryGenerator.php index df5b0b0e0ad0c..1a669ace443ec 100644 --- a/lib/internal/Magento/Framework/TestFramework/Unit/Autoloader/FactoryGenerator.php +++ b/lib/internal/Magento/Framework/TestFramework/Unit/Autoloader/FactoryGenerator.php @@ -43,6 +43,9 @@ public function generate($className) */ private function isFactory($className) { + if (!preg_match('/[\\\A-Z]/', substr(ltrim($className), 0, 1))) { + return false; + } $sourceName = rtrim(substr($className, 0, -strlen('Factory')), '\\'); return $sourceName . 'Factory' == $className; } From 40f35ee7ad5b5c3390e9cb297a7871019269c807 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Mon, 16 Dec 2019 16:11:43 -0600 Subject: [PATCH 574/595] Fix static --- .../view/frontend/templates/form.phtml | 36 ++++++++++++++++--- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Contact/view/frontend/templates/form.phtml b/app/code/Magento/Contact/view/frontend/templates/form.phtml index 053cf419e4225..2982a0a99f74c 100644 --- a/app/code/Magento/Contact/view/frontend/templates/form.phtml +++ b/app/code/Magento/Contact/view/frontend/templates/form.phtml @@ -17,29 +17,55 @@ $viewModel = $block->getViewModel(); data-mage-init='{"validation":{}}'> <fieldset class="fieldset"> <legend class="legend"><span><?= $block->escapeHtml(__('Write Us')) ?></span></legend><br /> - <div class="field note no-label"><?= $block->escapeHtml(__('Jot us a note and we’ll get back to you as quickly as possible.')) ?></div> + <div class="field note no-label"> + <?= $block->escapeHtml(__('Jot us a note and we’ll get back to you as quickly as possible.')) ?> + </div> <div class="field name required"> <label class="label" for="name"><span><?= $block->escapeHtml(__('Name')) ?></span></label> <div class="control"> - <input name="name" id="name" title="<?= $block->escapeHtmlAttr(__('Name')) ?>" value="<?= $block->escapeHtmlAttr($viewModel->getUserName()) ?>" class="input-text" type="text" data-validate="{required:true}"/> + <input name="name" + id="name" + title="<?= $block->escapeHtmlAttr(__('Name')) ?>" + value="<?= $block->escapeHtmlAttr($viewModel->getUserName()) ?>" + class="input-text" + type="text" + data-validate="{required:true}"/> </div> </div> <div class="field email required"> <label class="label" for="email"><span><?= $block->escapeHtml(__('Email')) ?></span></label> <div class="control"> - <input name="email" id="email" title="<?= $block->escapeHtmlAttr(__('Email')) ?>" value="<?= $block->escapeHtmlAttr($viewModel->getUserEmail()) ?>" class="input-text" type="email" data-validate="{required:true, 'validate-email':true}"/> + <input name="email" + id="email" + title="<?= $block->escapeHtmlAttr(__('Email')) ?>" + value="<?= $block->escapeHtmlAttr($viewModel->getUserEmail()) ?>" + class="input-text" + type="email" + data-validate="{required:true, 'validate-email':true}"/> </div> </div> <div class="field telephone"> <label class="label" for="telephone"><span><?= $block->escapeHtml(__('Phone Number')) ?></span></label> <div class="control"> - <input name="telephone" id="telephone" title="<?= $block->escapeHtmlAttr(__('Phone Number')) ?>" value="<?= $block->escapeHtmlAttr($viewModel->getUserTelephone()) ?>" class="input-text" type="text" /> + <input name="telephone" + id="telephone" + title="<?= $block->escapeHtmlAttr(__('Phone Number')) ?>" + value="<?= $block->escapeHtmlAttr($viewModel->getUserTelephone()) ?>" + class="input-text" + type="text" /> </div> </div> <div class="field comment required"> <label class="label" for="comment"><span><?= $block->escapeHtml(__('What’s on your mind?')) ?></span></label> <div class="control"> - <textarea name="comment" id="comment" title="<?= $block->escapeHtmlAttr(__('What’s on your mind?')) ?>" class="input-text" cols="5" rows="3" data-validate="{required:true}"><?= $block->escapeHtml($viewModel->getUserComment()) ?></textarea> + <textarea name="comment" + id="comment" + title="<?= $block->escapeHtmlAttr(__('What’s on your mind?')) ?>" + class="input-text" + cols="5" + rows="3" + data-validate="{required:true}"><?= $block->escapeHtml($viewModel->getUserComment()) ?> + </textarea> </div> </div> <?= $block->getChildHtml('form.additional.info') ?> From a4984838127857816256e4d0a0a4ed82f1d43ccb Mon Sep 17 00:00:00 2001 From: Viktor Tymchynskyi <vtymchynskyi@magento.com> Date: Mon, 16 Dec 2019 16:31:33 -0600 Subject: [PATCH 575/595] MC-25203: Introduce PHPStan code analysis tool to the static build - Fix test --- .../Magento/PhpStan/Formatters/FilteredErrorFormatterTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/FilteredErrorFormatterTest.php b/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/FilteredErrorFormatterTest.php index dfedd625fdb0e..8512f311f15a2 100644 --- a/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/FilteredErrorFormatterTest.php +++ b/dev/tests/static/framework/tests/unit/testsuite/Magento/PhpStan/Formatters/FilteredErrorFormatterTest.php @@ -33,7 +33,7 @@ class FilteredErrorFormatterTest extends ErrorFormatterTestCase */ public function testFormatErrors( string $message, - int $exitCode + int $exitCode, array $fileErrors, string $expected ): void { From aa419de0b281718352112a7e6540388efccd395f Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Mon, 16 Dec 2019 16:44:36 -0600 Subject: [PATCH 576/595] Fix codestyle --- app/code/Magento/Contact/view/frontend/templates/form.phtml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Contact/view/frontend/templates/form.phtml b/app/code/Magento/Contact/view/frontend/templates/form.phtml index 2982a0a99f74c..3a7c4c8b6d865 100644 --- a/app/code/Magento/Contact/view/frontend/templates/form.phtml +++ b/app/code/Magento/Contact/view/frontend/templates/form.phtml @@ -56,7 +56,9 @@ $viewModel = $block->getViewModel(); </div> </div> <div class="field comment required"> - <label class="label" for="comment"><span><?= $block->escapeHtml(__('What’s on your mind?')) ?></span></label> + <label class="label" for="comment"> + <span><?= $block->escapeHtml(__('What’s on your mind?')) ?></span> + </label> <div class="control"> <textarea name="comment" id="comment" From 9c51c71ad2f686a51026a014a984c2e22a481cf5 Mon Sep 17 00:00:00 2001 From: Viktor Tymchynskyi <vtymchynskyi@magento.com> Date: Mon, 16 Dec 2019 16:53:54 -0600 Subject: [PATCH 577/595] MC-25203: Introduce PHPStan code analysis tool to the static build - update composer --- composer.json | 2 +- composer.lock | 450 +++++++++++++++++++++++++------------------------- 2 files changed, 222 insertions(+), 230 deletions(-) diff --git a/composer.json b/composer.json index 59737c298b720..7e01980e32f58 100644 --- a/composer.json +++ b/composer.json @@ -92,7 +92,7 @@ "pdepend/pdepend": "2.5.2", "phpcompatibility/php-compatibility": "^9.3", "phpmd/phpmd": "@stable", - "phpstan/phpstan": "^0.12.2", + "phpstan/phpstan": "^0.12.3", "phpunit/phpunit": "~6.5.0", "sebastian/phpcpd": "~3.0.0", "squizlabs/php_codesniffer": "~3.4.0" diff --git a/composer.lock b/composer.lock index 8391dd2f48518..a63cdcdf4a1e1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7effdb746287f89357497d7bc2ed1bf4", + "content-hash": "38446350ff1ac4609f77d5d74213880d", "packages": [ { "name": "braintree/braintree_php", @@ -201,16 +201,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.2.5", + "version": "1.2.4", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "62e8fc2dc550e5d6d8c9360c7721662670f58149" + "reference": "10bb96592168a0f8e8f6dcde3532d9fa50b0b527" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/62e8fc2dc550e5d6d8c9360c7721662670f58149", - "reference": "62e8fc2dc550e5d6d8c9360c7721662670f58149", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/10bb96592168a0f8e8f6dcde3532d9fa50b0b527", + "reference": "10bb96592168a0f8e8f6dcde3532d9fa50b0b527", "shasum": "" }, "require": { @@ -221,7 +221,7 @@ "require-dev": { "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8", "psr/log": "^1.0", - "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" + "symfony/process": "^2.5 || ^3.0 || ^4.0" }, "type": "library", "extra": { @@ -253,7 +253,7 @@ "ssl", "tls" ], - "time": "2019-12-11T14:44:42+00:00" + "time": "2019-08-30T08:44:50+00:00" }, { "name": "composer/composer", @@ -595,16 +595,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.5.0", + "version": "6.4.1", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "dbc2bc3a293ed6b1ae08a3651e2bfd213d19b6a5" + "reference": "0895c932405407fd3a7368b6910c09a24d26db11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/dbc2bc3a293ed6b1ae08a3651e2bfd213d19b6a5", - "reference": "dbc2bc3a293ed6b1ae08a3651e2bfd213d19b6a5", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/0895c932405407fd3a7368b6910c09a24d26db11", + "reference": "0895c932405407fd3a7368b6910c09a24d26db11", "shasum": "" }, "require": { @@ -619,13 +619,12 @@ "psr/log": "^1.1" }, "suggest": { - "ext-intl": "Required for Internationalized Domain Name (IDN) support", "psr/log": "Required for using the Log middleware" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.5-dev" + "dev-master": "6.3-dev" } }, "autoload": { @@ -658,7 +657,7 @@ "rest", "web service" ], - "time": "2019-12-07T18:20:45+00:00" + "time": "2019-10-23T15:58:00+00:00" }, { "name": "guzzlehttp/promises", @@ -1066,16 +1065,16 @@ }, { "name": "magento/zendframework1", - "version": "1.14.3", + "version": "1.14.2", "source": { "type": "git", "url": "https://github.com/magento/zf1.git", - "reference": "726855dfb080089dc7bc7b016624129f8e7bc4e5" + "reference": "8221062d42a198e431d183bbe672e5e1a2f98c5f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/zf1/zipball/726855dfb080089dc7bc7b016624129f8e7bc4e5", - "reference": "726855dfb080089dc7bc7b016624129f8e7bc4e5", + "url": "https://api.github.com/repos/magento/zf1/zipball/8221062d42a198e431d183bbe672e5e1a2f98c5f", + "reference": "8221062d42a198e431d183bbe672e5e1a2f98c5f", "shasum": "" }, "require": { @@ -1109,7 +1108,7 @@ "ZF1", "framework" ], - "time": "2019-11-26T15:09:40+00:00" + "time": "2019-07-26T16:43:11+00:00" }, { "name": "monolog/monolog", @@ -2084,16 +2083,16 @@ }, { "name": "symfony/css-selector", - "version": "v4.4.1", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "64acec7e0d67125e9f4656c68d4a38a42ab5a0b7" + "reference": "f4b3ff6a549d9ed28b2b0ecd1781bf67cf220ee9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/64acec7e0d67125e9f4656c68d4a38a42ab5a0b7", - "reference": "64acec7e0d67125e9f4656c68d4a38a42ab5a0b7", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/f4b3ff6a549d9ed28b2b0ecd1781bf67cf220ee9", + "reference": "f4b3ff6a549d9ed28b2b0ecd1781bf67cf220ee9", "shasum": "" }, "require": { @@ -2102,7 +2101,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -2133,20 +2132,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2019-10-12T00:35:04+00:00" + "time": "2019-10-02T08:36:26+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.3.9", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "87a1ae7480f2020818013605a65776b9033bcc4f" + "reference": "0df002fd4f500392eabd243c2947061a50937287" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/87a1ae7480f2020818013605a65776b9033bcc4f", - "reference": "87a1ae7480f2020818013605a65776b9033bcc4f", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/0df002fd4f500392eabd243c2947061a50937287", + "reference": "0df002fd4f500392eabd243c2947061a50937287", "shasum": "" }, "require": { @@ -2203,7 +2202,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2019-11-28T13:25:45+00:00" + "time": "2019-11-03T09:04:05+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -2265,16 +2264,16 @@ }, { "name": "symfony/filesystem", - "version": "v4.4.1", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "40c2606131d56eff6f193b6e2ceb92414653b591" + "reference": "9abbb7ef96a51f4d7e69627bc6f63307994e4263" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/40c2606131d56eff6f193b6e2ceb92414653b591", - "reference": "40c2606131d56eff6f193b6e2ceb92414653b591", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/9abbb7ef96a51f4d7e69627bc6f63307994e4263", + "reference": "9abbb7ef96a51f4d7e69627bc6f63307994e4263", "shasum": "" }, "require": { @@ -2284,7 +2283,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -2311,20 +2310,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2019-11-26T23:16:41+00:00" + "time": "2019-08-20T14:07:54+00:00" }, { "name": "symfony/finder", - "version": "v4.4.1", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "ce8743441da64c41e2a667b8eb66070444ed911e" + "reference": "72a068f77e317ae77c0a0495236ad292cfb5ce6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/ce8743441da64c41e2a667b8eb66070444ed911e", - "reference": "ce8743441da64c41e2a667b8eb66070444ed911e", + "url": "https://api.github.com/repos/symfony/finder/zipball/72a068f77e317ae77c0a0495236ad292cfb5ce6f", + "reference": "72a068f77e317ae77c0a0495236ad292cfb5ce6f", "shasum": "" }, "require": { @@ -2333,7 +2332,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -2360,20 +2359,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2019-11-17T21:56:56+00:00" + "time": "2019-10-30T12:53:54+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.13.1", + "version": "v1.12.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" + "reference": "550ebaac289296ce228a706d0867afc34687e3f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", - "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", + "reference": "550ebaac289296ce228a706d0867afc34687e3f4", "shasum": "" }, "require": { @@ -2385,7 +2384,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.12-dev" } }, "autoload": { @@ -2418,20 +2417,20 @@ "polyfill", "portable" ], - "time": "2019-11-27T13:56:44+00:00" + "time": "2019-08-06T08:03:45+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.13.1", + "version": "v1.12.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f" + "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f", - "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17", + "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17", "shasum": "" }, "require": { @@ -2443,7 +2442,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.12-dev" } }, "autoload": { @@ -2477,20 +2476,20 @@ "portable", "shim" ], - "time": "2019-11-27T14:18:11+00:00" + "time": "2019-08-06T08:03:45+00:00" }, { "name": "symfony/process", - "version": "v4.3.9", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "207dab1f17d34ad71ea72e9741ab8049a9d8251b" + "reference": "3b2e0cb029afbb0395034509291f21191d1a4db0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/207dab1f17d34ad71ea72e9741ab8049a9d8251b", - "reference": "207dab1f17d34ad71ea72e9741ab8049a9d8251b", + "url": "https://api.github.com/repos/symfony/process/zipball/3b2e0cb029afbb0395034509291f21191d1a4db0", + "reference": "3b2e0cb029afbb0395034509291f21191d1a4db0", "shasum": "" }, "require": { @@ -2526,7 +2525,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2019-11-28T10:05:26+00:00" + "time": "2019-10-28T17:07:32+00:00" }, { "name": "tedivm/jshrink", @@ -3530,16 +3529,16 @@ }, { "name": "zendframework/zend-http", - "version": "2.11.1", + "version": "2.10.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-http.git", - "reference": "76000da8490b8685d63ff6f6ff8eefa459f6e9e7" + "reference": "4b4983178693a8fdda53b0bbee58552e2d2b1ac0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-http/zipball/76000da8490b8685d63ff6f6ff8eefa459f6e9e7", - "reference": "76000da8490b8685d63ff6f6ff8eefa459f6e9e7", + "url": "https://api.github.com/repos/zendframework/zend-http/zipball/4b4983178693a8fdda53b0bbee58552e2d2b1ac0", + "reference": "4b4983178693a8fdda53b0bbee58552e2d2b1ac0", "shasum": "" }, "require": { @@ -3560,8 +3559,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.11.x-dev", - "dev-develop": "2.12.x-dev" + "dev-master": "2.10.x-dev", + "dev-develop": "2.11.x-dev" } }, "autoload": { @@ -3581,7 +3580,7 @@ "zend", "zf" ], - "time": "2019-12-04T23:02:34+00:00" + "time": "2019-02-19T18:58:14+00:00" }, { "name": "zendframework/zend-hydrator", @@ -3645,26 +3644,22 @@ }, { "name": "zendframework/zend-i18n", - "version": "2.10.1", + "version": "2.9.2", "source": { "type": "git", "url": "https://github.com/zendframework/zend-i18n.git", - "reference": "84038e6a1838b611dcc491b1c40321fa4c3a123c" + "reference": "e17a54b3aee333ab156958f570cde630acee8b07" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-i18n/zipball/84038e6a1838b611dcc491b1c40321fa4c3a123c", - "reference": "84038e6a1838b611dcc491b1c40321fa4c3a123c", + "url": "https://api.github.com/repos/zendframework/zend-i18n/zipball/e17a54b3aee333ab156958f570cde630acee8b07", + "reference": "e17a54b3aee333ab156958f570cde630acee8b07", "shasum": "" }, "require": { - "ext-intl": "*", "php": "^5.6 || ^7.0", "zendframework/zend-stdlib": "^2.7 || ^3.0" }, - "conflict": { - "phpspec/prophecy": "<1.9.0" - }, "require-dev": { "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.16", "zendframework/zend-cache": "^2.6.1", @@ -3677,6 +3672,7 @@ "zendframework/zend-view": "^2.6.3" }, "suggest": { + "ext-intl": "Required for most features of Zend\\I18n; included in default builds of PHP", "zendframework/zend-cache": "Zend\\Cache component", "zendframework/zend-config": "Zend\\Config component", "zendframework/zend-eventmanager": "You should install this package to use the events in the translator", @@ -3689,8 +3685,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.10.x-dev", - "dev-develop": "2.11.x-dev" + "dev-master": "2.9.x-dev", + "dev-develop": "2.10.x-dev" }, "zf": { "component": "Zend\\I18n", @@ -3712,7 +3708,7 @@ "i18n", "zf" ], - "time": "2019-12-12T14:08:22+00:00" + "time": "2019-09-30T12:04:37+00:00" }, { "name": "zendframework/zend-inputfilter", @@ -4798,16 +4794,16 @@ }, { "name": "zendframework/zend-view", - "version": "2.11.4", + "version": "2.11.3", "source": { "type": "git", "url": "https://github.com/zendframework/zend-view.git", - "reference": "a8b1b2d9b52e191539be861a6529f8c8a0c06b9d" + "reference": "e766457bd6ce13c5354e443bb949511b6904d7f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-view/zipball/a8b1b2d9b52e191539be861a6529f8c8a0c06b9d", - "reference": "a8b1b2d9b52e191539be861a6529f8c8a0c06b9d", + "url": "https://api.github.com/repos/zendframework/zend-view/zipball/e766457bd6ce13c5354e443bb949511b6904d7f5", + "reference": "e766457bd6ce13c5354e443bb949511b6904d7f5", "shasum": "" }, "require": { @@ -4881,7 +4877,7 @@ "view", "zf" ], - "time": "2019-12-04T08:40:50+00:00" + "time": "2019-10-11T21:10:04+00:00" } ], "packages-dev": [ @@ -5284,16 +5280,16 @@ }, { "name": "codeception/phpunit-wrapper", - "version": "6.7.1", + "version": "6.7.0", "source": { "type": "git", "url": "https://github.com/Codeception/phpunit-wrapper.git", - "reference": "d3b611635b47a583dfaa1a9e98b98fa476d14025" + "reference": "93f59e028826464eac086052fa226e58967f6907" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/d3b611635b47a583dfaa1a9e98b98fa476d14025", - "reference": "d3b611635b47a583dfaa1a9e98b98fa476d14025", + "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/93f59e028826464eac086052fa226e58967f6907", + "reference": "93f59e028826464eac086052fa226e58967f6907", "shasum": "" }, "require": { @@ -5326,7 +5322,7 @@ } ], "description": "PHPUnit classes used by Codeception", - "time": "2019-11-23T18:22:38+00:00" + "time": "2019-08-18T15:43:35+00:00" }, { "name": "codeception/stub", @@ -6166,16 +6162,16 @@ }, { "name": "doctrine/cache", - "version": "1.10.0", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "382e7f4db9a12dc6c19431743a2b096041bcdd62" + "reference": "89a5c76c39c292f7798f964ab3c836c3f8192a55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/382e7f4db9a12dc6c19431743a2b096041bcdd62", - "reference": "382e7f4db9a12dc6c19431743a2b096041bcdd62", + "url": "https://api.github.com/repos/doctrine/cache/zipball/89a5c76c39c292f7798f964ab3c836c3f8192a55", + "reference": "89a5c76c39c292f7798f964ab3c836c3f8192a55", "shasum": "" }, "require": { @@ -6242,9 +6238,10 @@ "memcached", "php", "redis", + "riak", "xcache" ], - "time": "2019-11-29T15:36:20+00:00" + "time": "2019-11-15T14:31:57+00:00" }, { "name": "doctrine/inflector", @@ -6623,16 +6620,16 @@ }, { "name": "fzaninotto/faker", - "version": "v1.9.1", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/fzaninotto/Faker.git", - "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f" + "reference": "27a216cbe72327b2d6369fab721a5843be71e57d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/fc10d778e4b84d5bd315dad194661e091d307c6f", - "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/27a216cbe72327b2d6369fab721a5843be71e57d", + "reference": "27a216cbe72327b2d6369fab721a5843be71e57d", "shasum": "" }, "require": { @@ -6645,9 +6642,7 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } + "branch-alias": [] }, "autoload": { "psr-4": { @@ -6669,7 +6664,7 @@ "faker", "fixtures" ], - "time": "2019-12-12T13:22:17+00:00" + "time": "2019-11-14T13:13:06+00:00" }, { "name": "grasmash/expander", @@ -7035,16 +7030,16 @@ }, { "name": "league/flysystem", - "version": "1.0.61", + "version": "1.0.57", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "4fb13c01784a6c9f165a351e996871488ca2d8c9" + "reference": "0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/4fb13c01784a6c9f165a351e996871488ca2d8c9", - "reference": "4fb13c01784a6c9f165a351e996871488ca2d8c9", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a", + "reference": "0e9db7f0b96b9f12dcf6f65bc34b72b1a30ea55a", "shasum": "" }, "require": { @@ -7115,7 +7110,7 @@ "sftp", "storage" ], - "time": "2019-12-08T21:46:50+00:00" + "time": "2019-10-16T21:01:05+00:00" }, { "name": "lusitanian/oauth", @@ -7349,16 +7344,16 @@ }, { "name": "mustache/mustache", - "version": "v2.13.0", + "version": "v2.12.0", "source": { "type": "git", "url": "https://github.com/bobthecow/mustache.php.git", - "reference": "e95c5a008c23d3151d59ea72484d4f72049ab7f4" + "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/e95c5a008c23d3151d59ea72484d4f72049ab7f4", - "reference": "e95c5a008c23d3151d59ea72484d4f72049ab7f4", + "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/fe8fe72e9d580591854de404cc59a1b83ca4d19e", + "reference": "fe8fe72e9d580591854de404cc59a1b83ca4d19e", "shasum": "" }, "require": { @@ -7391,20 +7386,20 @@ "mustache", "templating" ], - "time": "2019-11-23T21:40:31+00:00" + "time": "2017-07-11T12:54:05+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.9.4", + "version": "1.9.3", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7" + "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/579bb7356d91f9456ccd505f24ca8b667966a0a7", - "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea", + "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea", "shasum": "" }, "require": { @@ -7439,7 +7434,7 @@ "object", "object graph" ], - "time": "2019-12-15T19:12:40+00:00" + "time": "2019-08-09T12:45:53+00:00" }, { "name": "nikic/php-parser", @@ -8012,34 +8007,33 @@ }, { "name": "phpoption/phpoption", - "version": "1.7.2", + "version": "1.5.2", "source": { "type": "git", "url": "https://github.com/schmittjoh/php-option.git", - "reference": "77f7c4d2e65413aff5b5a8cc8b3caf7a28d81959" + "reference": "2ba2586380f8d2b44ad1b9feb61c371020b27793" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/77f7c4d2e65413aff5b5a8cc8b3caf7a28d81959", - "reference": "77f7c4d2e65413aff5b5a8cc8b3caf7a28d81959", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/2ba2586380f8d2b44ad1b9feb61c371020b27793", + "reference": "2ba2586380f8d2b44ad1b9feb61c371020b27793", "shasum": "" }, "require": { - "php": "^5.5.9 || ^7.0" + "php": ">=5.3.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.3", - "phpunit/phpunit": "^4.8.35 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.7|^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.5-dev" } }, "autoload": { - "psr-4": { - "PhpOption\\": "src/PhpOption/" + "psr-0": { + "PhpOption\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -8050,10 +8044,6 @@ { "name": "Johannes M. Schmitt", "email": "schmittjoh@gmail.com" - }, - { - "name": "Graham Campbell", - "email": "graham@alt-three.com" } ], "description": "Option Type for PHP", @@ -8063,7 +8053,7 @@ "php", "type" ], - "time": "2019-12-15T19:35:24+00:00" + "time": "2019-11-06T22:27:00+00:00" }, { "name": "phpspec/prophecy", @@ -9356,27 +9346,27 @@ }, { "name": "symfony/browser-kit", - "version": "v4.4.1", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "e19e465c055137938afd40cfddd687e7511bbbf0" + "reference": "b14fa08508afd152257d5dcc7adb5f278654d972" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/e19e465c055137938afd40cfddd687e7511bbbf0", - "reference": "e19e465c055137938afd40cfddd687e7511bbbf0", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/b14fa08508afd152257d5dcc7adb5f278654d972", + "reference": "b14fa08508afd152257d5dcc7adb5f278654d972", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/dom-crawler": "^3.4|^4.0|^5.0" + "symfony/dom-crawler": "~3.4|~4.0" }, "require-dev": { - "symfony/css-selector": "^3.4|^4.0|^5.0", - "symfony/http-client": "^4.3|^5.0", - "symfony/mime": "^4.3|^5.0", - "symfony/process": "^3.4|^4.0|^5.0" + "symfony/css-selector": "~3.4|~4.0", + "symfony/http-client": "^4.3", + "symfony/mime": "^4.3", + "symfony/process": "~3.4|~4.0" }, "suggest": { "symfony/process": "" @@ -9384,7 +9374,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -9411,36 +9401,36 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2019-10-28T20:30:34+00:00" + "time": "2019-10-28T17:07:32+00:00" }, { "name": "symfony/config", - "version": "v4.4.1", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "7aa5817f1b7a8ed377752b90fcc47dfb3c67b40c" + "reference": "8267214841c44d315a55242ea867684eb43c42ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/7aa5817f1b7a8ed377752b90fcc47dfb3c67b40c", - "reference": "7aa5817f1b7a8ed377752b90fcc47dfb3c67b40c", + "url": "https://api.github.com/repos/symfony/config/zipball/8267214841c44d315a55242ea867684eb43c42ce", + "reference": "8267214841c44d315a55242ea867684eb43c42ce", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/filesystem": "^3.4|^4.0|^5.0", + "symfony/filesystem": "~3.4|~4.0", "symfony/polyfill-ctype": "~1.8" }, "conflict": { "symfony/finder": "<3.4" }, "require-dev": { - "symfony/event-dispatcher": "^3.4|^4.0|^5.0", - "symfony/finder": "^3.4|^4.0|^5.0", - "symfony/messenger": "^4.1|^5.0", - "symfony/service-contracts": "^1.1|^2", - "symfony/yaml": "^3.4|^4.0|^5.0" + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/finder": "~3.4|~4.0", + "symfony/messenger": "~4.1", + "symfony/yaml": "~3.4|~4.0" }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" @@ -9448,7 +9438,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -9475,29 +9465,29 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2019-12-01T10:50:45+00:00" + "time": "2019-11-08T08:31:27+00:00" }, { "name": "symfony/dependency-injection", - "version": "v4.4.1", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "ad46a4def1325befab696b49c839dffea3fc92bd" + "reference": "80c6d9e19467dfbba14f830ed478eb592ce51b64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/ad46a4def1325befab696b49c839dffea3fc92bd", - "reference": "ad46a4def1325befab696b49c839dffea3fc92bd", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/80c6d9e19467dfbba14f830ed478eb592ce51b64", + "reference": "80c6d9e19467dfbba14f830ed478eb592ce51b64", "shasum": "" }, "require": { "php": "^7.1.3", "psr/container": "^1.0", - "symfony/service-contracts": "^1.1.6|^2" + "symfony/service-contracts": "^1.1.6" }, "conflict": { - "symfony/config": "<4.3|>=5.0", + "symfony/config": "<4.3", "symfony/finder": "<3.4", "symfony/proxy-manager-bridge": "<3.4", "symfony/yaml": "<3.4" @@ -9508,8 +9498,8 @@ }, "require-dev": { "symfony/config": "^4.3", - "symfony/expression-language": "^3.4|^4.0|^5.0", - "symfony/yaml": "^3.4|^4.0|^5.0" + "symfony/expression-language": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" }, "suggest": { "symfony/config": "", @@ -9521,7 +9511,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -9548,20 +9538,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2019-12-01T10:19:36+00:00" + "time": "2019-11-08T16:22:27+00:00" }, { "name": "symfony/dom-crawler", - "version": "v4.4.1", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "36bbcab9369fc2f583220890efd43bf262d563fd" + "reference": "4b9efd5708c3a38593e19b6a33e40867f4f89d72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/36bbcab9369fc2f583220890efd43bf262d563fd", - "reference": "36bbcab9369fc2f583220890efd43bf262d563fd", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/4b9efd5708c3a38593e19b6a33e40867f4f89d72", + "reference": "4b9efd5708c3a38593e19b6a33e40867f4f89d72", "shasum": "" }, "require": { @@ -9574,7 +9564,7 @@ }, "require-dev": { "masterminds/html5": "^2.6", - "symfony/css-selector": "^3.4|^4.0|^5.0" + "symfony/css-selector": "~3.4|~4.0" }, "suggest": { "symfony/css-selector": "" @@ -9582,7 +9572,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -9609,7 +9599,7 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2019-10-29T11:38:30+00:00" + "time": "2019-10-28T17:07:32+00:00" }, { "name": "symfony/http-foundation", @@ -9668,16 +9658,16 @@ }, { "name": "symfony/options-resolver", - "version": "v4.4.1", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "2be23e63f33de16b49294ea6581f462932a77e2f" + "reference": "f46c7fc8e207bd8a2188f54f8738f232533765a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/2be23e63f33de16b49294ea6581f462932a77e2f", - "reference": "2be23e63f33de16b49294ea6581f462932a77e2f", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/f46c7fc8e207bd8a2188f54f8738f232533765a4", + "reference": "f46c7fc8e207bd8a2188f54f8738f232533765a4", "shasum": "" }, "require": { @@ -9686,7 +9676,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -9718,20 +9708,20 @@ "configuration", "options" ], - "time": "2019-10-28T21:57:16+00:00" + "time": "2019-10-28T20:59:01+00:00" }, { "name": "symfony/polyfill-php54", - "version": "v1.13.1", + "version": "v1.12.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php54.git", - "reference": "dd1618047426412036e98d159940d58a81fc392c" + "reference": "a043bcced870214922fbb4bf22679d431ec0296a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/dd1618047426412036e98d159940d58a81fc392c", - "reference": "dd1618047426412036e98d159940d58a81fc392c", + "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/a043bcced870214922fbb4bf22679d431ec0296a", + "reference": "a043bcced870214922fbb4bf22679d431ec0296a", "shasum": "" }, "require": { @@ -9740,7 +9730,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.12-dev" } }, "autoload": { @@ -9776,20 +9766,20 @@ "portable", "shim" ], - "time": "2019-11-27T13:56:44+00:00" + "time": "2019-08-06T08:03:45+00:00" }, { "name": "symfony/polyfill-php55", - "version": "v1.13.1", + "version": "v1.12.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php55.git", - "reference": "b0d838f225725e2951af1aafc784d2e5ea7b656e" + "reference": "548bb39407e78e54f785b4e18c7e0d5d9e493265" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/b0d838f225725e2951af1aafc784d2e5ea7b656e", - "reference": "b0d838f225725e2951af1aafc784d2e5ea7b656e", + "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/548bb39407e78e54f785b4e18c7e0d5d9e493265", + "reference": "548bb39407e78e54f785b4e18c7e0d5d9e493265", "shasum": "" }, "require": { @@ -9799,7 +9789,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.12-dev" } }, "autoload": { @@ -9832,20 +9822,20 @@ "portable", "shim" ], - "time": "2019-11-27T13:56:44+00:00" + "time": "2019-08-06T08:03:45+00:00" }, { "name": "symfony/polyfill-php70", - "version": "v1.13.1", + "version": "v1.12.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "af23c7bb26a73b850840823662dda371484926c4" + "reference": "54b4c428a0054e254223797d2713c31e08610831" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/af23c7bb26a73b850840823662dda371484926c4", - "reference": "af23c7bb26a73b850840823662dda371484926c4", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/54b4c428a0054e254223797d2713c31e08610831", + "reference": "54b4c428a0054e254223797d2713c31e08610831", "shasum": "" }, "require": { @@ -9855,7 +9845,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.12-dev" } }, "autoload": { @@ -9891,20 +9881,20 @@ "portable", "shim" ], - "time": "2019-11-27T13:56:44+00:00" + "time": "2019-08-06T08:03:45+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.13.1", + "version": "v1.12.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "66fea50f6cb37a35eea048d75a7d99a45b586038" + "reference": "04ce3335667451138df4307d6a9b61565560199e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/66fea50f6cb37a35eea048d75a7d99a45b586038", - "reference": "66fea50f6cb37a35eea048d75a7d99a45b586038", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/04ce3335667451138df4307d6a9b61565560199e", + "reference": "04ce3335667451138df4307d6a9b61565560199e", "shasum": "" }, "require": { @@ -9913,7 +9903,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.12-dev" } }, "autoload": { @@ -9946,24 +9936,24 @@ "portable", "shim" ], - "time": "2019-11-27T13:56:44+00:00" + "time": "2019-08-06T08:03:45+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.0.1", + "version": "v1.1.8", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "144c5e51266b281231e947b51223ba14acf1a749" + "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", - "reference": "144c5e51266b281231e947b51223ba14acf1a749", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ffc7f5692092df31515df2a5ecf3b7302b3ddacf", + "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf", "shasum": "" }, "require": { - "php": "^7.2.5", + "php": "^7.1.3", "psr/container": "^1.0" }, "suggest": { @@ -9972,7 +9962,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "1.1-dev" } }, "autoload": { @@ -10004,30 +9994,30 @@ "interoperability", "standards" ], - "time": "2019-11-18T17:27:11+00:00" + "time": "2019-10-14T12:27:06+00:00" }, { "name": "symfony/stopwatch", - "version": "v4.4.1", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "5745b514fc56ae1907c6b8ed74f94f90f64694e9" + "reference": "e96c259de6abcd0cead71f0bf4d730d53ee464d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5745b514fc56ae1907c6b8ed74f94f90f64694e9", - "reference": "5745b514fc56ae1907c6b8ed74f94f90f64694e9", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/e96c259de6abcd0cead71f0bf4d730d53ee464d0", + "reference": "e96c259de6abcd0cead71f0bf4d730d53ee464d0", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/service-contracts": "^1.0|^2" + "symfony/service-contracts": "^1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -10054,20 +10044,20 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2019-11-05T16:11:08+00:00" + "time": "2019-11-05T14:48:09+00:00" }, { "name": "symfony/yaml", - "version": "v4.4.1", + "version": "v4.3.8", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "76de473358fe802578a415d5bb43c296cf09d211" + "reference": "324cf4b19c345465fad14f3602050519e09e361d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/76de473358fe802578a415d5bb43c296cf09d211", - "reference": "76de473358fe802578a415d5bb43c296cf09d211", + "url": "https://api.github.com/repos/symfony/yaml/zipball/324cf4b19c345465fad14f3602050519e09e361d", + "reference": "324cf4b19c345465fad14f3602050519e09e361d", "shasum": "" }, "require": { @@ -10078,7 +10068,7 @@ "symfony/console": "<3.4" }, "require-dev": { - "symfony/console": "^3.4|^4.0|^5.0" + "symfony/console": "~3.4|~4.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" @@ -10086,7 +10076,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -10113,7 +10103,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-11-12T14:51:11+00:00" + "time": "2019-10-30T12:58:49+00:00" }, { "name": "theseer/fdomdocument", @@ -10248,29 +10238,31 @@ }, { "name": "webmozart/assert", - "version": "1.6.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "573381c0a64f155a0d9a23f4b0c797194805b925" + "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925", - "reference": "573381c0a64f155a0d9a23f4b0c797194805b925", + "url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4", + "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4", "shasum": "" }, "require": { "php": "^5.3.3 || ^7.0", "symfony/polyfill-ctype": "^1.8" }, - "conflict": { - "vimeo/psalm": "<3.6.0" - }, "require-dev": { "phpunit/phpunit": "^4.8.36 || ^7.5.13" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -10292,7 +10284,7 @@ "check", "validate" ], - "time": "2019-11-24T13:36:37+00:00" + "time": "2019-08-24T08:43:50+00:00" }, { "name": "weew/helpers-array", From 2be8374fe0262eccb232ff9614211c126d496a4b Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Tue, 17 Dec 2019 07:42:22 +0700 Subject: [PATCH 578/595] Refactor code --- .../Unit/Pricing/MsrpPriceCalculatorTest.php | 85 +++++++++---------- 1 file changed, 40 insertions(+), 45 deletions(-) diff --git a/app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php b/app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php index aac6852b7000c..24e10207ff14c 100644 --- a/app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php +++ b/app/code/Magento/Msrp/Test/Unit/Pricing/MsrpPriceCalculatorTest.php @@ -9,7 +9,7 @@ namespace Magento\Msrp\Test\Unit\Pricing; use Magento\Catalog\Model\Product; -use Magento\Catalog\Model\Product\Type as Type; +use Magento\Catalog\Model\Product\Type as ProductType; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\GroupedProduct\Model\Product\Type\Grouped as GroupedType; use Magento\Msrp\Pricing\MsrpPriceCalculator; @@ -19,6 +19,36 @@ class MsrpPriceCalculatorTest extends TestCase { + /** + * @var MsrpPriceCalculator + */ + private $pricing; + + /** + * @var MsrpGroupedCalculator|MockObject + */ + private $msrpGroupedCalculatorMock; + + /** + * Prepare environment to test + */ + protected function setUp() + { + $objectManager = new ObjectManager($this); + $this->msrpGroupedCalculatorMock = $this->createMock(MsrpGroupedCalculator::class); + $this->pricing = $objectManager->getObject( + MsrpPriceCalculator::class, + [ + 'msrpPriceCalculators' => [ + [ + 'productType' => GroupedType::TYPE_CODE, + 'priceCalculator' => $this->msrpGroupedCalculatorMock + ] + ] + ] + ); + } + /** * Test getMrspPriceValue() with the data provider below * @@ -27,17 +57,12 @@ class MsrpPriceCalculatorTest extends TestCase * @param float $expected * @dataProvider getMsrpPriceValueDataProvider */ - public function testGetMsrpPriceValue($msrpPriceCalculators, $productMock, $expected) + public function testGetMsrpPriceValue($msrpPriceCalculatorPrice, $productMock, $expected) { - $objectManager = new ObjectManager($this); - $pricing = $objectManager->getObject( - MsrpPriceCalculator::class, - [ - 'msrpPriceCalculators' => $msrpPriceCalculators - ] - ); + $this->msrpGroupedCalculatorMock->expects($this->any()) + ->method('getMsrpPriceValue')->willReturn($msrpPriceCalculatorPrice); - $this->assertEquals($expected, $pricing->getMsrpPriceValue($productMock)); + $this->assertEquals($expected, $this->pricing->getMsrpPriceValue($productMock)); } /** @@ -48,49 +73,19 @@ public function testGetMsrpPriceValue($msrpPriceCalculators, $productMock, $expe public function getMsrpPriceValueDataProvider() { return [ - 'Get Mrsp Price with grouped product and price calculator is also grouped product type' => [ - [ - [ - 'productType' => GroupedType::TYPE_CODE, - 'priceCalculator' => $this->createPriceCalculatorMock( - MsrpGroupedCalculator::class, - 23.50 - ) - ] - ], + 'Get Mrsp Price with product and msrp calculator and the same product type' => [ + 23.50, $this->createProductMock(GroupedType::TYPE_CODE, 0), 23.50 ], - 'Get Mrsp Price with simple product and price calculator is grouped product type' => [ - [ - [ - 'productType' => GroupedType::TYPE_CODE, - 'priceCalculator' => $this->createPriceCalculatorMock( - MsrpGroupedCalculator::class, - 0 - ) - ] - ], - $this->createProductMock(Type::TYPE_SIMPLE, 24.88), + 'Get Mrsp Price with product and msrp calculator and the different product type' => [ + 24.88, + $this->createProductMock(ProductType::TYPE_SIMPLE, 24.88), 24.88 ] ]; } - /** - * Create Price Calculator Mock - * - * @param string $class - * @param float $msrpPriceValue - * @return MockObject - */ - private function createPriceCalculatorMock($class, $msrpPriceValue) - { - $priceCalculatorMock = $this->createMock($class); - $priceCalculatorMock->expects($this->any())->method('getMsrpPriceValue')->willReturn($msrpPriceValue); - return $priceCalculatorMock; - } - /** * Create Product Mock * From 9b6d9d0436d5dd03960e08de1748eec76dfe07c8 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Tue, 17 Dec 2019 10:14:33 +0700 Subject: [PATCH 579/595] [Directory] Cover action directory/json/countryRegion by Integration Test --- .../Adminhtml/Json/CountryRegionTest.php | 50 +++++++++++++++++++ .../_files/example_region_in_country.php | 37 ++++++++++++++ .../example_region_in_country_rollback.php | 26 ++++++++++ 3 files changed, 113 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Directory/Controller/Adminhtml/Json/CountryRegionTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country.php create mode 100644 dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country_rollback.php diff --git a/dev/tests/integration/testsuite/Magento/Directory/Controller/Adminhtml/Json/CountryRegionTest.php b/dev/tests/integration/testsuite/Magento/Directory/Controller/Adminhtml/Json/CountryRegionTest.php new file mode 100644 index 0000000000000..8d3b12aa34f1e --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Directory/Controller/Adminhtml/Json/CountryRegionTest.php @@ -0,0 +1,50 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Directory\Controller\Adminhtml\Json; + +use Magento\Framework\App\Request\Http as HttpRequest; +use Magento\TestFramework\TestCase\AbstractBackendController; + +/** + * @magentoAppArea adminhtml + */ +class CountryRegionTest extends AbstractBackendController +{ + /** + * Test Execute without param + */ + public function testExecuteWithNoCountryParam() + { + $this->getRequest()->setMethod(HttpRequest::METHOD_POST); + $this->getRequest()->setPostValue([]); + $this->dispatch('backend/directory/json/countryRegion'); + + $actual = $this->getResponse()->getBody(); + + $this->assertEquals('[]', $actual); + } + + /** + * Test Execute with region in the fixture + * + * @magentoDataFixture Magento/Directory/_files/example_region_in_country.php + */ + public function testExecute() + { + $this->getRequest()->setMethod(HttpRequest::METHOD_POST); + $this->getRequest()->setPostValue([ + 'parent' => 'WW' + ]); + $this->dispatch('backend/directory/json/countryRegion'); + + $actual = $this->getResponse()->getBody(); + + $this->assertContains('Example Region 1', $actual); + $this->assertContains('Example Region 2', $actual); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country.php b/dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country.php new file mode 100644 index 0000000000000..680c0079a795c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country.php @@ -0,0 +1,37 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Directory\Model\Region as RegionModel; +use Magento\Directory\Model\ResourceModel\Region as RegionResource; + +$objectManager = Bootstrap::getObjectManager(); + +$regionData = [ + [ + 'country_id' => 'WW', + 'code' => 'ER1', + 'default_name' => 'Example Region 1' + ], + [ + 'country_id' => 'WW', + 'code' => 'ER2', + 'default_name' => 'Example Region 2' + ] +]; + +/** @var RegionModel $region */ +$region = $objectManager->create(RegionModel::class); +/** @var RegionResource $regionResource */ +$regionResource = $objectManager->get(RegionResource::class); + +foreach ($regionData as $data) { + /** @var RegionModel $region */ + $region = $objectManager->create(RegionModel::class); + $regionResource->save($region); +} diff --git a/dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country_rollback.php b/dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country_rollback.php new file mode 100644 index 0000000000000..4f78873aa380f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country_rollback.php @@ -0,0 +1,26 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Directory\Model\Region as RegionModel; +use Magento\Directory\Model\ResourceModel\Region as RegionResource; +use Magento\Directory\Model\ResourceModel\Region\Collection as RegionResourceCollection; + +$objectManager = Bootstrap::getObjectManager(); +$regionCode = ['ER1', 'ER2']; + +/** @var RegionResource $regionResource */ +$regionResource = $objectManager->get(RegionResource::class); + +$regionCollection = $objectManager->create(RegionResourceCollection::class) + ->addFieldToFilter('code', ['in' => $regionCode]); + +/** @var RegionModel $region */ +foreach ($regionCollection as $region) { + $regionResource->delete($region); +} From e3ce8c9f5bf263b12614af349a38be5e7168020b Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Tue, 17 Dec 2019 11:20:18 +0700 Subject: [PATCH 580/595] [Directory] Cover action directory/json/countryRegion by Integration Test --- .../Magento/Directory/_files/example_region_in_country.php | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country.php b/dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country.php index 680c0079a795c..ba33b09a1f948 100644 --- a/dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country.php +++ b/dev/tests/integration/testsuite/Magento/Directory/_files/example_region_in_country.php @@ -33,5 +33,6 @@ foreach ($regionData as $data) { /** @var RegionModel $region */ $region = $objectManager->create(RegionModel::class); + $region->setData($data); $regionResource->save($region); } From 8451e0f6d4754d29c9458ab21ec60aafa674f8b9 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <51681547+engcom-Golf@users.noreply.github.com> Date: Tue, 17 Dec 2019 10:33:14 +0200 Subject: [PATCH 581/595] Fix static test --- .../Magento/Framework/View/Element/Template/File/Resolver.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Element/Template/File/Resolver.php b/lib/internal/Magento/Framework/View/Element/Template/File/Resolver.php index b13caa55d3174..cd7ba1dfaecda 100644 --- a/lib/internal/Magento/Framework/View/Element/Template/File/Resolver.php +++ b/lib/internal/Magento/Framework/View/Element/Template/File/Resolver.php @@ -9,9 +9,7 @@ use Magento\Framework\Serialize\Serializer\Json; /** - * Class Resolver - * - * @package Magento\Framework\View\Element\Template\File + * Resolver, returns template file name by template. */ class Resolver { From 2e7f74bc940752ff4faa682300cdac667b872695 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <51681547+engcom-Golf@users.noreply.github.com> Date: Tue, 17 Dec 2019 10:34:01 +0200 Subject: [PATCH 582/595] fix static test --- lib/internal/Magento/Framework/View/Element/RendererList.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/View/Element/RendererList.php b/lib/internal/Magento/Framework/View/Element/RendererList.php index 96707c74dd253..eba78867d7725 100644 --- a/lib/internal/Magento/Framework/View/Element/RendererList.php +++ b/lib/internal/Magento/Framework/View/Element/RendererList.php @@ -6,7 +6,7 @@ namespace Magento\Framework\View\Element; /** - * Renderer List + * Get renderer by code * * @api */ From 78dc52b87d6a4517799bc0f359b8016e0d40b21a Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <51681547+engcom-Golf@users.noreply.github.com> Date: Tue, 17 Dec 2019 10:34:58 +0200 Subject: [PATCH 583/595] fix static test fix --- .../Framework/View/Element/ExceptionHandlerBlockFactory.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Element/ExceptionHandlerBlockFactory.php b/lib/internal/Magento/Framework/View/Element/ExceptionHandlerBlockFactory.php index b1c74777fb102..b13ac2531ebc8 100644 --- a/lib/internal/Magento/Framework/View/Element/ExceptionHandlerBlockFactory.php +++ b/lib/internal/Magento/Framework/View/Element/ExceptionHandlerBlockFactory.php @@ -6,9 +6,7 @@ namespace Magento\Framework\View\Element; /** - * Class ExceptionHandlerBlockFactory - * - * @package Magento\Framework\View\Element + * Factory for BlockInterface */ class ExceptionHandlerBlockFactory { From dd7479d20dd1afbfaa470c9012c0dea61be00fff Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Tue, 17 Dec 2019 17:11:21 +0700 Subject: [PATCH 584/595] [Search] Cover SynonymActions Column by Unit Test --- .../Listing/Column/SynonymActionsTest.php | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 app/code/Magento/Search/Test/Unit/Ui/Component/Listing/Column/SynonymActionsTest.php diff --git a/app/code/Magento/Search/Test/Unit/Ui/Component/Listing/Column/SynonymActionsTest.php b/app/code/Magento/Search/Test/Unit/Ui/Component/Listing/Column/SynonymActionsTest.php new file mode 100644 index 0000000000000..7ba1eab0437f0 --- /dev/null +++ b/app/code/Magento/Search/Test/Unit/Ui/Component/Listing/Column/SynonymActionsTest.php @@ -0,0 +1,122 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\Search\Test\Unit\Ui\Component\Listing\Column; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Framework\UrlInterface; +use Magento\Search\Ui\Component\Listing\Column\SynonymActions; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class SynonymActionsTest extends TestCase +{ + /** + * @var SynonymActions + */ + private $synonymActions; + + /** + * @var UrlInterface|MockObject + */ + private $urlBuilderMock; + + /** + * Setup environment to test + */ + protected function setup() + { + $this->urlBuilderMock = $this->createMock(UrlInterface::class); + + $objectManager = new ObjectManager($this); + + $this->synonymActions = $objectManager->getObject( + SynonymActions::class, + [ + 'urlBuilder' => $this->urlBuilderMock, + 'data' => [ + 'name' => 'actions' + ] + ] + ); + } + + /** + * Test prepareDataSource() with data source has no item + */ + public function testPrepareDataSourceWithNoItem() + { + $dataSource = [ + 'data' => [] + ]; + $expected = [ + 'data' => [] + ]; + /** + * Assert Result + */ + $this->assertEquals($expected, $this->synonymActions->prepareDataSource($dataSource)); + } + + /** + * Test prepareDataSource() with data source has items + */ + public function testPrepareDataSourceWithItems() + { + $dataSource = [ + 'data' => [ + 'items' => [ + [ + 'group_id' => 1 + ] + ] + ] + ]; + $expected = [ + 'data' => [ + 'items' => [ + [ + 'group_id' => 1, + 'actions' => [ + 'delete' => [ + 'href' => 'http://localhost/magento2/admin/search/synonyms/delete/group_id/1', + 'label' => (string)__('Delete'), + 'confirm' => [ + 'title' => (string)__('Delete'), + 'message' => (string)__( + 'Are you sure you want to delete synonym group with id: %1?', + 1 + ) + ], + '__disableTmpl' => true + ], + 'edit' => [ + 'href' => 'http://localhost/magento2/admin/search/synonyms/edit/group_id/1', + 'label' => (string)__('View/Edit'), + '__disableTmpl' => true + ] + ] + ] + ] + ] + ]; + + $this->urlBuilderMock->expects($this->at(0))->method('getUrl') + ->with(SynonymActions::SYNONYM_URL_PATH_DELETE, ['group_id' => 1]) + ->willReturn('http://localhost/magento2/admin/search/synonyms/delete/group_id/1'); + + $this->urlBuilderMock->expects($this->at(1))->method('getUrl') + ->with(SynonymActions::SYNONYM_URL_PATH_EDIT, ['group_id' => 1]) + ->willReturn('http://localhost/magento2/admin/search/synonyms/edit/group_id/1'); + + /** + * Assert Result + */ + $this->assertEquals($expected, $this->synonymActions->prepareDataSource($dataSource)); + } +} From b0d2f6535389c43e17d71380febd55bd12567887 Mon Sep 17 00:00:00 2001 From: Nazar Klovanych <nazarn96@gmail.com> Date: Tue, 17 Dec 2019 14:33:41 +0200 Subject: [PATCH 585/595] Cover changes with jasmine test --- .../base/js/lib/ko/bind/color-picker.test.js | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/lib/ko/bind/color-picker.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/lib/ko/bind/color-picker.test.js index 9b756a2f2a49a..afbd7e8e94c2d 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/lib/ko/bind/color-picker.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/lib/ko/bind/color-picker.test.js @@ -85,5 +85,28 @@ define([ expect($.fn.init).toHaveBeenCalledWith($input, undefined); }); + + it('Verify config value is empty when reset colorpicker intput', function () { + var value = { + configStuffInHere: true, + value: jasmine.createSpy().and.returnValue(undefined) + }, + valueAccessor = jasmine.createSpy().and.returnValue(value), + viewModel = { + disabled: jasmine.createSpy().and.returnValue(false) + }; + + $.fn.spectrum = jasmine.createSpy(); + $input = jasmine.createSpy(); + + ko.bindingHandlers.colorPicker.update($input, valueAccessor, null, viewModel); + expect($.fn.spectrum).toHaveBeenCalledTimes(1); + expect(valueAccessor().value).toHaveBeenCalledTimes(4); + + value.value = jasmine.createSpy().and.returnValue(''); + ko.bindingHandlers.colorPicker.update($input, valueAccessor, null, viewModel); + expect($.fn.spectrum).toHaveBeenCalledTimes(3); + expect(valueAccessor().value).toHaveBeenCalledTimes(5); + }); }); }); From 41a583abd83a20c21bbc80c044ad9f6f0ebcc63b Mon Sep 17 00:00:00 2001 From: Sathish <srsathish92@gmail.com> Date: Tue, 17 Dec 2019 18:58:35 +0530 Subject: [PATCH 586/595] Expected result added with data provider --- .../Test/Unit/Helper/DataTest.php | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/GoogleAnalytics/Test/Unit/Helper/DataTest.php b/app/code/Magento/GoogleAnalytics/Test/Unit/Helper/DataTest.php index ea1df498499de..4da5b70e10b91 100644 --- a/app/code/Magento/GoogleAnalytics/Test/Unit/Helper/DataTest.php +++ b/app/code/Magento/GoogleAnalytics/Test/Unit/Helper/DataTest.php @@ -53,10 +53,13 @@ protected function setUp(): void /** * Test for isGoogleAnalyticsAvailable() * + * @param string $value + * @param bool $flag + * @param bool $result * @return void * @dataProvider gaDataProvider */ - public function testIsGoogleAnalyticsAvailable($value, $flag): void + public function testIsGoogleAnalyticsAvailable($value, $flag, $result): void { $this->scopeConfigMock->expects($this->once()) ->method('getValue') @@ -68,7 +71,7 @@ public function testIsGoogleAnalyticsAvailable($value, $flag): void ->with(HelperData::XML_PATH_ACTIVE, ScopeInterface::SCOPE_STORE) ->willReturn($flag); - $this->assertEquals(($value && $flag), $this->helper->isGoogleAnalyticsAvailable()); + $this->assertEquals($result, $this->helper->isGoogleAnalyticsAvailable()); } /** @@ -79,25 +82,27 @@ public function testIsGoogleAnalyticsAvailable($value, $flag): void public function gaDataProvider(): array { return [ - ['GA-XXXX', true], - ['GA-XXXX', false], - ['', true] + ['GA-XXXX', true, true], + ['GA-XXXX', false, false], + ['', true, false] ]; } /** * Test for isAnonymizedIpActive() * + * @param string $value + * @param bool $result * @return void * @dataProvider yesNoDataProvider */ - public function testIsAnonymizedIpActive($value): void + public function testIsAnonymizedIpActive($value, $result): void { $this->scopeConfigMock->expects($this->once()) ->method('getValue') ->with(HelperData::XML_PATH_ANONYMIZE, ScopeInterface::SCOPE_STORE) ->willReturn($value); - $this->assertEquals((bool) $value, $this->helper->isAnonymizedIpActive()); + $this->assertEquals($result, $this->helper->isAnonymizedIpActive()); } /** @@ -108,8 +113,8 @@ public function testIsAnonymizedIpActive($value): void public function yesNoDataProvider(): array { return [ - ['Yes' => '1'], - ['No' => '0'] + ['Yes' => '1', 'result' => true], + ['No' => '0', 'result' => false] ]; } } From 8201ea2a15fafa5a50560b3c9890092b059bb619 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Tue, 17 Dec 2019 22:14:55 +0700 Subject: [PATCH 587/595] [GiftMessage] Cover Observer SalesEventOrderItemToQuoteItemObserver by Unit Test --- ...sEventOrderItemToQuoteItemObserverTest.php | 196 ++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 app/code/Magento/GiftMessage/Test/Unit/Observer/SalesEventOrderItemToQuoteItemObserverTest.php diff --git a/app/code/Magento/GiftMessage/Test/Unit/Observer/SalesEventOrderItemToQuoteItemObserverTest.php b/app/code/Magento/GiftMessage/Test/Unit/Observer/SalesEventOrderItemToQuoteItemObserverTest.php new file mode 100644 index 0000000000000..1df1c1101ccd1 --- /dev/null +++ b/app/code/Magento/GiftMessage/Test/Unit/Observer/SalesEventOrderItemToQuoteItemObserverTest.php @@ -0,0 +1,196 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\GiftMessage\Test\Unit\Observer; + +use Magento\Framework\Event; +use Magento\Framework\Event\Observer; +use Magento\Framework\Message\MessageInterface; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\GiftMessage\Helper\Message as MessageHelper; +use Magento\GiftMessage\Model\Message as MessageModel; +use Magento\GiftMessage\Model\MessageFactory; +use Magento\GiftMessage\Observer\SalesEventOrderItemToQuoteItemObserver; +use Magento\Quote\Model\Quote\Item as QuoteItem; +use Magento\Sales\Model\Order; +use Magento\Sales\Model\Order\Item as OrderItem; +use Magento\Store\Model\Store; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class SalesEventOrderItemToQuoteItemObserverTest extends TestCase +{ + /** + * Stub message id + */ + private const STUB_MESSAGE_ID = 1; + + /** + * Stub new message id + */ + private const STUB_NEW_MESSAGE_ID = 2; + + /** + * @var SalesEventOrderItemToQuoteItemObserver + */ + private $observer; + + /** + * @var MessageFactory|MockObject + */ + private $messageFactoryMock; + + /** + * @var MessageHelper|MockObject + */ + private $giftMessageHelperMock; + + /** + * @var Observer|MockObject + */ + private $observerMock; + + /** + * @var Event|MockObject + */ + private $eventMock; + + /** + * @var Order|MockObject + */ + private $orderMock; + + /** + * @var OrderItem|MockObject + */ + private $orderItemMock; + + /** + * @var Store|MockObject + */ + private $storeMock; + + /** + * @var MessageInterface|MockObject + */ + private $messageMock; + + /** + * @var QuoteItem|MockObject + */ + private $quoteItemMock; + + /** + * Prepare environment for test + */ + public function setUp(): void + { + $this->messageFactoryMock = $this->createMock(MessageFactory::class); + $this->giftMessageHelperMock = $this->createMock(MessageHelper::class); + $this->observerMock = $this->createMock(Observer::class); + $this->eventMock = $this->createPartialMock(Event::class, ['getOrderItem', 'getQuoteItem']); + $this->orderItemMock = $this->createPartialMock( + OrderItem::class, + ['getOrder', 'getStoreId', 'getGiftMessageId'] + ); + $this->quoteItemMock = $this->createPartialMock(QuoteItem::class, ['setGiftMessageId']); + $this->orderMock = $this->createPartialMock(Order::class, ['getReordered']); + $this->storeMock = $this->createMock(Store::class); + $this->messageMock = $this->createMock(MessageModel::class); + + $objectManager = new ObjectManager($this); + + $this->observer = $objectManager->getObject( + SalesEventOrderItemToQuoteItemObserver::class, + [ + 'messageFactory' => $this->messageFactoryMock, + 'giftMessageMessage' => $this->giftMessageHelperMock + ] + ); + } + + /** + * Tests duplicating gift message from order item to quote item + * + * @param bool $orderIsReordered + * @param bool $isMessagesAllowed + * @dataProvider giftMessageDataProvider + */ + public function testExecute($orderIsReordered, $isMessagesAllowed) + { + $this->eventMock->expects($this->atLeastOnce()) + ->method('getOrderItem') + ->willReturn($this->orderItemMock); + + $this->orderItemMock->expects($this->atLeastOnce()) + ->method('getOrder') + ->willReturn($this->orderMock); + + $this->observerMock->expects($this->atLeastOnce()) + ->method('getEvent') + ->willReturn($this->eventMock); + + if (!$orderIsReordered && $isMessagesAllowed) { + $this->eventMock + ->expects($this->atLeastOnce()) + ->method('getQuoteItem') + ->willReturn($this->quoteItemMock); + $this->orderMock->expects($this->once()) + ->method('getReordered') + ->willReturn($orderIsReordered); + $this->orderItemMock->expects($this->once()) + ->method('getGiftMessageId') + ->willReturn(self::STUB_MESSAGE_ID); + $this->giftMessageHelperMock->expects($this->once()) + ->method('isMessagesAllowed') + ->willReturn($isMessagesAllowed); + $this->messageFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($this->messageMock); + $this->messageMock->expects($this->once()) + ->method('load') + ->with(self::STUB_MESSAGE_ID) + ->willReturnSelf(); + $this->messageMock->expects($this->once()) + ->method('setId') + ->with(null) + ->willReturnSelf(); + $this->messageMock->expects($this->once()) + ->method('save') + ->willReturnSelf(); + $this->messageMock->expects($this->once()) + ->method('getId') + ->willReturn(self::STUB_NEW_MESSAGE_ID); + $this->quoteItemMock->expects($this->once()) + ->method('setGiftMessageId') + ->with(self::STUB_NEW_MESSAGE_ID) + ->willReturnSelf(); + } + + /** Run observer */ + $this->observer->execute($this->observerMock); + } + + /** + * Providing gift message data for test + * + * @return array + */ + public function giftMessageDataProvider() + { + return [ + 'order is not reordered, messages is allowed' => [false, true], + 'order is reordered, messages is allowed' => [true, true], + 'order is reordered, messages is not allowed' => [true, false], + 'order is not reordered, messages is not allowed' => [false, false] + ]; + } +} From 97b128635b82ce74c9ee1e92e1792a0a40fb089a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?= <lukasz.bajsarowicz@gmail.com> Date: Thu, 12 Dec 2019 11:20:35 +0100 Subject: [PATCH 588/595] Add information about the path that is not allowed --- app/code/Magento/MediaStorage/App/Media.php | 49 +++-- .../MediaStorage/Test/Unit/App/MediaTest.php | 184 +++++++++++------- 2 files changed, 146 insertions(+), 87 deletions(-) diff --git a/app/code/Magento/MediaStorage/App/Media.php b/app/code/Magento/MediaStorage/App/Media.php index e1644ebaf5a48..15bf7bb62e970 100644 --- a/app/code/Magento/MediaStorage/App/Media.php +++ b/app/code/Magento/MediaStorage/App/Media.php @@ -5,22 +5,31 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\MediaStorage\App; +use Closure; +use Exception; +use LogicException; use Magento\Catalog\Model\View\Asset\PlaceholderFactory; +use Magento\Framework\App; +use Magento\Framework\App\Area; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\App\ResponseInterface; use Magento\Framework\App\State; +use Magento\Framework\AppInterface; use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\WriteInterface; +use Magento\MediaStorage\Model\File\Storage\Config; use Magento\MediaStorage\Model\File\Storage\ConfigFactory; use Magento\MediaStorage\Model\File\Storage\Response; -use Magento\Framework\App; -use Magento\Framework\App\Filesystem\DirectoryList; -use Magento\Framework\AppInterface; +use Magento\MediaStorage\Model\File\Storage\Synchronization; use Magento\MediaStorage\Model\File\Storage\SynchronizationFactory; -use Magento\Framework\App\Area; -use Magento\MediaStorage\Model\File\Storage\Config; use Magento\MediaStorage\Service\ImageResize; /** + * Media Storage + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class Media implements AppInterface @@ -28,7 +37,7 @@ class Media implements AppInterface /** * Authorization function * - * @var \Closure + * @var Closure */ private $isAllowed; @@ -59,7 +68,7 @@ class Media implements AppInterface private $response; /** - * @var \Magento\Framework\Filesystem\Directory\WriteInterface + * @var WriteInterface */ private $directory; @@ -92,7 +101,7 @@ class Media implements AppInterface * @param ConfigFactory $configFactory * @param SynchronizationFactory $syncFactory * @param Response $response - * @param \Closure $isAllowed + * @param Closure $isAllowed * @param string $mediaDirectory * @param string $configCacheFile * @param string $relativeFileName @@ -106,7 +115,7 @@ public function __construct( ConfigFactory $configFactory, SynchronizationFactory $syncFactory, Response $response, - \Closure $isAllowed, + Closure $isAllowed, $mediaDirectory, $configCacheFile, $relativeFileName, @@ -120,6 +129,7 @@ public function __construct( $this->directory = $filesystem->getDirectoryWrite(DirectoryList::PUB); $mediaDirectory = trim($mediaDirectory); if (!empty($mediaDirectory)) { + // phpcs:ignore Magento2.Functions.DiscouragedFunction $this->mediaDirectoryPath = str_replace('\\', '/', realpath($mediaDirectory)); } $this->configCacheFile = $configCacheFile; @@ -135,9 +145,9 @@ public function __construct( * Run application * * @return Response - * @throws \LogicException + * @throws LogicException */ - public function launch() + public function launch(): ResponseInterface { $this->appState->setAreaCode(Area::AREA_GLOBAL); @@ -150,12 +160,12 @@ public function launch() $allowedResources = $config->getAllowedResources(); $isAllowed = $this->isAllowed; if (!$isAllowed($this->relativeFileName, $allowedResources)) { - throw new \LogicException('The specified path is not allowed.'); + throw new LogicException('The path is not allowed: ' . $this->relativeFileName); } } try { - /** @var \Magento\MediaStorage\Model\File\Storage\Synchronization $sync */ + /** @var Synchronization $sync */ $sync = $this->syncFactory->create(['directory' => $this->directory]); $sync->synchronize($this->relativeFileName); $this->imageResize->resizeFromImageName($this->getOriginalImage($this->relativeFileName)); @@ -164,14 +174,19 @@ public function launch() } else { $this->setPlaceholderImage(); } - } catch (\Exception $e) { + } catch (Exception $e) { $this->setPlaceholderImage(); } return $this->response; } - private function setPlaceholderImage() + /** + * Set Placeholder as a response + * + * @return void + */ + private function setPlaceholderImage(): void { $placeholder = $this->placeholderFactory->create(['type' => 'image']); $this->response->setFilePath($placeholder->getPath()); @@ -189,9 +204,9 @@ private function getOriginalImage(string $resizedImagePath): string } /** - * {@inheritdoc} + * @inheritdoc */ - public function catchException(App\Bootstrap $bootstrap, \Exception $exception) + public function catchException(App\Bootstrap $bootstrap, Exception $exception) { $this->response->setHttpResponseCode(404); if ($bootstrap->isDeveloperMode()) { diff --git a/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php b/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php index 90075d11c6af3..e6f43dd435869 100644 --- a/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php +++ b/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php @@ -3,145 +3,118 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\MediaStorage\Test\Unit\App; +use Exception; +use LogicException; use Magento\Catalog\Model\View\Asset\Placeholder; use Magento\Catalog\Model\View\Asset\PlaceholderFactory; +use Magento\Framework\App\Bootstrap; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Filesystem; +use Magento\Framework\Filesystem\Directory\Read; +use Magento\Framework\Filesystem\Directory\WriteInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\MediaStorage\App\Media; +use Magento\MediaStorage\Model\File\Storage\Config; +use Magento\MediaStorage\Model\File\Storage\ConfigFactory; +use Magento\MediaStorage\Model\File\Storage\Response; +use Magento\MediaStorage\Model\File\Storage\Synchronization; +use Magento\MediaStorage\Model\File\Storage\SynchronizationFactory; +use PHPUnit\Framework\TestCase; +use PHPUnit_Framework_MockObject_MockObject as MockObject; /** - * Class MediaTest + * Verification for Media class + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class MediaTest extends \PHPUnit\Framework\TestCase +class MediaTest extends TestCase { const MEDIA_DIRECTORY = 'mediaDirectory'; const RELATIVE_FILE_PATH = 'test/file.png'; const CACHE_FILE_PATH = 'var'; /** - * @var \Magento\MediaStorage\App\Media + * @var Media */ - private $model; + private $mediaModel; /** - * @var \Magento\MediaStorage\Model\File\Storage\ConfigFactory|\PHPUnit_Framework_MockObject_MockObject + * @var ConfigFactory|MockObject */ private $configFactoryMock; /** - * @var \Magento\MediaStorage\Model\File\Storage\SynchronizationFactory|\PHPUnit_Framework_MockObject_MockObject + * @var SynchronizationFactory|MockObject */ private $syncFactoryMock; /** - * @var callable - */ - private $closure; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var Config|MockObject */ private $configMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var Synchronization|MockObject */ private $sync; /** - * @var \Magento\MediaStorage\Model\File\Storage\Response|\PHPUnit_Framework_MockObject_MockObject + * @var Response|MockObject */ private $responseMock; /** - * @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject + * @var Filesystem|MockObject */ private $filesystemMock; /** - * @var \Magento\Framework\Filesystem\Directory\Read|\PHPUnit_Framework_MockObject_MockObject + * @var Read|MockObject */ private $directoryMock; protected function setUp() { - $this->closure = function () { - return true; - }; - $this->configMock = $this->createMock(\Magento\MediaStorage\Model\File\Storage\Config::class); - $this->sync = $this->createMock(\Magento\MediaStorage\Model\File\Storage\Synchronization::class); + $this->configMock = $this->createMock(Config::class); + $this->sync = $this->createMock(Synchronization::class); $this->configFactoryMock = $this->createPartialMock( - \Magento\MediaStorage\Model\File\Storage\ConfigFactory::class, + ConfigFactory::class, ['create'] ); $this->configFactoryMock->expects($this->any()) ->method('create') ->will($this->returnValue($this->configMock)); $this->syncFactoryMock = $this->createPartialMock( - \Magento\MediaStorage\Model\File\Storage\SynchronizationFactory::class, + SynchronizationFactory::class, ['create'] ); $this->syncFactoryMock->expects($this->any()) ->method('create') ->will($this->returnValue($this->sync)); - $this->filesystemMock = $this->createMock(\Magento\Framework\Filesystem::class); - $this->directoryMock = $this->getMockForAbstractClass( - \Magento\Framework\Filesystem\Directory\WriteInterface::class - ); + $this->filesystemMock = $this->createMock(Filesystem::class); + $this->directoryMock = $this->getMockForAbstractClass(WriteInterface::class); $this->filesystemMock->expects($this->any()) ->method('getDirectoryWrite') ->with(DirectoryList::PUB) ->will($this->returnValue($this->directoryMock)); - $this->responseMock = $this->createMock(\Magento\MediaStorage\Model\File\Storage\Response::class); - - $objectManager = new ObjectManager($this); - $this->model = $objectManager->getObject( - \Magento\MediaStorage\App\Media::class, - [ - 'configFactory' => $this->configFactoryMock, - 'syncFactory' => $this->syncFactoryMock, - 'response' => $this->responseMock, - 'isAllowed' => $this->closure, - 'mediaDirectory' => false, - 'configCacheFile' => self::CACHE_FILE_PATH, - 'relativeFileName' => self::RELATIVE_FILE_PATH, - 'filesystem' => $this->filesystemMock, - 'placeholderFactory' => $this->createConfiguredMock( - PlaceholderFactory::class, - [ - 'create' => $this->createMock(Placeholder::class) - ] - ), - ] - ); + $this->responseMock = $this->createMock(Response::class); } protected function tearDown() { - unset($this->model); + unset($this->mediaModel); } public function testProcessRequestCreatesConfigFileMediaDirectoryIsNotProvided() { - $objectManager = new ObjectManager($this); - $this->model = $objectManager->getObject( - \Magento\MediaStorage\App\Media::class, - [ - 'configFactory' => $this->configFactoryMock, - 'syncFactory' => $this->syncFactoryMock, - 'response' => $this->responseMock, - 'isAllowed' => $this->closure, - 'mediaDirectory' => false, - 'configCacheFile' => self::CACHE_FILE_PATH, - 'relativeFileName' => self::RELATIVE_FILE_PATH, - 'filesystem' => $this->filesystemMock - ] - ); + $this->mediaModel = $this->getMediaModel(); + $filePath = '/absolute/path/to/test/file.png'; $this->directoryMock->expects($this->any()) ->method('getAbsolutePath') @@ -158,11 +131,13 @@ public function testProcessRequestCreatesConfigFileMediaDirectoryIsNotProvided() ->with(self::RELATIVE_FILE_PATH) ->will($this->returnValue(true)); $this->responseMock->expects($this->once())->method('setFilePath')->with($filePath); - $this->model->launch(); + $this->mediaModel->launch(); } public function testProcessRequestReturnsFileIfItsProperlySynchronized() { + $this->mediaModel = $this->getMediaModel(); + $filePath = '/absolute/path/to/test/file.png'; $this->sync->expects($this->once())->method('synchronize')->with(self::RELATIVE_FILE_PATH); $this->directoryMock->expects($this->once()) @@ -178,11 +153,13 @@ public function testProcessRequestReturnsFileIfItsProperlySynchronized() ] )); $this->responseMock->expects($this->once())->method('setFilePath')->with($filePath); - $this->assertSame($this->responseMock, $this->model->launch()); + $this->assertSame($this->responseMock, $this->mediaModel->launch()); } public function testProcessRequestReturnsNotFoundIfFileIsNotSynchronized() { + $this->mediaModel = $this->getMediaModel(); + $this->sync->expects($this->once())->method('synchronize')->with(self::RELATIVE_FILE_PATH); $this->directoryMock->expects($this->once()) ->method('getAbsolutePath') @@ -192,7 +169,7 @@ public function testProcessRequestReturnsNotFoundIfFileIsNotSynchronized() ->method('isReadable') ->with(self::RELATIVE_FILE_PATH) ->will($this->returnValue(false)); - $this->assertSame($this->responseMock, $this->model->launch()); + $this->assertSame($this->responseMock, $this->mediaModel->launch()); } /** @@ -203,8 +180,12 @@ public function testProcessRequestReturnsNotFoundIfFileIsNotSynchronized() */ public function testCatchException($isDeveloper, $setBodyCalls) { - $bootstrap = $this->createMock(\Magento\Framework\App\Bootstrap::class); - $exception = $this->createMock(\Exception::class); + /** @var Bootstrap|MockObject $bootstrap */ + $bootstrap = $this->createMock(Bootstrap::class); + + /** @var Exception|MockObject $exception */ + $exception = $this->createMock(Exception::class); + $this->responseMock->expects($this->once()) ->method('setHttpResponseCode') ->with(404); @@ -215,7 +196,32 @@ public function testCatchException($isDeveloper, $setBodyCalls) ->method('setBody'); $this->responseMock->expects($this->once()) ->method('sendResponse'); - $this->model->catchException($bootstrap, $exception); + + $this->isAllowed = true; + $this->mediaModel = $this->getMediaModel(); + + $this->mediaModel->catchException($bootstrap, $exception); + } + + public function testExceptionWhenIsAllowedReturnsFalse() + { + $this->mediaModel = $this->getMediaModel(false); + + $filePath = '/absolute/path/to/test/file.png'; + $this->directoryMock->expects($this->any()) + ->method('getAbsolutePath') + ->will($this->returnValueMap( + [ + [null, self::MEDIA_DIRECTORY], + [self::RELATIVE_FILE_PATH, $filePath], + ] + )); + $this->configMock->expects($this->once())->method('save'); + + $this->expectException(LogicException::class); + $this->expectExceptionMessage('The path is not allowed: ' . self::RELATIVE_FILE_PATH); + + $this->mediaModel->launch(); } /** @@ -228,4 +234,42 @@ public function catchExceptionDataProvider() 'developer mode' => [true, 1], ]; } + + /** + * Generates Media class instance for test + * + * @param bool $isAllowed + * @return Media + */ + protected function getMediaModel(bool $isAllowed = true): Media + { + $objectManager = new ObjectManager($this); + + $isAllowedCallback = function () use ($isAllowed) { + return $isAllowed; + }; + + /** @var Media $mediaClass */ + $mediaClass = $objectManager->getObject( + Media::class, + [ + 'configFactory' => $this->configFactoryMock, + 'syncFactory' => $this->syncFactoryMock, + 'response' => $this->responseMock, + 'isAllowed' => $isAllowedCallback, + 'mediaDirectory' => false, + 'configCacheFile' => self::CACHE_FILE_PATH, + 'relativeFileName' => self::RELATIVE_FILE_PATH, + 'filesystem' => $this->filesystemMock, + 'placeholderFactory' => $this->createConfiguredMock( + PlaceholderFactory::class, + [ + 'create' => $this->createMock(Placeholder::class) + ] + ), + ] + ); + + return $mediaClass; + } } From f6df6cd490cedf6f75d9800bd33ad357516091b5 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Tue, 17 Dec 2019 16:07:03 -0600 Subject: [PATCH 589/595] Change action groups name according to CE branch changes --- ...roductAttributeByAttributeCodeActionGroup.xml | 16 +++++----------- ...pdownProductAttributeFromAttributeSetTest.xml | 7 +++++-- .../Test/AdminDeleteProductAttributeTest.xml | 7 +++++-- ...FieldProductAttributeFromAttributeSetTest.xml | 7 +++++-- ...eteUsedInConfigurableProductAttributeTest.xml | 2 +- ...minCheckResultsOfColorAndOtherFiltersTest.xml | 4 ++-- ...frontElasticsearch6SearchInvalidValueTest.xml | 7 +++++-- ...AdminCartRulesAppliedForProductInCartTest.xml | 1 + ...roductWithAttributesImagesAndSwatchesTest.xml | 7 +++++-- 9 files changed, 34 insertions(+), 24 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml index 7fbf6a9b2a178..ddba6649161ef 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductAttributeByAttributeCodeActionGroup.xml @@ -10,21 +10,15 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="DeleteProductAttributeByAttributeCodeActionGroup"> <annotations> - <description>Goes to the Admin Product Attributes grid page. Filters the grid for the provided Product Attribute Code. Deletes the Product Attribute from the grid. Validates that the Success Message is present.</description> + <description>Delete a Product Attribute from the Product Attribute creation/edit page.</description> </annotations> <arguments> - <argument name="ProductAttributeCode" type="string"/> + <argument name="productAttributeCode" type="string"/> </arguments> - <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> - <waitForPageLoad stepKey="waitForAttributeGridPageLoad"/> - <fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductAttributeCode}}" stepKey="setAttributeCode"/> - <click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="searchForAttributeFromTheGrid"/> - <click selector="{{AdminProductAttributeGridSection.FirstRow}}" stepKey="clickOnAttributeRow"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> + <waitForPageLoad stepKey="waitForViewAdminProductAttributeLoad" time="30"/> <click selector="{{AttributePropertiesSection.DeleteAttribute}}" stepKey="deleteAttribute"/> - <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="ClickOnDeleteButton"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> + <click selector="{{ModalConfirmationSection.OkButton}}" stepKey="clickOnConfirmOk"/> + <waitForPageLoad stepKey="waitForViewProductAttributePageLoad"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml index bded224a86563..3abe68a503b57 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml @@ -49,8 +49,11 @@ <waitForPageLoad stepKey="waitForPageToSave"/> <see userInput="You saved the attribute set" selector="{{AdminMessagesSection.success}}" stepKey="successMessage"/> <!--Delete product attribute from product attribute grid --> - <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> - <argument name="ProductAttributeCode" value="$$attribute.attribute_code$$"/> + <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="openProductAttributeFromSearchResultInGrid"> + <argument name="productAttributeCode" value="$$attribute.attribute_code$$"/> + </actionGroup> + <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttributeByAttributeCode"> + <argument name="productAttributeCode" value="$$attribute.attribute_code$$"/> </actionGroup> <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <!--Confirm Attribute is not present in Product Attribute Grid --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml index f81b05c61a669..4060182a9bace 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductAttributeTest.xml @@ -24,8 +24,11 @@ <after> <actionGroup ref="logout" stepKey="logout"/> </after> - <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> - <argument name="ProductAttributeCode" value="$$createProductAttribute.attribute_code$$"/> + <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="openProductAttributeFromSearchResultInGrid"> + <argument name="productAttributeCode" value="$$createProductAttribute.attribute_code$$"/> + </actionGroup> + <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttributeByAttributeCode"> + <argument name="productAttributeCode" value="$$createProductAttribute.attribute_code$$"/> </actionGroup> <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <!-- Assert the product attribute is not in the grid by Attribute code --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml index f5fc104fa2b8d..4f05c364fda0e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml @@ -55,8 +55,11 @@ <waitForPageLoad stepKey="waitForProductToLoad"/> <seeElement selector="{{AdminProductFormSection.newAddedAttribute($$attribute.attribute_code$$)}}" stepKey="seeProductAttributeIsAdded"/> <!--Delete product attribute from product attribute grid --> - <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> - <argument name="ProductAttributeCode" value="$$attribute.attribute_code$$"/> + <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="openProductAttributeFromSearchResultInGrid"> + <argument name="productAttributeCode" value="$$attribute.attribute_code$$"/> + </actionGroup> + <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttributeByAttributeCode"> + <argument name="productAttributeCode" value="$$attribute.attribute_code$$"/> </actionGroup> <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <!-- Confirm attribute is not present in product attribute grid --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/DeleteUsedInConfigurableProductAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/DeleteUsedInConfigurableProductAttributeTest.xml index 6706175a4da54..0daf8361ef9d1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/DeleteUsedInConfigurableProductAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/DeleteUsedInConfigurableProductAttributeTest.xml @@ -81,7 +81,7 @@ <!-- Click Delete Attribute button --> <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttributeByAttributeCode"> - <argument name="ProductAttributeCode" value="$$productAttributeHandle.attribute_code$$"/> + <argument name="productAttributeCode" value="$$productAttributeHandle.attribute_code$$"/> </actionGroup> <!-- Should see error message: This attribute is used in configurable products. --> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml index 826718de80d5b..fabd4a2c253b6 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckResultsOfColorAndOtherFiltersTest.xml @@ -95,14 +95,14 @@ <argument name="productAttributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttributeByAttributeCode"> - <argument name="ProductAttributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> + <argument name="productAttributeCode" value="$$createConfigProductAttribute.attribute_code$$"/> </actionGroup> <!-- Delete Second attribute --> <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="openSecondProductAttributeFromSearchResultInGrid"> <argument name="productAttributeCode" value="$$createConfigProductAttribute2.attribute_code$$"/> </actionGroup> <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteSecondProductAttributeByAttributeCode"> - <argument name="ProductAttributeCode" value="$$createConfigProductAttribute2.attribute_code$$"/> + <argument name="productAttributeCode" value="$$createConfigProductAttribute2.attribute_code$$"/> </actionGroup> <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <!-- Clear filters --> diff --git a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml index 1d171664a21f2..050ce1263d10d 100644 --- a/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml +++ b/app/code/Magento/Elasticsearch6/Test/Mftf/Test/StorefrontElasticsearch6SearchInvalidValueTest.xml @@ -34,8 +34,11 @@ <magentoCLI command="config:set {{SetMinQueryLength3Config.path}} {{SetMinQueryLength3Config.value}}" stepKey="setMinQueryLengthPreviousState"/> <!--Delete created data--> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> - <argument name="ProductAttributeCode" value="{{textProductAttribute.attribute_code}}"/> + <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="openProductAttributeFromSearchResultInGrid"> + <argument name="productAttributeCode" value="{{textProductAttribute.attribute_code}}"/> + </actionGroup> + <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttributeByAttributeCode"> + <argument name="productAttributeCode" value="{{textProductAttribute.attribute_code}}"/> </actionGroup> <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <amOnPage url="{{AdminProductAttributeGridPage.url}}" stepKey="navigateToProductAttributeGrid"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml index e493ea389f389..916416dcd9141 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminCartRulesAppliedForProductInCartTest.xml @@ -99,6 +99,7 @@ <!--Go to Storefront and add product to cart and checkout from cart--> <amOnPage url="{{StorefrontProductPage.url($$simpleProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage"/> + <waitForPageLoad stepKey="waitForProductPage" /> <fillField selector="{{StorefrontProductActionSection.quantity}}" userInput="2" stepKey="setQuantity"/> <actionGroup ref="StorefrontAddToCartCustomOptionsProductPageActionGroup" stepKey="AddProductToCard"> <argument name="productName" value="$$simpleProduct.name$$"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml index a9e70193dd876..d034faeefbdc0 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.xml @@ -59,8 +59,11 @@ </before> <after> <!-- Delete product attribute and clear grid filter --> - <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttribute"> - <argument name="ProductAttributeCode" value="{{VisualSwatchProductAttribute.attribute_code}}"/> + <actionGroup ref="OpenProductAttributeFromSearchResultInGridActionGroup" stepKey="openProductAttributeFromSearchResultInGrid"> + <argument name="productAttributeCode" value="{{VisualSwatchProductAttribute.attribute_code}}"/> + </actionGroup> + <actionGroup ref="DeleteProductAttributeByAttributeCodeActionGroup" stepKey="deleteProductAttributeByAttributeCode"> + <argument name="productAttributeCode" value="{{VisualSwatchProductAttribute.attribute_code}}"/> </actionGroup> <actionGroup ref="AssertProductAttributeRemovedSuccessfullyActionGroup" stepKey="deleteProductAttributeSuccess"/> <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="clearAttributesGridFilter"/> From 7c6bbe36676a453c567b7928c5ad434d02ec0d98 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Tue, 17 Dec 2019 16:40:15 -0600 Subject: [PATCH 590/595] Change action groups name according to CE branch changes --- .../Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml index a8d8face1a1e6..f70f5757ec5c2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminVirtualSetEditRelatedProductsTest.xml @@ -17,6 +17,9 @@ <severity value="CRITICAL"/> <testCaseId value="MC-3415"/> <group value="Catalog"/> + <skip> + <issueId value="MC-194"/> + </skip> </annotations> <before></before> <after> From a77faf33bff263f273de6942f2c495676364df17 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Wed, 18 Dec 2019 07:51:37 +0700 Subject: [PATCH 591/595] Refactor code to pass review --- .../Listing/Column/SynonymActionsTest.php | 51 ++++++++++++++----- 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/Search/Test/Unit/Ui/Component/Listing/Column/SynonymActionsTest.php b/app/code/Magento/Search/Test/Unit/Ui/Component/Listing/Column/SynonymActionsTest.php index 7ba1eab0437f0..d5563ec1cb289 100644 --- a/app/code/Magento/Search/Test/Unit/Ui/Component/Listing/Column/SynonymActionsTest.php +++ b/app/code/Magento/Search/Test/Unit/Ui/Component/Listing/Column/SynonymActionsTest.php @@ -16,6 +16,21 @@ class SynonymActionsTest extends TestCase { + /** + * Stub synonym group id + */ + private const STUB_SYNONYM_GROUP_ID = 1; + + /** + * Synonym group delete url + */ + private const SYNONYM_GROUP_DELETE_URL = 'http://localhost/magento2/admin/search/synonyms/delete/group_id/%d'; + + /** + * Synonym group edit url + */ + private const SYNONYM_GROUP_EDIT_URL = 'http://localhost/magento2/admin/search/synonyms/edit/group_id/%d'; + /** * @var SynonymActions */ @@ -72,31 +87,38 @@ public function testPrepareDataSourceWithItems() 'data' => [ 'items' => [ [ - 'group_id' => 1 + 'group_id' => self::STUB_SYNONYM_GROUP_ID ] ] ] ]; + $expected = [ 'data' => [ 'items' => [ [ - 'group_id' => 1, + 'group_id' => self::STUB_SYNONYM_GROUP_ID, 'actions' => [ 'delete' => [ - 'href' => 'http://localhost/magento2/admin/search/synonyms/delete/group_id/1', + 'href' => sprintf( + self::SYNONYM_GROUP_DELETE_URL, + self::STUB_SYNONYM_GROUP_ID + ), 'label' => (string)__('Delete'), 'confirm' => [ 'title' => (string)__('Delete'), 'message' => (string)__( 'Are you sure you want to delete synonym group with id: %1?', - 1 + self::STUB_SYNONYM_GROUP_ID ) ], '__disableTmpl' => true ], 'edit' => [ - 'href' => 'http://localhost/magento2/admin/search/synonyms/edit/group_id/1', + 'href' => sprintf( + self::SYNONYM_GROUP_EDIT_URL, + self::STUB_SYNONYM_GROUP_ID + ), 'label' => (string)__('View/Edit'), '__disableTmpl' => true ] @@ -106,13 +128,18 @@ public function testPrepareDataSourceWithItems() ] ]; - $this->urlBuilderMock->expects($this->at(0))->method('getUrl') - ->with(SynonymActions::SYNONYM_URL_PATH_DELETE, ['group_id' => 1]) - ->willReturn('http://localhost/magento2/admin/search/synonyms/delete/group_id/1'); - - $this->urlBuilderMock->expects($this->at(1))->method('getUrl') - ->with(SynonymActions::SYNONYM_URL_PATH_EDIT, ['group_id' => 1]) - ->willReturn('http://localhost/magento2/admin/search/synonyms/edit/group_id/1'); + $this->urlBuilderMock->method('getUrl')->will( + $this->returnValueMap([ + [ + SynonymActions::SYNONYM_URL_PATH_DELETE, ['group_id' => self::STUB_SYNONYM_GROUP_ID], + sprintf(self::SYNONYM_GROUP_DELETE_URL, self::STUB_SYNONYM_GROUP_ID) + ], + [ + SynonymActions::SYNONYM_URL_PATH_EDIT, ['group_id' => self::STUB_SYNONYM_GROUP_ID], + sprintf(self::SYNONYM_GROUP_EDIT_URL, self::STUB_SYNONYM_GROUP_ID) + ] + ]) + ); /** * Assert Result From 85036fa5f76417765a42d66ebb50a93de00e8532 Mon Sep 17 00:00:00 2001 From: Eden <eden@magestore.com> Date: Wed, 18 Dec 2019 09:00:55 +0700 Subject: [PATCH 592/595] Refactor code to pass review --- ...sEventOrderItemToQuoteItemObserverTest.php | 153 +++++++++++------- 1 file changed, 91 insertions(+), 62 deletions(-) diff --git a/app/code/Magento/GiftMessage/Test/Unit/Observer/SalesEventOrderItemToQuoteItemObserverTest.php b/app/code/Magento/GiftMessage/Test/Unit/Observer/SalesEventOrderItemToQuoteItemObserverTest.php index 1df1c1101ccd1..5ac75caa4b512 100644 --- a/app/code/Magento/GiftMessage/Test/Unit/Observer/SalesEventOrderItemToQuoteItemObserverTest.php +++ b/app/code/Magento/GiftMessage/Test/Unit/Observer/SalesEventOrderItemToQuoteItemObserverTest.php @@ -93,7 +93,10 @@ class SalesEventOrderItemToQuoteItemObserverTest extends TestCase */ public function setUp(): void { - $this->messageFactoryMock = $this->createMock(MessageFactory::class); + $this->messageFactoryMock = $this->getMockBuilder(MessageFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); $this->giftMessageHelperMock = $this->createMock(MessageHelper::class); $this->observerMock = $this->createMock(Observer::class); $this->eventMock = $this->createPartialMock(Event::class, ['getOrderItem', 'getQuoteItem']); @@ -106,6 +109,18 @@ public function setUp(): void $this->storeMock = $this->createMock(Store::class); $this->messageMock = $this->createMock(MessageModel::class); + $this->eventMock->expects($this->atLeastOnce()) + ->method('getOrderItem') + ->willReturn($this->orderItemMock); + + $this->orderItemMock->expects($this->atLeastOnce()) + ->method('getOrder') + ->willReturn($this->orderMock); + + $this->observerMock->expects($this->atLeastOnce()) + ->method('getEvent') + ->willReturn($this->eventMock); + $objectManager = new ObjectManager($this); $this->observer = $objectManager->getObject( @@ -118,79 +133,93 @@ public function setUp(): void } /** - * Tests duplicating gift message from order item to quote item - * - * @param bool $orderIsReordered - * @param bool $isMessagesAllowed - * @dataProvider giftMessageDataProvider + * Test when the order is reorder */ - public function testExecute($orderIsReordered, $isMessagesAllowed) + public function testReorder() { - $this->eventMock->expects($this->atLeastOnce()) - ->method('getOrderItem') - ->willReturn($this->orderItemMock); + $this->orderMock->expects($this->once()) + ->method('getReordered') + ->willReturn(true); - $this->orderItemMock->expects($this->atLeastOnce()) - ->method('getOrder') - ->willReturn($this->orderMock); + $this->giftMessageHelperMock->expects($this->never()) + ->method('isMessagesAllowed'); - $this->observerMock->expects($this->atLeastOnce()) - ->method('getEvent') - ->willReturn($this->eventMock); + $this->eventMock + ->expects($this->never()) + ->method('getQuoteItem') + ->willReturn($this->quoteItemMock); + + /** Run observer */ + $this->observer->execute($this->observerMock); + } - if (!$orderIsReordered && $isMessagesAllowed) { - $this->eventMock - ->expects($this->atLeastOnce()) - ->method('getQuoteItem') - ->willReturn($this->quoteItemMock); - $this->orderMock->expects($this->once()) - ->method('getReordered') - ->willReturn($orderIsReordered); - $this->orderItemMock->expects($this->once()) - ->method('getGiftMessageId') - ->willReturn(self::STUB_MESSAGE_ID); - $this->giftMessageHelperMock->expects($this->once()) - ->method('isMessagesAllowed') - ->willReturn($isMessagesAllowed); - $this->messageFactoryMock->expects($this->once()) - ->method('create') - ->willReturn($this->messageMock); - $this->messageMock->expects($this->once()) - ->method('load') - ->with(self::STUB_MESSAGE_ID) - ->willReturnSelf(); - $this->messageMock->expects($this->once()) - ->method('setId') - ->with(null) - ->willReturnSelf(); - $this->messageMock->expects($this->once()) - ->method('save') - ->willReturnSelf(); - $this->messageMock->expects($this->once()) - ->method('getId') - ->willReturn(self::STUB_NEW_MESSAGE_ID); - $this->quoteItemMock->expects($this->once()) - ->method('setGiftMessageId') - ->with(self::STUB_NEW_MESSAGE_ID) - ->willReturnSelf(); - } + /** + * Test when the order is new reorder and gift message is not allowed + */ + public function testNewOrderWhenGiftMessageIsNotAllowed() + { + $this->orderMock->expects($this->once()) + ->method('getReordered') + ->willReturn(false); + + $this->giftMessageHelperMock->expects($this->once()) + ->method('isMessagesAllowed') + ->willReturn(false); + + $this->eventMock + ->expects($this->never()) + ->method('getQuoteItem') + ->willReturn($this->quoteItemMock); /** Run observer */ $this->observer->execute($this->observerMock); } /** - * Providing gift message data for test - * - * @return array + * Test when the order is new reorder and gift message is allowed */ - public function giftMessageDataProvider() + public function testNewOrderWhenGiftMessageIsAllowed() { - return [ - 'order is not reordered, messages is allowed' => [false, true], - 'order is reordered, messages is allowed' => [true, true], - 'order is reordered, messages is not allowed' => [true, false], - 'order is not reordered, messages is not allowed' => [false, false] - ]; + $this->orderMock->expects($this->once()) + ->method('getReordered') + ->willReturn(false); + + $this->giftMessageHelperMock->expects($this->once()) + ->method('isMessagesAllowed') + ->willReturn(true); + + $this->eventMock + ->expects($this->atLeastOnce()) + ->method('getQuoteItem') + ->willReturn($this->quoteItemMock); + + $this->orderItemMock->expects($this->once()) + ->method('getGiftMessageId') + ->willReturn(self::STUB_MESSAGE_ID); + + $this->messageFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($this->messageMock); + $this->messageMock->expects($this->once()) + ->method('load') + ->with(self::STUB_MESSAGE_ID) + ->willReturnSelf(); + $this->messageMock->expects($this->once()) + ->method('setId') + ->with(null) + ->willReturnSelf(); + $this->messageMock->expects($this->once()) + ->method('save') + ->willReturnSelf(); + $this->messageMock->expects($this->once()) + ->method('getId') + ->willReturn(self::STUB_NEW_MESSAGE_ID); + $this->quoteItemMock->expects($this->once()) + ->method('setGiftMessageId') + ->with(self::STUB_NEW_MESSAGE_ID) + ->willReturnSelf(); + + /** Run observer */ + $this->observer->execute($this->observerMock); } } From 27d9b2c035a8e7a405d1b47cc98b34492aaccb46 Mon Sep 17 00:00:00 2001 From: Kevin Kozan <kkozan@adobe.com> Date: Wed, 18 Dec 2019 08:55:23 -0600 Subject: [PATCH 593/595] MQE-1927: Deliver MFTF 2.5.4 to 2.4-develop - Composer version bump --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 7e01980e32f58..ab767fdac286d 100644 --- a/composer.json +++ b/composer.json @@ -88,7 +88,7 @@ "friendsofphp/php-cs-fixer": "~2.14.0", "lusitanian/oauth": "~0.8.10", "magento/magento-coding-standard": "*", - "magento/magento2-functional-testing-framework": "2.5.3", + "magento/magento2-functional-testing-framework": "2.5.4", "pdepend/pdepend": "2.5.2", "phpcompatibility/php-compatibility": "^9.3", "phpmd/phpmd": "@stable", diff --git a/composer.lock b/composer.lock index a63cdcdf4a1e1..b6d834610059a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "38446350ff1ac4609f77d5d74213880d", + "content-hash": "8d8e6b87c1f6ac98b3b7331eba9473f3", "packages": [ { "name": "braintree/braintree_php", @@ -7220,21 +7220,21 @@ }, { "name": "magento/magento2-functional-testing-framework", - "version": "2.5.3", + "version": "2.5.4", "source": { "type": "git", "url": "https://github.com/magento/magento2-functional-testing-framework.git", - "reference": "f627085a469da79e4a628d4bf0452f12aefa4389" + "reference": "4f482ce22a755a812b76f81020ae71d502f9d043" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/magento2-functional-testing-framework/zipball/f627085a469da79e4a628d4bf0452f12aefa4389", - "reference": "f627085a469da79e4a628d4bf0452f12aefa4389", + "url": "https://api.github.com/repos/magento/magento2-functional-testing-framework/zipball/4f482ce22a755a812b76f81020ae71d502f9d043", + "reference": "4f482ce22a755a812b76f81020ae71d502f9d043", "shasum": "" }, "require": { "allure-framework/allure-codeception": "~1.3.0", - "codeception/codeception": "~2.3.4 || ~2.4.0 ", + "codeception/codeception": "~2.4.5", "composer/composer": "^1.4", "consolidation/robo": "^1.0.0", "csharpru/vault-php": "~3.5.3", @@ -7294,7 +7294,7 @@ "magento", "testing" ], - "time": "2019-10-31T14:52:02+00:00" + "time": "2019-12-12T20:14:00+00:00" }, { "name": "mikey179/vfsstream", From 5f2f318f51b21416f0acb06860abb42401efb04c Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Wed, 18 Dec 2019 13:02:29 -0600 Subject: [PATCH 594/595] Change action groups name according to CE branch changes --- .../AdminCategoryAssignProductActionGroup.xml | 1 + ...lectNotLoggedInCustomerGroupActionGroup.xml | 18 ------------------ 2 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryAssignProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryAssignProductActionGroup.xml index 9dc661ae5ecad..454c65c8bc5c3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryAssignProductActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryAssignProductActionGroup.xml @@ -17,6 +17,7 @@ </arguments> <conditionalClick selector="{{AdminCategoryBasicFieldSection.productsInCategory}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="false" stepKey="clickOnProductInCategory"/> + <scrollTo stepKey="scrollToProductGrid" selector="{{AdminCategoryBasicFieldSection.productsInCategory}}" x="0" y="-80" /> <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickOnResetFilter"/> <fillField selector="{{AdminCategoryContentSection.productTableColumnSku}}" userInput="{{productSku}}" stepKey="fillSkuFilter"/> <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearchButton"/> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.xml b/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.xml deleted file mode 100644 index 38b64803acadd..0000000000000 --- a/app/code/Magento/CatalogRule/Test/Mftf/ActionGroup/SelectNotLoggedInCustomerGroupActionGroup.xml +++ /dev/null @@ -1,18 +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="SelectNotLoggedInCustomerGroupActionGroup"> - <annotations> - <description>Selects the 'NOT LOGGED IN' Customer Group for a Catalog Price Rule on the creation/edit page.</description> - </annotations> - - <selectOption selector="{{AdminNewCatalogPriceRule.customerGroups}}" userInput="NOT LOGGED IN" stepKey="selectCustomerGroup"/> - </actionGroup> -</actionGroups> From ccc0c71457cea73e2c58b184ea283317f732f469 Mon Sep 17 00:00:00 2001 From: Volodymyr Zaets <vzaets@magento.com> Date: Wed, 18 Dec 2019 14:43:36 -0600 Subject: [PATCH 595/595] Remove redundant line --- app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php b/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php index e6f43dd435869..8d3211684d377 100644 --- a/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php +++ b/app/code/Magento/MediaStorage/Test/Unit/App/MediaTest.php @@ -197,7 +197,6 @@ public function testCatchException($isDeveloper, $setBodyCalls) $this->responseMock->expects($this->once()) ->method('sendResponse'); - $this->isAllowed = true; $this->mediaModel = $this->getMediaModel(); $this->mediaModel->catchException($bootstrap, $exception);